#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);
int /*<<< orphan*/ nfw_weights(double, double, double, long, double *, double *,
                               double *, double *, double *, double *, double *,
                               double *, double, int);
int solver_nfw(double r0, double beta, long ngal, double *ucounts,
               double *bcounts, double *r, double *w, double *lambda, double *p,
               double *wt, double *rlambda, double *theta_r, double tol,
               double *cpars, double rsig) {
  double lamlo, lamhi, mid, outlo, outmid;
  double cval;
  int i;
  lamlo = 0.5;
  lamhi = 2000.0;
  outlo = -1.0;
  while (fabs(lamhi - lamlo) > 2 * tol) {
    mid = (lamhi + lamlo) / 2.0;
    if (outlo < 0.0) {
      nfw_weights(lamlo, r0, beta, ngal, ucounts, bcounts, r, w, p, wt, rlambda,
                  theta_r, rsig, 1);
      outlo = 0.0;
      for (i = 0; i < ngal; i++) {
        outlo += wt[i];
      }
      cval = cpars[3] + cpars[2] * (*rlambda) +
             cpars[1] * (*rlambda) * (*rlambda) +
             cpars[0] * (*rlambda) * (*rlambda) * (*rlambda);
      if (cval < 0.0) {
        cval = 0.0;
      }
      outlo += lamlo * cval;
    }
    nfw_weights(mid, r0, beta, ngal, ucounts, bcounts, r, w, p, wt, rlambda,
                theta_r, rsig, 1);
    outmid = 0.0;
    for (i = 0; i < ngal; i++) {
      outmid += wt[i];
    }
    cval = cpars[3] + cpars[2] * (*rlambda) +
           cpars[1] * (*rlambda) * (*rlambda) +
           cpars[0] * (*rlambda) * (*rlambda) * (*rlambda);
    if (cval < 0.0) {
      cval = 0.0;
    }
    outmid += mid * cval;
    if (outlo < 1.0) {
      outlo = 0.9;
    }
    if ((outlo - lamlo) * (outmid - mid) > 0.0) {
      lamlo = mid;
      outlo = -1.0;
    } else {
      lamhi = mid;
    }
  }
  *lambda = (lamlo + lamhi) / 2.0;
  nfw_weights(*lambda, r0, beta, ngal, ucounts, bcounts, r, w, p, wt, rlambda,
              theta_r, rsig, 0);
  if (*lambda < 1.0) {
    *lambda = -1.0;
    *rlambda = -1.0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<solver_nfw>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xa8,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
movsd  %xmm2,-0x50(%rbp)
movsd  %xmm3,-0x58(%rbp)
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe87(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe72(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    14fa <solver_nfw+0x3da>
movsd  -0x68(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  0xe49(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    1338 <solver_nfw+0x218>
movsd  -0x60(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
movsd  -0x58(%rbp),%xmm3
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
movl   $0x1,0x18(%rsp)
call   1040 <nfw_weights@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x8c(%rbp)
movslq -0x8c(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    128a <solver_nfw+0x16a>
mov    0x18(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    124b <solver_nfw+0x12b>
mov    0x30(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    0x30(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x30(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    0x20(%rbp),%rax
mulsd  (%rax),%xmm1
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x20(%rbp),%rax
mulsd  (%rax),%xmm0
mov    0x20(%rbp),%rax
mulsd  (%rax),%xmm0
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    1319 <solver_nfw+0x1f9>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
movsd  -0x58(%rbp),%xmm3
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
movl   $0x1,0x18(%rsp)
call   1040 <nfw_weights@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x8c(%rbp)
movslq -0x8c(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    13dc <solver_nfw+0x2bc>
mov    0x18(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    139d <solver_nfw+0x27d>
mov    0x30(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    0x30(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x30(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    0x20(%rbp),%rax
mulsd  (%rax),%xmm1
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x20(%rbp),%rax
mulsd  (%rax),%xmm0
mov    0x20(%rbp),%rax
mulsd  (%rax),%xmm0
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    146b <solver_nfw+0x34b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xb8e(%rip),%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    14aa <solver_nfw+0x38a>
movsd  0xb83(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
subsd  -0x70(%rbp),%xmm1
mulsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14eb <solver_nfw+0x3cb>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xb1f(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    14f5 <solver_nfw+0x3d5>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1193 <solver_nfw+0x73>
movsd  -0x60(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  0xb0c(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
movsd  -0x58(%rbp),%xmm3
xor    %ebx,%ebx
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   1040 <nfw_weights@plt>
mov    -0x48(%rbp),%rax
movsd  0xaa4(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    15a6 <solver_nfw+0x486>
mov    -0x48(%rbp),%rax
movsd  0xa6e(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    0x20(%rbp),%rax
movsd  0xa5e(%rip),%xmm0
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<solver_nfw>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
movsd  %xmm3,0x58(%rsp)
movsd  %xmm2,0x20(%rsp)
mov    %r9,%rbp
mov    %r8,0x50(%rsp)
mov    %rcx,0x48(%rsp)
mov    %rdx,0x40(%rsp)
mov    %rsi,0x38(%rsp)
mov    %rdi,%r13
movsd  %xmm1,0x30(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    0xd8(%rsp),%r14
movsd  0xe8d(%rip),%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x20(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x20(%rsp)
ucomisd %xmm1,%xmm0
jbe    15d3 <solver_nfw+0x4b3>
mov    %rbp,0x90(%rsp)
mov    0xf0(%rsp),%r15
lea    -0x1(%r13),%rax
mov    %rax,0x88(%rsp)
mov    %r13d,%ebp
and    $0x7,%ebp
mov    %r13,%r12
and    $0xfffffffffffffff8,%r12
movsd  0xe46(%rip),%xmm5
movsd  0xe46(%rip),%xmm1
movsd  0xe46(%rip),%xmm3
jmp    123d <solver_nfw+0x11d>
nopl   0x0(%rax)
movapd %xmm2,0x70(%rsp)
xorpd  %xmm2,%xmm2
cmpltsd %xmm1,%xmm2
andpd  %xmm2,%xmm6
andnpd %xmm5,%xmm2
orpd   %xmm6,%xmm2
movapd %xmm2,0x10(%rsp)
movapd %xmm4,%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm4,0x8(%rsp)
call   1030 <fabs@plt>
movapd 0x10(%rsp),%xmm2
movapd 0x70(%rsp),%xmm3
movsd  0x8(%rsp),%xmm5
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
ucomisd 0x20(%rsp),%xmm1
movapd %xmm2,%xmm1
jbe    15dd <solver_nfw+0x4bd>
movsd  %xmm5,0x8(%rsp)
addsd  %xmm1,%xmm5
mulsd  0xdc9(%rip),%xmm5
xorpd  %xmm0,%xmm0
ucomisd %xmm3,%xmm0
mov    0xe0(%rsp),%rbx
movapd %xmm1,0x10(%rsp)
movapd %xmm5,0x60(%rsp)
jbe    13d9 <solver_nfw+0x2b9>
movapd %xmm1,%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
mov    %r13,%rdi
mov    0x38(%rsp),%rsi
mov    0x40(%rsp),%rdx
mov    0x48(%rsp),%rcx
mov    0x50(%rsp),%r8
mov    0xd0(%rsp),%r9
movsd  0x58(%rsp),%xmm3
push   $0x1
push   0xf0(%rsp)
push   %rbx
push   %r14
call   1040 <nfw_weights@plt>
add    $0x20,%rsp
test   %r13,%r13
jle    12ea <solver_nfw+0x1ca>
cmpq   $0x7,0x88(%rsp)
jae    1307 <solver_nfw+0x1e7>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
mov    0xe0(%rsp),%rbx
movapd 0x10(%rsp),%xmm4
movapd 0x60(%rsp),%xmm5
jmp    1370 <solver_nfw+0x250>
xorpd  %xmm0,%xmm0
mov    0xe0(%rsp),%rbx
movapd 0x10(%rsp),%xmm4
movapd 0x60(%rsp),%xmm5
jmp    138e <solver_nfw+0x26e>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
mov    0xe0(%rsp),%rbx
movapd 0x10(%rsp),%xmm4
movapd 0x60(%rsp),%xmm5
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  (%r14,%rax,8),%xmm0
addsd  0x8(%r14,%rax,8),%xmm0
addsd  0x10(%r14,%rax,8),%xmm0
addsd  0x18(%r14,%rax,8),%xmm0
addsd  0x20(%r14,%rax,8),%xmm0
addsd  0x28(%r14,%rax,8),%xmm0
addsd  0x30(%r14,%rax,8),%xmm0
addsd  0x38(%r14,%rax,8),%xmm0
add    $0x8,%rax
cmp    %rax,%r12
jne    1330 <solver_nfw+0x210>
test   %rbp,%rbp
je     138e <solver_nfw+0x26e>
lea    (%r14,%rax,8),%rax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
addsd  (%rax,%rcx,8),%xmm0
add    $0x1,%rcx
cmp    %rcx,%rbp
jne    1380 <solver_nfw+0x260>
movsd  (%rbx),%xmm1
movsd  0x10(%r15),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x18(%r15),%xmm2
movsd  0x8(%r15),%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  (%r15),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
xorpd  %xmm3,%xmm3
maxsd  %xmm2,%xmm3
mulsd  %xmm4,%xmm3
addsd  %xmm0,%xmm3
movapd %xmm3,0x70(%rsp)
movapd %xmm5,%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
mov    %r13,%rdi
mov    0x38(%rsp),%rsi
mov    0x40(%rsp),%rdx
mov    0x48(%rsp),%rcx
mov    0x50(%rsp),%r8
mov    0xd0(%rsp),%r9
movsd  0x58(%rsp),%xmm3
push   $0x1
push   0xf0(%rsp)
push   %rbx
push   %r14
call   1040 <nfw_weights@plt>
add    $0x20,%rsp
test   %r13,%r13
jle    1470 <solver_nfw+0x350>
cmpq   $0x7,0x88(%rsp)
jae    14a0 <solver_nfw+0x380>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
mov    0xe0(%rsp),%rdx
movsd  0x8(%rsp),%xmm4
movapd 0x10(%rsp),%xmm5
movapd 0x60(%rsp),%xmm6
movapd 0x70(%rsp),%xmm7
jmp    1510 <solver_nfw+0x3f0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorpd  %xmm0,%xmm0
mov    0xe0(%rsp),%rdx
movsd  0x8(%rsp),%xmm4
movapd 0x10(%rsp),%xmm5
movapd 0x60(%rsp),%xmm6
movapd 0x70(%rsp),%xmm7
jmp    152e <solver_nfw+0x40e>
nopl   0x0(%rax)
xorpd  %xmm0,%xmm0
xor    %eax,%eax
mov    0xe0(%rsp),%rdx
movsd  0x8(%rsp),%xmm4
movapd 0x10(%rsp),%xmm5
movapd 0x60(%rsp),%xmm6
movapd 0x70(%rsp),%xmm7
cs nopw 0x0(%rax,%rax,1)
addsd  (%r14,%rax,8),%xmm0
addsd  0x8(%r14,%rax,8),%xmm0
addsd  0x10(%r14,%rax,8),%xmm0
addsd  0x18(%r14,%rax,8),%xmm0
addsd  0x20(%r14,%rax,8),%xmm0
addsd  0x28(%r14,%rax,8),%xmm0
addsd  0x30(%r14,%rax,8),%xmm0
addsd  0x38(%r14,%rax,8),%xmm0
add    $0x8,%rax
cmp    %rax,%r12
jne    14d0 <solver_nfw+0x3b0>
test   $0x7,%r13b
je     152e <solver_nfw+0x40e>
lea    (%r14,%rax,8),%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
addsd  (%rax,%rcx,8),%xmm0
add    $0x1,%rcx
cmp    %rcx,%rbp
jne    1520 <solver_nfw+0x400>
movsd  (%rdx),%xmm1
movsd  0x10(%r15),%xmm2
mulsd  %xmm1,%xmm2
addsd  0x18(%r15),%xmm2
movsd  0x8(%r15),%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  (%r15),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
xorpd  %xmm1,%xmm1
maxsd  %xmm2,%xmm1
mulsd  %xmm6,%xmm1
addsd  %xmm0,%xmm1
movapd %xmm7,%xmm0
cmpltsd 0xaa2(%rip),%xmm0
movapd %xmm0,%xmm2
movsd  0xa9e(%rip),%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm7,%xmm0
orpd   %xmm2,%xmm0
movapd %xmm0,%xmm2
subsd  %xmm5,%xmm2
subsd  %xmm6,%xmm1
mulsd  %xmm2,%xmm1
ucomisd 0xa82(%rip),%xmm1
ja     15bc <solver_nfw+0x49c>
movapd %xmm6,%xmm4
movsd  0xa5c(%rip),%xmm2
ja     11e0 <solver_nfw+0xc0>
movapd %xmm0,%xmm2
jmp    11e0 <solver_nfw+0xc0>
movsd  0xa2d(%rip),%xmm5
jmp    15f1 <solver_nfw+0x4d1>
addsd  %xmm2,%xmm5
mulsd  0xa2f(%rip),%xmm5
mov    0x90(%rsp),%rbp
mov    0xe0(%rsp),%rax
movsd  %xmm5,0x0(%rbp)
movapd %xmm5,%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
mov    %r13,%rdi
mov    0x38(%rsp),%rsi
mov    0x40(%rsp),%rdx
mov    0x48(%rsp),%rcx
mov    0x50(%rsp),%r8
mov    0xd0(%rsp),%r9
movsd  0x58(%rsp),%xmm3
push   $0x0
push   0xf0(%rsp)
push   %rax
push   %r14
mov    %rax,%rbx
call   1040 <nfw_weights@plt>
add    $0x20,%rsp
movsd  0x9d5(%rip),%xmm0
ucomisd 0x0(%rbp),%xmm0
jbe    166b <solver_nfw+0x54b>
movabs $0xbff0000000000000,%rax
mov    %rax,0x0(%rbp)
mov    %rax,(%rbx)
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @solver_nfw(double %0, double %1, i64 %2, double* %3, double* %4, double* %5, double* %6, double* nocapture %7, double* %8, double* %9, double* %10, double* %11, double %12, double* nocapture %13, double %14) {
%16 = tail call i32 @fabs(double 1.999500e+03)
%17 = sitofp i32 %16 to double
%18 = fmul double %12, 2.000000e+00
%19 = fcmp olt double %18, %17
br i1 %19, label %20, label %200
20: ; preds = %15
%21 = icmp sgt i64 %2, 0
%22 = getelementptr inbounds double, double* %13, i64 3
%23 = getelementptr inbounds double, double* %13, i64 2
%24 = getelementptr inbounds double, double* %13, i64 1
%25 = add i64 %2, -1
%26 = and i64 %2, 7
%27 = icmp ult i64 %25, 7
%28 = and i64 %2, -8
%29 = icmp eq i64 %26, 0
%30 = and i64 %2, 7
%31 = icmp ult i64 %25, 7
%32 = and i64 %2, -8
%33 = icmp eq i64 %30, 0
br label %34
34: ; preds = %20, %168
%35 = phi double [ -1.000000e+00, %20 ], [ %192, %168 ]
%36 = phi double [ 5.000000e-01, %20 ], [ %191, %168 ]
%37 = phi double [ 2.000000e+03, %20 ], [ %190, %168 ]
%38 = fadd double %37, %36
%39 = fmul double %38, 5.000000e-01
%40 = fcmp olt double %35, 0.000000e+00
br i1 %40, label %41, label %112
41: ; preds = %34
%42 = tail call i32 @nfw_weights(double %36, double %0, double %1, i64 %2, double* %3, double* %4, double* %5, double* %6, double* %8, double* %9, double* %10, double* %11, double %14, i32 1)
br i1 %21, label %43, label %96
43: ; preds = %41
br i1 %27, label %82, label %44
44: ; preds = %43, %44
%45 = phi i64 [ %79, %44 ], [ 0, %43 ]
%46 = phi double [ %78, %44 ], [ 0.000000e+00, %43 ]
%47 = phi i64 [ %80, %44 ], [ 0, %43 ]
%48 = getelementptr inbounds double, double* %9, i64 %45
%49 = load double, double* %48
%50 = fadd double %46, %49
%51 = or i64 %45, 1
%52 = getelementptr inbounds double, double* %9, i64 %51
%53 = load double, double* %52
%54 = fadd double %50, %53
%55 = or i64 %45, 2
%56 = getelementptr inbounds double, double* %9, i64 %55
%57 = load double, double* %56
%58 = fadd double %54, %57
%59 = or i64 %45, 3
%60 = getelementptr inbounds double, double* %9, i64 %59
%61 = load double, double* %60
%62 = fadd double %58, %61
%63 = or i64 %45, 4
%64 = getelementptr inbounds double, double* %9, i64 %63
%65 = load double, double* %64
%66 = fadd double %62, %65
%67 = or i64 %45, 5
%68 = getelementptr inbounds double, double* %9, i64 %67
%69 = load double, double* %68
%70 = fadd double %66, %69
%71 = or i64 %45, 6
%72 = getelementptr inbounds double, double* %9, i64 %71
%73 = load double, double* %72
%74 = fadd double %70, %73
%75 = or i64 %45, 7
%76 = getelementptr inbounds double, double* %9, i64 %75
%77 = load double, double* %76
%78 = fadd double %74, %77
%79 = add nuw nsw i64 %45, 8
%80 = add i64 %47, 8
%81 = icmp eq i64 %80, %28
br i1 %81, label %82, label %44
82: ; preds = %44, %43
%83 = phi double [ undef, %43 ], [ %78, %44 ]
%84 = phi i64 [ 0, %43 ], [ %79, %44 ]
%85 = phi double [ 0.000000e+00, %43 ], [ %78, %44 ]
br i1 %29, label %96, label %86
86: ; preds = %82, %86
%87 = phi i64 [ %93, %86 ], [ %84, %82 ]
%88 = phi double [ %92, %86 ], [ %85, %82 ]
%89 = phi i64 [ %94, %86 ], [ 0, %82 ]
%90 = getelementptr inbounds double, double* %9, i64 %87
%91 = load double, double* %90
%92 = fadd double %88, %91
%93 = add nuw nsw i64 %87, 1
%94 = add i64 %89, 1
%95 = icmp eq i64 %94, %26
br i1 %95, label %96, label %86
96: ; preds = %82, %86, %41
%97 = phi double [ 0.000000e+00, %41 ], [ %83, %82 ], [ %92, %86 ]
%98 = load double, double* %22
%99 = load double, double* %23
%100 = load double, double* %10
%101 = tail call double @llvm.fmuladd.f64(double %99, double %100, double %98)
%102 = load double, double* %24
%103 = fmul double %100, %102
%104 = tail call double @llvm.fmuladd.f64(double %103, double %100, double %101)
%105 = load double, double* %13
%106 = fmul double %100, %105
%107 = fmul double %100, %106
%108 = tail call double @llvm.fmuladd.f64(double %107, double %100, double %104)
%109 = fcmp olt double %108, 0.000000e+00
%110 = select i1 %109, double 0.000000e+00, double %108
%111 = tail call double @llvm.fmuladd.f64(double %36, double %110, double %97)
br label %112
112: ; preds = %96, %34
%113 = phi double [ %111, %96 ], [ %35, %34 ]
%114 = tail call i32 @nfw_weights(double %39, double %0, double %1, i64 %2, double* %3, double* %4, double* %5, double* %6, double* %8, double* %9, double* %10, double* %11, double %14, i32 1)
br i1 %21, label %115, label %168
115: ; preds = %112
br i1 %31, label %154, label %116
116: ; preds = %115, %116
%117 = phi i64 [ %151, %116 ], [ 0, %115 ]
%118 = phi double [ %150, %116 ], [ 0.000000e+00, %115 ]
%119 = phi i64 [ %152, %116 ], [ 0, %115 ]
%120 = getelementptr inbounds double, double* %9, i64 %117
%121 = load double, double* %120
%122 = fadd double %118, %121
%123 = or i64 %117, 1
%124 = getelementptr inbounds double, double* %9, i64 %123
%125 = load double, double* %124
%126 = fadd double %122, %125
%127 = or i64 %117, 2
%128 = getelementptr inbounds double, double* %9, i64 %127
%129 = load double, double* %128
%130 = fadd double %126, %129
%131 = or i64 %117, 3
%132 = getelementptr inbounds double, double* %9, i64 %131
%133 = load double, double* %132
%134 = fadd double %130, %133
%135 = or i64 %117, 4
%136 = getelementptr inbounds double, double* %9, i64 %135
%137 = load double, double* %136
%138 = fadd double %134, %137
%139 = or i64 %117, 5
%140 = getelementptr inbounds double, double* %9, i64 %139
%141 = load double, double* %140
%142 = fadd double %138, %141
%143 = or i64 %117, 6
%144 = getelementptr inbounds double, double* %9, i64 %143
%145 = load double, double* %144
%146 = fadd double %142, %145
%147 = or i64 %117, 7
%148 = getelementptr inbounds double, double* %9, i64 %147
%149 = load double, double* %148
%150 = fadd double %146, %149
%151 = add nuw nsw i64 %117, 8
%152 = add i64 %119, 8
%153 = icmp eq i64 %152, %32
br i1 %153, label %154, label %116
154: ; preds = %116, %115
%155 = phi double [ undef, %115 ], [ %150, %116 ]
%156 = phi i64 [ 0, %115 ], [ %151, %116 ]
%157 = phi double [ 0.000000e+00, %115 ], [ %150, %116 ]
br i1 %33, label %168, label %158
158: ; preds = %154, %158
%159 = phi i64 [ %165, %158 ], [ %156, %154 ]
%160 = phi double [ %164, %158 ], [ %157, %154 ]
%161 = phi i64 [ %166, %158 ], [ 0, %154 ]
%162 = getelementptr inbounds double, double* %9, i64 %159
%163 = load double, double* %162
%164 = fadd double %160, %163
%165 = add nuw nsw i64 %159, 1
%166 = add i64 %161, 1
%167 = icmp eq i64 %166, %30
br i1 %167, label %168, label %158
168: ; preds = %154, %158, %112
%169 = phi double [ 0.000000e+00, %112 ], [ %155, %154 ], [ %164, %158 ]
%170 = load double, double* %22
%171 = load double, double* %23
%172 = load double, double* %10
%173 = tail call double @llvm.fmuladd.f64(double %171, double %172, double %170)
%174 = load double, double* %24
%175 = fmul double %172, %174
%176 = tail call double @llvm.fmuladd.f64(double %175, double %172, double %173)
%177 = load double, double* %13
%178 = fmul double %172, %177
%179 = fmul double %172, %178
%180 = tail call double @llvm.fmuladd.f64(double %179, double %172, double %176)
%181 = fcmp olt double %180, 0.000000e+00
%182 = select i1 %181, double 0.000000e+00, double %180
%183 = tail call double @llvm.fmuladd.f64(double %39, double %182, double %169)
%184 = fcmp olt double %113, 1.000000e+00
%185 = select i1 %184, double 9.000000e-01, double %113
%186 = fsub double %185, %36
%187 = fsub double %183, %39
%188 = fmul double %186, %187
%189 = fcmp ogt double %188, 0.000000e+00
%190 = select i1 %189, double %37, double %39
%191 = select i1 %189, double %39, double %36
%192 = select i1 %189, double -1.000000e+00, double %185
%193 = fsub double %190, %191
%194 = tail call i32 @fabs(double %193)
%195 = sitofp i32 %194 to double
%196 = fcmp olt double %18, %195
br i1 %196, label %34, label %197
197: ; preds = %168
%198 = fadd double %190, %191
%199 = fmul double %198, 5.000000e-01
br label %200
200: ; preds = %197, %15
%201 = phi double [ %199, %197 ], [ 1.000250e+03, %15 ]
store double %201, double* %7
%202 = tail call i32 @nfw_weights(double %201, double %0, double %1, i64 %2, double* %3, double* %4, double* %5, double* %6, double* %8, double* %9, double* %10, double* %11, double %14, i32 0)
%203 = load double, double* %7
%204 = fcmp olt double %203, 1.000000e+00
br i1 %204, label %205, label %206
205: ; preds = %200
store double -1.000000e+00, double* %7
store double -1.000000e+00, double* %10
br label %206
206: ; preds = %205, %200
ret i32 0
}