#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*/ exit(int);
double fabs(double);
int /*<<< orphan*/ printf(char *);
double stub1(double);
double stub2(double);
double stub3(double);
double zbrent(double (*func)(double), double x1, double x2, double xacc) {
  int iter;
  double a = x1, b = x2, c = x2, d, e, min1, min2;
  double fa = (*func)(a), fb = (*func)(b), fc, p, q, r, s, xacc1, xm;
  fc = fb;
  for (iter = 1; iter <= 20; iter++) {
    if ((fb > 0.0 && fc > 0.0) || (fb < 0.0 && fc < 0.0)) {
      c = a;
      fc = fa;
      e = d = b - a;
    }
    if (fabs(fc) < fabs(fb)) {
      a = b;
      b = c;
      c = a;
      fa = fb;
      fb = fc;
      fc = fa;
    }
    xacc1 = 2.0 * 3.0E-8 * fabs(b) + 0.5 * xacc;
    xm = 0.5 * (c - b);
    if (fabs(xm) <= xacc1 || fb == 0.0)
      return b;
    if (fabs(e) >= xacc1 && fabs(fa) > fabs(fb)) {
      s = fb / fa;
      if (a == c) {
        p = 2.0 * xm * s;
        q = 1.0 - s;
      } else {
        q = fa / fc;
        r = fb / fc;
        p = s * (2.0 * xm * q * (q - r) - (b - a) * (r - 1.0));
        q = (q - 1.0) * (r - 1.0) * (s - 1.0);
      }
      if (p > 0.0)
        q = -q;
      p = fabs(p);
      min1 = 3.0 * xm * q - fabs(xacc1 * q);
      min2 = fabs(e * q);
      if (2.0 * p < (min1 < min2 ? min1 : min2)) {
        e = d;
        d = p / q;
      } else {
        d = xm;
        e = d;
      }
    } else {
      d = xm;
      e = d;
    }
    a = b;
    fa = fb;
    if (fabs(d) > xacc1)
      b += d;
    else
      b += ((xm) < 0 ? -fabs(xacc1) : fabs(xacc1));
    fb = (*func)(b);
  }
  printf("\n\nError in function zbrent():");
  printf("\nToo many iterations!!!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<zbrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x30(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x38(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x14,-0x24(%rbp)
jg     16e8 <zbrent+0x5c8>
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11bb <zbrent+0x9b>
movsd  -0x78(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     11d7 <zbrent+0xb7>
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    11ff <zbrent+0xdf>
xorps  %xmm0,%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    11ff <zbrent+0xdf>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  %xmm0,-0x50(%rbp)
movsd  -0x78(%rbp),%xmm1
movaps 0xdf5(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movaps 0xde5(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1265 <zbrent+0x145>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
movaps 0xd8f(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xd93(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  0xd8e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x40(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
movsd  0xd64(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm1
ff
movaps 0xd39(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jae    12f5 <zbrent+0x1d5>
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1303 <zbrent+0x1e3>
jp     1303 <zbrent+0x1e3>
movsd  -0x38(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret
movsd  -0x50(%rbp),%xmm0
movaps 0xcf1(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jb     15f8 <zbrent+0x4d8>
movsd  -0x68(%rbp),%xmm0
movaps 0xcd3(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm1
movaps 0xcc3(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    15f8 <zbrent+0x4d8>
movsd  -0x70(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jne    13ad <zbrent+0x28d>
jp     13ad <zbrent+0x28d>
movsd  0xcad(%rip),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x80(%rbp)
movsd  0xc88(%rip),%xmm0
subsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
jmp    1497 <zbrent+0x377>
movsd  -0x68(%rbp),%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xc47(%rip),%xmm1
mulsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0x88(%rbp),%xmm1
ff
movsd  -0x88(%rbp),%xmm3
ff
subsd  -0x90(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm4
ff
movsd  0xc05(%rip),%xmm5
subsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xbc5(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x90(%rbp),%xmm1
ff
movsd  0xbb1(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x98(%rbp),%xmm1
ff
movsd  0xb99(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14d0 <zbrent+0x3b0>
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movaps 0xb24(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xb43(%rip),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x88(%rbp),%xmm1
ff
movaps 0xaec(%rip),%xmm3
pand   %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movaps 0xab0(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xac7(%rip),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1594 <zbrent+0x474>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    15a1 <zbrent+0x481>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    15dc <zbrent+0x4bc>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x80(%rbp),%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
jmp    15f3 <zbrent+0x4d3>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    160f <zbrent+0x4ef>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
movaps 0x9d1(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    1655 <zbrent+0x535>
movsd  -0x48(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    16ca <zbrent+0x5aa>
xorps  %xmm0,%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jbe    169d <zbrent+0x57d>
movsd  -0xa0(%rbp),%xmm0
ff
movaps 0x98b(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    16b8 <zbrent+0x598>
movsd  -0xa0(%rbp),%xmm0
ff
movaps 0x954(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x38(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x70(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118d <zbrent+0x6d>
lea    0x949(%rip),%rdi
call   1030 <printf@plt>
lea    0x95b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<zbrent>:
push   %rbp
push   %rbx
sub    $0x78,%rsp
movsd  %xmm2,(%rsp)
movapd %xmm1,0x10(%rsp)
mov    %rdi,%rbx
movaps %xmm0,0x40(%rsp)
call   *%rdi
movaps %xmm0,0x20(%rsp)
movapd 0x10(%rsp),%xmm0
call   *%rbx
movapd 0x20(%rsp),%xmm6
movapd 0x10(%rsp),%xmm13
movapd %xmm0,%xmm7
movsd  (%rsp),%xmm0
mulsd  0xe8a(%rip),%xmm0
movsd  %xmm0,(%rsp)
unpcklpd %xmm7,%xmm6
mov    $0x14,%ebp
xorpd  %xmm9,%xmm9
movapd 0xe9e(%rip),%xmm10
movapd 0xe95(%rip),%xmm11
movapd %xmm13,%xmm2
jmp    1215 <zbrent+0xe5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  %xmm7,0x8(%rsp)
movapd %xmm0,0x40(%rsp)
addsd  %xmm0,%xmm3
movapd %xmm3,0x10(%rsp)
movapd %xmm3,%xmm0
movapd %xmm6,0x60(%rsp)
call   *%rbx
movapd 0x10(%rsp),%xmm13
movaps 0x60(%rsp),%xmm12
movapd 0xe48(%rip),%xmm11
xorpd  %xmm9,%xmm9
movapd 0x50(%rsp),%xmm6
unpcklpd %xmm0,%xmm6
add    $0xffffffff,%ebp
movapd 0xe2d(%rip),%xmm10
movapd 0x20(%rsp),%xmm7
movsd  0x38(%rsp),%xmm2
je     148f <zbrent+0x35f>
movapd %xmm6,%xmm1
unpckhpd %xmm6,%xmm1
ucomisd %xmm9,%xmm1
movapd 0x40(%rsp),%xmm0
jbe    1231 <zbrent+0x101>
ucomisd %xmm9,%xmm7
ja     124a <zbrent+0x11a>
ucomisd %xmm1,%xmm9
jbe    147c <zbrent+0x34c>
ucomisd %xmm7,%xmm9
movsd  0x8(%rsp),%xmm8
jbe    1261 <zbrent+0x131>
movapd %xmm13,%xmm12
subsd  %xmm0,%xmm12
movapd %xmm12,%xmm8
movapd %xmm6,%xmm7
movapd %xmm0,%xmm2
movapd %xmm7,%xmm3
andpd  %xmm10,%xmm3
movapd %xmm1,%xmm4
andpd  %xmm10,%xmm4
ucomisd %xmm3,%xmm4
jbe    1290 <zbrent+0x160>
movapd %xmm1,%xmm6
unpcklpd %xmm7,%xmm6
movapd %xmm1,%xmm7
movapd %xmm13,%xmm14
jmp    129f <zbrent+0x16f>
nopl   0x0(%rax)
movapd %xmm2,%xmm14
movapd %xmm13,%xmm2
movapd %xmm0,%xmm13
movapd %xmm2,%xmm0
movapd %xmm2,%xmm1
andpd  %xmm10,%xmm1
mulsd  0xd54(%rip),%xmm1
addsd  (%rsp),%xmm1
movapd %xmm14,%xmm2
subsd  %xmm0,%xmm2
mulsd  0xd36(%rip),%xmm2
movapd %xmm2,%xmm3
andpd  %xmm10,%xmm3
ucomisd %xmm3,%xmm1
jae    1488 <zbrent+0x358>
movapd %xmm6,%xmm15
unpckhpd %xmm6,%xmm15
ucomisd %xmm9,%xmm15
jne    12f4 <zbrent+0x1c4>
jnp    1488 <zbrent+0x358>
movapd %xmm12,%xmm4
andpd  %xmm11,%xmm4
ucomisd %xmm1,%xmm4
movapd %xmm7,0x20(%rsp)
movsd  %xmm14,0x38(%rsp)
jb     1350 <zbrent+0x220>
movapd %xmm6,%xmm4
andpd  %xmm11,%xmm4
pshufd $0xee,%xmm4,%xmm5
ucomisd %xmm5,%xmm4
jbe    1350 <zbrent+0x220>
movapd %xmm15,%xmm4
divsd  %xmm6,%xmm4
ucomisd %xmm14,%xmm13
jne    135d <zbrent+0x22d>
jp     135d <zbrent+0x22d>
movapd %xmm2,%xmm5
addsd  %xmm2,%xmm5
movsd  0xcd1(%rip),%xmm6
subsd  %xmm4,%xmm6
jmp    13c0 <zbrent+0x290>
nopl   (%rax)
movapd %xmm2,%xmm6
movapd %xmm2,%xmm7
jmp    1446 <zbrent+0x316>
unpcklpd %xmm7,%xmm7
divpd  %xmm7,%xmm6
movapd %xmm2,%xmm7
addsd  %xmm2,%xmm7
mulsd  %xmm6,%xmm7
movapd %xmm6,%xmm14
unpckhpd %xmm6,%xmm14
movapd %xmm6,%xmm5
subsd  %xmm14,%xmm5
mulsd  %xmm7,%xmm5
movapd %xmm0,%xmm14
subsd  %xmm13,%xmm14
addpd  0xca6(%rip),%xmm6
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
mulsd  %xmm7,%xmm14
subsd  %xmm14,%xmm5
mulsd  %xmm6,%xmm7
movapd %xmm4,%xmm6
addsd  0xc54(%rip),%xmm6
mulsd  %xmm7,%xmm6
mulsd  %xmm5,%xmm4
movapd %xmm6,%xmm7
xorpd  0xc80(%rip),%xmm7
xorpd  %xmm5,%xmm5
cmpltsd %xmm4,%xmm5
andpd  %xmm5,%xmm7
andnpd %xmm6,%xmm5
orpd   %xmm7,%xmm5
andpd  %xmm10,%xmm4
movapd %xmm2,%xmm6
mulsd  0xc2a(%rip),%xmm6
movapd %xmm1,%xmm7
mulsd  %xmm5,%xmm7
andpd  %xmm10,%xmm7
mulsd  %xmm5,%xmm6
subsd  %xmm7,%xmm6
mulsd  %xmm5,%xmm12
andpd  %xmm10,%xmm12
movapd %xmm4,%xmm7
addsd  %xmm4,%xmm7
minsd  %xmm12,%xmm6
ucomisd %xmm7,%xmm6
movapd %xmm2,%xmm6
movapd %xmm2,%xmm7
jbe    1446 <zbrent+0x316>
divsd  %xmm5,%xmm4
movapd %xmm4,%xmm3
andpd  %xmm11,%xmm3
movapd %xmm8,%xmm6
movapd %xmm4,%xmm7
movapd %xmm15,0x50(%rsp)
ucomisd %xmm1,%xmm3
movapd %xmm7,%xmm3
ja     11b0 <zbrent+0x80>
ucomisd %xmm2,%xmm9
andpd  %xmm11,%xmm1
movapd %xmm1,%xmm3
jbe    11b0 <zbrent+0x80>
xorpd  0xbd9(%rip),%xmm3
jmp    11b0 <zbrent+0x80>
movsd  0x8(%rsp),%xmm8
jmp    1261 <zbrent+0x131>
add    $0x78,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xbca(%rip),%rdi
call   1040 <printf@plt>
lea    0xbdc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0A\0AError in function zbrent():\00"
@.str.1 = [25 x i8] c"\0AToo many iterations!!!\0A\00"
define double @zbrent(double (double)* %0, double %1, double %2, double %3) {
%5 = alloca double (double)*
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
store double (double)* %0, double (double)** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%26 = load double, double* %6
store double %26, double* %10
%27 = load double, double* %7
store double %27, double* %11
%28 = load double, double* %7
store double %28, double* %12
%29 = load double (double)*, double (double)** %5
%30 = load double, double* %10
%31 = call double %29(double %30)
store double %31, double* %17
%32 = load double (double)*, double (double)** %5
%33 = load double, double* %11
%34 = call double %32(double %33)
store double %34, double* %18
%35 = load double, double* %18
store double %35, double* %19
store i32 1, i32* %9
br label %36
36: ; preds = %221, %4
%37 = load i32, i32* %9
%38 = icmp sle i32 %37, 20
br i1 %38, label %39, label %224
39: ; preds = %36
%40 = load double, double* %18
%41 = fcmp ogt double %40, 0.000000e+00
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load double, double* %19
%44 = fcmp ogt double %43, 0.000000e+00
br i1 %44, label %51, label %45
45: ; preds = %42, %39
%46 = load double, double* %18
%47 = fcmp olt double %46, 0.000000e+00
br i1 %47, label %48, label %57
48: ; preds = %45
%49 = load double, double* %19
%50 = fcmp olt double %49, 0.000000e+00
br i1 %50, label %51, label %57
51: ; preds = %48, %42
%52 = load double, double* %10
store double %52, double* %12
%53 = load double, double* %17
store double %53, double* %19
%54 = load double, double* %11
%55 = load double, double* %10
%56 = fsub double %54, %55
store double %56, double* %13
store double %56, double* %14
br label %57
57: ; preds = %51, %48, %45
%58 = load double, double* %19
%59 = call double @llvm.fabs.f64(double %58)
%60 = load double, double* %18
%61 = call double @llvm.fabs.f64(double %60)
%62 = fcmp olt double %59, %61
br i1 %62, label %63, label %70
63: ; preds = %57
%64 = load double, double* %11
store double %64, double* %10
%65 = load double, double* %12
store double %65, double* %11
%66 = load double, double* %10
store double %66, double* %12
%67 = load double, double* %18
store double %67, double* %17
%68 = load double, double* %19
store double %68, double* %18
%69 = load double, double* %17
store double %69, double* %19
br label %70
70: ; preds = %63, %57
%71 = load double, double* %11
%72 = call double @llvm.fabs.f64(double %71)
%73 = load double, double* %8
%74 = fmul double 5.000000e-01, %73
%75 = call double @llvm.fmuladd.f64(double 6.000000e-08, double %72, double %74)
store double %75, double* %24
%76 = load double, double* %12
%77 = load double, double* %11
%78 = fsub double %76, %77
%79 = fmul double 5.000000e-01, %78
store double %79, double* %25
%80 = load double, double* %25
%81 = call double @llvm.fabs.f64(double %80)
%82 = load double, double* %24
%83 = fcmp ole double %81, %82
br i1 %83, label %87, label %84
84: ; preds = %70
%85 = load double, double* %18
%86 = fcmp oeq double %85, 0.000000e+00
br i1 %86, label %87, label %89
87: ; preds = %84, %70
%88 = load double, double* %11
ret double %88
89: ; preds = %84
%90 = load double, double* %14
%91 = call double @llvm.fabs.f64(double %90)
%92 = load double, double* %24
%93 = fcmp oge double %91, %92
br i1 %93, label %94, label %189
94: ; preds = %89
%95 = load double, double* %17
%96 = call double @llvm.fabs.f64(double %95)
%97 = load double, double* %18
%98 = call double @llvm.fabs.f64(double %97)
%99 = fcmp ogt double %96, %98
br i1 %99, label %100, label %189
100: ; preds = %94
%101 = load double, double* %18
%102 = load double, double* %17
%103 = fdiv double %101, %102
store double %103, double* %23
%104 = load double, double* %10
%105 = load double, double* %12
%106 = fcmp oeq double %104, %105
br i1 %106, label %107, label %114
107: ; preds = %100
%108 = load double, double* %25
%109 = fmul double 2.000000e+00, %108
%110 = load double, double* %23
%111 = fmul double %109, %110
store double %111, double* %20
%112 = load double, double* %23
%113 = fsub double 1.000000e+00, %112
store double %113, double* %21
br label %146
114: ; preds = %100
%115 = load double, double* %17
%116 = load double, double* %19
%117 = fdiv double %115, %116
store double %117, double* %21
%118 = load double, double* %18
%119 = load double, double* %19
%120 = fdiv double %118, %119
store double %120, double* %22
%121 = load double, double* %23
%122 = load double, double* %25
%123 = fmul double 2.000000e+00, %122
%124 = load double, double* %21
%125 = fmul double %123, %124
%126 = load double, double* %21
%127 = load double, double* %22
%128 = fsub double %126, %127
%129 = load double, double* %11
%130 = load double, double* %10
%131 = fsub double %129, %130
%132 = load double, double* %22
%133 = fsub double %132, 1.000000e+00
%134 = fmul double %131, %133
%135 = fneg double %134
%136 = call double @llvm.fmuladd.f64(double %125, double %128, double %135)
%137 = fmul double %121, %136
store double %137, double* %20
%138 = load double, double* %21
%139 = fsub double %138, 1.000000e+00
%140 = load double, double* %22
%141 = fsub double %140, 1.000000e+00
%142 = fmul double %139, %141
%143 = load double, double* %23
%144 = fsub double %143, 1.000000e+00
%145 = fmul double %142, %144
store double %145, double* %21
br label %146
146: ; preds = %114, %107
%147 = load double, double* %20
%148 = fcmp ogt double %147, 0.000000e+00
br i1 %148, label %149, label %152
149: ; preds = %146
%150 = load double, double* %21
%151 = fneg double %150
store double %151, double* %21
br label %152
152: ; preds = %149, %146
%153 = load double, double* %20
%154 = call double @llvm.fabs.f64(double %153)
store double %154, double* %20
%155 = load double, double* %25
%156 = fmul double 3.000000e+00, %155
%157 = load double, double* %21
%158 = load double, double* %24
%159 = load double, double* %21
%160 = fmul double %158, %159
%161 = call double @llvm.fabs.f64(double %160)
%162 = fneg double %161
%163 = call double @llvm.fmuladd.f64(double %156, double %157, double %162)
store double %163, double* %15
%164 = load double, double* %14
%165 = load double, double* %21
%166 = fmul double %164, %165
%167 = call double @llvm.fabs.f64(double %166)
store double %167, double* %16
%168 = load double, double* %20
%169 = fmul double 2.000000e+00, %168
%170 = load double, double* %15
%171 = load double, double* %16
%172 = fcmp olt double %170, %171
br i1 %172, label %173, label %175
173: ; preds = %152
%174 = load double, double* %15
br label %177
175: ; preds = %152
%176 = load double, double* %16
br label %177
177: ; preds = %175, %173
%178 = phi double [ %174, %173 ], [ %176, %175 ]
%179 = fcmp olt double %169, %178
br i1 %179, label %180, label %185
180: ; preds = %177
%181 = load double, double* %13
store double %181, double* %14
%182 = load double, double* %20
%183 = load double, double* %21
%184 = fdiv double %182, %183
store double %184, double* %13
br label %188
185: ; preds = %177
%186 = load double, double* %25
store double %186, double* %13
%187 = load double, double* %13
store double %187, double* %14
br label %188
188: ; preds = %185, %180
br label %192
189: ; preds = %94, %89
%190 = load double, double* %25
store double %190, double* %13
%191 = load double, double* %13
store double %191, double* %14
br label %192
192: ; preds = %189, %188
%193 = load double, double* %11
store double %193, double* %10
%194 = load double, double* %18
store double %194, double* %17
%195 = load double, double* %13
%196 = call double @llvm.fabs.f64(double %195)
%197 = load double, double* %24
%198 = fcmp ogt double %196, %197
br i1 %198, label %199, label %203
199: ; preds = %192
%200 = load double, double* %13
%201 = load double, double* %11
%202 = fadd double %201, %200
store double %202, double* %11
br label %217
203: ; preds = %192
%204 = load double, double* %25
%205 = fcmp olt double %204, 0.000000e+00
br i1 %205, label %206, label %210
206: ; preds = %203
%207 = load double, double* %24
%208 = call double @llvm.fabs.f64(double %207)
%209 = fneg double %208
br label %213
210: ; preds = %203
%211 = load double, double* %24
%212 = call double @llvm.fabs.f64(double %211)
br label %213
213: ; preds = %210, %206
%214 = phi double [ %209, %206 ], [ %212, %210 ]
%215 = load double, double* %11
%216 = fadd double %215, %214
store double %216, double* %11
br label %217
217: ; preds = %213, %199
%218 = load double (double)*, double (double)** %5
%219 = load double, double* %11
%220 = call double %218(double %219)
store double %220, double* %18
br label %221
221: ; preds = %217
%222 = load i32, i32* %9
%223 = add nsw i32 %222, 1
store i32 %223, i32* %9
br label %36
224: ; preds = %36
%225 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%226 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%227 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0A\0AError in function zbrent():\00"
@str = [24 x i8] c"\0AToo many iterations!!!\00"
define double @zbrent(double (double)* nocapture %0, double %1, double %2, double %3) {
%5 = tail call double %0(double %1)
%6 = tail call double %0(double %2)
%7 = fmul double %3, 5.000000e-01
%8 = insertelement <2 x double> poison, double %5, i64 0
%9 = insertelement <2 x double> %8, double %6, i64 1
br label %10
10: ; preds = %4, %124
%11 = phi i32 [ 1, %4 ], [ %128, %124 ]
%12 = phi double [ %1, %4 ], [ %44, %124 ]
%13 = phi double [ %2, %4 ], [ %126, %124 ]
%14 = phi double [ %2, %4 ], [ %43, %124 ]
%15 = phi double [ %6, %4 ], [ %42, %124 ]
%16 = phi double [ undef, %4 ], [ %117, %124 ]
%17 = phi double [ undef, %4 ], [ %116, %124 ]
%18 = phi <2 x double> [ %9, %4 ], [ %131, %124 ]
%19 = extractelement <2 x double> %18, i64 1
%20 = fcmp ogt double %19, 0.000000e+00
%21 = fcmp ogt double %15, 0.000000e+00
%22 = select i1 %20, i1 %21, i1 false
br i1 %22, label %27, label %23
23: ; preds = %10
%24 = fcmp olt double %19, 0.000000e+00
%25 = fcmp olt double %15, 0.000000e+00
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %27, label %30
27: ; preds = %23, %10
%28 = fsub double %13, %12
%29 = extractelement <2 x double> %18, i64 0
br label %30
30: ; preds = %27, %23
%31 = phi double [ %28, %27 ], [ %17, %23 ]
%32 = phi double [ %28, %27 ], [ %16, %23 ]
%33 = phi double [ %29, %27 ], [ %15, %23 ]
%34 = phi double [ %12, %27 ], [ %14, %23 ]
%35 = tail call double @llvm.fabs.f64(double %33)
%36 = tail call double @llvm.fabs.f64(double %19)
%37 = fcmp olt double %35, %36
br i1 %37, label %38, label %41
38: ; preds = %30
%39 = insertelement <2 x double> poison, double %19, i64 0
%40 = insertelement <2 x double> %39, double %33, i64 1
br label %41
41: ; preds = %38, %30
%42 = phi double [ %19, %38 ], [ %33, %30 ]
%43 = phi double [ %13, %38 ], [ %34, %30 ]
%44 = phi double [ %34, %38 ], [ %13, %30 ]
%45 = phi double [ %13, %38 ], [ %12, %30 ]
%46 = phi <2 x double> [ %40, %38 ], [ %18, %30 ]
%47 = tail call double @llvm.fabs.f64(double %44)
%48 = tail call double @llvm.fmuladd.f64(double %47, double 6.000000e-08, double %7)
%49 = fsub double %43, %44
%50 = fmul double %49, 5.000000e-01
%51 = tail call double @llvm.fabs.f64(double %50)
%52 = fcmp ole double %51, %48
%53 = extractelement <2 x double> %46, i64 1
%54 = fcmp oeq double %53, 0.000000e+00
%55 = select i1 %52, i1 true, i1 %54
br i1 %55, label %56, label %57
56: ; preds = %41
ret double %44
57: ; preds = %41
%58 = tail call double @llvm.fabs.f64(double %31)
%59 = fcmp oge double %58, %48
%60 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %46)
%61 = extractelement <2 x double> %60, i64 0
%62 = extractelement <2 x double> %60, i64 1
%63 = fcmp ogt double %61, %62
%64 = select i1 %59, i1 %63, i1 false
br i1 %64, label %65, label %114
65: ; preds = %57
%66 = extractelement <2 x double> %46, i64 0
%67 = fdiv double %53, %66
%68 = fcmp oeq double %45, %43
br i1 %68, label %69, label %72
69: ; preds = %65
%70 = fmul double %50, 2.000000e+00
%71 = fsub double 1.000000e+00, %67
br label %92
72: ; preds = %65
%73 = insertelement <2 x double> poison, double %42, i64 0
%74 = shufflevector <2 x double> %73, <2 x double> poison, <2 x i32> zeroinitializer
%75 = fdiv <2 x double> %46, %74
%76 = fmul double %50, 2.000000e+00
%77 = extractelement <2 x double> %75, i64 0
%78 = fmul double %77, %76
%79 = shufflevector <2 x double> %75, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%80 = fsub <2 x double> %75, %79
%81 = extractelement <2 x double> %80, i64 0
%82 = fsub double %44, %45
%83 = fneg double %82
%84 = fadd <2 x double> %75, <double -1.000000e+00, double -1.000000e+00>
%85 = extractelement <2 x double> %84, i64 1
%86 = fmul double %85, %83
%87 = tail call double @llvm.fmuladd.f64(double %78, double %81, double %86)
%88 = extractelement <2 x double> %84, i64 0
%89 = fmul double %88, %85
%90 = fadd double %67, -1.000000e+00
%91 = fmul double %90, %89
br label %92
92: ; preds = %72, %69
%93 = phi double [ %70, %69 ], [ %87, %72 ]
%94 = phi double [ %71, %69 ], [ %91, %72 ]
%95 = fmul double %67, %93
%96 = fcmp ogt double %95, 0.000000e+00
%97 = fneg double %94
%98 = select i1 %96, double %97, double %94
%99 = tail call double @llvm.fabs.f64(double %95)
%100 = fmul double %50, 3.000000e+00
%101 = fmul double %48, %98
%102 = tail call double @llvm.fabs.f64(double %101)
%103 = fneg double %102
%104 = tail call double @llvm.fmuladd.f64(double %100, double %98, double %103)
%105 = fmul double %31, %98
%106 = tail call double @llvm.fabs.f64(double %105)
%107 = fmul double %99, 2.000000e+00
%108 = fcmp olt double %104, %106
%109 = select i1 %108, double %104, double %106
%110 = fcmp olt double %107, %109
br i1 %110, label %111, label %114
111: ; preds = %92
%112 = fdiv double %99, %98
%113 = tail call double @llvm.fabs.f64(double %112)
br label %114
114: ; preds = %57, %92, %111
%115 = phi double [ %51, %57 ], [ %51, %92 ], [ %113, %111 ]
%116 = phi double [ %50, %57 ], [ %50, %92 ], [ %32, %111 ]
%117 = phi double [ %50, %57 ], [ %50, %92 ], [ %112, %111 ]
%118 = fcmp ogt double %115, %48
br i1 %118, label %124, label %119
119: ; preds = %114
%120 = fcmp olt double %50, 0.000000e+00
%121 = tail call double @llvm.fabs.f64(double %48)
br i1 %120, label %122, label %124
122: ; preds = %119
%123 = fneg double %121
br label %124
124: ; preds = %119, %122, %114
%125 = phi double [ %117, %114 ], [ %123, %122 ], [ %121, %119 ]
%126 = fadd double %44, %125
%127 = tail call double %0(double %126)
%128 = add nuw nsw i32 %11, 1
%129 = icmp eq i32 %128, 21
%130 = insertelement <2 x double> poison, double %53, i64 0
%131 = insertelement <2 x double> %130, double %127, i64 1
br i1 %129, label %132, label %10
132: ; preds = %124
%133 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%134 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%135 = tail call i32 @exit(i32 1)
unreachable
}