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
  %st6.global-to-local = alloca x86_fp80, align 4
  %st7.global-to-local = alloca x86_fp80, align 4
  %tmp266 = call double @__decompiler_undefined_function_3()
  %stack_var_-50 = 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_-50, 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
  %v3_51 = load double, double* %stack_var_-50, align 8
  %v8_51 = fpext double %v3_51 to x86_fp80
  store x86_fp80 %v8_51, x86_fp80* %st7.global-to-local, align 4
  %v5_54 = fpext double %tmp266 to x86_fp80
  %v6_54 = add i3 %v0_4b, -2
  store i3 %v6_54, i3* %fpu_stat_TOP.global-to-local, align 1
  store x86_fp80 %v5_54, x86_fp80* %st6.global-to-local, align 4
  %v3_5a = call i32 @__asm_wait(i32 %v1_45)
  %v0_5b = load i32, i32* %fpsw.global-to-local, align 4
  %v1_5b = call i16 @__asm_fnstsw(i32 %v0_5b)
  %tmp281 = and i16 %v1_5b, 256
  %v16_5d = icmp ne i16 %tmp281, 0
  %v1_5f = icmp eq i1 %v16_5d, false
  %v0_6a = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  %v3_6a = load double, double* bitcast (i32* @edi to double*), align 8
  %v4_6a = fpext double %v3_6a to x86_fp80
  %v5_6a = add i3 %v0_6a, -1
  store i3 %v5_6a, i3* %fpu_stat_TOP.global-to-local, align 1
  %tmp273 = bitcast double %v3_6a to i64
  %tmp274 = trunc i64 %tmp273 to i32
  br i1 %v1_5f, label %dec_label_pc_6a, label %dec_label_pc_73

dec_label_pc_6a:                                  ; preds = %dec_label_pc_40
  store x86_fp80 %v4_6a, x86_fp80* %st7.global-to-local, align 4
  %v2_6c = fsub x86_fp80 0xK80000000000000000000, %v4_6a
  br label %dec_label_pc_73

dec_label_pc_73:                                  ; preds = %dec_label_pc_40, %dec_label_pc_6a
  %storemerge10 = phi x86_fp80 [ %v2_6c, %dec_label_pc_6a ], [ %v4_6a, %dec_label_pc_40 ]
  %storemerge7 = phi i32 [ -1, %dec_label_pc_6a ], [ 1, %dec_label_pc_40 ]
  store i32 %storemerge7, i32* %edx.global-to-local, align 4
  %v4_75 = fadd x86_fp80 %storemerge10, %storemerge10
  %tmp275 = fptrunc x86_fp80 %v4_75 to double
  store double %tmp275, double* %stack_var_-50, align 8
  %v3_7d = fmul x86_fp80 %v4_75, %v4_75
  %v3_83 = fmul x86_fp80 %v5_54, %v5_54
  %v4_85 = fadd x86_fp80 %v3_83, %v3_7d
  %v2_87 = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_85)
  %v6_89 = fsub x86_fp80 %v2_87, %v4_6a
  %v3_8b = fmul x86_fp80 %v6_89, %v6_89
  %v7_8d = fpext double %v6_45 to x86_fp80
  %v3_91 = fmul x86_fp80 %v7_8d, %v7_8d
  store x86_fp80 %v3_91, x86_fp80* %st6.global-to-local, align 4
  %v4_93 = fadd x86_fp80 %v3_91, %v3_8b
  %v2_95 = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_93)
  store x86_fp80 %v2_95, x86_fp80* %st7.global-to-local, align 4
  %v3_97 = add i32 %tmp274, -16
  %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 = fsub x86_fp80 %v2_95, %v6_97
  %v2_9a = call x86_fp80 @llvm.fabs.f80(x86_fp80 %v7_97)
  store x86_fp80 %v2_9a, x86_fp80* %st7.global-to-local, align 4
  %v3_9c = add i32 %tmp274, -84
  %v4_9c = inttoptr i32 %v3_9c to double*
  %v5_9c = load double, double* %v4_9c, align 4
  %v6_9c = fpext double %v5_9c to x86_fp80
  %v7_9c = fsub x86_fp80 %v2_9a, %v6_9c
  store x86_fp80 %v7_9c, x86_fp80* %st7.global-to-local, align 4
  %v2_9f = load i32, i32* %esi.global-to-local, align 4
  %v3_9f = add i32 %v2_9f, -32
  %v4_9f = fptrunc x86_fp80 %v7_9c to double
  %v5_9f = inttoptr i32 %v3_9f to double*
  store double %v4_9f, double* %v5_9f, align 4
  %v6_9f = add i3 %v0_6a, 2
  store i3 %v6_9f, i3* %fpu_stat_TOP.global-to-local, align 1
  %v2_a2 = load double, double* %stack_var_-50, align 8
  %v3_a2 = fptrunc double %v2_a2 to float
  %v4_a2 = bitcast float %v3_a2 to i32
  %v5_a2 = sext i32 %v4_a2 to i128
  call void @__asm_movupd.1(i128 %v5_a2, i128 %v5_17)
  %v1_a7 = call i32 @__asm_movsd.2(i128 %v5_1c)
  %v4_a7 = sext i32 %v1_a7 to i64
  %v6_a7 = bitcast i64 %v4_a7 to double
  %v0_ad = load i32, i32* %edx.global-to-local, align 4
  %v10_ad = icmp eq i32 %v0_ad, 1
  %v1_b0 = icmp eq i1 %v10_ad, false
  %v0_f9 = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  br i1 %v1_b0, label %dec_label_pc_f9, label %dec_label_pc_b2

dec_label_pc_b2:                                  ; preds = %dec_label_pc_73
  %v3_b2 = load double, double* %stack_var_-50, align 8
  %v8_b2 = fpext double %v3_b2 to x86_fp80
  %v3_b5 = fmul x86_fp80 %v8_b2, %v8_b2
  %v4_bd = fadd x86_fp80 %v3_83, %v3_b5
  %v2_bf = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_bd)
  store x86_fp80 %v2_bf, x86_fp80* %st7.global-to-local, align 4
  store x86_fp80 %v5_54, x86_fp80* %st6.global-to-local, align 4
  %v9_c5 = add i3 %v0_f9, -3
  store i3 %v9_c5, i3* %fpu_stat_TOP.global-to-local, align 1
  %v3_c8 = call i32 @__asm_fpatan(i32 %v1_a7)
  %v2_ca = load i32, i32* @edi, align 8
  %v3_ca = add i32 %v2_ca, 32
  %v4_ca = inttoptr i32 %v3_ca to double*
  %v5_ca = load double, double* %v4_ca, align 4
  %v6_ca = fpext double %v5_ca to x86_fp80
  %v7_ca = fmul x86_fp80 %v8_b2, %v6_ca
  %v0_cd = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  %v2_cd = add i32 %v2_ca, -72
  %v3_cd = inttoptr i32 %v2_cd to double*
  %v4_cd = load double, double* %v3_cd, align 4
  %v5_cd = fpext double %v4_cd to x86_fp80
  %v3_d0 = fadd x86_fp80 %v5_cd, %v5_cd
  %v4_d2 = fmul x86_fp80 %v7_ca, %v3_d0
  %v3_d4 = add i32 %v2_ca, -16
  %v4_d4 = inttoptr i32 %v3_d4 to double*
  %v5_d4 = load double, double* %v4_d4, align 4
  %v6_d4 = fpext double %v5_d4 to x86_fp80
  %v7_d4 = fadd x86_fp80 %v4_d2, %v6_d4
  %v4_d7 = fptrunc x86_fp80 %v7_d4 to double
  %v6_d7 = add i3 %v0_cd, 1
  %v1_db = load x86_fp80, x86_fp80* %st6.global-to-local, align 4
  %v3_db = add i32 %v2_ca, 8
  %v4_db = inttoptr i32 %v3_db to double*
  %v5_db = load double, double* %v4_db, align 4
  %v6_db = fpext double %v5_db to x86_fp80
  %v7_db = fsub x86_fp80 %v1_db, %v6_db
  %v3_de = fmul x86_fp80 %v7_db, %v7_db
  %v7_e0 = fpext double %v6_a7 to x86_fp80
  %v3_e4 = fmul x86_fp80 %v7_e0, %v7_e0
  %v4_e6 = fadd x86_fp80 %v3_e4, %v3_de
  store i3 %v6_d7, i3* %fpu_stat_TOP.global-to-local, align 1
  %v2_e8 = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_e6)
  %v7_ea = fsub x86_fp80 %v2_e8, %v7_d4
  %v2_f2 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %v7_ea)
  store x86_fp80 %v2_f2, x86_fp80* %st6.global-to-local, align 4
  %v3_f4 = add i32 %v2_ca, -84
  %v4_f4 = inttoptr i32 %v3_f4 to double*
  %v5_f4 = load double, double* %v4_f4, align 4
  %v6_f4 = fpext double %v5_f4 to x86_fp80
  %v7_f4 = fsub x86_fp80 %v2_f2, %v6_f4
  store x86_fp80 %v7_f4, x86_fp80* %st6.global-to-local, align 4
  br label %dec_label_pc_13b

dec_label_pc_f9:                                  ; preds = %dec_label_pc_73
  store x86_fp80 %v5_54, x86_fp80* %st7.global-to-local, align 4
  %v7_fd = fpext double %v6_a7 to x86_fp80
  store x86_fp80 %v7_fd, x86_fp80* %st6.global-to-local, align 4
  %v3_101 = load double, double* %stack_var_-50, align 8
  %v8_101 = fpext double %v3_101 to x86_fp80
  %v2_104 = load i32, i32* @edi, align 8
  %v3_104 = add i32 %v2_104, 8
  %v4_104 = inttoptr i32 %v3_104 to double*
  %v5_104 = load double, double* %v4_104, align 4
  %v6_104 = fpext double %v5_104 to x86_fp80
  %v7_104 = fadd x86_fp80 %v8_101, %v6_104
  %tmp276 = fptrunc x86_fp80 %v7_104 to double
  store double %tmp276, double* %stack_var_-50, align 8
  %v6_10a = add i3 %v0_f9, -1
  %v3_115 = fmul x86_fp80 %v7_104, %v7_104
  %v3_11b = fmul x86_fp80 %v7_fd, %v7_fd
  store x86_fp80 %v3_11b, x86_fp80* %st6.global-to-local, align 4
  %v4_11d = fadd x86_fp80 %v3_11b, %v3_115
  %v2_11f = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_11d)
  store x86_fp80 %v2_11f, x86_fp80* %st7.global-to-local, align 4
  %v3_121 = add i32 %v2_104, -72
  %v4_121 = inttoptr i32 %v3_121 to double*
  %v5_121 = load double, double* %v4_121, align 4
  %v6_121 = fpext double %v5_121 to x86_fp80
  %v7_121 = fadd x86_fp80 %v2_11f, %v6_121
  store x86_fp80 %v7_121, x86_fp80* %st7.global-to-local, align 4
  %v3_124 = add i32 %v2_104, -16
  %v4_124 = inttoptr i32 %v3_124 to double*
  %v5_124 = load double, double* %v4_124, align 4
  %v6_124 = fpext double %v5_124 to x86_fp80
  %v7_124 = fsub x86_fp80 %v7_121, %v6_124
  %v3_127 = fmul x86_fp80 %v7_124, %v7_124
  store x86_fp80 %v3_83, x86_fp80* %st6.global-to-local, align 4
  %v4_12f = fadd x86_fp80 %v3_83, %v3_127
  store i3 %v6_10a, i3* %fpu_stat_TOP.global-to-local, align 1
  %v2_131 = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %v4_12f)
  store x86_fp80 %v2_131, x86_fp80* %st7.global-to-local, align 4
  %v5_133 = load double, double* %v4_121, align 4
  %v6_133 = fpext double %v5_133 to x86_fp80
  %v7_133 = fsub x86_fp80 %v2_131, %v6_133
  %v2_136 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %v7_133)
  store x86_fp80 %v2_136, x86_fp80* %st7.global-to-local, align 4
  %v3_138 = add i32 %v2_104, -84
  %v4_138 = inttoptr i32 %v3_138 to double*
  %v5_138 = load double, double* %v4_138, align 4
  %v6_138 = fpext double %v5_138 to x86_fp80
  %v7_138 = fsub x86_fp80 %v2_136, %v6_138
  store x86_fp80 %v7_138, x86_fp80* %st7.global-to-local, align 4
  br label %dec_label_pc_13b

dec_label_pc_13b:                                 ; preds = %dec_label_pc_f9, %dec_label_pc_b2
  %v0_13b = phi i3 [ %v6_10a, %dec_label_pc_f9 ], [ %v6_d7, %dec_label_pc_b2 ]
  %stack_var_-42.0 = phi double [ %v6_a7, %dec_label_pc_f9 ], [ %v4_d7, %dec_label_pc_b2 ]
  %stack_var_-26.0 = phi x86_fp80 [ 0xK00000000000000000000, %dec_label_pc_f9 ], [ %v7_ea, %dec_label_pc_b2 ]
  %v1_13b = load i32, i32* %esi.global-to-local, align 4
  %v2_13b = add i32 %v1_13b, -32
  %v3_13b = inttoptr i32 %v2_13b to double*
  %v4_13b = load double, double* %v3_13b, align 4
  %v5_13b = fpext double %v4_13b to x86_fp80
  %v2_144 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %stack_var_-26.0)
  %v4_146 = fsub x86_fp80 %v2_144, %stack_var_-26.0
  %v4_148 = fadd x86_fp80 %v4_146, %v5_13b
  %v4_14a = fptrunc x86_fp80 %v4_148 to double
  store double %v4_14a, double* %v3_13b, align 4
  store i3 %v0_13b, i3* %fpu_stat_TOP.global-to-local, align 1
  %v1_150 = fptrunc double %stack_var_-42.0 to float
  %v2_150 = bitcast float %v1_150 to i32
  %v3_150 = call i32 @__asm_wait(i32 %v2_150)
  %v0_151 = load i32, i32* %fpsw.global-to-local, align 4
  %v1_151 = call i16 @__asm_fnstsw(i32 %v0_151)
  %v2_151 = sext i16 %v1_151 to i32
  %v4_151 = and i32 %v3_150, -65536
  %tmp279 = udiv i32 %v2_151, 2
  %v12_153 = and i32 %tmp279, 32512
  %v2_151.masked = and i32 %v2_151, -65281
  %v13_153 = or i32 %v4_151, %v2_151.masked
  %v14_153 = or i32 %v13_153, %v12_153
  %v15_15315 = and i32 %v2_151, 256
  %v16_153 = icmp ne i32 %v15_15315, 0
  %v1_155 = icmp eq i1 %v16_153, false
  br i1 %v1_155, label %dec_label_pc_159, label %dec_label_pc_15e

dec_label_pc_159:                                 ; preds = %dec_label_pc_13b
  %v1_15b = load i32, i32* %esi.global-to-local, align 4
  %v2_15b = add i32 %v1_15b, -32
  %v3_15b = inttoptr i32 %v2_15b to double*
  %v4_15b = load double, double* %v3_15b, align 4
  %v5_15b = fpext double %v4_15b to x86_fp80
  store x86_fp80 %v5_15b, x86_fp80* %st6.global-to-local, align 4
  br label %dec_label_pc_15e

dec_label_pc_15e:                                 ; preds = %dec_label_pc_13b, %dec_label_pc_159
  %v0_15e = load i32, i32* @edi, align 8
  %v1_15e = add i32 %v0_15e, -76
  %v2_15e = inttoptr i32 %v1_15e to i32*
  %v3_15e = load i32, i32* %v2_15e, align 4
  %v10_15e = icmp eq i32 %v3_15e, 0
  %v1_162 = icmp eq i1 %v10_15e, false
  %v1_167.pre = load x86_fp80, x86_fp80* %st7.global-to-local, align 4
  br i1 %v1_162, label %dec_label_pc_167, label %dec_label_pc_164

dec_label_pc_164:                                 ; preds = %dec_label_pc_15e
  %v3_164 = add i32 %v0_15e, -32
  %v4_164 = inttoptr i32 %v3_164 to double*
  %v5_164 = load double, double* %v4_164, align 4
  %v6_164 = fpext double %v5_164 to x86_fp80
  %v7_164 = fdiv x86_fp80 %v1_167.pre, %v6_164
  store x86_fp80 %v7_164, x86_fp80* %st7.global-to-local, align 4
  br label %dec_label_pc_167

dec_label_pc_167:                                 ; preds = %dec_label_pc_15e, %dec_label_pc_164
  %v1_167 = phi x86_fp80 [ %v7_164, %dec_label_pc_164 ], [ %v1_167.pre, %dec_label_pc_15e ]
  %v0_167 = load i3, i3* %fpu_stat_TOP.global-to-local, align 1
  %v2_167 = load i32, i32* %esi.global-to-local, align 4
  %v3_167 = add i32 %v2_167, -32
  %v4_167 = fptrunc x86_fp80 %v1_167 to double
  %v5_167 = inttoptr i32 %v3_167 to double*
  store double %v4_167, double* %v5_167, align 4
  %v6_167 = add i3 %v0_167, 1
  store i3 %v6_167, i3* %fpu_stat_TOP.global-to-local, align 1
  ret i32 %v14_153
}

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_wait(i32) local_unnamed_addr

declare i16 @__asm_fnstsw(i32) local_unnamed_addr

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

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

declare i32 @__asm_fpatan(i32) local_unnamed_addr

declare double @__decompiler_undefined_function_3() local_unnamed_addr

attributes #0 = { nounwind readnone speculatable }
