void conservativeHeadRichardsJLeverettAni(
    const int nSimplex, const int nPointsPerSimplex, const int nSpace,
    const int *materialTypes, const double rho, const double beta,
    const double *gravity, const double *phi, const double *psiD,
    const double *ns, const double *nk, const double *S_wirr,
    const double *S_nwr, const double *kr0x, const double *kr0y,
    const double *kr0z, double *u, double *mass, double *dmass, double *f,
    double *df, double *a, double *da) {
  int i, j, k, I, matID;
  const int nSpace2 = nSpace * nSpace;
  register double psiC, pcBar, Se, dSe, Sw, dSw, kr, dkr, rho2 = rho * rho,
                                                          rhom, drhom;
  const double reg_diff = 1.0e-2;
  for (i = 0; i < nSimplex; i++) {
    matID = materialTypes[i];
    for (j = 0; j < nPointsPerSimplex; j++) {
      k = i * nPointsPerSimplex + j;
      psiC = -u[k];
      if (psiC >= psiD[matID]) {
        pcBar = psiC / psiD[matID];
        Se = pow(pcBar, -ns[matID]);
        Sw = Se * (1.0 - S_wirr[matID] - S_nwr[matID]) + S_wirr[matID];
        dSe = ns[matID] * Se / (pcBar * psiD[matID]);
        dSw = (1.0 - S_wirr[matID] - S_nwr[matID]) * dSe;
        kr = pow(Se, (2.0 + 3.0 * ns[matID]) / ns[matID]);
        dkr = ((2.0 + 3.0 * ns[matID]) / ns[matID] *
               pow(Se, 2.0 / ns[matID] * (1.0 + ns[matID])) * dSe);
        kr = pow(Se, nk[matID]);
        dkr = nk[matID] * pow(Se, nk[matID] - 1) * dSe;
      } else {
        Se = 1.0;
        Sw = 1.0 - S_nwr[matID];
        dSw = 0.0;
        kr = 1.0;
        dkr = 0.0;
      }
      rhom = rho * exp(beta * u[k]);
      drhom = beta * rhom;
      mass[k] = rhom * Sw * phi[matID];
      dmass[k] = rhom * dSw * phi[matID] + drhom * Sw * phi[matID];
      I = 0;
      f[k * nSpace + I] = rho2 * kr0x[matID] * kr * gravity[I];
      df[k * nSpace + I] = rho2 * kr0x[matID] * dkr * gravity[I];
      a[k * nSpace2 + I * nSpace + I] = rho * kr0x[matID] * kr;
      da[k * nSpace2 + I * nSpace + I] = rho * kr0x[matID] * dkr;
      if (nSpace > 1) {
        I = 1;
        f[k * nSpace + I] = rho2 * kr0y[matID] * kr * gravity[I];
        df[k * nSpace + I] = rho2 * kr0y[matID] * dkr * gravity[I];
        a[k * nSpace2 + I * nSpace + I] = rho * kr0y[matID] * kr;
        da[k * nSpace2 + I * nSpace + I] = rho * kr0y[matID] * dkr;
        if (nSpace > 2) {
          I = 2;
          f[k * nSpace + I] = rho2 * kr0z[matID] * kr * gravity[I];
          df[k * nSpace + I] = rho2 * kr0z[matID] * dkr * gravity[I];
          a[k * nSpace2 + I * nSpace + I] = rho * kr0z[matID] * kr;
          da[k * nSpace2 + I * nSpace + I] = rho * kr0z[matID] * dkr;
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<conservativeHeadRichardsJLeverettAni>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    0x80(%rbp),%rax
mov    0x78(%rbp),%rax
mov    0x70(%rbp),%rax
mov    0x68(%rbp),%rax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xe53(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    18a2 <conservativeHeadRichardsJLeverettAni+0x782>
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    188f <conservativeHeadRichardsJLeverettAni+0x76f>
mov    -0x3c(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    0x50(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jb     1465 <conservativeHeadRichardsJLeverettAni+0x345>
movsd  -0x58(%rbp),%xmm0
mov    0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  0xd72(%rip),%xmm2
subsd  (%rax,%rcx,8),%xmm2
mov    0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
mov    0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mov    0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  0xd09(%rip),%xmm0
subsd  (%rax,%rcx,8),%xmm0
mov    0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xce3(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xccf(%rip),%xmm2
addsd  %xmm2,%xmm1
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xca4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc90(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  0xc62(%rip),%xmm1
divsd  (%rax,%rcx,8),%xmm1
mov    0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  0xc45(%rip),%xmm2
addsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mov    0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x88(%rbp)
ff
mov    0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mov    0x20(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xbcd(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    14af <conservativeHeadRichardsJLeverettAni+0x38f>
movsd  0xb9b(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  0xb86(%rip),%xmm0
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xb6c(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mov    0x50(%rbp),%rax
movslq -0x44(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x78(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x58(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x80(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0x78(%rbp),%xmm1
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x60(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x48(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movslq -0x48(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x68(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movslq -0x48(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x70(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mov    0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    0x78(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0x50(%rbp),%ecx
mov    -0x48(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mov    0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    0x80(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0x50(%rbp),%ecx
mov    -0x48(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
cmpl   $0x1,-0xc(%rbp)
jle    187c <conservativeHeadRichardsJLeverettAni+0x75c>
movl   $0x1,-0x48(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movslq -0x48(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x68(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movslq -0x48(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x70(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mov    0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    0x78(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0x50(%rbp),%ecx
mov    -0x48(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mov    0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    0x80(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0x50(%rbp),%ecx
mov    -0x48(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
cmpl   $0x2,-0xc(%rbp)
jle    1877 <conservativeHeadRichardsJLeverettAni+0x757>
movl   $0x2,-0x48(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movslq -0x48(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x68(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    -0x30(%rbp),%rax
movslq -0x48(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x70(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mov    0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    0x78(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0x50(%rbp),%ecx
mov    -0x48(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mov    0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
mov    0x80(%rbp),%rax
mov    -0x44(%rbp),%ecx
imul   -0x50(%rbp),%ecx
mov    -0x48(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    187c <conservativeHeadRichardsJLeverettAni+0x75c>
jmp    1881 <conservativeHeadRichardsJLeverettAni+0x761>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11dd <conservativeHeadRichardsJLeverettAni+0xbd>
jmp    1894 <conservativeHeadRichardsJLeverettAni+0x774>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11bc <conservativeHeadRichardsJLeverettAni+0x9c>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conservativeHeadRichardsJLeverettAni>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %r9,0xe0(%rsp)
mov    %r8,0x38(%rsp)
movsd  %xmm1,0x68(%rsp)
mov    %rcx,0x80(%rsp)
mov    %rdx,0x30(%rsp)
mov    %esi,0x14(%rsp)
test   %edi,%edi
jle    16cc <conservativeHeadRichardsJLeverettAni+0x5ac>
mov    0x190(%rsp),%rsi
mov    0x188(%rsp),%rbx
mov    0x180(%rsp),%rax
mov    %rax,0x50(%rsp)
mov    0x178(%rsp),%rax
mov    %rax,0x48(%rsp)
mov    0x170(%rsp),%rax
mov    %rax,0x18(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0xd0(%rsp)
mov    0x30(%rsp),%r8
movslq %r8d,%rdx
mov    0x14(%rsp),%ecx
movslq %ecx,%rbp
mov    %edi,%edi
mov    %rdi,0x90(%rsp)
mov    %ebp,%edi
mov    %edx,%eax
imul   %edx,%eax
mov    %eax,0x44(%rsp)
imul   %ecx,%eax
mov    %eax,0x40(%rsp)
add    $0x10,%rbx
mov    %rdx,%rax
imul   %rbp,%rax
shl    $0x3,%rbp
mov    %rbp,0x98(%rsp)
shl    $0x3,%rax
mov    %rax,0x88(%rsp)
add    $0x10,%rsi
shl    $0x3,%rdi
mov    %rdi,0xc0(%rsp)
movapd 0xdf5(%rip),%xmm2
mov    0x130(%rsp),%r12
lea    (%r8,%r8,1),%eax
add    $0x2,%eax
mov    %rax,0xa0(%rsp)
mov    %rdx,0xc8(%rsp)
lea    0x1(%rdx),%eax
mov    %rax,0xa8(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
movsd  %xmm0,0xd8(%rsp)
jmp    12a2 <conservativeHeadRichardsJLeverettAni+0x182>
xchg   %ax,%ax
mov    0x20(%rsp),%rcx
add    $0x1,%rcx
mov    0x28(%rsp),%rax
add    0x40(%rsp),%eax
mov    %rax,0x28(%rsp)
mov    0x98(%rsp),%rax
add    %rax,0x18(%rsp)
add    %rax,0x48(%rsp)
add    %rax,0x50(%rsp)
mov    0x88(%rsp),%rax
add    %rax,%rbx
add    %rax,%rsi
mov    %rcx,%rax
mov    %rcx,0x20(%rsp)
cmp    0x90(%rsp),%rcx
je     16cc <conservativeHeadRichardsJLeverettAni+0x5ac>
cmpl   $0x0,0x14(%rsp)
jle    1250 <conservativeHeadRichardsJLeverettAni+0x130>
mov    0x80(%rsp),%rax
mov    0x20(%rsp),%rcx
movslq (%rax,%rcx,4),%r15
xor    %r14d,%r14d
xor    %r13d,%r13d
mov    0x28(%rsp),%rbp
mov    %rsi,0xf0(%rsp)
mov    %rbx,0xe8(%rsp)
jmp    1306 <conservativeHeadRichardsJLeverettAni+0x1e6>
nopw   0x0(%rax,%rax,1)
add    0x44(%rsp),%ebp
add    $0x8,%r13
add    0xc8(%rsp),%r14
cmp    %r13,0xc0(%rsp)
movapd 0xd00(%rip),%xmm2
je     1250 <conservativeHeadRichardsJLeverettAni+0x130>
mov    0x18(%rsp),%rax
movsd  (%rax,%r13,1),%xmm0
movapd %xmm0,%xmm3
xorpd  %xmm2,%xmm3
movsd  (%r12,%r15,8),%xmm1
ucomisd %xmm1,%xmm3
jae    1370 <conservativeHeadRichardsJLeverettAni+0x250>
movsd  0xce3(%rip),%xmm1
movapd %xmm1,%xmm2
mov    0x150(%rsp),%rax
subsd  (%rax,%r15,8),%xmm2
movsd  %xmm2,0x60(%rsp)
xorpd  %xmm2,%xmm2
movsd  %xmm2,0x58(%rsp)
movsd  %xmm1,0x70(%rsp)
xorpd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
jmp    14bf <conservativeHeadRichardsJLeverettAni+0x39f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
divsd  %xmm1,%xmm3
movapd %xmm3,0x70(%rsp)
mov    %r12,%rbx
mov    0x138(%rsp),%r12
movsd  (%r12,%r15,8),%xmm1
xorpd  %xmm2,%xmm1
movapd %xmm3,%xmm0
mov    %rax,0x18(%rsp)
call   1040 <pow@plt>
mov    0x148(%rsp),%rax
movsd  (%rax,%r15,8),%xmm1
movsd  0xc5d(%rip),%xmm2
subsd  %xmm1,%xmm2
mov    0x150(%rsp),%rax
subsd  (%rax,%r15,8),%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,0x60(%rsp)
movsd  (%r12,%r15,8),%xmm3
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm3,%xmm1
movapd 0x70(%rsp),%xmm4
mulsd  (%rbx,%r15,8),%xmm4
divsd  %xmm4,%xmm1
movsd  %xmm1,0xb8(%rsp)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x58(%rsp)
movapd %xmm3,%xmm1
mulsd  0xbfe(%rip),%xmm1
movsd  0xbfe(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm3,%xmm1
call   1040 <pow@plt>
movsd  (%r12,%r15,8),%xmm1
mov    %rbx,%r12
movsd  0xbe0(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xbc4(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <pow@plt>
mov    0x140(%rsp),%rbx
movsd  (%rbx,%r15,8),%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <pow@plt>
movsd  %xmm0,0x70(%rsp)
movsd  (%rbx,%r15,8),%xmm1
movsd  %xmm1,0xb0(%rsp)
addsd  0xb97(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xb0(%rsp),%xmm0
mulsd  0xb8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    0x18(%rsp),%rax
movsd  (%rax,%r13,1),%xmm0
mulsd  0x68(%rsp),%xmm0
call   1030 <exp@plt>
movsd  0xd8(%rsp),%xmm3
mulsd  %xmm3,%xmm0
movapd %xmm0,%xmm1
movsd  0x60(%rsp),%xmm4
movapd %xmm4,%xmm2
mulsd  %xmm0,%xmm2
mov    0xe0(%rsp),%rax
mulsd  (%rax,%r15,8),%xmm2
mulsd  0x68(%rsp),%xmm1
mov    0x48(%rsp),%rcx
movsd  %xmm2,(%rcx,%r13,1)
mulsd  0x58(%rsp),%xmm0
movsd  (%rax,%r15,8),%xmm2
mulsd  %xmm4,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x50(%rsp),%rax
movsd  %xmm0,(%rax,%r13,1)
mov    0x158(%rsp),%rcx
movsd  (%rcx,%r15,8),%xmm0
movsd  0xd0(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x70(%rsp),%xmm2
mulsd  %xmm2,%xmm0
mov    0x38(%rsp),%rax
mulsd  (%rax),%xmm0
mov    0xe8(%rsp),%rbx
movsd  %xmm0,-0x10(%rbx,%r14,8)
movsd  (%rcx,%r15,8),%xmm0
mulsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm4
mulsd  %xmm4,%xmm0
mulsd  (%rax),%xmm0
mov    0xf0(%rsp),%rsi
movsd  %xmm0,-0x10(%rsi,%r14,8)
movsd  (%rcx,%r15,8),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
movslq %ebp,%rax
mov    0x198(%rsp),%rdx
movsd  %xmm0,(%rdx,%rax,8)
movsd  (%rcx,%r15,8),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm4,%xmm0
mov    0x1a0(%rsp),%rcx
movsd  %xmm0,(%rcx,%rax,8)
cmpl   $0x2,0x30(%rsp)
jl     12e0 <conservativeHeadRichardsJLeverettAni+0x1c0>
mov    0x160(%rsp),%rdi
movsd  (%rdi,%r15,8),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mov    0x38(%rsp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x8(%rbx,%r14,8)
movsd  (%rdi,%r15,8),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
mulsd  0x8(%rax),%xmm0
mov    0xa8(%rsp),%rax
lea    (%rax,%rbp,1),%eax
movsd  %xmm0,-0x8(%rsi,%r14,8)
movsd  (%rdi,%r15,8),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
cltq
movsd  %xmm0,(%rdx,%rax,8)
movsd  (%rdi,%r15,8),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,(%rcx,%rax,8)
cmpl   $0x2,0x30(%rsp)
je     12e0 <conservativeHeadRichardsJLeverettAni+0x1c0>
mov    0x168(%rsp),%rdi
movsd  (%rdi,%r15,8),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mov    0x38(%rsp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,(%rbx,%r14,8)
movsd  (%rdi,%r15,8),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,(%rsi,%r14,8)
movsd  (%rdi,%r15,8),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
mov    0xa0(%rsp),%rax
add    %ebp,%eax
cltq
movsd  %xmm0,(%rdx,%rax,8)
movsd  (%rdi,%r15,8),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,(%rcx,%rax,8)
jmp    12e0 <conservativeHeadRichardsJLeverettAni+0x1c0>
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @conservativeHeadRichardsJLeverettAni(i32 %0, i32 %1, i32 %2, i32* %3, double %4, double %5, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %16, double* %17, double* %18, double* %19, double* %20, double* %21, double* %22) {
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32*
%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 double*
%38 = alloca double*
%39 = alloca double*
%40 = alloca double*
%41 = alloca double*
%42 = alloca double*
%43 = alloca double*
%44 = alloca double*
%45 = alloca double*
%46 = alloca double*
%47 = alloca i32
%48 = alloca i32
%49 = alloca i32
%50 = alloca i32
%51 = alloca i32
%52 = alloca i32
%53 = alloca double
%54 = alloca double
%55 = alloca double
%56 = alloca double
%57 = alloca double
%58 = alloca double
%59 = alloca double
%60 = alloca double
%61 = alloca double
%62 = alloca double
%63 = alloca double
%64 = alloca double
store i32 %0, i32* %24
store i32 %1, i32* %25
store i32 %2, i32* %26
store i32* %3, i32** %27
store double %4, double* %28
store double %5, double* %29
store double* %6, double** %30
store double* %7, double** %31
store double* %8, double** %32
store double* %9, double** %33
store double* %10, double** %34
store double* %11, double** %35
store double* %12, double** %36
store double* %13, double** %37
store double* %14, double** %38
store double* %15, double** %39
store double* %16, double** %40
store double* %17, double** %41
store double* %18, double** %42
store double* %19, double** %43
store double* %20, double** %44
store double* %21, double** %45
store double* %22, double** %46
%65 = load i32, i32* %26
%66 = load i32, i32* %26
%67 = mul nsw i32 %65, %66
store i32 %67, i32* %52
%68 = load double, double* %28
%69 = load double, double* %28
%70 = fmul double %68, %69
store double %70, double* %61
store double 1.000000e-02, double* %64
store i32 0, i32* %47
br label %71
71: ; preds = %567, %23
%72 = load i32, i32* %47
%73 = load i32, i32* %24
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %570
75: ; preds = %71
%76 = load i32*, i32** %27
%77 = load i32, i32* %47
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %76, i64 %78
%80 = load i32, i32* %79
store i32 %80, i32* %51
store i32 0, i32* %48
br label %81
81: ; preds = %563, %75
%82 = load i32, i32* %48
%83 = load i32, i32* %25
%84 = icmp slt i32 %82, %83
br i1 %84, label %85, label %566
85: ; preds = %81
%86 = load i32, i32* %47
%87 = load i32, i32* %25
%88 = mul nsw i32 %86, %87
%89 = load i32, i32* %48
%90 = add nsw i32 %88, %89
store i32 %90, i32* %49
%91 = load double*, double** %40
%92 = load i32, i32* %49
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %91, i64 %93
%95 = load double, double* %94
%96 = fneg double %95
store double %96, double* %53
%97 = load double, double* %53
%98 = load double*, double** %32
%99 = load i32, i32* %51
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %98, i64 %100
%102 = load double, double* %101
%103 = fcmp oge double %97, %102
br i1 %103, label %104, label %235
104: ; preds = %85
%105 = load double, double* %53
%106 = load double*, double** %32
%107 = load i32, i32* %51
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
%110 = load double, double* %109
%111 = fdiv double %105, %110
store double %111, double* %54
%112 = load double, double* %54
%113 = load double*, double** %33
%114 = load i32, i32* %51
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double, double* %113, i64 %115
%117 = load double, double* %116
%118 = fneg double %117
%119 = call double @pow(double %112, double %118)
store double %119, double* %55
%120 = load double, double* %55
%121 = load double*, double** %35
%122 = load i32, i32* %51
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %121, i64 %123
%125 = load double, double* %124
%126 = fsub double 1.000000e+00, %125
%127 = load double*, double** %36
%128 = load i32, i32* %51
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %127, i64 %129
%131 = load double, double* %130
%132 = fsub double %126, %131
%133 = load double*, double** %35
%134 = load i32, i32* %51
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %133, i64 %135
%137 = load double, double* %136
%138 = call double @llvm.fmuladd.f64(double %120, double %132, double %137)
store double %138, double* %57
%139 = load double*, double** %33
%140 = load i32, i32* %51
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double, double* %139, i64 %141
%143 = load double, double* %142
%144 = load double, double* %55
%145 = fmul double %143, %144
%146 = load double, double* %54
%147 = load double*, double** %32
%148 = load i32, i32* %51
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds double, double* %147, i64 %149
%151 = load double, double* %150
%152 = fmul double %146, %151
%153 = fdiv double %145, %152
store double %153, double* %56
%154 = load double*, double** %35
%155 = load i32, i32* %51
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %154, i64 %156
%158 = load double, double* %157
%159 = fsub double 1.000000e+00, %158
%160 = load double*, double** %36
%161 = load i32, i32* %51
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds double, double* %160, i64 %162
%164 = load double, double* %163
%165 = fsub double %159, %164
%166 = load double, double* %56
%167 = fmul double %165, %166
store double %167, double* %58
%168 = load double, double* %55
%169 = load double*, double** %33
%170 = load i32, i32* %51
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds double, double* %169, i64 %171
%173 = load double, double* %172
%174 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %173, double 2.000000e+00)
%175 = load double*, double** %33
%176 = load i32, i32* %51
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double, double* %175, i64 %177
%179 = load double, double* %178
%180 = fdiv double %174, %179
%181 = call double @pow(double %168, double %180)
store double %181, double* %59
%182 = load double*, double** %33
%183 = load i32, i32* %51
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
%186 = load double, double* %185
%187 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %186, double 2.000000e+00)
%188 = load double*, double** %33
%189 = load i32, i32* %51
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds double, double* %188, i64 %190
%192 = load double, double* %191
%193 = fdiv double %187, %192
%194 = load double, double* %55
%195 = load double*, double** %33
%196 = load i32, i32* %51
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds double, double* %195, i64 %197
%199 = load double, double* %198
%200 = fdiv double 2.000000e+00, %199
%201 = load double*, double** %33
%202 = load i32, i32* %51
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds double, double* %201, i64 %203
%205 = load double, double* %204
%206 = fadd double 1.000000e+00, %205
%207 = fmul double %200, %206
%208 = call double @pow(double %194, double %207)
%209 = fmul double %193, %208
%210 = load double, double* %56
%211 = fmul double %209, %210
store double %211, double* %60
%212 = load double, double* %55
%213 = load double*, double** %34
%214 = load i32, i32* %51
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds double, double* %213, i64 %215
%217 = load double, double* %216
%218 = call double @pow(double %212, double %217)
store double %218, double* %59
%219 = load double*, double** %34
%220 = load i32, i32* %51
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds double, double* %219, i64 %221
%223 = load double, double* %222
%224 = load double, double* %55
%225 = load double*, double** %34
%226 = load i32, i32* %51
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double, double* %225, i64 %227
%229 = load double, double* %228
%230 = fsub double %229, 1.000000e+00
%231 = call double @pow(double %224, double %230)
%232 = fmul double %223, %231
%233 = load double, double* %56
%234 = fmul double %232, %233
store double %234, double* %60
br label %242
235: ; preds = %85
store double 1.000000e+00, double* %55
%236 = load double*, double** %36
%237 = load i32, i32* %51
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds double, double* %236, i64 %238
%240 = load double, double* %239
%241 = fsub double 1.000000e+00, %240
store double %241, double* %57
store double 0.000000e+00, double* %58
store double 1.000000e+00, double* %59
store double 0.000000e+00, double* %60
br label %242
242: ; preds = %235, %104
%243 = load double, double* %28
%244 = load double, double* %29
%245 = load double*, double** %40
%246 = load i32, i32* %49
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds double, double* %245, i64 %247
%249 = load double, double* %248
%250 = fmul double %244, %249
%251 = call double @exp(double %250)
%252 = fmul double %243, %251
store double %252, double* %62
%253 = load double, double* %29
%254 = load double, double* %62
%255 = fmul double %253, %254
store double %255, double* %63
%256 = load double, double* %62
%257 = load double, double* %57
%258 = fmul double %256, %257
%259 = load double*, double** %31
%260 = load i32, i32* %51
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds double, double* %259, i64 %261
%263 = load double, double* %262
%264 = fmul double %258, %263
%265 = load double*, double** %41
%266 = load i32, i32* %49
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds double, double* %265, i64 %267
store double %264, double* %268
%269 = load double, double* %62
%270 = load double, double* %58
%271 = fmul double %269, %270
%272 = load double*, double** %31
%273 = load i32, i32* %51
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds double, double* %272, i64 %274
%276 = load double, double* %275
%277 = load double, double* %63
%278 = load double, double* %57
%279 = fmul double %277, %278
%280 = load double*, double** %31
%281 = load i32, i32* %51
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds double, double* %280, i64 %282
%284 = load double, double* %283
%285 = fmul double %279, %284
%286 = call double @llvm.fmuladd.f64(double %271, double %276, double %285)
%287 = load double*, double** %42
%288 = load i32, i32* %49
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds double, double* %287, i64 %289
store double %286, double* %290
store i32 0, i32* %50
%291 = load double, double* %61
%292 = load double*, double** %37
%293 = load i32, i32* %51
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds double, double* %292, i64 %294
%296 = load double, double* %295
%297 = fmul double %291, %296
%298 = load double, double* %59
%299 = fmul double %297, %298
%300 = load double*, double** %30
%301 = load i32, i32* %50
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds double, double* %300, i64 %302
%304 = load double, double* %303
%305 = fmul double %299, %304
%306 = load double*, double** %43
%307 = load i32, i32* %49
%308 = load i32, i32* %26
%309 = mul nsw i32 %307, %308
%310 = load i32, i32* %50
%311 = add nsw i32 %309, %310
%312 = sext i32 %311 to i64
%313 = getelementptr inbounds double, double* %306, i64 %312
store double %305, double* %313
%314 = load double, double* %61
%315 = load double*, double** %37
%316 = load i32, i32* %51
%317 = sext i32 %316 to i64
%318 = getelementptr inbounds double, double* %315, i64 %317
%319 = load double, double* %318
%320 = fmul double %314, %319
%321 = load double, double* %60
%322 = fmul double %320, %321
%323 = load double*, double** %30
%324 = load i32, i32* %50
%325 = sext i32 %324 to i64
%326 = getelementptr inbounds double, double* %323, i64 %325
%327 = load double, double* %326
%328 = fmul double %322, %327
%329 = load double*, double** %44
%330 = load i32, i32* %49
%331 = load i32, i32* %26
%332 = mul nsw i32 %330, %331
%333 = load i32, i32* %50
%334 = add nsw i32 %332, %333
%335 = sext i32 %334 to i64
%336 = getelementptr inbounds double, double* %329, i64 %335
store double %328, double* %336
%337 = load double, double* %28
%338 = load double*, double** %37
%339 = load i32, i32* %51
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds double, double* %338, i64 %340
%342 = load double, double* %341
%343 = fmul double %337, %342
%344 = load double, double* %59
%345 = fmul double %343, %344
%346 = load double*, double** %45
%347 = load i32, i32* %49
%348 = load i32, i32* %52
%349 = mul nsw i32 %347, %348
%350 = load i32, i32* %50
%351 = load i32, i32* %26
%352 = mul nsw i32 %350, %351
%353 = add nsw i32 %349, %352
%354 = load i32, i32* %50
%355 = add nsw i32 %353, %354
%356 = sext i32 %355 to i64
%357 = getelementptr inbounds double, double* %346, i64 %356
store double %345, double* %357
%358 = load double, double* %28
%359 = load double*, double** %37
%360 = load i32, i32* %51
%361 = sext i32 %360 to i64
%362 = getelementptr inbounds double, double* %359, i64 %361
%363 = load double, double* %362
%364 = fmul double %358, %363
%365 = load double, double* %60
%366 = fmul double %364, %365
%367 = load double*, double** %46
%368 = load i32, i32* %49
%369 = load i32, i32* %52
%370 = mul nsw i32 %368, %369
%371 = load i32, i32* %50
%372 = load i32, i32* %26
%373 = mul nsw i32 %371, %372
%374 = add nsw i32 %370, %373
%375 = load i32, i32* %50
%376 = add nsw i32 %374, %375
%377 = sext i32 %376 to i64
%378 = getelementptr inbounds double, double* %367, i64 %377
store double %366, double* %378
%379 = load i32, i32* %26
%380 = icmp sgt i32 %379, 1
br i1 %380, label %381, label %562
381: ; preds = %242
store i32 1, i32* %50
%382 = load double, double* %61
%383 = load double*, double** %38
%384 = load i32, i32* %51
%385 = sext i32 %384 to i64
%386 = getelementptr inbounds double, double* %383, i64 %385
%387 = load double, double* %386
%388 = fmul double %382, %387
%389 = load double, double* %59
%390 = fmul double %388, %389
%391 = load double*, double** %30
%392 = load i32, i32* %50
%393 = sext i32 %392 to i64
%394 = getelementptr inbounds double, double* %391, i64 %393
%395 = load double, double* %394
%396 = fmul double %390, %395
%397 = load double*, double** %43
%398 = load i32, i32* %49
%399 = load i32, i32* %26
%400 = mul nsw i32 %398, %399
%401 = load i32, i32* %50
%402 = add nsw i32 %400, %401
%403 = sext i32 %402 to i64
%404 = getelementptr inbounds double, double* %397, i64 %403
store double %396, double* %404
%405 = load double, double* %61
%406 = load double*, double** %38
%407 = load i32, i32* %51
%408 = sext i32 %407 to i64
%409 = getelementptr inbounds double, double* %406, i64 %408
%410 = load double, double* %409
%411 = fmul double %405, %410
%412 = load double, double* %60
%413 = fmul double %411, %412
%414 = load double*, double** %30
%415 = load i32, i32* %50
%416 = sext i32 %415 to i64
%417 = getelementptr inbounds double, double* %414, i64 %416
%418 = load double, double* %417
%419 = fmul double %413, %418
%420 = load double*, double** %44
%421 = load i32, i32* %49
%422 = load i32, i32* %26
%423 = mul nsw i32 %421, %422
%424 = load i32, i32* %50
%425 = add nsw i32 %423, %424
%426 = sext i32 %425 to i64
%427 = getelementptr inbounds double, double* %420, i64 %426
store double %419, double* %427
%428 = load double, double* %28
%429 = load double*, double** %38
%430 = load i32, i32* %51
%431 = sext i32 %430 to i64
%432 = getelementptr inbounds double, double* %429, i64 %431
%433 = load double, double* %432
%434 = fmul double %428, %433
%435 = load double, double* %59
%436 = fmul double %434, %435
%437 = load double*, double** %45
%438 = load i32, i32* %49
%439 = load i32, i32* %52
%440 = mul nsw i32 %438, %439
%441 = load i32, i32* %50
%442 = load i32, i32* %26
%443 = mul nsw i32 %441, %442
%444 = add nsw i32 %440, %443
%445 = load i32, i32* %50
%446 = add nsw i32 %444, %445
%447 = sext i32 %446 to i64
%448 = getelementptr inbounds double, double* %437, i64 %447
store double %436, double* %448
%449 = load double, double* %28
%450 = load double*, double** %38
%451 = load i32, i32* %51
%452 = sext i32 %451 to i64
%453 = getelementptr inbounds double, double* %450, i64 %452
%454 = load double, double* %453
%455 = fmul double %449, %454
%456 = load double, double* %60
%457 = fmul double %455, %456
%458 = load double*, double** %46
%459 = load i32, i32* %49
%460 = load i32, i32* %52
%461 = mul nsw i32 %459, %460
%462 = load i32, i32* %50
%463 = load i32, i32* %26
%464 = mul nsw i32 %462, %463
%465 = add nsw i32 %461, %464
%466 = load i32, i32* %50
%467 = add nsw i32 %465, %466
%468 = sext i32 %467 to i64
%469 = getelementptr inbounds double, double* %458, i64 %468
store double %457, double* %469
%470 = load i32, i32* %26
%471 = icmp sgt i32 %470, 2
br i1 %471, label %472, label %561
472: ; preds = %381
store i32 2, i32* %50
%473 = load double, double* %61
%474 = load double*, double** %39
%475 = load i32, i32* %51
%476 = sext i32 %475 to i64
%477 = getelementptr inbounds double, double* %474, i64 %476
%478 = load double, double* %477
%479 = fmul double %473, %478
%480 = load double, double* %59
%481 = fmul double %479, %480
%482 = load double*, double** %30
%483 = load i32, i32* %50
%484 = sext i32 %483 to i64
%485 = getelementptr inbounds double, double* %482, i64 %484
%486 = load double, double* %485
%487 = fmul double %481, %486
%488 = load double*, double** %43
%489 = load i32, i32* %49
%490 = load i32, i32* %26
%491 = mul nsw i32 %489, %490
%492 = load i32, i32* %50
%493 = add nsw i32 %491, %492
%494 = sext i32 %493 to i64
%495 = getelementptr inbounds double, double* %488, i64 %494
store double %487, double* %495
%496 = load double, double* %61
%497 = load double*, double** %39
%498 = load i32, i32* %51
%499 = sext i32 %498 to i64
%500 = getelementptr inbounds double, double* %497, i64 %499
%501 = load double, double* %500
%502 = fmul double %496, %501
%503 = load double, double* %60
%504 = fmul double %502, %503
%505 = load double*, double** %30
%506 = load i32, i32* %50
%507 = sext i32 %506 to i64
%508 = getelementptr inbounds double, double* %505, i64 %507
%509 = load double, double* %508
%510 = fmul double %504, %509
%511 = load double*, double** %44
%512 = load i32, i32* %49
%513 = load i32, i32* %26
%514 = mul nsw i32 %512, %513
%515 = load i32, i32* %50
%516 = add nsw i32 %514, %515
%517 = sext i32 %516 to i64
%518 = getelementptr inbounds double, double* %511, i64 %517
store double %510, double* %518
%519 = load double, double* %28
%520 = load double*, double** %39
%521 = load i32, i32* %51
%522 = sext i32 %521 to i64
%523 = getelementptr inbounds double, double* %520, i64 %522
%524 = load double, double* %523
%525 = fmul double %519, %524
%526 = load double, double* %59
%527 = fmul double %525, %526
%528 = load double*, double** %45
%529 = load i32, i32* %49
%530 = load i32, i32* %52
%531 = mul nsw i32 %529, %530
%532 = load i32, i32* %50
%533 = load i32, i32* %26
%534 = mul nsw i32 %532, %533
%535 = add nsw i32 %531, %534
%536 = load i32, i32* %50
%537 = add nsw i32 %535, %536
%538 = sext i32 %537 to i64
%539 = getelementptr inbounds double, double* %528, i64 %538
store double %527, double* %539
%540 = load double, double* %28
%541 = load double*, double** %39
%542 = load i32, i32* %51
%543 = sext i32 %542 to i64
%544 = getelementptr inbounds double, double* %541, i64 %543
%545 = load double, double* %544
%546 = fmul double %540, %545
%547 = load double, double* %60
%548 = fmul double %546, %547
%549 = load double*, double** %46
%550 = load i32, i32* %49
%551 = load i32, i32* %52
%552 = mul nsw i32 %550, %551
%553 = load i32, i32* %50
%554 = load i32, i32* %26
%555 = mul nsw i32 %553, %554
%556 = add nsw i32 %552, %555
%557 = load i32, i32* %50
%558 = add nsw i32 %556, %557
%559 = sext i32 %558 to i64
%560 = getelementptr inbounds double, double* %549, i64 %559
store double %548, double* %560
br label %561
561: ; preds = %472, %381
br label %562
562: ; preds = %561, %242
br label %563
563: ; preds = %562
%564 = load i32, i32* %48
%565 = add nsw i32 %564, 1
store i32 %565, i32* %48
br label %81
566: ; preds = %81
br label %567
567: ; preds = %566
%568 = load i32, i32* %47
%569 = add nsw i32 %568, 1
store i32 %569, i32* %47
br label %71
570: ; preds = %71
ret void
}

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