#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 */
double fabs(double);
double stub1(void *, double);
double stub2(void *, double);
double stub3(void *, double);
int zbrent(double *rv, double ax, double bx, double tol,
           double (*func)(void *fdata, double tp), void *fdata) {
  int i;
  double cx;
  double af, bf, cf;
  af = (*func)(fdata, ax);
  bf = (*func)(fdata, bx);
  if (af * bf > 0.0)
    return -1;
  cx = bx;
  cf = bf;
  for (i = 0; i < 100; i++) {
    double xdel;
    double del = 1e80;
    double pdel = 1e80;
    double tol1;
    if (bf * cf > 0.0) {
      cx = ax;
      cf = af;
      pdel = del = bx - ax;
    }
    if (fabs(cf) < fabs(bf)) {
      ax = bx;
      af = bf;
      bx = cx;
      bf = cf;
      cx = ax;
      cf = af;
    }
    tol1 = (0.5 * tol) + (2.0 * 2.2204460492503131e-016 * fabs(bx));
    xdel = 0.5 * (cx - bx);
    if (bf == 0.0 || fabs(xdel) <= tol1) {
      *rv = bx;
      return 0;
    }
    if (fabs(pdel) >= tol1 && fabs(af) > fabs(bf)) {
      double P, Q;
      if (ax == cx) {
        double R;
        R = bf / cf;
        P = (cx - bx) * R;
        Q = R - 1.0;
      } else {
        double R, S, T;
        R = bf / cf;
        S = bf / af;
        T = af / cf;
        P = S * ((T * (R - T) * (cx - bx)) - ((1.0 - R) * (bx - ax)));
        Q = (T - 1.0) * (R - 1.0) * (S - 1.0);
      }
      if (P < 0.0)
        Q = -Q;
      P = fabs(P);
      {
        double min1, min2;
        min1 = (3.0 * xdel * Q) - (tol1 * fabs(Q));
        min2 = fabs(pdel * Q);
        if (min2 < min1)
          min1 = min2;
        if ((2.0 * P) < min1) {
          pdel = del;
          del = P / Q;
        } else {
          pdel = del = xdel;
        }
      }
    } else {
      pdel = del = xdel;
    }
    ax = bx;
    af = bf;
    if (fabs(del) > tol1)
      bx += del;
    else
      bx += (xdel > 0.0 ? tol1 : -tol1);
    bf = (*func)(fdata, bx);
  }
  return -2;
}


x86 assembly (clang, -O0):
<zbrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1171 <zbrent+0x71>
movl   $0xffffffff,-0x4(%rbp)
jmp    16c0 <zbrent+0x5c0>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x64,-0x3c(%rbp)
jge    16b9 <zbrent+0x5b9>
movsd  0xe62(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe55(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11ef <zbrent+0xef>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm1
movaps 0xe35(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
movaps 0xe25(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1255 <zbrent+0x155>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movaps 0xdca(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xd9e(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xd8a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x48(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  0xd6b(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12c3 <zbrent+0x1c3>
jp     12c3 <zbrent+0x1c3>
jmp    12e2 <zbrent+0x1e2>
movsd  -0x68(%rbp),%xmm1
movaps 0xd61(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     12fb <zbrent+0x1fb>
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    16c0 <zbrent+0x5c0>
movsd  -0x78(%rbp),%xmm0
movaps 0xd29(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x80(%rbp),%xmm0
jb     15eb <zbrent+0x4eb>
movsd  -0x50(%rbp),%xmm0
movaps 0xd0e(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
movaps 0xcfe(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    15eb <zbrent+0x4eb>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jne    13a3 <zbrent+0x2a3>
jp     13a3 <zbrent+0x2a3>
movsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xc86(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    149c <zbrent+0x39c>
movsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
subsd  -0xb0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
movsd  -0x48(%rbp),%xmm3
subsd  -0x20(%rbp),%xmm3
movsd  0xc09(%rip),%xmm2
subsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x20(%rbp),%xmm4
subsd  -0x18(%rbp),%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,-0x88(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  0xbb8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0xba4(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
movsd  0xb8c(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    14d4 <zbrent+0x3d4>
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movaps 0xb4d(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xb29(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x80(%rbp),%xmm1
movsd  -0x90(%rbp),%xmm3
ff
movaps 0xb18(%rip),%xmm4
pand   %xmm4,%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movaps 0xad5(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1591 <zbrent+0x491>
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xa8f(%rip),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    15d7 <zbrent+0x4d7>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
divsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
jmp    15e6 <zbrent+0x4e6>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  %xmm0,-0x78(%rbp)
jmp    15fa <zbrent+0x4fa>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  %xmm0,-0x78(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x70(%rbp),%xmm0
movaps 0xa16(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    163d <zbrent+0x53d>
movsd  -0x70(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1697 <zbrent+0x597>
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1661 <zbrent+0x561>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
jmp    1685 <zbrent+0x585>
movsd  -0x80(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x58(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    118c <zbrent+0x8c>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zbrent>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
mov    %rdi,%r15
mov    %rdx,%rdi
movaps %xmm0,0x30(%rsp)
call   *%rsi
movaps %xmm0,0x20(%rsp)
mov    %r14,%rdi
movsd  0x10(%rsp),%xmm0
call   *%rbx
movapd 0x20(%rsp),%xmm2
movapd %xmm0,%xmm7
movapd %xmm2,%xmm0
mulsd  %xmm7,%xmm0
mov    $0xffffffff,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     14bf <zbrent+0x3bf>
movapd %xmm7,%xmm11
unpcklpd %xmm2,%xmm11
mov    $0x64,%ebp
movapd 0xecb(%rip),%xmm5
movsd  0x8(%rsp),%xmm8
mulsd  0xe8b(%rip),%xmm8
movapd 0xeb2(%rip),%xmm10
movsd  0x10(%rsp),%xmm14
movapd %xmm14,%xmm1
movsd  %xmm8,0x8(%rsp)
jmp    125c <zbrent+0x15c>
cs nopw 0x0(%rax,%rax,1)
movapd %xmm5,%xmm3
andpd  %xmm10,%xmm3
movapd %xmm0,%xmm4
xorpd  0xe9b(%rip),%xmm4
xorpd  %xmm2,%xmm2
cmpltsd %xmm1,%xmm2
movapd %xmm2,%xmm1
andpd  %xmm0,%xmm1
andnpd %xmm4,%xmm2
orpd   %xmm1,%xmm2
cmpltsd %xmm3,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
andpd  %xmm5,%xmm0
orpd   %xmm1,%xmm0
movapd %xmm7,0x30(%rsp)
addsd  %xmm7,%xmm0
movapd %xmm0,0x50(%rsp)
mov    %r14,%rdi
movapd %xmm9,0x10(%rsp)
movapd %xmm11,0x40(%rsp)
movsd  %xmm12,0x20(%rsp)
call   *%rbx
movsd  0x20(%rsp),%xmm1
movapd 0xe14(%rip),%xmm10
movapd 0x10(%rsp),%xmm7
unpcklpd 0x40(%rsp),%xmm0
movapd 0x50(%rsp),%xmm14
movapd %xmm0,%xmm11
add    $0xffffffff,%ebp
movsd  0x8(%rsp),%xmm8
movapd 0xdea(%rip),%xmm5
je     14b1 <zbrent+0x3b1>
movapd %xmm7,%xmm2
mulsd  %xmm11,%xmm2
ucomisd 0xdc3(%rip),%xmm2
ja     1280 <zbrent+0x180>
movsd  0xd88(%rip),%xmm13
movapd 0x30(%rsp),%xmm6
jmp    1294 <zbrent+0x194>
movapd %xmm14,%xmm13
movapd 0x30(%rsp),%xmm6
subsd  %xmm6,%xmm13
movapd %xmm6,%xmm1
movapd %xmm11,%xmm3
unpckhpd %xmm11,%xmm3
xorpd  %xmm4,%xmm4
cmpltsd %xmm2,%xmm4
andpd  %xmm4,%xmm3
andnpd %xmm7,%xmm4
orpd   %xmm3,%xmm4
movapd %xmm4,%xmm9
andpd  %xmm5,%xmm4
movapd %xmm11,%xmm2
andpd  %xmm5,%xmm2
ucomisd %xmm4,%xmm2
jbe    12f0 <zbrent+0x1f0>
movapd %xmm9,%xmm2
unpcklpd %xmm11,%xmm2
movapd %xmm11,%xmm9
movapd %xmm14,%xmm12
movapd %xmm2,%xmm11
jmp    12ff <zbrent+0x1ff>
cs nopw 0x0(%rax,%rax,1)
movapd %xmm1,%xmm12
movapd %xmm14,%xmm1
movapd %xmm6,%xmm14
movapd %xmm1,%xmm7
movapd %xmm1,%xmm0
andpd  %xmm5,%xmm0
mulsd  0xcf5(%rip),%xmm0
ucomisd 0xd14(%rip),%xmm11
jne    1324 <zbrent+0x224>
jnp    14b8 <zbrent+0x3b8>
addsd  %xmm8,%xmm0
movapd %xmm12,%xmm2
subsd  %xmm7,%xmm2
movapd %xmm2,%xmm1
mulsd  0xcd2(%rip),%xmm1
movapd %xmm1,%xmm3
andpd  %xmm5,%xmm3
ucomisd %xmm3,%xmm0
jae    14b8 <zbrent+0x3b8>
movapd %xmm13,%xmm4
andpd  %xmm10,%xmm4
ucomisd %xmm0,%xmm4
jb     13b0 <zbrent+0x2b0>
movapd %xmm11,%xmm4
andpd  %xmm10,%xmm4
pshufd $0xee,%xmm4,%xmm5
ucomisd %xmm4,%xmm5
movapd %xmm1,%xmm5
jbe    11b9 <zbrent+0xb9>
ucomisd %xmm12,%xmm14
movapd %xmm11,%xmm3
divsd  %xmm9,%xmm3
jne    13b9 <zbrent+0x2b9>
jp     13b9 <zbrent+0x2b9>
mulsd  %xmm3,%xmm2
addsd  0xc84(%rip),%xmm3
jmp    1431 <zbrent+0x331>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movapd %xmm1,%xmm5
jmp    11b9 <zbrent+0xb9>
movapd %xmm11,%xmm4
shufpd $0x1,%xmm9,%xmm4
movapd %xmm11,%xmm5
divpd  %xmm4,%xmm5
movapd %xmm5,%xmm4
unpckhpd %xmm5,%xmm4
movapd %xmm3,%xmm6
subsd  %xmm4,%xmm6
mulsd  %xmm4,%xmm6
movsd  0xc2e(%rip),%xmm8
subsd  %xmm3,%xmm8
movapd %xmm7,%xmm4
subsd  %xmm14,%xmm4
mulsd  %xmm8,%xmm4
mulsd  %xmm2,%xmm6
subsd  %xmm4,%xmm6
mulsd  %xmm5,%xmm6
addsd  0xc0f(%rip),%xmm3
addpd  0xc37(%rip),%xmm5
movapd %xmm5,%xmm4
unpckhpd %xmm5,%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm5,%xmm4
movapd %xmm6,%xmm2
movapd %xmm4,%xmm3
movapd 0xc07(%rip),%xmm6
movapd %xmm3,%xmm5
xorpd  0xc1b(%rip),%xmm5
movapd %xmm2,%xmm4
cmpltsd 0xbde(%rip),%xmm4
andpd  %xmm4,%xmm5
andnpd %xmm3,%xmm4
orpd   %xmm5,%xmm4
andpd  %xmm6,%xmm2
movapd %xmm1,%xmm5
mulsd  0xbba(%rip),%xmm5
andpd  %xmm6,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm4,%xmm5
subsd  %xmm3,%xmm5
mulsd  %xmm4,%xmm13
andpd  %xmm6,%xmm13
minsd  %xmm5,%xmm13
movapd %xmm2,%xmm3
addsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm13
movapd %xmm1,%xmm5
jbe    11b0 <zbrent+0xb0>
divsd  %xmm4,%xmm2
movapd %xmm2,%xmm5
jmp    11b0 <zbrent+0xb0>
mov    $0xfffffffe,%eax
jmp    14bf <zbrent+0x3bf>
movsd  %xmm7,(%r15)
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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