source_filename = "test"
target datalayout = "e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"

@edi = internal unnamed_addr global i32 0, align 8

define i32 @function_0() local_unnamed_addr {
dec_label_pc_0:
  %esi.global-to-local = alloca i32, align 4
  %fpsw.global-to-local = alloca i32, align 4
  %fpu_stat_TOP.global-to-local = alloca i3, align 1
  %st5.global-to-local = alloca x86_fp80, align 4
  %st7.global-to-local = alloca x86_fp80, align 4
  %tmp276 = call double @__decompiler_undefined_function_1()
  %tmp279 = call i32 @__decompiler_undefined_function_3()
  %stack_var_-40 = alloca double, align 8
  %v0_3 = load i32, i32* %esi.global-to-local, align 4
  %v1_3 = add i32 %v0_3, -120
  %v2_3 = inttoptr i32 %v1_3 to i128*
  %v3_3 = load i128, i128* %v2_3, align 4
  %v4_3 = call i128 @__asm_movupd(i128 %v3_3)
  %v1_8 = add i32 %v0_3, -104
  %v2_8 = inttoptr i32 %v1_8 to i64*
  %v3_8 = load i64, i64* %v2_8, align 4
  %v4_8 = call i128 @__asm_movsd(i64 %v3_8)
  %v1_d = load i32, i32* @edi, align 8
  %v2_d = add i32 %v1_d, -32
  %v3_d = inttoptr i32 %v2_d to i128*
  %v4_d = load i128, i128* %v3_d, align 4
  %v5_d = call i128 @__asm_mulpd(i128 %v4_3, i128 %v4_d)
  %v1_12 = load i32, i32* @edi, align 8
  %v2_12 = add i32 %v1_12, -32
  %v3_12 = inttoptr i32 %v2_12 to i64*
  %v4_12 = load i64, i64* %v3_12, align 4
  %v5_12 = call i128 @__asm_mulsd(i128 %v4_8, i64 %v4_12)
  %v1_17 = load i32, i32* @edi, align 8
  %v2_17 = add i32 %v1_17, -64
  %v3_17 = inttoptr i32 %v2_17 to i128*
  %v4_17 = load i128, i128* %v3_17, align 4
  %v5_17 = call i128 @__asm_addpd(i128 %v5_d, i128 %v4_17)
  %v1_1c = load i32, i32* @edi, align 8
  %v2_1c = add i32 %v1_1c, -48
  %v3_1c = inttoptr i32 %v2_1c to i64*
  %v4_1c = load i64, i64* %v3_1c, align 4
  %v5_1c = call i128 @__asm_addsd(i128 %v5_12, i64 %v4_1c)
  %v0_21 = load i32, i32* @edi, align 8
  %v1_21 = add i32 %v0_21, -76
  %v2_21 = inttoptr i32 %v1_21 to i32*
  %v3_21 = load i32, i32* %v2_21, align 4
  %v10_21 = icmp eq i32 %v3_21, 0
  br i1 %v10_21, label %dec_label_pc_40, label %dec_label_pc_27

dec_label_pc_27:                                  ; preds = %dec_label_pc_0
  %v0_27 = load i32, i32* %esi.global-to-local, align 4
  %v1_27 = add i32 %v0_27, 112
  %v2_27 = inttoptr i32 %v1_27 to i64*
  %v3_27 = load i64, i64* %v2_27, align 4
  %v4_27 = call i128 @__asm_movsd(i64 %v3_27)
  %v1_2c = load i32, i32* @edi, align 8
  %v2_2c = add i32 %v1_2c, -32
  %v3_2c = inttoptr i32 %v2_2c to i64*
  %v4_2c = load i64, i64* %v3_2c, align 4
  %v5_2c = call i128 @__asm_mulsd(i128 %v4_27, i64 %v4_2c)
  %v0_31 = load i32, i32* %esi.global-to-local, align 4
  %v1_31 = add i32 %v0_31, -120
  %v2_31 = inttoptr i32 %v1_31 to i128*
  %v3_31 = load i128, i128* %v2_31, align 4
  call void @__asm_movupd.1(i128 %v3_31, i128 %v5_17)
  %v1_36 = call i32 @__asm_movsd.2(i128 %v5_1c)
  %v3_36 = add i32 %v0_31, -104
  %v4_36 = sext i32 %v1_36 to i64
  %v5_36 = inttoptr i32 %v3_36 to i64*
  store i64 %v4_36, i64* %v5_36, align 4
  %v1_3b = call i32 @__asm_movsd.2(i128 %v5_2c)
  %v2_3b = load i32, i32* %esi.global-to-local, align 4
  %v3_3b = add i32 %v2_3b, 112
  %v4_3b = sext i32 %v1_3b to i64
  %v5_3b = inttoptr i32 %v3_3b to i64*
  store i64 %v4_3b, i64* %v5_3b, align 4
  br label %dec_label_pc_40

dec_label_pc_40:                                  ; preds = %dec_label_pc_27, %dec_label_pc_0
  %v2_40 = load double, double* %stack_var_-40, align 8
  %v3_40 = fptrunc double %v2_40 to float
  %v4_40 = bitcast float %v3_40 to i32
  %v5_40 = sext i32 %v4_40 to i128
  call void @__asm_movupd.1(i128 %v5_40, i128 %v5_17)
  %v1_45 = call i32 @__asm_movsd.2(i128 %v5_1c)
  %v4_45 = sext i32 %v1_45 to i64
  %v6_45 = bitcast i64 %v4_45 to double
  %v0_4b = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  %v8_4b = add i3 %v0_4b, -1
  %tmp284 = call double @llvm.fabs.f64(double %v6_45)
  %v2_4f = fpext double %tmp284 to x86_fp80
  store x86_fp80 %v2_4f, x86_fp80* %st7.global-to-local, align 4
  store i3 %v8_4b, i3* %fpu_stat_TOP.global-to-local, align 1
  %v0_56 = call i32 @__asm_wait()
  %v0_57 = load i32, i32* %fpsw.global-to-local, align 4
  %v1_57 = call i16 @__asm_fnstsw(i32 %v0_57)
  %tmp299 = and i16 %v1_57, 256
  %v16_59 = icmp ne i16 %tmp299, 0
  %v1_5b = icmp eq i1 %v16_59, false
  br i1 %v1_5b, label %dec_label_pc_67, label %dec_label_pc_5d

dec_label_pc_5d:                                  ; preds = %dec_label_pc_40
  %v0_5d = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  %v1_5f = load i32, i32* @edi, align 8
  %v2_5f = add i32 %v1_5f, 24
  %v3_5f = inttoptr i32 %v2_5f to double*
  %v4_5f = load double, double* %v3_5f, align 4
  %v5_5f = fpext double %v4_5f to x86_fp80
  store x86_fp80 %v5_5f, x86_fp80* %st7.global-to-local, align 4
  br label %dec_label_pc_eb

dec_label_pc_67:                                  ; preds = %dec_label_pc_40
  %v0_67 = load i32, i32* @edi, align 8
  %v1_67 = add i32 %v0_67, -120
  %v2_67 = inttoptr i32 %v1_67 to i32*
  %v3_67 = load i32, i32* %v2_67, align 4
  %v11_67 = icmp slt i32 %v3_67, 0
  %v2_6b = icmp eq i1 %v11_67, false
  br i1 %v2_6b, label %dec_label_pc_72, label %dec_label_pc_6d

dec_label_pc_6d:                                  ; preds = %dec_label_pc_67
  %v1_6d = load x86_fp80, x86_fp80* %st7.global-to-local, align 4
  %v3_6d = add i32 %v0_67, 48
  %v4_6d = inttoptr i32 %v3_6d to double*
  %v5_6d = load double, double* %v4_6d, align 4
  %v6_6d = fpext double %v5_6d to x86_fp80
  %v7_6d = fmul x86_fp80 %v1_6d, %v6_6d
  %v2_70 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %v7_6d)
  %v3_70 = fcmp olt x86_fp80 %v2_70, 0xK403E8000000000000000
  %v4_70 = call x86_fp80 @llvm.sin.f80(x86_fp80 %v7_6d)
  %storemerge295 = select i1 %v3_70, x86_fp80 %v4_70, x86_fp80 %v7_6d
  store x86_fp80 %storemerge295, x86_fp80* %st7.global-to-local, align 4
  %v3_72.pr = load i32, i32* %v2_67, align 4
  br label %dec_label_pc_72

dec_label_pc_72:                                  ; preds = %dec_label_pc_6d, %dec_label_pc_67
  %v3_72 = phi i32 [ %v3_72.pr, %dec_label_pc_6d ], [ %v3_67, %dec_label_pc_67 ]
  switch i32 %v3_72, label %dec_label_pc_7e [
    i32 1, label %dec_label_pc_84
    i32 -1, label %dec_label_pc_84
  ]

dec_label_pc_7e:                                  ; preds = %dec_label_pc_72
  %v1_7e = load x86_fp80, x86_fp80* %st7.global-to-local, align 4
  %v4_82 = fsub x86_fp80 0xK3FFF8000000000000000, %v1_7e
  store x86_fp80 %v4_82, x86_fp80* %st7.global-to-local, align 4
  br label %dec_label_pc_84

dec_label_pc_84:                                  ; preds = %dec_label_pc_72, %dec_label_pc_72, %dec_label_pc_7e
  %v0_84 = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  %v2_84 = add i32 %v0_67, -72
  %v3_84 = inttoptr i32 %v2_84 to double*
  %v4_84 = load double, double* %v3_84, align 4
  %v5_84 = fpext double %v4_84 to x86_fp80
  %v6_84 = add i3 %v0_84, -1
  store i3 %v6_84, i3* %fpu_stat_TOP.global-to-local, align 1
  %v3_87 = load x86_fp80, x86_fp80* %st7.global-to-local, align 4
  store x86_fp80 %v5_84, x86_fp80* %st7.global-to-local, align 4
  %v0_89 = call i32 @__asm_fyl2x()
  %v2_8f = icmp sgt i32 %tmp279, -1
  br i1 %v2_8f, label %dec_label_pc_99, label %dec_label_pc_97

dec_label_pc_97:                                  ; preds = %dec_label_pc_84
  %v2_97 = fsub x86_fp80 0xK80000000000000000000, %v3_87
  br label %dec_label_pc_99

dec_label_pc_99:                                  ; preds = %dec_label_pc_84, %dec_label_pc_97
  %v1_99 = phi x86_fp80 [ %v2_97, %dec_label_pc_97 ], [ %v3_87, %dec_label_pc_84 ]
  %v2_99 = load i32, i32* @edi, align 8
  %v3_99 = add i32 %v2_99, -92
  %v4_99 = inttoptr i32 %v3_99 to double*
  %v5_99 = load double, double* %v4_99, align 4
  %v6_99 = fpext double %v5_99 to x86_fp80
  %v7_99 = fadd x86_fp80 %v1_99, %v6_99
  %v2_9c = call x86_fp80 @llvm.fabs.f80(x86_fp80 %v7_99)
  %v3_9c = fcmp olt x86_fp80 %v2_9c, 0xK403E8000000000000000
  %v0_9c = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  br i1 %v3_9c, label %bb287, label %dec_label_pc_99._crit_edge

dec_label_pc_99._crit_edge:                       ; preds = %dec_label_pc_99
  %v1_9e.pre = load x86_fp80, x86_fp80* %st5.global-to-local, align 4
  br label %bb288

bb287:                                            ; preds = %dec_label_pc_99
  %v4_9c = call x86_fp80 @llvm.sin.f80(x86_fp80 %v7_99)
  %v7_9c = call x86_fp80 @llvm.cos.f80(x86_fp80 %v7_99)
  %v8_9c = add i3 %v0_9c, -1
  store i3 %v8_9c, i3* %fpu_stat_TOP.global-to-local, align 1
  store x86_fp80 %v7_9c, x86_fp80* %st5.global-to-local, align 4
  br label %bb288

bb288:                                            ; preds = %dec_label_pc_99._crit_edge, %bb287
  %v1_a2 = phi x86_fp80 [ %v7_99, %dec_label_pc_99._crit_edge ], [ %v4_9c, %bb287 ]
  %v1_9e = phi x86_fp80 [ %v1_9e.pre, %dec_label_pc_99._crit_edge ], [ %v7_9c, %bb287 ]
  %v0_9e = phi i3 [ %v0_9c, %dec_label_pc_99._crit_edge ], [ %v8_9c, %bb287 ]
  %v3_a6 = load double, double* %stack_var_-40, align 8
  %v8_a6 = fpext double %v3_a6 to x86_fp80
  %v5_ad = fpext double %tmp276 to x86_fp80
  %v7_bc = fmul x86_fp80 %v1_9e, %v8_a6
  %v7_c4 = fmul x86_fp80 %v1_a2, %v5_ad
  %v4_c8 = fadd x86_fp80 %v7_c4, %v7_bc
  store x86_fp80 %v4_c8, x86_fp80* %st5.global-to-local, align 4
  store i3 %v0_9e, i3* %fpu_stat_TOP.global-to-local, align 1
  %v4_ca = call i32 @__asm_fpatan(x86_fp80 %v1_a2, x86_fp80 %v1_9e)
  %v4_cc = load double, double* bitcast (i32* @edi to double*), align 8
  %v5_cc = fpext double %v4_cc to x86_fp80
  %v6_cc = fmul x86_fp80 %v4_c8, %v5_cc
  store x86_fp80 %v6_cc, x86_fp80* %st5.global-to-local, align 4
  %tmp289 = bitcast double %v4_cc to i64
  %tmp290 = trunc i64 %tmp289 to i32
  %v3_ce = add i32 %tmp290, -84
  %v4_ce = inttoptr i32 %v3_ce to double*
  %v5_ce = load double, double* %v4_ce, align 4
  %v6_ce = fpext double %v5_ce to x86_fp80
  %v7_ce = fdiv x86_fp80 %v6_cc, %v6_ce
  %v0_d1 = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  %v2_d3 = call x86_fp80 @llvm.round.f80(x86_fp80 %v7_ce)
  %v4_d5 = fsub x86_fp80 %v7_ce, %v2_d3
  store x86_fp80 %v4_d5, x86_fp80* %st5.global-to-local, align 4
  %v5_d7 = load double, double* %v4_ce, align 4
  %v6_d7 = fpext double %v5_d7 to x86_fp80
  %v7_d7 = fmul x86_fp80 %v4_d5, %v6_d7
  %v2_da = call x86_fp80 @llvm.fabs.f80(x86_fp80 %v7_d7)
  store x86_fp80 %v2_da, x86_fp80* %st5.global-to-local, align 4
  %v3_dc = add i32 %tmp290, -16
  %v4_dc = inttoptr i32 %v3_dc to double*
  %v5_dc = load double, double* %v4_dc, align 4
  %v6_dc = fpext double %v5_dc to x86_fp80
  %v7_dc = fdiv x86_fp80 %v2_da, %v6_dc
  %v4_e1 = fadd x86_fp80 %v7_dc, 0xKBFFF8000000000000000
  store x86_fp80 %v4_e1, x86_fp80* %st5.global-to-local, align 4
  %v5_e3 = load double, double* %v4_dc, align 4
  %v6_e3 = fpext double %v5_e3 to x86_fp80
  %v7_e3 = fmul x86_fp80 %v4_e1, %v6_e3
  store x86_fp80 %v7_e3, x86_fp80* %st5.global-to-local, align 4
  %v3_e6 = add i32 %tmp290, 8
  %v4_e6 = inttoptr i32 %v3_e6 to double*
  %v5_e6 = load double, double* %v4_e6, align 4
  %v6_e6 = fpext double %v5_e6 to x86_fp80
  %v7_e6 = fmul x86_fp80 %v7_e3, %v6_e6
  %v2_e9 = fsub x86_fp80 0xK80000000000000000000, %v7_e6
  store x86_fp80 %v2_e9, x86_fp80* %st5.global-to-local, align 4
  br label %dec_label_pc_eb

dec_label_pc_eb:                                  ; preds = %bb288, %dec_label_pc_5d
  %v2_10d = phi i32 [ %tmp290, %bb288 ], [ %v1_5f, %dec_label_pc_5d ]
  %v0_eb = phi i3 [ %v0_d1, %bb288 ], [ %v0_5d, %dec_label_pc_5d ]
  %v7_f8 = fpext double %v6_45 to x86_fp80
  %v3_fc = fmul x86_fp80 %v7_f8, %v7_f8
  store x86_fp80 %v3_fc, x86_fp80* %st5.global-to-local, align 4
  %v3_fe = add i32 %v2_10d, -108
  %v4_fe = inttoptr i32 %v3_fe to double*
  %v5_fe = load double, double* %v4_fe, align 4
  %v6_fe = fpext double %v5_fe to x86_fp80
  %v7_fe = fmul x86_fp80 %v3_fc, %v6_fe
  store x86_fp80 %v7_fe, x86_fp80* %st5.global-to-local, align 4
  %v7_101 = add i3 %v0_eb, -1
  store i3 %v7_101, i3* %fpu_stat_TOP.global-to-local, align 1
  %v0_112 = call i32 @__asm_wait()
  %v0_113 = load i32, i32* %fpsw.global-to-local, align 4
  %v1_113 = call i16 @__asm_fnstsw(i32 %v0_113)
  store x86_fp80 %v2_4f, x86_fp80* %st7.global-to-local, align 4
  %v2_125 = load i32, i32* @edi, align 8
  %v3_125 = add i32 %v2_125, 40
  %v4_125 = inttoptr i32 %v3_125 to double*
  %v5_125 = load double, double* %v4_125, align 4
  %v6_125 = fpext double %v5_125 to x86_fp80
  %v7_125 = fsub x86_fp80 %v2_4f, %v6_125
  store x86_fp80 %v7_125, x86_fp80* %st7.global-to-local, align 4
  %v0_12a = call i32 @__asm_wait()
  %v0_12b = load i32, i32* %fpsw.global-to-local, align 4
  %v1_12b = call i16 @__asm_fnstsw(i32 %v0_12b)
  %v2_12b = sext i16 %v1_12b to i32
  %v4_12b = and i32 %v0_12a, -65536
  %tmp292 = udiv i32 %v2_12b, 2
  %v12_12d = and i32 %tmp292, 32512
  %v2_12b.masked = and i32 %v2_12b, -65281
  %v13_12d = or i32 %v4_12b, %v2_12b.masked
  %v14_12d = or i32 %v13_12d, %v12_12d
  %storemerge.in = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  %storemerge = add i3 %storemerge.in, 1
  store i3 %storemerge, i3* %fpu_stat_TOP.global-to-local, align 1
  %v0_137 = load i32, i32* @edi, align 8
  %v1_137 = add i32 %v0_137, -76
  %v2_137 = inttoptr i32 %v1_137 to i32*
  %v3_137 = load i32, i32* %v2_137, align 4
  %v10_137 = icmp eq i32 %v3_137, 0
  %v1_13b = icmp eq i1 %v10_137, false
  %v1_140.pre = load x86_fp80, x86_fp80* %st7.global-to-local, align 4
  br i1 %v1_13b, label %dec_label_pc_140, label %dec_label_pc_13d

dec_label_pc_13d:                                 ; preds = %dec_label_pc_eb
  %v3_13d = add i32 %v0_137, -32
  %v4_13d = inttoptr i32 %v3_13d to double*
  %v5_13d = load double, double* %v4_13d, align 4
  %v6_13d = fpext double %v5_13d to x86_fp80
  %v7_13d = fdiv x86_fp80 %v1_140.pre, %v6_13d
  store x86_fp80 %v7_13d, x86_fp80* %st7.global-to-local, align 4
  br label %dec_label_pc_140

dec_label_pc_140:                                 ; preds = %dec_label_pc_eb, %dec_label_pc_13d
  %v1_140 = phi x86_fp80 [ %v7_13d, %dec_label_pc_13d ], [ %v1_140.pre, %dec_label_pc_eb ]
  %v2_140 = load i32, i32* %esi.global-to-local, align 4
  %v3_140 = add i32 %v2_140, -32
  %v4_140 = fptrunc x86_fp80 %v1_140 to double
  %v5_140 = inttoptr i32 %v3_140 to double*
  store double %v4_140, double* %v5_140, align 4
  %v6_140 = add i3 %storemerge.in, 2
  store i3 %v6_140, i3* %fpu_stat_TOP.global-to-local, align 1
  ret i32 %v14_12d
}

declare i128 @__asm_movupd(i128) local_unnamed_addr

declare i128 @__asm_movsd(i64) local_unnamed_addr

declare i128 @__asm_mulpd(i128, i128) local_unnamed_addr

declare i128 @__asm_mulsd(i128, i64) local_unnamed_addr

declare i128 @__asm_addpd(i128, i128) local_unnamed_addr

declare i128 @__asm_addsd(i128, i64) local_unnamed_addr

declare void @__asm_movupd.1(i128, i128) local_unnamed_addr

declare i32 @__asm_movsd.2(i128) local_unnamed_addr

; Function Attrs: nounwind readnone speculatable
declare x86_fp80 @llvm.fabs.f80(x86_fp80) #0

declare i32 @__asm_wait() local_unnamed_addr

declare i16 @__asm_fnstsw(i32) local_unnamed_addr

; Function Attrs: nounwind readnone speculatable
declare x86_fp80 @llvm.sin.f80(x86_fp80) #0

declare i32 @__asm_fyl2x() local_unnamed_addr

; Function Attrs: nounwind readnone speculatable
declare x86_fp80 @llvm.cos.f80(x86_fp80) #0

declare i32 @__asm_fpatan(x86_fp80, x86_fp80) local_unnamed_addr

; Function Attrs: nounwind readnone speculatable
declare x86_fp80 @llvm.round.f80(x86_fp80) #0

; Function Attrs: nounwind readnone speculatable
declare x86_fp80 @llvm.sqrt.f80(x86_fp80) #0

declare double @__decompiler_undefined_function_1() local_unnamed_addr

declare i32 @__decompiler_undefined_function_3() local_unnamed_addr

; Function Attrs: nounwind readnone speculatable
declare double @llvm.fabs.f64(double) #0

attributes #0 = { nounwind readnone speculatable }
