#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, ...);
int /*<<< orphan*/ scanf(char *, double *, double *, double *, double *);
main() {
  double a, b, c, d;
  double p1, p2, mid;
  double function[1000];
  scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
  int i;
  for (i = 0; i <= 999; ++i) {
    function[i] = (a * i * i * i) + (b * i * i) + (c * i) + (d);
    printf("Func: %lf for x = %d\n", function[i], i);
  }
  for (i = 0; i <= 999; ++i) {
    if (function[i] < 0) {
      p1 = i;
      break;
    }
  }
  for (i = 0; i <= 999; ++i) {
    if (function[i] > 0) {
      p2 = i;
      break;
    }
  }
  while (function[(int)p2] > 0 && function[(int)p1] < 0) {
    mid = (p1 + p2) / 2.0;
    if (function[(int)mid] > 0) {
      p2 = mid;
    } else if (function[(int)mid] < 0) {
      p1 = mid;
    } else {
      printf("The root is at %lf", mid);
    }
    if (p1 == p2 && p2 == mid)
      break;
    printf("%lf\t%lf\t%lf\n", p1, p2, mid);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecf(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1040 <scanf@plt>
movl   $0x0,-0x1f84(%rbp)
cmpl   $0x3e7,-0x1f84(%rbp)
jg     1214 <main+0xf4>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x1f84(%rbp),%xmm0
ff
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x1f84(%rbp),%xmm0
ff
mulsd  %xmm0,%xmm1
cvtsi2sdl -0x1f84(%rbp),%xmm2
ff
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x1f84(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm0
cvtsi2sdl -0x1f84(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x1f84(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x28(%rbp),%xmm0
movslq -0x1f84(%rbp),%rax
movsd  %xmm0,-0x1f80(%rbp,%rax,8)
ff ff
movslq -0x1f84(%rbp),%rax
movsd  -0x1f80(%rbp,%rax,8),%xmm0
ff ff
mov    -0x1f84(%rbp),%esi
lea    0xe1f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1f84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f84(%rbp)
jmp    1158 <main+0x38>
movl   $0x0,-0x1f84(%rbp)
cmpl   $0x3e7,-0x1f84(%rbp)
jg     1272 <main+0x152>
movslq -0x1f84(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd -0x1f80(%rbp,%rax,8),%xmm0
ff ff
jbe    1259 <main+0x139>
cvtsi2sdl -0x1f84(%rbp),%xmm0
ff
movsd  %xmm0,-0x30(%rbp)
jmp    1272 <main+0x152>
jmp    125e <main+0x13e>
mov    -0x1f84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f84(%rbp)
jmp    121e <main+0xfe>
movl   $0x0,-0x1f84(%rbp)
cmpl   $0x3e7,-0x1f84(%rbp)
jg     12d4 <main+0x1b4>
movslq -0x1f84(%rbp),%rax
movsd  -0x1f80(%rbp,%rax,8),%xmm0
ff ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12bb <main+0x19b>
cvtsi2sdl -0x1f84(%rbp),%xmm0
ff
movsd  %xmm0,-0x38(%rbp)
jmp    12d4 <main+0x1b4>
jmp    12c0 <main+0x1a0>
mov    -0x1f84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1f84(%rbp)
jmp    127c <main+0x15c>
jmp    12d9 <main+0x1b9>
cvttsd2si -0x38(%rbp),%eax
cltq
movsd  -0x1f80(%rbp,%rax,8),%xmm0
ff ff
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x1f85(%rbp)
jbe    131a <main+0x1fa>
cvttsd2si -0x30(%rbp),%eax
cltq
xorps  %xmm0,%xmm0
ucomisd -0x1f80(%rbp,%rax,8),%xmm0
ff ff
seta   %al
mov    %al,-0x1f85(%rbp)
mov    -0x1f85(%rbp),%al
test   $0x1,%al
jne    132d <main+0x20d>
jmp    1407 <main+0x2e7>
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  0xcc1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
cvttsd2si -0x40(%rbp),%eax
cltq
movsd  -0x1f80(%rbp,%rax,8),%xmm0
ff ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1374 <main+0x254>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    13b4 <main+0x294>
cvttsd2si -0x40(%rbp),%eax
cltq
xorps  %xmm0,%xmm0
ucomisd -0x1f80(%rbp,%rax,8),%xmm0
ff ff
jbe    139c <main+0x27c>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    13af <main+0x28f>
movsd  -0x40(%rbp),%xmm0
lea    0xc86(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    13b4 <main+0x294>
movsd  -0x30(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
jne    13e5 <main+0x2c5>
jp     13e5 <main+0x2c5>
movsd  -0x38(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jne    13e5 <main+0x2c5>
jp     13e5 <main+0x2c5>
jmp    1407 <main+0x2e7>
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
lea    0xc46(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    12d9 <main+0x1b9>
mov    -0x4(%rbp),%eax
add    $0x1f90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1f88,%rsp
lea    0xed7(%rip),%rdi
lea    0x38(%rsp),%rsi
lea    0x30(%rsp),%rdx
lea    0x28(%rsp),%rcx
lea    0x20(%rsp),%r8
call   1040 <scanf@plt>
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0x30(%rsp),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
mulsd  0x28(%rsp),%xmm0
addsd  %xmm1,%xmm0
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp,%rbx,8)
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x3e8,%rbx
jne    1160 <main+0x40>
mov    $0x4,%eax
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
ucomisd 0x20(%rsp,%rax,8),%xmm0
ja     1206 <main+0xe6>
ucomisd 0x28(%rsp,%rax,8),%xmm0
ja     120c <main+0xec>
ucomisd 0x30(%rsp,%rax,8),%xmm0
ja     1212 <main+0xf2>
ucomisd 0x38(%rsp,%rax,8),%xmm0
ja     1218 <main+0xf8>
ucomisd 0x40(%rsp,%rax,8),%xmm0
ja     121c <main+0xfc>
add    $0x5,%rax
cmp    $0x3ec,%rax
jne    11d0 <main+0xb0>
jmp    1223 <main+0x103>
add    $0xfffffffffffffffc,%rax
jmp    121c <main+0xfc>
add    $0xfffffffffffffffd,%rax
jmp    121c <main+0xfc>
add    $0xfffffffffffffffe,%rax
jmp    121c <main+0xfc>
add    $0xffffffffffffffff,%rax
xorps  %xmm4,%xmm4
cvtsi2sd %eax,%xmm4
mov    $0x4,%eax
xorpd  %xmm0,%xmm0
nopl   0x0(%rax)
movsd  0x20(%rsp,%rax,8),%xmm1
ucomisd %xmm0,%xmm1
ja     127a <main+0x15a>
movsd  0x28(%rsp,%rax,8),%xmm1
ucomisd %xmm0,%xmm1
ja     1280 <main+0x160>
movsd  0x30(%rsp,%rax,8),%xmm1
ucomisd %xmm0,%xmm1
ja     1286 <main+0x166>
movsd  0x38(%rsp,%rax,8),%xmm1
ucomisd %xmm0,%xmm1
ja     128c <main+0x16c>
movsd  0x40(%rsp,%rax,8),%xmm1
ucomisd %xmm0,%xmm1
ja     1290 <main+0x170>
add    $0x5,%rax
cmp    $0x3ec,%rax
jne    1230 <main+0x110>
jmp    1297 <main+0x177>
add    $0xfffffffffffffffc,%rax
jmp    1290 <main+0x170>
add    $0xfffffffffffffffd,%rax
jmp    1290 <main+0x170>
add    $0xfffffffffffffffe,%rax
jmp    1290 <main+0x170>
add    $0xffffffffffffffff,%rax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
cvttsd2si %xmm1,%eax
cltq
movsd  0x40(%rsp,%rax,8),%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jbe    13b2 <main+0x292>
lea    0xd89(%rip),%rbx
lea    0xd6f(%rip),%r14
jmp    1310 <main+0x1f0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
movapd %xmm4,%xmm0
movsd  %xmm4,0x10(%rsp)
mov    $0x3,%al
movsd  %xmm1,0x8(%rsp)
call   1030 <printf@plt>
xorpd  %xmm3,%xmm3
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm4
cvttsd2si %xmm1,%eax
cltq
movsd  0x40(%rsp,%rax,8),%xmm0
ucomisd %xmm3,%xmm0
jbe    13b2 <main+0x292>
cvttsd2si %xmm4,%eax
cltq
ucomisd 0x40(%rsp,%rax,8),%xmm3
jbe    13b2 <main+0x292>
movapd %xmm1,%xmm2
addsd  %xmm4,%xmm2
mulsd  0xcce(%rip),%xmm2
cvttsd2si %xmm2,%eax
cltq
movsd  0x40(%rsp,%rax,8),%xmm0
ucomisd %xmm3,%xmm0
jbe    1350 <main+0x230>
movapd %xmm2,%xmm1
jmp    1392 <main+0x272>
nopw   0x0(%rax,%rax,1)
ucomisd %xmm0,%xmm3
jbe    1360 <main+0x240>
movapd %xmm2,%xmm4
jmp    1392 <main+0x272>
nopl   0x0(%rax)
mov    %r14,%rdi
movapd %xmm2,%xmm0
mov    $0x1,%al
movsd  %xmm4,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x18(%rsp)
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm4
ucomisd %xmm1,%xmm4
jne    12d0 <main+0x1b0>
jp     12d0 <main+0x1b0>
ucomisd %xmm2,%xmm1
jne    12d0 <main+0x1b0>
jp     12d0 <main+0x1b0>
xor    %eax,%eax
add    $0x1f88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%lf %lf %lf %lf\00"
@.str.1 = [22 x i8] c"Func: %lf for x = %d\0A\00"
@.str.2 = [19 x i8] c"The root is at %lf\00"
@.str.3 = [13 x i8] c"%lf\09%lf\09%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca [1000 x double]
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 @scanf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4, double* %5)
store i32 0, i32* %10
br label %12
12: ; preds = %48, %0
%13 = load i32, i32* %10
%14 = icmp sle i32 %13, 999
br i1 %14, label %15, label %51
15: ; preds = %12
%16 = load double, double* %2
%17 = load i32, i32* %10
%18 = sitofp i32 %17 to double
%19 = fmul double %16, %18
%20 = load i32, i32* %10
%21 = sitofp i32 %20 to double
%22 = fmul double %19, %21
%23 = load i32, i32* %10
%24 = sitofp i32 %23 to double
%25 = load double, double* %3
%26 = load i32, i32* %10
%27 = sitofp i32 %26 to double
%28 = fmul double %25, %27
%29 = load i32, i32* %10
%30 = sitofp i32 %29 to double
%31 = fmul double %28, %30
%32 = call double @llvm.fmuladd.f64(double %22, double %24, double %31)
%33 = load double, double* %4
%34 = load i32, i32* %10
%35 = sitofp i32 %34 to double
%36 = call double @llvm.fmuladd.f64(double %33, double %35, double %32)
%37 = load double, double* %5
%38 = fadd double %36, %37
%39 = load i32, i32* %10
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1000 x double], [1000 x double]* %9, i64 0, i64 %40
store double %38, double* %41
%42 = load i32, i32* %10
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [1000 x double], [1000 x double]* %9, i64 0, i64 %43
%45 = load double, double* %44
%46 = load i32, i32* %10
%47 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %45, i32 %46)
br label %48
48: ; preds = %15
%49 = load i32, i32* %10
%50 = add nsw i32 %49, 1
store i32 %50, i32* %10
br label %12
51: ; preds = %12
store i32 0, i32* %10
br label %52
52: ; preds = %65, %51
%53 = load i32, i32* %10
%54 = icmp sle i32 %53, 999
br i1 %54, label %55, label %68
55: ; preds = %52
%56 = load i32, i32* %10
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [1000 x double], [1000 x double]* %9, i64 0, i64 %57
%59 = load double, double* %58
%60 = fcmp olt double %59, 0.000000e+00
br i1 %60, label %61, label %64
61: ; preds = %55
%62 = load i32, i32* %10
%63 = sitofp i32 %62 to double
store double %63, double* %6
br label %68
64: ; preds = %55
br label %65
65: ; preds = %64
%66 = load i32, i32* %10
%67 = add nsw i32 %66, 1
store i32 %67, i32* %10
br label %52
68: ; preds = %61, %52
store i32 0, i32* %10
br label %69
69: ; preds = %82, %68
%70 = load i32, i32* %10
%71 = icmp sle i32 %70, 999
br i1 %71, label %72, label %85
72: ; preds = %69
%73 = load i32, i32* %10
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [1000 x double], [1000 x double]* %9, i64 0, i64 %74
%76 = load double, double* %75
%77 = fcmp ogt double %76, 0.000000e+00
br i1 %77, label %78, label %81
78: ; preds = %72
%79 = load i32, i32* %10
%80 = sitofp i32 %79 to double
store double %80, double* %7
br label %85
81: ; preds = %72
br label %82
82: ; preds = %81
%83 = load i32, i32* %10
%84 = add nsw i32 %83, 1
store i32 %84, i32* %10
br label %69
85: ; preds = %78, %69
br label %86
86: ; preds = %137, %85
%87 = load double, double* %7
%88 = fptosi double %87 to i32
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [1000 x double], [1000 x double]* %9, i64 0, i64 %89
%91 = load double, double* %90
%92 = fcmp ogt double %91, 0.000000e+00
br i1 %92, label %93, label %100
93: ; preds = %86
%94 = load double, double* %6
%95 = fptosi double %94 to i32
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [1000 x double], [1000 x double]* %9, i64 0, i64 %96
%98 = load double, double* %97
%99 = fcmp olt double %98, 0.000000e+00
br label %100
100: ; preds = %93, %86
%101 = phi i1 [ false, %86 ], [ %99, %93 ]
br i1 %101, label %102, label %142
102: ; preds = %100
%103 = load double, double* %6
%104 = load double, double* %7
%105 = fadd double %103, %104
%106 = fdiv double %105, 2.000000e+00
store double %106, double* %8
%107 = load double, double* %8
%108 = fptosi double %107 to i32
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [1000 x double], [1000 x double]* %9, i64 0, i64 %109
%111 = load double, double* %110
%112 = fcmp ogt double %111, 0.000000e+00
br i1 %112, label %113, label %115
113: ; preds = %102
%114 = load double, double* %8
store double %114, double* %7
br label %128
115: ; preds = %102
%116 = load double, double* %8
%117 = fptosi double %116 to i32
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [1000 x double], [1000 x double]* %9, i64 0, i64 %118
%120 = load double, double* %119
%121 = fcmp olt double %120, 0.000000e+00
br i1 %121, label %122, label %124
122: ; preds = %115
%123 = load double, double* %8
store double %123, double* %6
br label %127
124: ; preds = %115
%125 = load double, double* %8
%126 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %125)
br label %127
127: ; preds = %124, %122
br label %128
128: ; preds = %127, %113
%129 = load double, double* %6
%130 = load double, double* %7
%131 = fcmp oeq double %129, %130
br i1 %131, label %132, label %137
132: ; preds = %128
%133 = load double, double* %7
%134 = load double, double* %8
%135 = fcmp oeq double %133, %134
br i1 %135, label %136, label %137
136: ; preds = %132
br label %142
137: ; preds = %132, %128
%138 = load double, double* %6
%139 = load double, double* %7
%140 = load double, double* %8
%141 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %138, double %139, double %140)
br label %86
142: ; preds = %136, %100
%143 = load i32, i32* %1
ret i32 %143
}

LLVM IR (-O2):
@.str = [16 x i8] c"%lf %lf %lf %lf\00"
@.str.1 = [22 x i8] c"Func: %lf for x = %d\0A\00"
@.str.2 = [19 x i8] c"The root is at %lf\00"
@.str.3 = [13 x i8] c"%lf\09%lf\09%lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca [1000 x double]
%6 = bitcast double* %1 to i8*
%7 = bitcast double* %2 to i8*
%8 = bitcast double* %3 to i8*
%9 = bitcast double* %4 to i8*
%10 = bitcast [1000 x double]* %5 to i8*
%11 = call i32 @scanf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4)
br label %12
12: ; preds = %0, %12
%13 = phi i64 [ 0, %0 ], [ %29, %12 ]
%14 = load double, double* %1
%15 = trunc i64 %13 to i32
%16 = sitofp i32 %15 to double
%17 = fmul double %14, %16
%18 = fmul double %17, %16
%19 = load double, double* %2
%20 = fmul double %19, %16
%21 = fmul double %20, %16
%22 = call double @llvm.fmuladd.f64(double %18, double %16, double %21)
%23 = load double, double* %3
%24 = call double @llvm.fmuladd.f64(double %23, double %16, double %22)
%25 = load double, double* %4
%26 = fadd double %25, %24
%27 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %13
store double %26, double* %27
%28 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %26, i32 %15)
%29 = add nuw nsw i64 %13, 1
%30 = icmp eq i64 %29, 1000
br i1 %30, label %31, label %12
31: ; preds = %12, %60
%32 = phi i64 [ %61, %60 ], [ 0, %12 ]
%33 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %32
%34 = load double, double* %33
%35 = fcmp olt double %34, 0.000000e+00
br i1 %35, label %36, label %40
36: ; preds = %55, %50, %45, %40, %31
%37 = phi i64 [ %32, %31 ], [ %41, %40 ], [ %46, %45 ], [ %51, %50 ], [ %56, %55 ]
%38 = trunc i64 %37 to i32
%39 = sitofp i32 %38 to double
br label %63
40: ; preds = %31
%41 = add nuw nsw i64 %32, 1
%42 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %41
%43 = load double, double* %42
%44 = fcmp olt double %43, 0.000000e+00
br i1 %44, label %36, label %45
45: ; preds = %40
%46 = add nuw nsw i64 %32, 2
%47 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %46
%48 = load double, double* %47
%49 = fcmp olt double %48, 0.000000e+00
br i1 %49, label %36, label %50
50: ; preds = %45
%51 = add nuw nsw i64 %32, 3
%52 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %51
%53 = load double, double* %52
%54 = fcmp olt double %53, 0.000000e+00
br i1 %54, label %36, label %55
55: ; preds = %50
%56 = add nuw nsw i64 %32, 4
%57 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %56
%58 = load double, double* %57
%59 = fcmp olt double %58, 0.000000e+00
br i1 %59, label %36, label %60
60: ; preds = %55
%61 = add nuw nsw i64 %32, 5
%62 = icmp eq i64 %61, 1000
br i1 %62, label %63, label %31
63: ; preds = %60, %36
%64 = phi double [ %39, %36 ], [ undef, %60 ]
br label %65
65: ; preds = %94, %63
%66 = phi i64 [ 0, %63 ], [ %95, %94 ]
%67 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %66
%68 = load double, double* %67
%69 = fcmp ogt double %68, 0.000000e+00
br i1 %69, label %70, label %74
70: ; preds = %89, %84, %79, %74, %65
%71 = phi i64 [ %66, %65 ], [ %75, %74 ], [ %80, %79 ], [ %85, %84 ], [ %90, %89 ]
%72 = trunc i64 %71 to i32
%73 = sitofp i32 %72 to double
br label %97
74: ; preds = %65
%75 = add nuw nsw i64 %66, 1
%76 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %75
%77 = load double, double* %76
%78 = fcmp ogt double %77, 0.000000e+00
br i1 %78, label %70, label %79
79: ; preds = %74
%80 = add nuw nsw i64 %66, 2
%81 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %80
%82 = load double, double* %81
%83 = fcmp ogt double %82, 0.000000e+00
br i1 %83, label %70, label %84
84: ; preds = %79
%85 = add nuw nsw i64 %66, 3
%86 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %85
%87 = load double, double* %86
%88 = fcmp ogt double %87, 0.000000e+00
br i1 %88, label %70, label %89
89: ; preds = %84
%90 = add nuw nsw i64 %66, 4
%91 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %90
%92 = load double, double* %91
%93 = fcmp ogt double %92, 0.000000e+00
br i1 %93, label %70, label %94
94: ; preds = %89
%95 = add nuw nsw i64 %66, 5
%96 = icmp eq i64 %95, 1000
br i1 %96, label %97, label %65
97: ; preds = %94, %70
%98 = phi double [ %73, %70 ], [ undef, %94 ]
%99 = fptosi double %98 to i32
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %100
%102 = load double, double* %101
%103 = fcmp ogt double %102, 0.000000e+00
br i1 %103, label %104, label %137
104: ; preds = %97, %130
%105 = phi double [ %126, %130 ], [ %64, %97 ]
%106 = phi double [ %125, %130 ], [ %98, %97 ]
%107 = fptosi double %105 to i32
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %108
%110 = load double, double* %109
%111 = fcmp olt double %110, 0.000000e+00
br i1 %111, label %112, label %137
112: ; preds = %104
%113 = fadd double %106, %105
%114 = fmul double %113, 5.000000e-01
%115 = fptosi double %114 to i32
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %116
%118 = load double, double* %117
%119 = fcmp ogt double %118, 0.000000e+00
br i1 %119, label %124, label %120
120: ; preds = %112
%121 = fcmp olt double %118, 0.000000e+00
br i1 %121, label %124, label %122
122: ; preds = %120
%123 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %114)
br label %124
124: ; preds = %120, %112, %122
%125 = phi double [ %106, %122 ], [ %114, %112 ], [ %106, %120 ]
%126 = phi double [ %105, %122 ], [ %105, %112 ], [ %114, %120 ]
%127 = fcmp oeq double %126, %125
%128 = fcmp oeq double %125, %114
%129 = select i1 %127, i1 %128, i1 false
br i1 %129, label %137, label %130
130: ; preds = %124
%131 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %126, double %125, double %114)
%132 = fptosi double %125 to i32
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds [1000 x double], [1000 x double]* %5, i64 0, i64 %133
%135 = load double, double* %134
%136 = fcmp ogt double %135, 0.000000e+00
br i1 %136, label %104, label %137
137: ; preds = %104, %130, %124, %97
ret i32 0
}