#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);
int /*<<< orphan*/ printf(char *);
double stub1(double);
double brent(double ax, double bx, double cx, double fbx, double (*f)(double),
             double tol, double *xmin) {
  int iter;
  double a, b, d, etemp, fu, fv, fw, fx, p, q, r, tol1, tol2, u, v, w, x, xm;
  double e = 0.0;
  a = (ax < cx ? ax : cx);
  b = (ax > cx ? ax : cx);
  x = w = v = bx;
  fw = fv = fx = fbx;
  for (iter = 1; iter <= 50; iter++) {
    xm = 0.5 * (a + b);
    tol2 = 2.0 * (tol1 = tol * fabs(x) + 1.0e-10);
    if (fabs(x - xm) <= (tol2 - 0.5 * (b - a))) {
      *xmin = x;
      return fx;
    }
    if (fabs(e) > tol1) {
      r = (x - w) * (fx - fv);
      q = (x - v) * (fx - fw);
      p = (x - v) * q - (x - w) * r;
      q = 2.0 * (q - r);
      if (q > 0.0)
        p = -p;
      q = fabs(q);
      etemp = e;
      e = d;
      if (fabs(p) >= fabs(0.5 * q * etemp) || p <= q * (a - x) ||
          p >= q * (b - x))
        d = 0.3819660 * (e = (x >= xm ? a - x : b - x));
      else {
        d = p / q;
        u = x + d;
        if (u - a < tol2 || b - u < tol2)
          d = ((xm - x) >= 0.0 ? fabs(tol1) : -fabs(tol1));
      }
    } else {
      d = 0.3819660 * (e = (x >= xm ? a - x : b - x));
    }
    u = (fabs(d) >= tol1 ? x + d : x + ((d) >= 0.0 ? fabs(tol1) : -fabs(tol1)));
    fu = (*f)(u);
    if (fu <= fx) {
      if (u >= x)
        a = x;
      else
        b = x;
      (v) = (w);
      (w) = (x);
      (x) = (u);
      (fv) = (fw);
      (fw) = (fx);
      (fx) = (fu);
    } else {
      if (u < x)
        a = u;
      else
        b = u;
      if (fu <= fw || w == x) {
        v = w;
        w = u;
        fv = fw;
        fw = fu;
      } else if (fu <= fv || v == x || v == w) {
        v = u;
        fv = fu;
      }
    }
  }
  printf("Too many iterations in brent\n");
  return fx;
}


x86 assembly (clang, -O0):
<brent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    116d <brent+0x5d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
jmp    117a <brent+0x6a>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11a9 <brent+0x99>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
jmp    11b6 <brent+0xa6>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  %xmm0,-0x78(%rbp)
movsd  %xmm0,-0x80(%rbp)
movl   $0x1,-0x44(%rbp)
cmpl   $0x32,-0x44(%rbp)
jg     193e <brent+0x82e>
movsd  -0x50(%rbp),%xmm1
addsd  -0x58(%rbp),%xmm1
movsd  0xdfe(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x38(%rbp),%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
movaps 0xdf6(%rip),%xmm2
pand   %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xdc6(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,-0xa8(%rbp)
ff
movsd  0xdaa(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm1
ff
subsd  -0xd8(%rbp),%xmm1
ff
movaps 0xdaf(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0x58(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  0xd61(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     12d3 <brent+0x1c3>
movsd  -0xd0(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    1957 <brent+0x847>
movsd  -0xe0(%rbp),%xmm0
ff
movaps 0xd4e(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jbe    161e <brent+0x50e>
movsd  -0xd0(%rbp),%xmm0
ff
subsd  -0xc8(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
subsd  -0x78(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
subsd  -0xc0(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
subsd  -0x80(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
subsd  -0xc0(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0xd0(%rbp),%xmm1
ff
subsd  -0xc8(%rbp),%xmm1
ff
mulsd  -0xa0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x98(%rbp),%xmm1
ff
subsd  -0xa0(%rbp),%xmm1
ff
movsd  0xc53(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13fd <brent+0x2ed>
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movaps 0xc24(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movaps 0xbef(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xbcb(%rip),%xmm1
mulsd  -0x98(%rbp),%xmm1
ff
mulsd  -0x68(%rbp),%xmm1
movaps 0xbcf(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jae    14c5 <brent+0x3b5>
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x50(%rbp),%xmm2
subsd  -0xd0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jae    14c5 <brent+0x3b5>
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x58(%rbp),%xmm2
subsd  -0xd0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1530 <brent+0x420>
movsd  -0xd0(%rbp),%xmm0
ff
ucomisd -0xd8(%rbp),%xmm0
ff
jb     14f5 <brent+0x3e5>
movsd  -0x50(%rbp),%xmm0
subsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
jmp    150a <brent+0x3fa>
movsd  -0x58(%rbp),%xmm0
subsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xf8(%rbp),%xmm1
ff
movsd  %xmm1,-0xe0(%rbp)
ff
movsd  0xafe(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1619 <brent+0x509>
movsd  -0x90(%rbp),%xmm0
ff
divsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0xd0(%rbp),%xmm0
ff
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm1
ff
subsd  -0x50(%rbp),%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
ja     1598 <brent+0x488>
movsd  -0x58(%rbp),%xmm1
subsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1614 <brent+0x504>
movsd  -0xd8(%rbp),%xmm0
ff
subsd  -0xd0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     15d5 <brent+0x4c5>
movsd  -0xa8(%rbp),%xmm0
ff
movaps 0xa6c(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
jmp    1607 <brent+0x4f7>
movsd  -0xa8(%rbp),%xmm0
ff
movaps 0xa4c(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
jmp    1619 <brent+0x509>
jmp    1684 <brent+0x574>
movsd  -0xd0(%rbp),%xmm0
ff
ucomisd -0xd8(%rbp),%xmm0
ff
jb     164e <brent+0x53e>
movsd  -0x50(%rbp),%xmm0
subsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
jmp    1663 <brent+0x553>
movsd  -0x58(%rbp),%xmm0
subsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x108(%rbp),%xmm1
ff
movsd  %xmm1,-0xe0(%rbp)
ff
movsd  0x9a5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movaps 0x9a0(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jb     16bc <brent+0x5ac>
movsd  -0xd0(%rbp),%xmm0
ff
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
jmp    174c <brent+0x63c>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     16fe <brent+0x5ee>
movsd  -0xa8(%rbp),%xmm0
ff
movaps 0x943(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
jmp    1730 <brent+0x620>
movsd  -0xa8(%rbp),%xmm0
ff
movaps 0x923(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movsd  -0x120(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  -0xb8(%rbp),%xmm0
ff
call   *%rax
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1814 <brent+0x704>
movsd  -0xb8(%rbp),%xmm0
ff
ucomisd -0xd0(%rbp),%xmm0
ff
jb     17ae <brent+0x69e>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
jmp    17bb <brent+0x6ab>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x58(%rbp)
movsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    192b <brent+0x81b>
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xd0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jbe    1840 <brent+0x730>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
jmp    184d <brent+0x73d>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x58(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jae    187d <brent+0x76d>
movsd  -0xc8(%rbp),%xmm0
ff
ucomisd -0xd0(%rbp),%xmm0
ff
jne    18b6 <brent+0x7a6>
jp     18b6 <brent+0x7a6>
movsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    1926 <brent+0x816>
movsd  -0x70(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jae    1907 <brent+0x7f7>
movsd  -0xc0(%rbp),%xmm0
ff
ucomisd -0xd0(%rbp),%xmm0
ff
jne    18eb <brent+0x7db>
jp     18eb <brent+0x7db>
jmp    1907 <brent+0x7f7>
movsd  -0xc0(%rbp),%xmm0
ff
ucomisd -0xc8(%rbp),%xmm0
ff
jne    1921 <brent+0x811>
jp     1921 <brent+0x811>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    1926 <brent+0x816>
jmp    192b <brent+0x81b>
jmp    1930 <brent+0x820>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11fe <brent+0xee>
lea    0x6fb(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brent>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rsi,%r14
movsd  %xmm4,0x30(%rsp)
mov    %rdi,%r15
movapd %xmm3,%xmm9
movapd %xmm0,%xmm10
movapd %xmm0,%xmm6
minsd  %xmm2,%xmm6
maxsd  %xmm2,%xmm10
mov    $0x32,%ebp
movapd 0xee2(%rip),%xmm12
xorpd  %xmm13,%xmm13
movapd %xmm1,%xmm14
movapd %xmm1,%xmm11
movapd %xmm3,%xmm15
movapd %xmm3,%xmm2
jmp    11cd <brent+0xbd>
nopl   0x0(%rax,%rax,1)
movapd %xmm4,%xmm10
cmpnlesd %xmm5,%xmm10
movapd %xmm10,%xmm2
andpd  %xmm4,%xmm2
andnpd 0x70(%rsp),%xmm10
orpd   %xmm2,%xmm10
movsd  0x10(%rsp),%xmm2
movapd %xmm9,%xmm15
movapd %xmm0,%xmm9
movsd  0x18(%rsp),%xmm11
movapd %xmm4,%xmm14
movapd 0xe7b(%rip),%xmm12
movapd 0x60(%rsp),%xmm13
movapd %xmm5,%xmm1
movapd %xmm3,%xmm6
add    $0xffffffff,%ebp
je     1564 <brent+0x454>
movsd  %xmm2,0x8(%rsp)
movapd 0x80(%rsp),%xmm8
movapd %xmm10,%xmm7
addsd  %xmm6,%xmm7
mulsd  0xe12(%rip),%xmm7
movapd %xmm1,%xmm3
movapd 0xe36(%rip),%xmm2
andpd  %xmm2,%xmm3
mulsd  0x30(%rsp),%xmm3
addsd  0xdfc(%rip),%xmm3
movapd %xmm3,%xmm0
addsd  %xmm3,%xmm0
movapd %xmm1,%xmm4
subsd  %xmm7,%xmm4
andpd  %xmm2,%xmm4
movapd %xmm10,%xmm5
subsd  %xmm6,%xmm5
mulsd  0xddf(%rip),%xmm5
addsd  %xmm0,%xmm5
ucomisd %xmm4,%xmm5
jae    155d <brent+0x44d>
movapd %xmm13,%xmm4
andpd  %xmm12,%xmm4
ucomisd %xmm3,%xmm4
movsd  %xmm11,0x38(%rsp)
movapd %xmm6,0x20(%rsp)
movsd  %xmm15,0x10(%rsp)
jbe    13a0 <brent+0x290>
movapd %xmm1,%xmm4
subsd  %xmm14,%xmm4
movapd %xmm9,%xmm2
subsd  0x8(%rsp),%xmm2
mulsd  %xmm4,%xmm2
movapd %xmm1,%xmm5
subsd  %xmm11,%xmm5
movapd %xmm9,%xmm6
subsd  %xmm15,%xmm6
mulsd  %xmm5,%xmm6
mulsd  %xmm2,%xmm4
mulsd  %xmm6,%xmm5
subsd  %xmm4,%xmm5
subsd  %xmm2,%xmm6
addsd  %xmm6,%xmm6
movapd %xmm6,%xmm15
movapd 0xd78(%rip),%xmm11
andpd  %xmm11,%xmm15
movapd %xmm5,%xmm2
andpd  %xmm11,%xmm2
movapd %xmm15,%xmm4
mulsd  0xd2d(%rip),%xmm4
mulsd  %xmm4,%xmm13
andpd  %xmm11,%xmm13
movapd 0x20(%rsp),%xmm11
ucomisd %xmm13,%xmm2
jae    13c0 <brent+0x2b0>
movapd %xmm5,%xmm4
xorpd  0xd45(%rip),%xmm4
xorpd  %xmm13,%xmm13
cmpltsd %xmm6,%xmm13
andpd  %xmm13,%xmm4
andnpd %xmm5,%xmm13
orpd   %xmm4,%xmm13
movapd %xmm11,%xmm4
subsd  %xmm1,%xmm4
mulsd  %xmm15,%xmm4
ucomisd %xmm13,%xmm4
jae    13c0 <brent+0x2b0>
movapd %xmm10,%xmm4
subsd  %xmm1,%xmm4
mulsd  %xmm15,%xmm4
ucomisd %xmm4,%xmm13
jae    13c0 <brent+0x2b0>
divsd  %xmm15,%xmm13
movapd %xmm1,%xmm4
addsd  %xmm13,%xmm4
movapd %xmm4,%xmm2
subsd  %xmm11,%xmm2
ucomisd %xmm2,%xmm0
ja     1373 <brent+0x263>
movapd %xmm10,%xmm2
subsd  %xmm4,%xmm2
ucomisd %xmm2,%xmm0
jbe    1394 <brent+0x284>
subsd  %xmm1,%xmm7
ucomisd 0xca1(%rip),%xmm7
movapd %xmm3,%xmm13
andpd  %xmm12,%xmm13
jae    1394 <brent+0x284>
xorpd  0xcac(%rip),%xmm13
movapd %xmm8,%xmm7
jmp    13e9 <brent+0x2d9>
nopl   0x0(%rax,%rax,1)
cmpnlesd %xmm1,%xmm7
movapd %xmm7,%xmm2
andpd  %xmm10,%xmm2
andnpd %xmm6,%xmm7
jmp    13d3 <brent+0x2c3>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpnlesd %xmm1,%xmm7
movapd %xmm7,%xmm2
andpd  %xmm10,%xmm2
andnpd %xmm11,%xmm7
orpd   %xmm2,%xmm7
subsd  %xmm1,%xmm7
movapd %xmm7,%xmm13
mulsd  0xc2f(%rip),%xmm13
movsd  %xmm14,0x18(%rsp)
movsd  %xmm9,(%rsp)
movapd %xmm13,%xmm2
andpd  %xmm12,%xmm2
ucomisd %xmm3,%xmm2
movapd %xmm13,%xmm0
jae    1427 <brent+0x317>
ucomisd 0xc0c(%rip),%xmm13
andpd  %xmm12,%xmm3
movapd %xmm3,%xmm0
jae    1427 <brent+0x317>
xorpd  0xc19(%rip),%xmm0
movapd %xmm13,0x80(%rsp)
movapd %xmm7,0x60(%rsp)
movapd %xmm10,0x70(%rsp)
addsd  %xmm1,%xmm0
movapd %xmm0,0x50(%rsp)
movapd %xmm1,0x40(%rsp)
call   *%r15
movsd  (%rsp),%xmm9
ucomisd %xmm0,%xmm9
jae    1510 <brent+0x400>
movapd 0x50(%rsp),%xmm5
movapd 0x40(%rsp),%xmm1
ucomisd %xmm5,%xmm1
movapd %xmm5,%xmm3
movsd  0x38(%rsp),%xmm4
ja     1484 <brent+0x374>
movapd 0x20(%rsp),%xmm3
movapd %xmm5,%xmm2
cmpltsd %xmm1,%xmm2
movapd 0x70(%rsp),%xmm10
andpd  %xmm2,%xmm10
andnpd %xmm5,%xmm2
orpd   %xmm2,%xmm10
movsd  0x10(%rsp),%xmm15
ucomisd %xmm0,%xmm15
movapd 0xb79(%rip),%xmm12
movsd  0x18(%rsp),%xmm14
movapd 0x60(%rsp),%xmm13
jae    1540 <brent+0x430>
ucomisd %xmm1,%xmm14
jne    14d0 <brent+0x3c0>
jnp    1540 <brent+0x430>
movsd  0x8(%rsp),%xmm2
ucomisd %xmm0,%xmm2
setae  %al
ucomisd %xmm1,%xmm4
setnp  %cl
sete   %dl
and    %cl,%dl
ucomisd %xmm14,%xmm4
setnp  %cl
sete   %bl
and    %cl,%bl
or     %dl,%bl
or     %al,%bl
jne    1504 <brent+0x3f4>
movapd %xmm2,%xmm0
movapd %xmm4,%xmm5
movapd %xmm0,%xmm2
movapd %xmm5,%xmm11
jmp    1554 <brent+0x444>
nop
movapd 0x50(%rsp),%xmm5
movapd 0x40(%rsp),%xmm4
ucomisd %xmm4,%xmm5
movapd 0x20(%rsp),%xmm3
jb     1170 <brent+0x60>
movapd %xmm4,%xmm3
jmp    1170 <brent+0x60>
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm15,%xmm2
movapd %xmm0,%xmm15
movapd %xmm14,%xmm11
movapd %xmm5,%xmm14
movapd %xmm1,%xmm5
jmp    11bc <brent+0xac>
movsd  %xmm1,(%r14)
jmp    157c <brent+0x46c>
lea    0xae5(%rip),%rdi
movsd  %xmm9,(%rsp)
call   1030 <puts@plt>
movsd  (%rsp),%xmm9
movapd %xmm9,%xmm0
add    $0x98,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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