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:
  %edx.global-to-local = alloca i32, align 4
  %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
  %st6.global-to-local = alloca x86_fp80, align 4
  %st7.global-to-local = alloca x86_fp80, align 4
  %tmp260 = call double @__decompiler_undefined_function_1()
  %stack_var_-60 = 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_-60, 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)
  %tmp272 = zext i32 %v1_45 to i80
  %v7_45 = bitcast i80 %tmp272 to x86_fp80
  %v0_4b = load i32, i32* @edi, align 8
  %v1_4b = add i32 %v0_4b, -80
  %v2_4b = inttoptr i32 %v1_4b to i32*
  %v3_4b = load i32, i32* %v2_4b, align 4
  %tmp285 = icmp sgt i32 %v3_4b, 2
  %spec.select = select i1 %tmp285, i32 %v3_4b, i32 2
  %tmp286 = icmp slt i32 %spec.select, 1000
  %storemerge283 = select i1 %tmp286, i32 %spec.select, i32 1000
  %v0_69 = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  %v2_69 = add i32 %v0_4b, -16
  %v3_69 = inttoptr i32 %v2_69 to double*
  %v4_69 = load double, double* %v3_69, align 4
  %v5_69 = fpext double %v4_69 to x86_fp80
  %v2_6c = add i3 %v0_69, -2
  %v2_6e = fsub x86_fp80 0xK80000000000000000000, %v5_69
  store x86_fp80 %v2_6e, x86_fp80* %st6.global-to-local, align 4
  %v6_74 = sitofp i32 %storemerge283 to x86_fp80
  %v7_74 = fdiv x86_fp80 %v5_69, %v6_74
  store x86_fp80 %v7_74, x86_fp80* %st7.global-to-local, align 4
  %v3_78 = add i32 %v0_4b, 24
  %v4_78 = inttoptr i32 %v3_78 to double*
  %v5_78 = load double, double* %v4_78, align 4
  %v6_78 = fpext double %v5_78 to x86_fp80
  %v7_78 = fmul x86_fp80 %v7_74, %v6_78
  %v2_7f = udiv i32 %storemerge283, 2
  store i32 %v2_7f, i32* %edx.global-to-local, align 4
  %v3_81 = load double, double* %stack_var_-60, align 8
  %v8_81 = fpext double %v3_81 to x86_fp80
  store x86_fp80 %v8_81, x86_fp80* %st7.global-to-local, align 4
  %v5_84 = fpext double %tmp260 to x86_fp80
  store i3 %v2_6c, i3* %fpu_stat_TOP.global-to-local, align 1
  store x86_fp80 %v5_84, x86_fp80* %st6.global-to-local, align 4
  %v8_88 = call i32 @__asm_fpatan(i32 %v1_45, x86_fp80 %v7_78, x86_fp80 %v2_6e)
  %v2_8a = load i32, i32* @edi, align 8
  %v3_8a = add i32 %v2_8a, 16
  %v4_8a = inttoptr i32 %v3_8a to double*
  %v5_8a = load double, double* %v4_8a, align 4
  %v6_8a = fpext double %v5_8a to x86_fp80
  %v7_8a = fsub x86_fp80 %v6_8a, %v5_84
  %v4_8d = load double, double* bitcast (i32* @edi to double*), align 8
  %v5_8d = fpext double %v4_8d to x86_fp80
  %v6_8d = fmul x86_fp80 %v7_8a, %v5_8d
  store x86_fp80 %v6_8d, x86_fp80* %st6.global-to-local, align 4
  %tmp275 = bitcast double %v4_8d to i64
  %tmp276 = trunc i64 %tmp275 to i32
  %v3_8f = add i32 %tmp276, -84
  %v4_8f = inttoptr i32 %v3_8f to i32*
  %v5_8f = load i32, i32* %v4_8f, align 4
  %v6_8f = sitofp i32 %v5_8f to x86_fp80
  %v7_8f = fmul x86_fp80 %v6_8d, %v6_8f
  %v2_92 = call x86_fp80 @llvm.round.f80(x86_fp80 %v7_8f)
  store x86_fp80 %v2_92, x86_fp80* %st6.global-to-local, align 4
  %v5_94 = load i32, i32* %v4_8f, align 4
  %v6_94 = sitofp i32 %v5_94 to x86_fp80
  %v7_94 = fdiv x86_fp80 %v2_92, %v6_94
  store x86_fp80 %v7_94, x86_fp80* %st6.global-to-local, align 4
  %v3_97 = add i32 %tmp276, 8
  %v4_97 = inttoptr i32 %v3_97 to double*
  %v5_97 = load double, double* %v4_97, align 4
  %v6_97 = fpext double %v5_97 to x86_fp80
  %v7_97 = fmul x86_fp80 %v7_94, %v6_97
  store x86_fp80 %v7_97, x86_fp80* %st6.global-to-local, align 4
  %v2_9a = call x86_fp80 @llvm.fabs.f80(x86_fp80 %v7_97)
  %v3_9a = fcmp olt x86_fp80 %v2_9a, 0xK403E8000000000000000
  %v0_9a = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  br i1 %v3_9a, label %bb, label %dec_label_pc_65._crit_edge

dec_label_pc_65._crit_edge:                       ; preds = %dec_label_pc_40
  %v1_9c.pre = load x86_fp80, x86_fp80* %st5.global-to-local, align 4
  br label %bb277

bb:                                               ; preds = %dec_label_pc_40
  %v4_9a = call x86_fp80 @llvm.sin.f80(x86_fp80 %v7_97)
  store x86_fp80 %v4_9a, x86_fp80* %st6.global-to-local, align 4
  %v7_9a = call x86_fp80 @llvm.cos.f80(x86_fp80 %v7_97)
  %v8_9a = add i3 %v0_9a, -1
  store i3 %v8_9a, i3* %fpu_stat_TOP.global-to-local, align 1
  store x86_fp80 %v7_9a, x86_fp80* %st5.global-to-local, align 4
  br label %bb277

bb277:                                            ; preds = %dec_label_pc_65._crit_edge, %bb
  %v1_a0 = phi x86_fp80 [ %v7_97, %dec_label_pc_65._crit_edge ], [ %v4_9a, %bb ]
  %v1_9c = phi x86_fp80 [ %v1_9c.pre, %dec_label_pc_65._crit_edge ], [ %v7_9a, %bb ]
  %v0_9c = phi i3 [ %v0_9a, %dec_label_pc_65._crit_edge ], [ %v8_9a, %bb ]
  %v6_9c = add i3 %v0_9c, 1
  %v3_a4 = load double, double* %stack_var_-60, align 8
  %v8_a4 = fpext double %v3_a4 to x86_fp80
  %v7_a7 = fmul x86_fp80 %v1_9c, %v8_a4
  %v7_af = fmul x86_fp80 %v1_a0, %v5_84
  %v4_b3 = fadd x86_fp80 %v7_af, %v7_a7
  %v3_b5 = fmul x86_fp80 %v4_b3, %v4_b3
  %v3_bb = fmul x86_fp80 %v7_45, %v7_45
  store x86_fp80 %v3_bb, x86_fp80* %st5.global-to-local, align 4
  %v4_bd = fadd x86_fp80 %v3_bb, %v3_b5
  %v2_bf = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_bd)
  store x86_fp80 %v2_bf, x86_fp80* %st6.global-to-local, align 4
  %v3_c1 = add i32 %tmp276, -16
  %v4_c1 = inttoptr i32 %v3_c1 to double*
  %v5_c1 = load double, double* %v4_c1, align 4
  %v6_c1 = fpext double %v5_c1 to x86_fp80
  %v7_c1 = fsub x86_fp80 %v2_bf, %v6_c1
  %v3_c4 = fmul x86_fp80 %v7_c1, %v7_c1
  %v7_c9 = fmul x86_fp80 %v1_a0, %v8_a4
  %v7_d1 = fmul x86_fp80 %v1_9c, %v5_84
  %v4_d7 = fsub x86_fp80 %v7_c9, %v7_d1
  %v3_d9 = fmul x86_fp80 %v4_d7, %v4_d7
  store x86_fp80 %v3_d9, x86_fp80* %st5.global-to-local, align 4
  %v4_db = fadd x86_fp80 %v3_d9, %v3_c4
  %v2_dd = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_db)
  store x86_fp80 %v2_dd, x86_fp80* %st6.global-to-local, align 4
  %v3_df = add i32 %tmp276, -72
  %v4_df = inttoptr i32 %v3_df to double*
  %v5_df = load double, double* %v4_df, align 4
  %v6_df = fpext double %v5_df to x86_fp80
  %v7_df = fsub x86_fp80 %v2_dd, %v6_df
  store x86_fp80 %v7_df, x86_fp80* %st6.global-to-local, align 4
  %v2_e6 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %v7_45)
  store x86_fp80 %v2_e6, x86_fp80* %st5.global-to-local, align 4
  %v5_e8 = load double, double* %v4_c1, align 4
  %v6_e8 = fpext double %v5_e8 to x86_fp80
  %v7_e8 = fsub x86_fp80 %v2_e6, %v6_e8
  store x86_fp80 %v7_e8, x86_fp80* %st5.global-to-local, align 4
  store i3 %v6_9c, i3* %fpu_stat_TOP.global-to-local, align 1
  %v3_112 = fmul x86_fp80 %v5_84, %v5_84
  %v0_f2.pre = load i32, i32* %edx.global-to-local, align 4
  br label %dec_label_pc_ef

dec_label_pc_ef:                                  ; preds = %dec_label_pc_14e, %bb277
  %v0_f2 = phi i32 [ %v0_f2.pre, %bb277 ], [ %v0_14e, %dec_label_pc_14e ]
  %v0_ef = phi i3 [ %v6_9c, %bb277 ], [ %storemerge, %dec_label_pc_14e ]
  %stack_var_-28.0.in = phi x86_fp80 [ %v2_6e, %bb277 ], [ %v7_101, %dec_label_pc_14e ]
  %stack_var_-44.0 = phi x86_fp80 [ %v7_e8, %bb277 ], [ %v10_f9, %dec_label_pc_14e ]
  %v1_ef = load x86_fp80, x86_fp80* %st7.global-to-local, align 4
  %v2_ef = load i32, i32* %esi.global-to-local, align 4
  %v3_ef = add i32 %v2_ef, -32
  %v4_ef = fptrunc x86_fp80 %v1_ef to double
  %v5_ef = inttoptr i32 %v3_ef to double*
  store double %v4_ef, double* %v5_ef, align 4
  %v1_f2 = add i32 %v0_f2, -1
  store i32 %v1_f2, i32* %edx.global-to-local, align 4
  %v10_f9 = fadd x86_fp80 %stack_var_-44.0, %v7_78
  %v7_101 = fadd x86_fp80 %v7_78, %stack_var_-28.0.in
  %v3_109 = load double, double* %stack_var_-60, align 8
  %v8_109 = fpext double %v3_109 to x86_fp80
  %v3_10c = fmul x86_fp80 %v8_109, %v8_109
  store x86_fp80 %v3_112, x86_fp80* %st6.global-to-local, align 4
  %v4_114 = fadd x86_fp80 %v3_112, %v3_10c
  %v2_116 = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_114)
  store x86_fp80 %v2_116, x86_fp80* %st7.global-to-local, align 4
  %v1_118 = load i32, i32* @edi, align 8
  %v2_118 = add i32 %v1_118, -16
  %v3_118 = inttoptr i32 %v2_118 to double*
  %v4_118 = load double, double* %v3_118, align 4
  %v5_118 = fpext double %v4_118 to x86_fp80
  %v3_11b = fmul x86_fp80 %v5_118, %v5_118
  %v3_121 = fmul x86_fp80 %v7_101, %v7_101
  %v2_123 = fsub x86_fp80 0xK80000000000000000000, %v3_121
  store x86_fp80 %v2_123, x86_fp80* %st5.global-to-local, align 4
  %v4_125 = fsub x86_fp80 %v3_11b, %v3_121
  %v2_127 = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_125)
  %v4_12b = fsub x86_fp80 %v2_116, %v2_127
  %v3_12d = fmul x86_fp80 %v4_12b, %v4_12b
  %v3_133 = fmul x86_fp80 %v10_f9, %v10_f9
  store x86_fp80 %v3_133, x86_fp80* %st6.global-to-local, align 4
  %v4_135 = fadd x86_fp80 %v3_133, %v3_12d
  %v2_137 = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_135)
  store x86_fp80 %v2_137, x86_fp80* %st7.global-to-local, align 4
  %v3_139 = add i32 %v1_118, -72
  %v4_139 = inttoptr i32 %v3_139 to double*
  %v5_139 = load double, double* %v4_139, align 4
  %v6_139 = fpext double %v5_139 to x86_fp80
  %v7_139 = fsub x86_fp80 %v2_137, %v6_139
  store x86_fp80 %v7_139, x86_fp80* %st7.global-to-local, align 4
  %v4_13c = load double, double* %v5_ef, align 4
  %v5_13c = fpext double %v4_13c to x86_fp80
  %v6_13c = add i3 %v0_ef, -1
  store i3 %v6_13c, i3* %fpu_stat_TOP.global-to-local, align 1
  store x86_fp80 %v5_13c, x86_fp80* %st6.global-to-local, align 4
  %v5_141 = call i32 @__asm_wait(x86_fp80 %v10_f9)
  %v0_142 = load i32, i32* %fpsw.global-to-local, align 4
  %v1_142 = call i16 @__asm_fnstsw(i32 %v0_142)
  %v2_142 = sext i16 %v1_142 to i32
  %v4_142 = and i32 %v5_141, -65536
  %tmp287 = udiv i32 %v2_142, 2
  %v12_144 = and i32 %tmp287, 32512
  %v2_142.masked = and i32 %v2_142, -65281
  %v13_144 = or i32 %v4_142, %v2_142.masked
  %v14_144 = or i32 %v13_144, %v12_144
  %v15_144281 = and i32 %v2_142, 256
  %v16_144 = icmp ne i32 %v15_144281, 0
  %v1_146 = icmp eq i1 %v16_144, false
  %v0_14c = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  br i1 %v1_146, label %dec_label_pc_14e, label %dec_label_pc_148

dec_label_pc_148:                                 ; preds = %dec_label_pc_ef
  %v1_14c = load x86_fp80, x86_fp80* %st6.global-to-local, align 4
  store x86_fp80 %v1_14c, x86_fp80* %st7.global-to-local, align 4
  br label %dec_label_pc_14e

dec_label_pc_14e:                                 ; preds = %dec_label_pc_ef, %dec_label_pc_148
  %storemerge = add i3 %v0_14c, 1
  store i3 %storemerge, i3* %fpu_stat_TOP.global-to-local, align 1
  %v0_14e = load i32, i32* %edx.global-to-local, align 4
  %v7_14e = icmp eq i32 %v0_14e, 0
  %v8_14e = icmp slt i32 %v0_14e, 0
  %v3_151 = icmp eq i1 %v8_14e, false
  %v4_151 = icmp eq i1 %v7_14e, false
  %v5_151 = icmp eq i1 %v3_151, %v4_151
  br i1 %v5_151, label %dec_label_pc_ef, label %dec_label_pc_153

dec_label_pc_153:                                 ; preds = %dec_label_pc_14e
  %v0_153 = load i32, i32* @edi, align 8
  %v1_153 = add i32 %v0_153, -76
  %v2_153 = inttoptr i32 %v1_153 to i32*
  %v3_153 = load i32, i32* %v2_153, align 4
  %v10_153 = icmp eq i32 %v3_153, 0
  %v1_157 = icmp eq i1 %v10_153, false
  %v1_15c.pre = load x86_fp80, x86_fp80* %st7.global-to-local, align 4
  br i1 %v1_157, label %dec_label_pc_15c, label %dec_label_pc_159

dec_label_pc_159:                                 ; preds = %dec_label_pc_153
  %v3_159 = add i32 %v0_153, -32
  %v4_159 = inttoptr i32 %v3_159 to double*
  %v5_159 = load double, double* %v4_159, align 4
  %v6_159 = fpext double %v5_159 to x86_fp80
  %v7_159 = fdiv x86_fp80 %v1_15c.pre, %v6_159
  store x86_fp80 %v7_159, x86_fp80* %st7.global-to-local, align 4
  br label %dec_label_pc_15c

dec_label_pc_15c:                                 ; preds = %dec_label_pc_153, %dec_label_pc_159
  %v1_15c = phi x86_fp80 [ %v7_159, %dec_label_pc_159 ], [ %v1_15c.pre, %dec_label_pc_153 ]
  %v2_15c = load i32, i32* %esi.global-to-local, align 4
  %v3_15c = add i32 %v2_15c, -32
  %v4_15c = fptrunc x86_fp80 %v1_15c to double
  %v5_15c = inttoptr i32 %v3_15c to double*
  store double %v4_15c, double* %v5_15c, align 4
  %v6_15c = add i3 %v0_14c, 2
  store i3 %v6_15c, i3* %fpu_stat_TOP.global-to-local, align 1
  ret i32 %v14_144
}

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

declare i32 @__asm_fpatan(i32, 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.fabs.f80(x86_fp80) #0

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

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

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

declare i32 @__asm_wait(x86_fp80) local_unnamed_addr

declare i16 @__asm_fnstsw(i32) local_unnamed_addr

declare double @__decompiler_undefined_function_1() local_unnamed_addr

attributes #0 = { nounwind readnone speculatable }
