#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 */
scalar_t__ atoi(char *);
int /*<<< orphan*/ exit(int);
double f(char *, double);
int /*<<< orphan*/ printFunction(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (argc < 4) {
    printf("Usage: bisection <poly|sin|cos|xsin|imaginary> <left bound> <right "
           "bound>\n");
    exit(1);
  }
  char *func = argv[1];
  double a = (double)atoi(argv[2]);
  double b = (double)atoi(argv[3]);
  printFunction(func);
  if (b <= a) {
    printf("Boundary ( %f, %f), ( %f, %f) is invalid\n", a, f(func, a), b,
           f(func, b));
    exit(0);
  }
  if ((f(func, a) > 0.0 && f(func, b) > 0.0) ||
      (f(func, a) < 0.0 && f(func, b) < 0.0)) {
    printf("Boundary ( %f, %f), ( %f, %f) is invalid\n", a, f(func, a), b,
           f(func, b));
    exit(0);
  }
  if (f(func, a) == 0.0 || f(func, b) == 0.0) {
    printf("One of the boundary points ( %f, %f), ( %f, %f) is already a "
           "solution\n",
           a, f(func, a), b, f(func, b));
    exit(0);
  }
  double m;
  int i = 0;
  while ((b - a) > 0.01) {
    m = ((b - a) / 2) + a;
    printf("At iteration %d, the three points are ( %f, %f), ( %f, %f), ( %f, "
           "%f)\n",
           i, a, f(func, a), m, f(func, m), b, f(func, b));
    if ((f(func, a) > 0.0 && f(func, m) > 0.0) ||
        (f(func, a) < 0.0 && f(func, m) < 0.0)) {
      a = m;
    } else if (f(func, m) == 0.0) {
      break;
    } else {
      b = m;
    }
    i++;
  }
  if (f(func, m) == 0.0) {
    printf("( %f, %f) is an exact solution\n", m, f(func, m));
    exit(0);
  } else {
    printf("Solution is in the range ( %f, %f)\n", a, b);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    118b <main+0x3b>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <atoi@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <printFunction@plt>
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     123e <main+0xee>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1040 <f@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
lea    0xe2b(%rip),%rdi
mov    $0x4,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <f@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1274 <main+0x124>
mov    -0x18(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1040 <f@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     12b0 <main+0x160>
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <f@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    130c <main+0x1bc>
mov    -0x18(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1040 <f@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    130c <main+0x1bc>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1040 <f@plt>
movsd  -0x68(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x58(%rbp),%xmm0
lea    0xd5d(%rip),%rdi
mov    $0x4,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <f@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1332 <main+0x1e2>
jp     1332 <main+0x1e2>
jmp    1353 <main+0x203>
mov    -0x18(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1040 <f@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13af <main+0x25f>
jp     13af <main+0x25f>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1040 <f@plt>
movsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x70(%rbp),%xmm0
lea    0xce4(%rip),%rdi
mov    $0x4,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
movl   $0x0,-0x34(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xc38(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    155f <main+0x40f>
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xc24(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0xac(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x18(%rbp),%rdi
movsd  -0x30(%rbp),%xmm0
call   1040 <f@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1040 <f@plt>
mov    -0xac(%rbp),%esi
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm3
ff
movsd  -0x90(%rbp),%xmm4
ff
movaps %xmm0,%xmm5
movsd  -0x88(%rbp),%xmm0
ff
lea    0xc38(%rip),%rdi
mov    $0x6,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <f@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14d1 <main+0x381>
mov    -0x18(%rbp),%rdi
movsd  -0x30(%rbp),%xmm0
call   1040 <f@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     150d <main+0x3bd>
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   1040 <f@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    151c <main+0x3cc>
mov    -0x18(%rbp),%rdi
movsd  -0x30(%rbp),%xmm0
call   1040 <f@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    151c <main+0x3cc>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1551 <main+0x401>
mov    -0x18(%rbp),%rdi
movsd  -0x30(%rbp),%xmm0
call   1040 <f@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1542 <main+0x3f2>
jp     1542 <main+0x3f2>
jmp    155f <main+0x40f>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1551 <main+0x401>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13b6 <main+0x266>
mov    -0x18(%rbp),%rdi
movsd  -0x30(%rbp),%xmm0
call   1040 <f@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    15bb <main+0x46b>
jp     15bb <main+0x46b>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x18(%rbp),%rdi
movsd  -0x30(%rbp),%xmm0
call   1040 <f@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
lea    0xb66(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xb67(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
cmp    $0x3,%edi
jg     1183 <main+0x23>
lea    0xfa0(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    %rsi,%rbp
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%rdi
call   1070 <atoi@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0x18(%rbp),%rdi
call   1070 <atoi@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <printFunction@plt>
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
call   1050 <f@plt>
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movapd %xmm0,%xmm3
ucomisd %xmm2,%xmm1
jae    1260 <main+0x100>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jbe    1209 <main+0xa9>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <f@plt>
movsd  0x10(%rsp),%xmm1
ucomisd 0xe09(%rip),%xmm0
ja     1243 <main+0xe3>
mov    %rbx,%rdi
movapd %xmm1,%xmm0
call   1050 <f@plt>
movsd  0x10(%rsp),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jbe    127f <main+0x11f>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <f@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
movsd  0x10(%rsp),%xmm1
jbe    127f <main+0x11f>
mov    %rbx,%rdi
movapd %xmm1,%xmm0
call   1050 <f@plt>
movsd  %xmm0,0x18(%rsp)
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
jmp    126d <main+0x10d>
mov    %rbx,%rdi
movapd %xmm2,%xmm0
movsd  %xmm3,0x18(%rsp)
call   1050 <f@plt>
movapd %xmm0,%xmm3
lea    0xd9b(%rip),%rdi
jmp    12de <main+0x17e>
mov    %rbx,%rdi
movapd %xmm1,%xmm0
call   1050 <f@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1297 <main+0x137>
jnp    12b1 <main+0x151>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <f@plt>
ucomisd 0xd63(%rip),%xmm0
jne    12fe <main+0x19e>
jp     12fe <main+0x19e>
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
call   1050 <f@plt>
movsd  %xmm0,0x18(%rsp)
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <f@plt>
movapd %xmm0,%xmm3
lea    0xd64(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    $0x4,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm0,%xmm1
ucomisd 0xce6(%rip),%xmm1
jbe    1473 <main+0x313>
xor    %ebp,%ebp
lea    0xd60(%rip),%r14
jmp    137b <main+0x21b>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
movsd  0x18(%rsp),%xmm0
call   1050 <f@plt>
xorpd  %xmm1,%xmm1
movsd  0x18(%rsp),%xmm3
ucomisd %xmm1,%xmm0
movapd %xmm3,%xmm4
movsd  0x10(%rsp),%xmm0
jne    135e <main+0x1fe>
jnp    1479 <main+0x319>
add    $0x1,%ebp
movapd %xmm4,%xmm1
subsd  %xmm0,%xmm1
ucomisd 0xc8f(%rip),%xmm1
movapd %xmm4,%xmm2
jbe    147f <main+0x31f>
movsd  %xmm2,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mulsd  0xc79(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
mov    %rbx,%rdi
call   1050 <f@plt>
movsd  %xmm0,0x28(%rsp)
mov    %rbx,%rdi
movsd  0x18(%rsp),%xmm0
call   1050 <f@plt>
movsd  %xmm0,0x20(%rsp)
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <f@plt>
movaps %xmm0,%xmm5
mov    %r14,%rdi
mov    %ebp,%esi
movsd  0x10(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
mov    $0x6,%al
call   1060 <printf@plt>
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
call   1050 <f@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1426 <main+0x2c6>
mov    %rbx,%rdi
movsd  0x18(%rsp),%xmm0
call   1050 <f@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     145e <main+0x2fe>
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
call   1050 <f@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1330 <main+0x1d0>
mov    %rbx,%rdi
movsd  0x18(%rsp),%xmm0
call   1050 <f@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1330 <main+0x1d0>
movsd  0x18(%rsp),%xmm3
movapd %xmm3,%xmm0
movsd  0x8(%rsp),%xmm4
jmp    135e <main+0x1fe>
movapd %xmm2,%xmm4
jmp    147f <main+0x31f>
movsd  0x8(%rsp),%xmm4
movsd  %xmm3,0x18(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %rbx,%rdi
movapd %xmm3,%xmm0
call   1050 <f@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14c9 <main+0x369>
jp     14c9 <main+0x369>
mov    %rbx,%rdi
movsd  0x18(%rsp),%xmm0
call   1050 <f@plt>
movaps %xmm0,%xmm1
lea    0xc0f(%rip),%rdi
movsd  0x18(%rsp),%xmm0
jmp    14dc <main+0x37c>
lea    0xc20(%rip),%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [75 x i8] c"Usage: bisection <poly|sin|cos|xsin|imaginary> <left bound> <right bound>\0A\00"
@.str.1 = [42 x i8] c"Boundary ( %f, %f), ( %f, %f) is invalid\0A\00"
@.str.2 = [71 x i8] c"One of the boundary points ( %f, %f), ( %f, %f) is already a solution\0A\00"
@.str.3 = [71 x i8] c"At iteration %d, the three points are ( %f, %f), ( %f, %f), ( %f, %f)\0A\00"
@.str.4 = [32 x i8] c"( %f, %f) is an exact solution\0A\00"
@.str.5 = [36 x i8] c"Solution is in the range ( %f, %f)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
store i8* %19, i8** %6
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call i64 @atoi(i8* %22)
%24 = sitofp i64 %23 to double
store double %24, double* %7
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 3
%27 = load i8*, i8** %26
%28 = call i64 @atoi(i8* %27)
%29 = sitofp i64 %28 to double
store double %29, double* %8
%30 = load i8*, i8** %6
%31 = call i32 @printFunction(i8* %30)
%32 = load double, double* %8
%33 = load double, double* %7
%34 = fcmp ole double %32, %33
br i1 %34, label %35, label %46
35: ; preds = %16
%36 = load double, double* %7
%37 = load i8*, i8** %6
%38 = load double, double* %7
%39 = call double @f(i8* %37, double %38)
%40 = load double, double* %8
%41 = load i8*, i8** %6
%42 = load double, double* %8
%43 = call double @f(i8* %41, double %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), double %36, double %39, double %40, double %43)
%45 = call i32 @exit(i32 0)
unreachable
46: ; preds = %16
%47 = load i8*, i8** %6
%48 = load double, double* %7
%49 = call double @f(i8* %47, double %48)
%50 = fcmp ogt double %49, 0.000000e+00
br i1 %50, label %51, label %56
51: ; preds = %46
%52 = load i8*, i8** %6
%53 = load double, double* %8
%54 = call double @f(i8* %52, double %53)
%55 = fcmp ogt double %54, 0.000000e+00
br i1 %55, label %66, label %56
56: ; preds = %51, %46
%57 = load i8*, i8** %6
%58 = load double, double* %7
%59 = call double @f(i8* %57, double %58)
%60 = fcmp olt double %59, 0.000000e+00
br i1 %60, label %61, label %77
61: ; preds = %56
%62 = load i8*, i8** %6
%63 = load double, double* %8
%64 = call double @f(i8* %62, double %63)
%65 = fcmp olt double %64, 0.000000e+00
br i1 %65, label %66, label %77
66: ; preds = %61, %51
%67 = load double, double* %7
%68 = load i8*, i8** %6
%69 = load double, double* %7
%70 = call double @f(i8* %68, double %69)
%71 = load double, double* %8
%72 = load i8*, i8** %6
%73 = load double, double* %8
%74 = call double @f(i8* %72, double %73)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), double %67, double %70, double %71, double %74)
%76 = call i32 @exit(i32 0)
unreachable
77: ; preds = %61, %56
%78 = load i8*, i8** %6
%79 = load double, double* %7
%80 = call double @f(i8* %78, double %79)
%81 = fcmp oeq double %80, 0.000000e+00
br i1 %81, label %87, label %82
82: ; preds = %77
%83 = load i8*, i8** %6
%84 = load double, double* %8
%85 = call double @f(i8* %83, double %84)
%86 = fcmp oeq double %85, 0.000000e+00
br i1 %86, label %87, label %98
87: ; preds = %82, %77
%88 = load double, double* %7
%89 = load i8*, i8** %6
%90 = load double, double* %7
%91 = call double @f(i8* %89, double %90)
%92 = load double, double* %8
%93 = load i8*, i8** %6
%94 = load double, double* %8
%95 = call double @f(i8* %93, double %94)
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0), double %88, double %91, double %92, double %95)
%97 = call i32 @exit(i32 0)
unreachable
98: ; preds = %82
store i32 0, i32* %10
br label %99
99: ; preds = %155, %98
%100 = load double, double* %8
%101 = load double, double* %7
%102 = fsub double %100, %101
%103 = fcmp ogt double %102, 1.000000e-02
br i1 %103, label %104, label %158
104: ; preds = %99
%105 = load double, double* %8
%106 = load double, double* %7
%107 = fsub double %105, %106
%108 = fdiv double %107, 2.000000e+00
%109 = load double, double* %7
%110 = fadd double %108, %109
store double %110, double* %9
%111 = load i32, i32* %10
%112 = load double, double* %7
%113 = load i8*, i8** %6
%114 = load double, double* %7
%115 = call double @f(i8* %113, double %114)
%116 = load double, double* %9
%117 = load i8*, i8** %6
%118 = load double, double* %9
%119 = call double @f(i8* %117, double %118)
%120 = load double, double* %8
%121 = load i8*, i8** %6
%122 = load double, double* %8
%123 = call double @f(i8* %121, double %122)
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), i32 %111, double %112, double %115, double %116, double %119, double %120, double %123)
%125 = load i8*, i8** %6
%126 = load double, double* %7
%127 = call double @f(i8* %125, double %126)
%128 = fcmp ogt double %127, 0.000000e+00
br i1 %128, label %129, label %134
129: ; preds = %104
%130 = load i8*, i8** %6
%131 = load double, double* %9
%132 = call double @f(i8* %130, double %131)
%133 = fcmp ogt double %132, 0.000000e+00
br i1 %133, label %144, label %134
134: ; preds = %129, %104
%135 = load i8*, i8** %6
%136 = load double, double* %7
%137 = call double @f(i8* %135, double %136)
%138 = fcmp olt double %137, 0.000000e+00
br i1 %138, label %139, label %146
139: ; preds = %134
%140 = load i8*, i8** %6
%141 = load double, double* %9
%142 = call double @f(i8* %140, double %141)
%143 = fcmp olt double %142, 0.000000e+00
br i1 %143, label %144, label %146
144: ; preds = %139, %129
%145 = load double, double* %9
store double %145, double* %7
br label %155
146: ; preds = %139, %134
%147 = load i8*, i8** %6
%148 = load double, double* %9
%149 = call double @f(i8* %147, double %148)
%150 = fcmp oeq double %149, 0.000000e+00
br i1 %150, label %151, label %152
151: ; preds = %146
br label %158
152: ; preds = %146
%153 = load double, double* %9
store double %153, double* %8
br label %154
154: ; preds = %152
br label %155
155: ; preds = %154, %144
%156 = load i32, i32* %10
%157 = add nsw i32 %156, 1
store i32 %157, i32* %10
br label %99
158: ; preds = %151, %99
%159 = load i8*, i8** %6
%160 = load double, double* %9
%161 = call double @f(i8* %159, double %160)
%162 = fcmp oeq double %161, 0.000000e+00
br i1 %162, label %163, label %170
163: ; preds = %158
%164 = load double, double* %9
%165 = load i8*, i8** %6
%166 = load double, double* %9
%167 = call double @f(i8* %165, double %166)
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), double %164, double %167)
%169 = call i32 @exit(i32 0)
unreachable
170: ; preds = %158
%171 = load double, double* %7
%172 = load double, double* %8
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), double %171, double %172)
%174 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [42 x i8] c"Boundary ( %f, %f), ( %f, %f) is invalid\0A\00"
@.str.2 = [71 x i8] c"One of the boundary points ( %f, %f), ( %f, %f) is already a solution\0A\00"
@.str.3 = [71 x i8] c"At iteration %d, the three points are ( %f, %f), ( %f, %f), ( %f, %f)\0A\00"
@.str.4 = [32 x i8] c"( %f, %f) is an exact solution\0A\00"
@.str.5 = [36 x i8] c"Solution is in the range ( %f, %f)\0A\00"
@str = [74 x i8] c"Usage: bisection <poly|sin|cos|xsin|imaginary> <left bound> <right bound>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 4
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i64 @atoi(i8* %11)
%13 = sitofp i64 %12 to double
%14 = getelementptr inbounds i8*, i8** %1, i64 3
%15 = load i8*, i8** %14
%16 = tail call i64 @atoi(i8* %15)
%17 = sitofp i64 %16 to double
%18 = tail call i32 @printFunction(i8* %9)
%19 = fcmp ugt double %17, %13
%20 = tail call double @f(i8* %9, double %13)
br i1 %19, label %25, label %21
21: ; preds = %7
%22 = tail call double @f(i8* %9, double %17)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), double %13, double %20, double %17, double %22)
%24 = tail call i32 @exit(i32 0)
unreachable
25: ; preds = %7
%26 = fcmp ogt double %20, 0.000000e+00
br i1 %26, label %27, label %30
27: ; preds = %25
%28 = tail call double @f(i8* %9, double %17)
%29 = fcmp ogt double %28, 0.000000e+00
br i1 %29, label %36, label %30
30: ; preds = %27, %25
%31 = tail call double @f(i8* %9, double %13)
%32 = fcmp olt double %31, 0.000000e+00
br i1 %32, label %33, label %41
33: ; preds = %30
%34 = tail call double @f(i8* %9, double %17)
%35 = fcmp olt double %34, 0.000000e+00
br i1 %35, label %36, label %41
36: ; preds = %33, %27
%37 = tail call double @f(i8* %9, double %13)
%38 = tail call double @f(i8* %9, double %17)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), double %13, double %37, double %17, double %38)
%40 = tail call i32 @exit(i32 0)
unreachable
41: ; preds = %33, %30
%42 = tail call double @f(i8* %9, double %13)
%43 = fcmp oeq double %42, 0.000000e+00
br i1 %43, label %50, label %44
44: ; preds = %41
%45 = tail call double @f(i8* %9, double %17)
%46 = fcmp oeq double %45, 0.000000e+00
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = fsub double %17, %13
%49 = fcmp ogt double %48, 1.000000e-02
br i1 %49, label %55, label %86
50: ; preds = %44, %41
%51 = tail call double @f(i8* %9, double %13)
%52 = tail call double @f(i8* %9, double %17)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0), double %13, double %51, double %17, double %52)
%54 = tail call i32 @exit(i32 0)
unreachable
55: ; preds = %47, %80
%56 = phi double [ %84, %80 ], [ %48, %47 ]
%57 = phi i32 [ %83, %80 ], [ 0, %47 ]
%58 = phi double [ %82, %80 ], [ %17, %47 ]
%59 = phi double [ %81, %80 ], [ %13, %47 ]
%60 = fmul double %56, 5.000000e-01
%61 = fadd double %59, %60
%62 = tail call double @f(i8* %9, double %59)
%63 = tail call double @f(i8* %9, double %61)
%64 = tail call double @f(i8* %9, double %58)
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), i32 %57, double %59, double %62, double %61, double %63, double %58, double %64)
%66 = tail call double @f(i8* %9, double %59)
%67 = fcmp ogt double %66, 0.000000e+00
br i1 %67, label %68, label %71
68: ; preds = %55
%69 = tail call double @f(i8* %9, double %61)
%70 = fcmp ogt double %69, 0.000000e+00
br i1 %70, label %80, label %71
71: ; preds = %68, %55
%72 = tail call double @f(i8* %9, double %59)
%73 = fcmp olt double %72, 0.000000e+00
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = tail call double @f(i8* %9, double %61)
%76 = fcmp olt double %75, 0.000000e+00
br i1 %76, label %80, label %77
77: ; preds = %74, %71
%78 = tail call double @f(i8* %9, double %61)
%79 = fcmp oeq double %78, 0.000000e+00
br i1 %79, label %86, label %80
80: ; preds = %77, %68, %74
%81 = phi double [ %61, %74 ], [ %61, %68 ], [ %59, %77 ]
%82 = phi double [ %58, %74 ], [ %58, %68 ], [ %61, %77 ]
%83 = add nuw nsw i32 %57, 1
%84 = fsub double %82, %81
%85 = fcmp ogt double %84, 1.000000e-02
br i1 %85, label %55, label %86
86: ; preds = %80, %77, %47
%87 = phi double [ %13, %47 ], [ %59, %77 ], [ %81, %80 ]
%88 = phi double [ %17, %47 ], [ %58, %77 ], [ %82, %80 ]
%89 = phi double [ undef, %47 ], [ %61, %77 ], [ %61, %80 ]
%90 = tail call double @f(i8* %9, double %89)
%91 = fcmp oeq double %90, 0.000000e+00
br i1 %91, label %92, label %96
92: ; preds = %86
%93 = tail call double @f(i8* %9, double %89)
%94 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), double %89, double %93)
%95 = tail call i32 @exit(i32 0)
unreachable
96: ; preds = %86
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), double %87, double %88)
%98 = tail call i32 @exit(i32 0)
unreachable
}