#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 fabs(double);
double brent_zero(double (*funcpt)(double), double ai, double bi, double tol,
                  double eps) {
  double bz;
  double a, b, c, d, e, fa, fb, fc;
  double m, s, etol, fd, p, q, r;
  int iter;
  fd = eps;
  a = ai;
  b = bi;
  c = a;
  fa = funcpt(a);
  fb = funcpt(b);
  fc = fa;
  e = b - a;
  d = e;
  if (fabs(fc) < fabs(fb)) {
    a = b;
    b = c;
    c = a;
    fa = fb;
    fb = fc;
    fc = fa;
  }
  etol = 2 * fd * fabs(b) + tol;
  m = 0.5 * (c - b);
  bz = b;
  iter = 0;
  while (fabs(m) >= etol && fb != 0.0) {
    iter++;
    if (fabs(e) < etol || fabs(fa) <= fabs(fb)) {
      e = m;
      d = e;
    } else {
      s = fb / fa;
      if (a == c) {
        p = 2.0 * m * s;
        q = 1.0 - s;
      } else {
        q = fa / fc;
        r = fb / fc;
        p = s * (2 * m * q * (q - r) - (b - a) * (r - 1.0));
        q = (q - 1.0) * (r - 1.0) * (s - 1.0);
      }
      if (p > 0.0) {
        q = -q;
      } else {
        p = -p;
      }
      s = e;
      e = d;
      if (2.0 * p < 3.0 * m * q - fabs(etol * q) && p < fabs(0.5 * s * q)) {
        d = p / q;
      } else {
        e = m;
        d = e;
      }
    }
    a = b;
    fa = fb;
    if (fabs(d) > etol) {
      b += d;
    } else if (0.0 < m) {
      b += etol;
    } else {
      b -= etol;
    }
    fb = funcpt(b);
    bz = b;
    if ((0.0 < fb && 0.0 < fc) || (fb <= 0.0 && fc <= 0.0)) {
      c = a;
      fc = fa;
      e = b - a;
      d = e;
    }
    if (fabs(fc) < fabs(fb)) {
      a = b;
      b = c;
      c = a;
      fa = fb;
      fb = fc;
      fc = fa;
    }
    etol = 2 * fd * fabs(b) + tol;
    m = 0.5 * (c - b);
  }
  return bz;
}


x86 assembly (clang, -O0):
<brent_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x38(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x40(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x70(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0xb0(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0xb0(%rbp),%eax
cmp    %ecx,%eax
jge    1207 <brent_zero+0xf7>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xdf9(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  -0xb8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x48(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
movsd  0xda4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0xac(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
xor    %eax,%eax
ucomisd -0x88(%rbp),%xmm0
ff
mov    %al,-0xb9(%rbp)
jb     12b7 <brent_zero+0x1a7>
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0xb9(%rbp)
mov    -0xb9(%rbp),%al
test   $0x1,%al
jne    12ca <brent_zero+0x1ba>
jmp    17d7 <brent_zero+0x6c7>
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
ja     1323 <brent_zero+0x213>
movsd  -0x60(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0xc0(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0xc0(%rbp),%eax
cmp    %ecx,%eax
jg     133c <brent_zero+0x22c>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    15ff <brent_zero+0x4ef>
movsd  -0x68(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jne    1395 <brent_zero+0x285>
jp     1395 <brent_zero+0x285>
movsd  0xc9f(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xc8d(%rip),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    1479 <brent_zero+0x369>
movsd  -0x60(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  0xc42(%rip),%xmm1
mulsd  -0x78(%rbp),%xmm1
mulsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm3
ff
subsd  -0xa8(%rbp),%xmm3
ff
movsd  -0x40(%rbp),%xmm2
subsd  -0x38(%rbp),%xmm2
movsd  -0xa8(%rbp),%xmm4
ff
movsd  0xc13(%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,-0x98(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0xbd0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
movsd  0xbbc(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  0xba7(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14ba <brent_zero+0x3aa>
movsd  -0xa0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    14e1 <brent_zero+0x3d1>
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xb0b(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0xb03(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
call   1030 <fabs@plt>
movsd  -0xd8(%rbp),%xmm0
ff
movsd  -0xd0(%rbp),%xmm3
ff
movsd  -0xc8(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    15e6 <brent_zero+0x4d6>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0xa5c(%rip),%xmm0
mulsd  -0x80(%rbp),%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
call   1030 <fabs@plt>
movsd  -0xe0(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm0
ucomisd %xmm1,%xmm0
jbe    15e6 <brent_zero+0x4d6>
movsd  -0x98(%rbp),%xmm0
ff
divsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
jmp    15fa <brent_zero+0x4ea>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    15ff <brent_zero+0x4ef>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    1643 <brent_zero+0x533>
movsd  -0x50(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1687 <brent_zero+0x577>
movsd  -0x78(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    166c <brent_zero+0x55c>
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1682 <brent_zero+0x572>
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1687 <brent_zero+0x577>
mov    -0x8(%rbp),%rax
movsd  -0x40(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    16c5 <brent_zero+0x5b5>
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     16e1 <brent_zero+0x5d1>
xorps  %xmm0,%xmm0
ucomisd -0x68(%rbp),%xmm0
jb     170e <brent_zero+0x5fe>
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
jb     170e <brent_zero+0x5fe>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x70(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,-0xe4(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0xe4(%rbp),%eax
cmp    %ecx,%eax
jge    1774 <brent_zero+0x664>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0x88c(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  -0xf0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x48(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
movsd  0x837(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1279 <brent_zero+0x169>
movsd  -0x30(%rbp),%xmm0
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brent_zero>:
push   %rbp
push   %rbx
sub    $0x88,%rsp
movsd  %xmm3,0x70(%rsp)
movsd  %xmm2,0x80(%rsp)
movsd  %xmm1,0x10(%rsp)
mov    %rdi,%rbx
movsd  %xmm0,0x28(%rsp)
call   *%rdi
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   *%rbx
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebp
movsd  0x30(%rsp),%xmm0
call   1030 <fabs@plt>
cmp    %eax,%ebp
jge    1183 <brent_zero+0x73>
movsd  0x28(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x10(%rsp),%xmm1
jmp    11a7 <brent_zero+0x97>
movsd  0x10(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x30(%rsp)
movsd  0x28(%rsp),%xmm1
movsd  %xmm1,0x60(%rsp)
movsd  0x70(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x70(%rsp)
movsd  %xmm0,0x18(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x70(%rsp),%xmm0
addsd  0x80(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x60(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
mulsd  0xe08(%rip),%xmm0
movsd  %xmm0,0x38(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd 0x8(%rsp),%xmm0
jb     1609 <brent_zero+0x4f9>
xorpd  %xmm1,%xmm1
movsd  0x20(%rsp),%xmm2
ucomisd %xmm1,%xmm2
jne    122c <brent_zero+0x11c>
jnp    1609 <brent_zero+0x4f9>
movsd  0x10(%rsp),%xmm0
subsd  0x28(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  %xmm1,0x40(%rsp)
movapd %xmm0,%xmm3
movsd  0x60(%rsp),%xmm1
movsd  %xmm1,0x48(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
movsd  0x38(%rsp),%xmm1
movapd %xmm1,%xmm0
ja     1440 <brent_zero+0x330>
movsd  0x40(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ebp
movsd  0x20(%rsp),%xmm0
call   1030 <fabs@plt>
movsd  0x38(%rsp),%xmm1
movapd %xmm1,%xmm0
cmp    %eax,%ebp
jle    1440 <brent_zero+0x330>
movsd  0x20(%rsp),%xmm2
movapd %xmm2,%xmm0
movsd  0x40(%rsp),%xmm5
divsd  %xmm5,%xmm0
movsd  0x60(%rsp),%xmm4
ucomisd 0x48(%rsp),%xmm4
jne    12fe <brent_zero+0x1ee>
jp     12fe <brent_zero+0x1ee>
movsd  0x38(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xd18(%rip),%xmm2
subsd  %xmm0,%xmm2
jmp    1358 <brent_zero+0x248>
movsd  0x30(%rsp),%xmm1
divsd  %xmm1,%xmm5
divsd  %xmm1,%xmm2
movsd  0x38(%rsp),%xmm3
addsd  %xmm3,%xmm3
mulsd  %xmm5,%xmm3
movapd %xmm5,%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm1
movsd  0x18(%rsp),%xmm3
subsd  %xmm4,%xmm3
movsd  0xcd0(%rip),%xmm4
addsd  %xmm4,%xmm2
mulsd  %xmm2,%xmm3
subsd  %xmm3,%xmm1
addsd  %xmm4,%xmm5
mulsd  %xmm2,%xmm5
movapd %xmm0,%xmm2
addsd  %xmm4,%xmm2
mulsd  %xmm5,%xmm2
mulsd  %xmm1,%xmm0
ucomisd 0xcbc(%rip),%xmm0
movapd %xmm0,%xmm3
ja     1376 <brent_zero+0x266>
movapd %xmm0,%xmm3
xorpd  0xcba(%rip),%xmm3
movapd %xmm2,%xmm1
xorpd  0xcae(%rip),%xmm1
xorpd  %xmm4,%xmm4
cmpltsd %xmm0,%xmm4
andpd  %xmm4,%xmm1
andnpd %xmm2,%xmm4
orpd   %xmm1,%xmm4
movapd %xmm4,0x50(%rsp)
movapd %xmm3,0x60(%rsp)
addsd  %xmm3,%xmm3
movsd  %xmm3,0x78(%rsp)
movsd  0x38(%rsp),%xmm0
mulsd  0xc5d(%rip),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  %xmm4,%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x40(%rsp),%xmm1
mulsd  0x50(%rsp),%xmm1
subsd  %xmm0,%xmm1
ucomisd 0x78(%rsp),%xmm1
movsd  0x38(%rsp),%xmm1
movapd %xmm1,%xmm0
jbe    1440 <brent_zero+0x330>
movsd  0x10(%rsp),%xmm0
mulsd  0xbf9(%rip),%xmm0
mulsd  0x50(%rsp),%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd 0x60(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
movapd %xmm1,%xmm0
jbe    1440 <brent_zero+0x330>
movapd 0x60(%rsp),%xmm0
divsd  0x50(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
nopl   (%rax)
movsd  %xmm0,0x28(%rsp)
movsd  %xmm1,0x78(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd 0x8(%rsp),%xmm0
jbe    1470 <brent_zero+0x360>
movsd  0x18(%rsp),%xmm0
addsd  0x28(%rsp),%xmm0
jmp    149c <brent_zero+0x38c>
xchg   %ax,%ax
xorpd  %xmm0,%xmm0
movsd  0x38(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    1490 <brent_zero+0x380>
movsd  0x8(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
jmp    149c <brent_zero+0x38c>
xchg   %ax,%ax
movsd  0x18(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
call   *%rbx
movapd %xmm0,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  0x30(%rsp),%xmm0
jbe    14be <brent_zero+0x3ae>
ucomisd %xmm1,%xmm0
ja     14ca <brent_zero+0x3ba>
ucomisd %xmm2,%xmm1
jb     14f2 <brent_zero+0x3e2>
ucomisd %xmm0,%xmm1
jb     14f2 <brent_zero+0x3e2>
movsd  0x50(%rsp),%xmm1
movsd  0x18(%rsp),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm0,0x48(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm1,0x78(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1030 <fabs@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
cmp    %eax,%ebp
jge    1550 <brent_zero+0x440>
movsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x40(%rsp)
movsd  0x30(%rsp),%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x30(%rsp)
jmp    157a <brent_zero+0x46a>
nopl   0x0(%rax)
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x70(%rsp),%xmm0
addsd  0x80(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x48(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
mulsd  0xa45(%rip),%xmm0
movsd  %xmm0,0x38(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd 0x8(%rsp),%xmm0
jb     1615 <brent_zero+0x505>
movsd  0x20(%rsp),%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
movsd  0x78(%rsp),%xmm0
movsd  0x28(%rsp),%xmm3
movsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x18(%rsp)
jne    1260 <brent_zero+0x150>
jp     1260 <brent_zero+0x150>
jmp    1615 <brent_zero+0x505>
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  0x50(%rsp),%xmm0
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define double @brent_zero(double (double)* nocapture %0, double %1, double %2, double %3, double %4) {
%6 = tail call double %0(double %1)
%7 = tail call double %0(double %2)
%8 = fsub double %2, %1
%9 = tail call i32 @fabs(double %6)
%10 = tail call i32 @fabs(double %7)
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %5
br label %13
13: ; preds = %5, %12
%14 = phi double [ %1, %12 ], [ %2, %5 ]
%15 = phi double [ %6, %12 ], [ %7, %5 ]
%16 = phi double [ %7, %12 ], [ %6, %5 ]
%17 = phi double [ %2, %12 ], [ %1, %5 ]
%18 = fmul double %4, 2.000000e+00
%19 = tail call i32 @fabs(double %14)
%20 = sitofp i32 %19 to double
%21 = tail call double @llvm.fmuladd.f64(double %18, double %20, double %3)
%22 = fsub double %17, %14
%23 = fmul double %22, 5.000000e-01
%24 = tail call i32 @fabs(double %23)
%25 = sitofp i32 %24 to double
%26 = fcmp ole double %21, %25
%27 = fcmp une double %15, 0.000000e+00
%28 = select i1 %26, i1 %27, i1 false
br i1 %28, label %29, label %145
29: ; preds = %13, %128
%30 = phi double [ %139, %128 ], [ %23, %13 ]
%31 = phi double [ %134, %128 ], [ %17, %13 ]
%32 = phi double [ %137, %128 ], [ %21, %13 ]
%33 = phi double [ %133, %128 ], [ %16, %13 ]
%34 = phi double [ %132, %128 ], [ %15, %13 ]
%35 = phi double [ %131, %128 ], [ %16, %13 ]
%36 = phi double [ %122, %128 ], [ %8, %13 ]
%37 = phi double [ %121, %128 ], [ %8, %13 ]
%38 = phi double [ %130, %128 ], [ %17, %13 ]
%39 = phi double [ %129, %128 ], [ %14, %13 ]
%40 = tail call i32 @fabs(double %36)
%41 = sitofp i32 %40 to double
%42 = fcmp ogt double %32, %41
br i1 %42, label %93, label %43
43: ; preds = %29
%44 = tail call i32 @fabs(double %35)
%45 = tail call i32 @fabs(double %34)
%46 = icmp sgt i32 %44, %45
br i1 %46, label %47, label %93
47: ; preds = %43
%48 = fdiv double %34, %35
%49 = fcmp oeq double %31, %38
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = fmul double %30, 2.000000e+00
%52 = fsub double 1.000000e+00, %48
br label %68
53: ; preds = %47
%54 = fdiv double %35, %33
%55 = fdiv double %34, %33
%56 = fmul double %30, 2.000000e+00
%57 = fmul double %54, %56
%58 = fsub double %54, %55
%59 = fsub double %39, %31
%60 = fadd double %55, -1.000000e+00
%61 = fneg double %59
%62 = fmul double %60, %61
%63 = tail call double @llvm.fmuladd.f64(double %57, double %58, double %62)
%64 = fadd double %54, -1.000000e+00
%65 = fmul double %64, %60
%66 = fadd double %48, -1.000000e+00
%67 = fmul double %66, %65
br label %68
68: ; preds = %53, %50
%69 = phi double [ %51, %50 ], [ %63, %53 ]
%70 = phi double [ %52, %50 ], [ %67, %53 ]
%71 = fmul double %48, %69
%72 = fcmp ogt double %71, 0.000000e+00
%73 = fneg double %70
%74 = fneg double %71
%75 = select i1 %72, double %71, double %74
%76 = select i1 %72, double %73, double %70
%77 = fmul double %75, 2.000000e+00
%78 = fmul double %30, 3.000000e+00
%79 = fmul double %32, %76
%80 = tail call i32 @fabs(double %79)
%81 = sitofp i32 %80 to double
%82 = fneg double %81
%83 = tail call double @llvm.fmuladd.f64(double %78, double %76, double %82)
%84 = fcmp olt double %77, %83
br i1 %84, label %85, label %93
85: ; preds = %68
%86 = fmul double %36, 5.000000e-01
%87 = fmul double %86, %76
%88 = tail call i32 @fabs(double %87)
%89 = sitofp i32 %88 to double
%90 = fcmp olt double %75, %89
br i1 %90, label %91, label %93
91: ; preds = %85
%92 = fdiv double %75, %76
br label %93
93: ; preds = %68, %85, %29, %43, %91
%94 = phi double [ %92, %91 ], [ %30, %43 ], [ %30, %29 ], [ %30, %85 ], [ %30, %68 ]
%95 = phi double [ %37, %91 ], [ %30, %43 ], [ %30, %29 ], [ %30, %85 ], [ %30, %68 ]
%96 = tail call i32 @fabs(double %94)
%97 = sitofp i32 %96 to double
%98 = fcmp olt double %32, %97
br i1 %98, label %99, label %101
99: ; preds = %93
%100 = fadd double %39, %94
br label %107
101: ; preds = %93
%102 = fcmp ogt double %30, 0.000000e+00
br i1 %102, label %103, label %105
103: ; preds = %101
%104 = fadd double %39, %32
br label %107
105: ; preds = %101
%106 = fsub double %39, %32
br label %107
107: ; preds = %103, %105, %99
%108 = phi double [ %100, %99 ], [ %104, %103 ], [ %106, %105 ]
%109 = tail call double %0(double %108)
%110 = fcmp ogt double %109, 0.000000e+00
%111 = fcmp ogt double %33, 0.000000e+00
%112 = select i1 %110, i1 %111, i1 false
br i1 %112, label %117, label %113
113: ; preds = %107
%114 = fcmp ole double %109, 0.000000e+00
%115 = fcmp ole double %33, 0.000000e+00
%116 = select i1 %114, i1 %115, i1 false
br i1 %116, label %117, label %119
117: ; preds = %113, %107
%118 = fsub double %108, %39
br label %119
119: ; preds = %117, %113
%120 = phi double [ %39, %117 ], [ %38, %113 ]
%121 = phi double [ %118, %117 ], [ %94, %113 ]
%122 = phi double [ %118, %117 ], [ %95, %113 ]
%123 = phi double [ %34, %117 ], [ %33, %113 ]
%124 = tail call i32 @fabs(double %123)
%125 = tail call i32 @fabs(double %109)
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %128
127: ; preds = %119
br label %128
128: ; preds = %127, %119
%129 = phi double [ %120, %127 ], [ %108, %119 ]
%130 = phi double [ %108, %127 ], [ %120, %119 ]
%131 = phi double [ %109, %127 ], [ %34, %119 ]
%132 = phi double [ %123, %127 ], [ %109, %119 ]
%133 = phi double [ %109, %127 ], [ %123, %119 ]
%134 = phi double [ %108, %127 ], [ %39, %119 ]
%135 = tail call i32 @fabs(double %129)
%136 = sitofp i32 %135 to double
%137 = tail call double @llvm.fmuladd.f64(double %18, double %136, double %3)
%138 = fsub double %130, %129
%139 = fmul double %138, 5.000000e-01
%140 = tail call i32 @fabs(double %139)
%141 = sitofp i32 %140 to double
%142 = fcmp ole double %137, %141
%143 = fcmp une double %132, 0.000000e+00
%144 = select i1 %142, i1 %143, i1 false
br i1 %144, label %29, label %145
145: ; preds = %128, %13
%146 = phi double [ %14, %13 ], [ %108, %128 ]
ret double %146
}