#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 main() {
  double lo = 1.5, hi = 2.4;
  int i;
  double x, result;
  for (i = 0; i < 233333; ++i) {
    x = (lo + hi) * 0.5;
    result = (((((x - 15) * x + 85) * x - 225) * x + 274) * x - 121);
    if (result > 0)
      lo = x;
    else
      hi = x;
  }
  printf("%.6lf\n", (lo + hi) * 0.5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x38f75,-0x1c(%rbp)
jge    1210 <main+0x100>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xec3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe89(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe4f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11f3 <main+0xe3>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11fd <main+0xed>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1202 <main+0xf2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1140 <main+0x30>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xdee(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
mov    $0x38f75,%eax
movsd  0xee1(%rip),%xmm8
movsd  0xee0(%rip),%xmm9
movsd  0xedf(%rip),%xmm10
movsd  0xede(%rip),%xmm11
movsd  0xede(%rip),%xmm5
movsd  0xede(%rip),%xmm6
xorpd  %xmm7,%xmm7
jmp    117e <main+0x6e>
xorpd  %xmm1,%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm3,%xmm1
orpd   %xmm1,%xmm0
movapd %xmm4,%xmm1
add    $0xffffffff,%eax
je     11c6 <main+0xb6>
movapd %xmm0,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm8,%xmm3
movapd %xmm3,%xmm2
addsd  %xmm9,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm10,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm11,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm5,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm6,%xmm2
ucomisd %xmm7,%xmm2
movapd %xmm3,%xmm4
ja     1160 <main+0x50>
movapd %xmm1,%xmm4
jmp    1160 <main+0x50>
addsd  %xmm4,%xmm0
mulsd  0xe3e(%rip),%xmm0
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%.6lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double 1.500000e+00, double* %2
store double 2.400000e+00, double* %3
store i32 0, i32* %4
br label %7
7: ; preds = %32, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 233333
br i1 %9, label %10, label %35
10: ; preds = %7
%11 = load double, double* %2
%12 = load double, double* %3
%13 = fadd double %11, %12
%14 = fmul double %13, 5.000000e-01
store double %14, double* %5
%15 = load double, double* %5
%16 = fsub double %15, 1.500000e+01
%17 = load double, double* %5
%18 = call double @llvm.fmuladd.f64(double %16, double %17, double 8.500000e+01)
%19 = load double, double* %5
%20 = call double @llvm.fmuladd.f64(double %18, double %19, double -2.250000e+02)
%21 = load double, double* %5
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double 2.740000e+02)
%23 = load double, double* %5
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double -1.210000e+02)
store double %24, double* %6
%25 = load double, double* %6
%26 = fcmp ogt double %25, 0.000000e+00
br i1 %26, label %27, label %29
27: ; preds = %10
%28 = load double, double* %5
store double %28, double* %2
br label %31
29: ; preds = %10
%30 = load double, double* %5
store double %30, double* %3
br label %31
31: ; preds = %29, %27
br label %32
32: ; preds = %31
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %7
35: ; preds = %7
%36 = load double, double* %2
%37 = load double, double* %3
%38 = fadd double %36, %37
%39 = fmul double %38, 5.000000e-01
%40 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.6lf\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi double [ 1.500000e+00, %0 ], [ %14, %1 ]
%3 = phi double [ 2.400000e+00, %0 ], [ %13, %1 ]
%4 = phi i32 [ 0, %0 ], [ %15, %1 ]
%5 = fadd double %3, %2
%6 = fmul double %5, 5.000000e-01
%7 = fadd double %6, -1.500000e+01
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double 8.500000e+01)
%9 = tail call double @llvm.fmuladd.f64(double %8, double %6, double -2.250000e+02)
%10 = tail call double @llvm.fmuladd.f64(double %9, double %6, double 2.740000e+02)
%11 = tail call double @llvm.fmuladd.f64(double %10, double %6, double -1.210000e+02)
%12 = fcmp ogt double %11, 0.000000e+00
%13 = select i1 %12, double %3, double %6
%14 = select i1 %12, double %6, double %2
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i32 %15, 233333
br i1 %16, label %17, label %1
17: ; preds = %1
%18 = fadd double %13, %14
%19 = fmul double %18, 5.000000e-01
%20 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %19)
ret i32 0
}