#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 sqrt(double);
double brent_local_min(double (*funcpt)(double), double a, double b, double t,
                       double eps, double *x) {
  double c, d, e, m, p, q, r, tol, t2;
  double u, v, w, fu, fv, fw, fx;
  double fd;
  fd = eps;
  c = (3.0 - sqrt(5.0)) / 2.0;
  *x = a + c * (b - a);
  w = *x;
  v = w;
  e = 0;
  fx = funcpt(*x);
  fw = fx;
  fv = fw;
  m = 0.5 * (a + b);
  tol = fd * fabs(*x) + t;
  t2 = 2.0 * tol;
  while (fabs(*x - m) > t2 - 0.5 * (b - a)) {
    p = 0;
    q = 0;
    r = 0;
    if (fabs(e) > tol) {
      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;
      } else {
        q = -q;
      }
      r = e;
      e = d;
    }
    if (fabs(p) < fabs(0.5 * q * r) && p < q * (a - *x) && p < q * (b - *x)) {
      d = p / q;
      u = *x + d;
      if ((u - a) < t2 || (b - u) < t2) {
        if (*x < m) {
          d = tol;
        } else {
          d = -tol;
        }
      }
    } else {
      if (*x < m) {
        e = b - *x;
      } else {
        e = a - *x;
      }
      d = c * e;
    }
    if (fabs(d) >= tol) {
      u = *x + d;
    } else if (d > 0) {
      u = *x + tol;
    } else {
      u = *x - tol;
    }
    fu = funcpt(u);
    if (fu <= fx) {
      if (u < *x) {
        b = *x;
      } else {
        a = *x;
      }
      v = w;
      fv = fw;
      w = *x;
      fw = fx;
      *x = u;
      fx = fu;
    } else {
      if (u < *x) {
        a = u;
      } else {
        b = u;
      }
      if (fu <= fw || w == *x) {
        v = w;
        fv = fw;
        w = u;
        fw = fu;
      } else if (fu <= fv || v == *x || v == w) {
        v = u;
        fv = fu;
      }
    }
    m = 0.5 * (a + b);
    tol = fd * fabs(*x) + t;
    t2 = 2.0 * tol;
  }
  return fx;
}


x86 assembly (clang, -O0):
<brent_local_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xecc(%rip),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe98(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rcx),%xmm0
call   *%rax
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xe03(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm2
movaps 0xe0b(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xdbd(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x50(%rbp),%xmm0
movaps 0xdcf(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x78(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xda4(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1819 <brent_local_min+0x709>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
movaps 0xd7e(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    13e9 <brent_local_min+0x2d9>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x90(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
subsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
subsd  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
movsd  -0x60(%rbp),%xmm2
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
subsd  -0x90(%rbp),%xmm1
ff
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm1
subsd  -0x68(%rbp),%xmm1
movsd  0xc8d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13b4 <brent_local_min+0x2a4>
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    13d5 <brent_local_min+0x2c5>
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm1
movaps 0xc3b(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xc07(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movaps 0xc1e(%rip),%xmm2
pand   %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    150e <brent_local_min+0x3fe>
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x30(%rbp),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    150e <brent_local_min+0x3fe>
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x30(%rbp),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    150e <brent_local_min+0x3fe>
movsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     14bd <brent_local_min+0x3ad>
movsd  -0x18(%rbp),%xmm1
subsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1509 <brent_local_min+0x3f9>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14e3 <brent_local_min+0x3d3>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1504 <brent_local_min+0x3f4>
movsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1509 <brent_local_min+0x3f9>
jmp    155d <brent_local_min+0x44d>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    153c <brent_local_min+0x42c>
movsd  -0x18(%rbp),%xmm0
mov    -0x30(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    154e <brent_local_min+0x43e>
movsd  -0x10(%rbp),%xmm0
mov    -0x30(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movaps 0xac7(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x70(%rbp),%xmm0
jb     158f <brent_local_min+0x47f>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    15cf <brent_local_min+0x4bf>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    15b8 <brent_local_min+0x4a8>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    15ca <brent_local_min+0x4ba>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    15cf <brent_local_min+0x4bf>
mov    -0x8(%rbp),%rax
movsd  -0x80(%rbp),%xmm0
call   *%rax
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1694 <brent_local_min+0x584>
movsd  -0x80(%rbp),%xmm1
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1625 <brent_local_min+0x515>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1632 <brent_local_min+0x522>
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
jmp    17ba <brent_local_min+0x6aa>
movsd  -0x80(%rbp),%xmm1
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    16ba <brent_local_min+0x5aa>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    16c4 <brent_local_min+0x5b4>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jae    16fa <brent_local_min+0x5ea>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
ucomisd (%rax),%xmm0
jne    173c <brent_local_min+0x62c>
jp     173c <brent_local_min+0x62c>
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    17b5 <brent_local_min+0x6a5>
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jae    1793 <brent_local_min+0x683>
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1777 <brent_local_min+0x667>
jp     1777 <brent_local_min+0x667>
jmp    1793 <brent_local_min+0x683>
movsd  -0x88(%rbp),%xmm0
ff
ucomisd -0x90(%rbp),%xmm0
ff
jne    17b0 <brent_local_min+0x6a0>
jp     17b0 <brent_local_min+0x6a0>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    17b5 <brent_local_min+0x6a5>
jmp    17ba <brent_local_min+0x6aa>
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0x83c(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm2
movaps 0x844(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0x7f6(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    124d <brent_local_min+0x13d>
movsd  -0xb0(%rbp),%xmm0
ff
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brent_local_min>:
push   %r15
push   %r14
push   %rbx
sub    $0x90,%rsp
mov    %rsi,%r15
movsd  %xmm3,0x38(%rsp)
movsd  %xmm2,0x30(%rsp)
movapd %xmm1,0x40(%rsp)
movapd %xmm0,%xmm2
movapd %xmm0,0x20(%rsp)
mov    %rdi,%r14
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
movsd  %xmm3,(%rsp)
movsd  0xebd(%rip),%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rsi)
movsd  %xmm0,0x18(%rsp)
call   *%rdi
movapd 0x40(%rsp),%xmm8
movapd %xmm0,%xmm15
movapd 0x20(%rsp),%xmm2
addsd  %xmm8,%xmm2
movsd  (%r15),%xmm14
movapd 0xea4(%rip),%xmm9
movapd %xmm14,%xmm1
andpd  %xmm9,%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  0x30(%rsp),%xmm1
movapd %xmm1,%xmm3
mulsd  0xe6a(%rip),%xmm2
addsd  %xmm1,%xmm3
movapd %xmm14,%xmm0
subsd  %xmm2,%xmm0
movsd  (%rsp),%xmm4
mulsd  0xe58(%rip),%xmm4
andpd  %xmm9,%xmm0
addsd  %xmm3,%xmm4
ucomisd %xmm4,%xmm0
jbe    15f9 <brent_local_min+0x4f9>
movapd 0xe5c(%rip),%xmm13
movsd  0xe2b(%rip),%xmm12
movsd  %xmm15,(%rsp)
movsd  %xmm15,0x8(%rsp)
movsd  0x18(%rsp),%xmm11
movsd  %xmm11,0x10(%rsp)
xorpd  %xmm10,%xmm10
jmp    12ea <brent_local_min+0x1ea>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm5,%xmm2
cmpltsd %xmm4,%xmm2
movapd %xmm2,%xmm1
andpd  %xmm4,%xmm1
andnpd 0x40(%rsp),%xmm2
orpd   %xmm1,%xmm2
movsd  %xmm5,(%r15)
movapd %xmm5,%xmm14
movsd  0x18(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
movapd %xmm2,%xmm8
movsd  (%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm3,(%rsp)
movapd 0x20(%rsp),%xmm5
movapd 0xdbb(%rip),%xmm9
movapd 0xdc2(%rip),%xmm13
movsd  0xd91(%rip),%xmm12
movapd %xmm8,%xmm2
addsd  %xmm5,%xmm2
movapd %xmm14,%xmm1
andpd  %xmm9,%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  0x30(%rsp),%xmm1
movapd %xmm1,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm12,%xmm2
movapd %xmm14,%xmm6
subsd  %xmm2,%xmm6
andpd  %xmm9,%xmm6
movapd %xmm8,%xmm7
subsd  %xmm5,%xmm7
mulsd  0xd4e(%rip),%xmm7
addsd  %xmm3,%xmm7
ucomisd %xmm7,%xmm6
movapd %xmm5,0x20(%rsp)
movapd %xmm0,%xmm15
movapd %xmm4,%xmm11
movapd 0x80(%rsp),%xmm10
jbe    15fe <brent_local_min+0x4fe>
movapd %xmm10,%xmm0
andpd  0xd29(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1380 <brent_local_min+0x280>
movapd %xmm14,%xmm4
subsd  %xmm11,%xmm4
movapd %xmm15,%xmm6
subsd  0x8(%rsp),%xmm6
mulsd  %xmm4,%xmm6
movapd %xmm14,%xmm5
subsd  0x10(%rsp),%xmm5
movapd %xmm15,%xmm0
subsd  (%rsp),%xmm0
mulsd  %xmm5,%xmm0
mulsd  %xmm6,%xmm4
mulsd  %xmm0,%xmm5
subsd  %xmm4,%xmm5
subsd  %xmm6,%xmm0
addsd  %xmm0,%xmm0
ucomisd 0xcc9(%rip),%xmm0
jbe    1356 <brent_local_min+0x256>
xorpd  %xmm13,%xmm5
movapd %xmm0,%xmm6
xorpd  %xmm13,%xmm6
xorpd  %xmm4,%xmm4
cmpltsd %xmm0,%xmm4
andpd  %xmm4,%xmm0
andnpd %xmm6,%xmm4
orpd   %xmm0,%xmm4
movapd 0x70(%rsp),%xmm0
movapd %xmm5,%xmm7
jmp    1392 <brent_local_min+0x292>
movapd %xmm10,%xmm0
xorpd  %xmm7,%xmm7
xorpd  %xmm4,%xmm4
xorpd  %xmm10,%xmm10
movapd %xmm7,%xmm5
andpd  %xmm9,%xmm5
movapd %xmm4,%xmm6
mulsd  %xmm12,%xmm6
mulsd  %xmm10,%xmm6
andpd  %xmm9,%xmm6
ucomisd %xmm5,%xmm6
jbe    1420 <brent_local_min+0x320>
movapd 0x20(%rsp),%xmm5
subsd  %xmm14,%xmm5
mulsd  %xmm4,%xmm5
ucomisd %xmm7,%xmm5
jbe    1420 <brent_local_min+0x320>
movapd %xmm8,%xmm5
subsd  %xmm14,%xmm5
mulsd  %xmm4,%xmm5
ucomisd %xmm7,%xmm5
jbe    1420 <brent_local_min+0x320>
divsd  %xmm4,%xmm7
movapd %xmm14,%xmm4
addsd  %xmm7,%xmm4
movapd %xmm4,%xmm5
subsd  0x20(%rsp),%xmm5
ucomisd %xmm5,%xmm3
ja     1409 <brent_local_min+0x309>
movapd %xmm8,%xmm5
subsd  %xmm4,%xmm5
ucomisd %xmm5,%xmm3
jbe    1418 <brent_local_min+0x318>
movapd %xmm1,%xmm7
ucomisd %xmm14,%xmm2
jbe    15e8 <brent_local_min+0x4e8>
movapd %xmm0,%xmm3
jmp    144e <brent_local_min+0x34e>
xchg   %ax,%ax
movapd %xmm14,%xmm3
cmpltsd %xmm2,%xmm3
movapd %xmm3,%xmm0
andpd  %xmm8,%xmm0
andnpd 0x20(%rsp),%xmm3
orpd   %xmm0,%xmm3
subsd  %xmm14,%xmm3
movapd %xmm3,%xmm7
mulsd  0xbb2(%rip),%xmm7
movapd %xmm7,%xmm0
andpd  0xbc6(%rip),%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm8,0x40(%rsp)
movsd  %xmm15,0x58(%rsp)
movsd  %xmm11,0x18(%rsp)
movapd %xmm7,0x70(%rsp)
movapd %xmm3,0x80(%rsp)
jae    14a0 <brent_local_min+0x3a0>
ucomisd 0xb8c(%rip),%xmm7
jbe    14b0 <brent_local_min+0x3b0>
addsd  %xmm14,%xmm1
jmp    14ba <brent_local_min+0x3ba>
cs nopw 0x0(%rax,%rax,1)
nop
addsd  %xmm7,%xmm14
jmp    14b5 <brent_local_min+0x3b5>
nopw   0x0(%rax,%rax,1)
subsd  %xmm1,%xmm14
movapd %xmm14,%xmm1
movapd %xmm1,0x60(%rsp)
movapd %xmm1,%xmm0
call   *%r14
movsd  0x58(%rsp),%xmm3
ucomisd %xmm0,%xmm3
movsd  (%r15),%xmm4
jae    15a0 <brent_local_min+0x4a0>
movapd 0x60(%rsp),%xmm2
ucomisd %xmm2,%xmm4
movapd %xmm2,%xmm5
ja     14f2 <brent_local_min+0x3f2>
movapd 0x20(%rsp),%xmm5
movapd %xmm2,%xmm1
cmpltsd %xmm4,%xmm1
movapd 0x40(%rsp),%xmm8
andpd  %xmm1,%xmm8
andnpd %xmm2,%xmm1
orpd   %xmm1,%xmm8
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
movapd 0xafe(%rip),%xmm9
movapd 0xb05(%rip),%xmm13
movsd  0xad4(%rip),%xmm12
movsd  0x18(%rsp),%xmm1
jae    15c0 <brent_local_min+0x4c0>
ucomisd %xmm4,%xmm1
jne    1548 <brent_local_min+0x448>
jnp    15c0 <brent_local_min+0x4c0>
movsd  0x8(%rsp),%xmm7
ucomisd %xmm0,%xmm7
setae  %al
movsd  0x10(%rsp),%xmm6
ucomisd %xmm4,%xmm6
setnp  %cl
sete   %dl
and    %cl,%dl
ucomisd %xmm1,%xmm6
setnp  %cl
sete   %bl
and    %cl,%bl
or     %dl,%bl
or     %al,%bl
jne    1581 <brent_local_min+0x481>
movapd %xmm6,%xmm2
movapd %xmm7,%xmm0
movapd %xmm4,%xmm14
movsd  %xmm2,0x10(%rsp)
movapd %xmm1,%xmm4
movsd  %xmm0,0x8(%rsp)
jmp    15df <brent_local_min+0x4df>
nopl   0x0(%rax,%rax,1)
movapd 0x60(%rsp),%xmm5
ucomisd %xmm5,%xmm4
ja     1210 <brent_local_min+0x110>
movapd %xmm4,0x20(%rsp)
jmp    1210 <brent_local_min+0x110>
nopl   0x0(%rax,%rax,1)
movapd %xmm4,%xmm14
movsd  %xmm1,0x10(%rsp)
movapd %xmm2,%xmm4
movsd  (%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movapd %xmm3,%xmm0
jmp    1277 <brent_local_min+0x177>
xorpd  0xa40(%rip),%xmm7
movapd %xmm0,%xmm3
jmp    144e <brent_local_min+0x34e>
movapd %xmm15,%xmm0
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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