void conservativeHeadRichardsMualemVanGenuchten_sd_het(
    const int nSimplex, const int nPointsPerSimplex, const int nSpace,
    double pc_eps, const int *rowptr, const int *colind,
    const int *materialTypes, const double rho, const double beta,
    const double *gravity, const double *alpha, const double *n,
    const double *thetaR, const double *thetaSR, const double *KWs, double *u,
    double *mass, double *dmass, double *f, double *df, double *a, double *da,
    double *vol_frac) {
  int i, j, k, I, matID, ii;
  const int nSpace2 = nSpace * nSpace;
  register double psiC, pcBarStar, pcBar, pcBar_n, pcBar_nM1, pcBar_nM2,
      onePlus_pcBar_n, sBar, sqrt_sBar, DsBar_DpsiC, thetaW, DthetaW_DpsiC,
      vBar, vBar2, DvBar_DpsiC, KWr, DKWr_DpsiC, rho2 = rho * rho, thetaS, rhom,
                                                 drhom, m, betauStar;
  const int nnz = rowptr[nSpace];
  for (i = 0; i < nSimplex; i++) {
    matID = materialTypes[i];
    for (j = 0; j < nPointsPerSimplex; j++) {
      k = i * nPointsPerSimplex + j;
      psiC = -u[k];
      m = 1.0 - 1.0 / n[matID];
      thetaS = thetaR[matID] + thetaSR[matID];
      if (psiC > 0.0) {
        pcBar = alpha[matID] * psiC;
        pcBarStar = fmax(pcBar, pc_eps);
        pcBar_nM2 = pow(pcBarStar, n[matID] - 2);
        pcBar_nM1 = pcBar_nM2 * pcBar;
        pcBar_n = pcBar_nM1 * pcBar;
        onePlus_pcBar_n = 1.0 + pcBar_n;
        sBar = pow(onePlus_pcBar_n, -m);
        DsBar_DpsiC = alpha[matID] * (1.0 - n[matID]) *
                      (sBar / onePlus_pcBar_n) * pcBar_nM1;
        vBar = 1.0 - pcBar_nM1 * sBar;
        vBar2 = vBar * vBar;
        DvBar_DpsiC = -alpha[matID] * (n[matID] - 1.0) * pcBar_nM2 * sBar -
                      pcBar_nM1 * DsBar_DpsiC;
        thetaW = thetaSR[matID] * sBar + thetaR[matID];
        DthetaW_DpsiC = thetaSR[matID] * DsBar_DpsiC;
        sqrt_sBar = sqrt(sBar);
        KWr = sqrt_sBar * vBar2;
        DKWr_DpsiC = ((0.5 / sqrt_sBar) * DsBar_DpsiC * vBar2 +
                      2.0 * sqrt_sBar * vBar * DvBar_DpsiC);
      } else {
        thetaW = thetaS;
        DthetaW_DpsiC = 0.0;
        KWr = 1.0;
        DKWr_DpsiC = 0.0;
      }
      betauStar = fmin(beta * u[k], 1000.0);
      rhom = rho * exp(betauStar);
      drhom = beta * rhom;
      mass[k] = rhom * thetaW;
      dmass[k] = -rhom * DthetaW_DpsiC + drhom * thetaW;
      vol_frac[k] = thetaW;
      for (I = 0; I < nSpace; I++) {
        f[k * nSpace + I] = 0.0;
        df[k * nSpace + I] = 0.0;
        for (ii = rowptr[I]; ii < rowptr[I + 1]; ii++) {
          f[k * nSpace + I] +=
              rho2 * KWr * KWs[matID * nnz + ii] * gravity[colind[ii]];
          df[k * nSpace + I] +=
              -rho2 * DKWr_DpsiC * KWs[matID * nnz + ii] * gravity[colind[ii]];
          a[k * nnz + ii] = rho * KWr * KWs[matID * nnz + ii];
          da[k * nnz + ii] = -rho * DKWr_DpsiC * KWs[matID * nnz + ii];
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<conservativeHeadRichardsMualemVanGenuchten_sd_het>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
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)
movsd  %xmm0,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x11c(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    18a5 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x775>
mov    -0x30(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1892 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x762>
mov    -0x44(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  0xdc2(%rip),%xmm1
divsd  (%rax,%rcx,8),%xmm1
movsd  0xdb5(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
mov    0x28(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1564 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x434>
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xd1f(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xcd7(%rip),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x110(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  0xc79(%rip),%xmm1
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
divsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xc19(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xbbc(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x88(%rbp),%xmm1
ff
mulsd  -0xb0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
mov    0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0xa0(%rbp),%xmm2
ff
mov    0x28(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    0x30(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
call   1050 <sqrt@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0xaf9(%rip),%xmm0
divsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xd0(%rbp),%xmm2
ff
movsd  0xad1(%rip),%xmm1
mulsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0xc8(%rbp),%xmm1
ff
mulsd  -0xd8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
jmp    159a <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x46a>
movsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  0xa79(%rip),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
mov    0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xa64(%rip),%xmm1
minsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x128(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
mulsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
mov    0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x100(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0xc0(%rbp),%xmm2
ff
movsd  -0x108(%rbp),%xmm1
ff
mulsd  -0xb8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x50(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xb8(%rbp),%xmm0
ff
mov    0x78(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    187f <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x74f>
mov    0x58(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x60(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x50(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    186c <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x73c>
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  -0xe0(%rbp),%xmm0
ff
mov    0x38(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x11c(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x58(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x58(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xf0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0xe8(%rbp),%xmm0
ff
mov    0x38(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x11c(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq -0x58(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x60(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
mulsd  -0xe0(%rbp),%xmm0
ff
mov    0x38(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x11c(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x68(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0x11c(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0xe8(%rbp),%xmm0
ff
mov    0x38(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x11c(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x70(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0x11c(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    16d7 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x5a7>
jmp    1871 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x741>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    168b <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x55b>
jmp    1884 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x754>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    11ec <conservativeHeadRichardsMualemVanGenuchten_sd_het+0xbc>
jmp    1897 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x767>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11cb <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x9b>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conservativeHeadRichardsMualemVanGenuchten_sd_het>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
movsd  %xmm2,0x68(%rsp)
movapd %xmm1,0x80(%rsp)
mov    %r9,0xa8(%rsp)
mov    %rcx,0x28(%rsp)
movapd %xmm0,0x120(%rsp)
mov    %edx,0xc(%rsp)
mov    %esi,0x8(%rsp)
test   %edi,%edi
jle    178b <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x65b>
mov    0x200(%rsp),%rax
mov    %rax,0x48(%rsp)
mov    0x1f8(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    0x1f0(%rsp),%r14
mov    0x1e8(%rsp),%r12
movapd 0x80(%rsp),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movslq 0xc(%rsp),%rcx
mov    0x28(%rsp),%rax
movslq (%rax,%rcx,4),%rax
movapd 0xe39(%rip),%xmm2
movapd %xmm1,0x150(%rsp)
xorpd  %xmm2,%xmm1
movapd %xmm1,0x140(%rsp)
xorpd  %xmm2,%xmm0
movapd %xmm0,0x130(%rsp)
movslq 0x8(%rsp),%rdx
mov    %edi,%esi
mov    %rsi,0xb8(%rsp)
mov    %rax,%rsi
imul   %rdx,%rsi
shl    $0x3,%rsi
mov    %rsi,0xb0(%rsp)
xorpd  %xmm0,%xmm0
mov    0x1a0(%rsp),%r13
mov    %rdx,0x98(%rsp)
mov    %edx,%edx
mov    %rdx,0xe0(%rsp)
mov    %rcx,0xd0(%rsp)
mov    %ecx,%ecx
mov    %rcx,0x108(%rsp)
mov    %rax,0xa0(%rsp)
lea    0x0(,%rax,8),%rax
mov    %rax,0xd8(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
mov    %r8,0xe8(%rsp)
jmp    12a1 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x171>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp),%rcx
add    $0x1,%rcx
mov    0xb0(%rsp),%rax
add    %rax,0x40(%rsp)
add    %rax,0x48(%rsp)
mov    %rcx,%rax
mov    %rcx,0x20(%rsp)
cmp    0xb8(%rsp),%rcx
je     178b <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x65b>
cmpl   $0x0,0x8(%rsp)
jle    1270 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x140>
mov    0xa8(%rsp),%rax
mov    0x20(%rsp),%rcx
movslq (%rax,%rcx,4),%rdx
imul   0x98(%rsp),%rcx
mov    %rcx,0xf0(%rsp)
mov    0xa0(%rsp),%rax
mov    %rdx,0x58(%rsp)
imul   %edx,%eax
cltq
mov    %rax,0x100(%rsp)
mov    0x48(%rsp),%rax
mov    %rax,0x78(%rsp)
mov    0x40(%rsp),%rax
mov    %rax,0x70(%rsp)
xor    %ecx,%ecx
jmp    1330 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x200>
nopl   0x0(%rax)
mov    0xf8(%rsp),%rcx
add    $0x1,%rcx
mov    0xd8(%rsp),%rax
add    %rax,0x70(%rsp)
add    %rax,0x78(%rsp)
cmp    0xe0(%rsp),%rcx
xorpd  %xmm0,%xmm0
je     1270 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x140>
mov    0xf0(%rsp),%rax
lea    (%rcx,%rax,1),%r15
mov    0x1d0(%rsp),%rax
movsd  (%rax,%r15,8),%xmm3
ucomisd %xmm3,%xmm0
mov    %rcx,0xf8(%rsp)
jbe    1480 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x350>
mov    0x1b0(%rsp),%rax
mov    0x58(%rsp),%rbx
movsd  (%rax,%rbx,8),%xmm1
movapd 0xc8a(%rip),%xmm0
xorpd  %xmm0,%xmm3
movsd  0xc96(%rip),%xmm2
divsd  %xmm1,%xmm2
movsd  0xc82(%rip),%xmm0
addsd  %xmm0,%xmm2
movapd %xmm2,0x30(%rsp)
mov    0x1a8(%rsp),%rbp
mulsd  0x0(%rbp,%rbx,8),%xmm3
movapd %xmm3,0x10(%rsp)
movapd 0x120(%rsp),%xmm4
movapd %xmm4,%xmm2
maxsd  %xmm3,%xmm2
movapd %xmm3,%xmm0
cmpunordsd %xmm3,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm4,%xmm0
orpd   %xmm3,%xmm0
addsd  0xc42(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x50(%rsp)
mulsd  %xmm0,%xmm2
addsd  0xc0c(%rip),%xmm2
movaps 0x30(%rsp),%xmm1
xorps  0xbf0(%rip),%xmm1
movapd %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
call   1040 <pow@plt>
movapd %xmm0,%xmm10
xorpd  %xmm0,%xmm0
movsd  0x0(%rbp,%rbx,8),%xmm9
mov    0x1b0(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm5
mov    0x1c0(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm4
movapd %xmm4,%xmm1
mulsd  %xmm10,%xmm1
mov    0x1b8(%rsp),%rax
addsd  (%rax,%rbx,8),%xmm1
ucomisd %xmm0,%xmm10
movsd  %xmm1,0x60(%rsp)
jb     14d0 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x3a0>
xorps  %xmm0,%xmm0
sqrtsd %xmm10,%xmm0
jmp    1520 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x3f0>
nopl   0x0(%rax)
mov    0x1b8(%rsp),%rax
mov    0x58(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x1c0(%rsp),%rax
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,0x60(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xb59(%rip),%xmm0
movsd  %xmm0,(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
jmp    15e0 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x4b0>
nopl   0x0(%rax,%rax,1)
movapd %xmm10,%xmm0
movsd  %xmm4,0x30(%rsp)
movsd  %xmm10,0xc8(%rsp)
movapd %xmm9,0x110(%rsp)
movsd  %xmm5,0xc0(%rsp)
call   1050 <sqrt@plt>
movsd  0xc0(%rsp),%xmm5
movapd 0x110(%rsp),%xmm9
movsd  0xc8(%rsp),%xmm10
movsd  0x30(%rsp),%xmm4
movapd 0x10(%rsp),%xmm8
movsd  (%rsp),%xmm6
movsd  0x50(%rsp),%xmm7
movsd  0xad6(%rip),%xmm3
movapd %xmm3,%xmm2
subsd  %xmm5,%xmm2
mulsd  %xmm9,%xmm2
movapd %xmm10,%xmm1
divsd  %xmm8,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm7,%xmm1
mulsd  %xmm1,%xmm4
movsd  %xmm4,0x30(%rsp)
movsd  0xabd(%rip),%xmm4
divsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm7,%xmm1
mulsd  %xmm10,%xmm7
movapd %xmm3,%xmm2
subsd  %xmm7,%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
xorpd  0xa6b(%rip),%xmm9
addsd  0xa7b(%rip),%xmm5
mulsd  %xmm9,%xmm5
mulsd  %xmm5,%xmm6
mulsd  %xmm10,%xmm6
subsd  %xmm1,%xmm6
mulsd  %xmm3,%xmm4
mulsd  %xmm0,%xmm3
movsd  %xmm3,(%rsp)
addsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm6,%xmm0
addsd  %xmm0,%xmm4
movsd  %xmm4,0x10(%rsp)
mov    0x1d0(%rsp),%rax
movsd  (%rax,%r15,8),%xmm3
mulsd  0x68(%rsp),%xmm3
minsd  0xa42(%rip),%xmm3
movapd %xmm3,%xmm0
call   1030 <exp@plt>
mulsd  0x80(%rsp),%xmm0
movapd %xmm0,%xmm1
mulsd  0x68(%rsp),%xmm1
movsd  0x60(%rsp),%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm0,%xmm2
mov    0x1d8(%rsp),%rax
movsd  %xmm2,(%rax,%r15,8)
mulsd  %xmm3,%xmm1
mulsd  0x30(%rsp),%xmm0
subsd  %xmm0,%xmm1
mov    0x1e0(%rsp),%rax
movsd  %xmm1,(%rax,%r15,8)
mov    0x208(%rsp),%rax
movsd  %xmm3,(%rax,%r15,8)
cmpl   $0x0,0xc(%rsp)
mov    0xe8(%rsp),%r11
movsd  0x10(%rsp),%xmm3
movsd  (%rsp),%xmm4
jle    1300 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x1d0>
imul   0xd0(%rsp),%r15
movapd 0x150(%rsp),%xmm0
mulsd  %xmm4,%xmm0
movapd %xmm3,%xmm1
mulsd  0x140(%rsp),%xmm1
mulsd  0x80(%rsp),%xmm4
mulsd  0x130(%rsp),%xmm3
mov    0x28(%rsp),%rax
mov    (%rax),%r8d
xor    %r9d,%r9d
jmp    16be <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x58e>
cmp    0x108(%rsp),%r9
je     1300 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x1d0>
mov    %r8d,%eax
lea    (%r9,%r15,1),%rdx
movq   $0x0,(%r12,%rdx,8)
movq   $0x0,(%r14,%rdx,8)
mov    0x28(%rsp),%rcx
mov    0x4(%rcx,%r9,4),%r8d
add    $0x1,%r9
cmp    %r8d,%eax
jge    16b0 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x580>
movslq %r8d,%rsi
cltq
mov    0x70(%rsp),%rcx
lea    (%rcx,%rax,8),%r10
mov    0x78(%rsp),%rcx
lea    (%rcx,%rax,8),%rbx
lea    (%r11,%rax,4),%rcx
mov    0x100(%rsp),%rdi
lea    (%rdi,%rax,1),%rbp
mov    0x1c8(%rsp),%rdi
lea    (%rdi,%rbp,8),%rbp
sub    %rax,%rsi
xor    %eax,%eax
movsd  0x0(%rbp,%rax,8),%xmm2
mulsd  %xmm0,%xmm2
movslq (%rcx,%rax,4),%rdi
mulsd  0x0(%r13,%rdi,8),%xmm2
addsd  (%r12,%rdx,8),%xmm2
movsd  %xmm2,(%r12,%rdx,8)
movsd  0x0(%rbp,%rax,8),%xmm2
mulsd  %xmm1,%xmm2
mulsd  0x0(%r13,%rdi,8),%xmm2
addsd  (%r14,%rdx,8),%xmm2
movsd  %xmm2,(%r14,%rdx,8)
movsd  0x0(%rbp,%rax,8),%xmm2
mulsd  %xmm4,%xmm2
movsd  %xmm2,(%r10,%rax,8)
movsd  0x0(%rbp,%rax,8),%xmm2
mulsd  %xmm3,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%rsi
jne    1720 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x5f0>
jmp    16b0 <conservativeHeadRichardsMualemVanGenuchten_sd_het+0x580>
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @conservativeHeadRichardsMualemVanGenuchten_sd_het(i32 %0, i32 %1, i32 %2, double %3, i32* %4, i32* %5, i32* %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 double
%28 = alloca i32*
%29 = alloca i32*
%30 = alloca i32*
%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 i32
%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
%65 = alloca double
%66 = alloca double
%67 = alloca double
%68 = alloca double
%69 = alloca double
%70 = alloca double
%71 = alloca double
%72 = alloca double
%73 = alloca double
%74 = alloca double
%75 = alloca double
%76 = alloca double
%77 = alloca i32
store i32 %0, i32* %24
store i32 %1, i32* %25
store i32 %2, i32* %26
store double %3, double* %27
store i32* %4, i32** %28
store i32* %5, i32** %29
store i32* %6, i32** %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
%78 = load i32, i32* %26
%79 = load i32, i32* %26
%80 = mul nsw i32 %78, %79
store i32 %80, i32* %53
%81 = load double, double* %31
%82 = load double, double* %31
%83 = fmul double %81, %82
store double %83, double* %71
%84 = load i32*, i32** %28
%85 = load i32, i32* %26
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i32, i32* %84, i64 %86
%88 = load i32, i32* %87
store i32 %88, i32* %77
store i32 0, i32* %47
br label %89
89: ; preds = %445, %23
%90 = load i32, i32* %47
%91 = load i32, i32* %24
%92 = icmp slt i32 %90, %91
br i1 %92, label %93, label %448
93: ; preds = %89
%94 = load i32*, i32** %30
%95 = load i32, i32* %47
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i32, i32* %94, i64 %96
%98 = load i32, i32* %97
store i32 %98, i32* %51
store i32 0, i32* %48
br label %99
99: ; preds = %441, %93
%100 = load i32, i32* %48
%101 = load i32, i32* %25
%102 = icmp slt i32 %100, %101
br i1 %102, label %103, label %444
103: ; preds = %99
%104 = load i32, i32* %47
%105 = load i32, i32* %25
%106 = mul nsw i32 %104, %105
%107 = load i32, i32* %48
%108 = add nsw i32 %106, %107
store i32 %108, i32* %49
%109 = load double*, double** %39
%110 = load i32, i32* %49
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %109, i64 %111
%113 = load double, double* %112
%114 = fneg double %113
store double %114, double* %54
%115 = load double*, double** %35
%116 = load i32, i32* %51
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %115, i64 %117
%119 = load double, double* %118
%120 = fdiv double 1.000000e+00, %119
%121 = fsub double 1.000000e+00, %120
store double %121, double* %75
%122 = load double*, double** %36
%123 = load i32, i32* %51
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds double, double* %122, i64 %124
%126 = load double, double* %125
%127 = load double*, double** %37
%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 = fadd double %126, %131
store double %132, double* %72
%133 = load double, double* %54
%134 = fcmp ogt double %133, 0.000000e+00
br i1 %134, label %135, label %248
135: ; preds = %103
%136 = load double*, double** %34
%137 = load i32, i32* %51
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
%140 = load double, double* %139
%141 = load double, double* %54
%142 = fmul double %140, %141
store double %142, double* %56
%143 = load double, double* %56
%144 = load double, double* %27
%145 = call double @llvm.maxnum.f64(double %143, double %144)
store double %145, double* %55
%146 = load double, double* %55
%147 = load double*, double** %35
%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 = fsub double %151, 2.000000e+00
%153 = call double @pow(double %146, double %152)
store double %153, double* %59
%154 = load double, double* %59
%155 = load double, double* %56
%156 = fmul double %154, %155
store double %156, double* %58
%157 = load double, double* %58
%158 = load double, double* %56
%159 = fmul double %157, %158
store double %159, double* %57
%160 = load double, double* %57
%161 = fadd double 1.000000e+00, %160
store double %161, double* %60
%162 = load double, double* %60
%163 = load double, double* %75
%164 = fneg double %163
%165 = call double @pow(double %162, double %164)
store double %165, double* %61
%166 = load double*, double** %34
%167 = load i32, i32* %51
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double, double* %166, i64 %168
%170 = load double, double* %169
%171 = load double*, double** %35
%172 = load i32, i32* %51
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds double, double* %171, i64 %173
%175 = load double, double* %174
%176 = fsub double 1.000000e+00, %175
%177 = fmul double %170, %176
%178 = load double, double* %61
%179 = load double, double* %60
%180 = fdiv double %178, %179
%181 = fmul double %177, %180
%182 = load double, double* %58
%183 = fmul double %181, %182
store double %183, double* %63
%184 = load double, double* %58
%185 = load double, double* %61
%186 = fneg double %184
%187 = call double @llvm.fmuladd.f64(double %186, double %185, double 1.000000e+00)
store double %187, double* %66
%188 = load double, double* %66
%189 = load double, double* %66
%190 = fmul double %188, %189
store double %190, double* %67
%191 = load double*, double** %34
%192 = load i32, i32* %51
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds double, double* %191, i64 %193
%195 = load double, double* %194
%196 = fneg double %195
%197 = load double*, double** %35
%198 = load i32, i32* %51
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds double, double* %197, i64 %199
%201 = load double, double* %200
%202 = fsub double %201, 1.000000e+00
%203 = fmul double %196, %202
%204 = load double, double* %59
%205 = fmul double %203, %204
%206 = load double, double* %61
%207 = load double, double* %58
%208 = load double, double* %63
%209 = fmul double %207, %208
%210 = fneg double %209
%211 = call double @llvm.fmuladd.f64(double %205, double %206, double %210)
store double %211, double* %68
%212 = load double*, double** %37
%213 = load i32, i32* %51
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds double, double* %212, i64 %214
%216 = load double, double* %215
%217 = load double, double* %61
%218 = load double*, double** %36
%219 = load i32, i32* %51
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds double, double* %218, i64 %220
%222 = load double, double* %221
%223 = call double @llvm.fmuladd.f64(double %216, double %217, double %222)
store double %223, double* %64
%224 = load double*, double** %37
%225 = load i32, i32* %51
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds double, double* %224, i64 %226
%228 = load double, double* %227
%229 = load double, double* %63
%230 = fmul double %228, %229
store double %230, double* %65
%231 = load double, double* %61
%232 = call double @sqrt(double %231)
store double %232, double* %62
%233 = load double, double* %62
%234 = load double, double* %67
%235 = fmul double %233, %234
store double %235, double* %69
%236 = load double, double* %62
%237 = fdiv double 5.000000e-01, %236
%238 = load double, double* %63
%239 = fmul double %237, %238
%240 = load double, double* %67
%241 = load double, double* %62
%242 = fmul double 2.000000e+00, %241
%243 = load double, double* %66
%244 = fmul double %242, %243
%245 = load double, double* %68
%246 = fmul double %244, %245
%247 = call double @llvm.fmuladd.f64(double %239, double %240, double %246)
store double %247, double* %70
br label %250
248: ; preds = %103
%249 = load double, double* %72
store double %249, double* %64
store double 0.000000e+00, double* %65
store double 1.000000e+00, double* %69
store double 0.000000e+00, double* %70
br label %250
250: ; preds = %248, %135
%251 = load double, double* %32
%252 = load double*, double** %39
%253 = load i32, i32* %49
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds double, double* %252, i64 %254
%256 = load double, double* %255
%257 = fmul double %251, %256
%258 = call double @llvm.minnum.f64(double %257, double 1.000000e+03)
store double %258, double* %76
%259 = load double, double* %31
%260 = load double, double* %76
%261 = call double @exp(double %260)
%262 = fmul double %259, %261
store double %262, double* %73
%263 = load double, double* %32
%264 = load double, double* %73
%265 = fmul double %263, %264
store double %265, double* %74
%266 = load double, double* %73
%267 = load double, double* %64
%268 = fmul double %266, %267
%269 = load double*, double** %40
%270 = load i32, i32* %49
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds double, double* %269, i64 %271
store double %268, double* %272
%273 = load double, double* %73
%274 = fneg double %273
%275 = load double, double* %65
%276 = load double, double* %74
%277 = load double, double* %64
%278 = fmul double %276, %277
%279 = call double @llvm.fmuladd.f64(double %274, double %275, double %278)
%280 = load double*, double** %41
%281 = load i32, i32* %49
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds double, double* %280, i64 %282
store double %279, double* %283
%284 = load double, double* %64
%285 = load double*, double** %46
%286 = load i32, i32* %49
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds double, double* %285, i64 %287
store double %284, double* %288
store i32 0, i32* %50
br label %289
289: ; preds = %437, %250
%290 = load i32, i32* %50
%291 = load i32, i32* %26
%292 = icmp slt i32 %290, %291
br i1 %292, label %293, label %440
293: ; preds = %289
%294 = load double*, double** %42
%295 = load i32, i32* %49
%296 = load i32, i32* %26
%297 = mul nsw i32 %295, %296
%298 = load i32, i32* %50
%299 = add nsw i32 %297, %298
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds double, double* %294, i64 %300
store double 0.000000e+00, double* %301
%302 = load double*, double** %43
%303 = load i32, i32* %49
%304 = load i32, i32* %26
%305 = mul nsw i32 %303, %304
%306 = load i32, i32* %50
%307 = add nsw i32 %305, %306
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds double, double* %302, i64 %308
store double 0.000000e+00, double* %309
%310 = load i32*, i32** %28
%311 = load i32, i32* %50
%312 = sext i32 %311 to i64
%313 = getelementptr inbounds i32, i32* %310, i64 %312
%314 = load i32, i32* %313
store i32 %314, i32* %52
br label %315
315: ; preds = %433, %293
%316 = load i32, i32* %52
%317 = load i32*, i32** %28
%318 = load i32, i32* %50
%319 = add nsw i32 %318, 1
%320 = sext i32 %319 to i64
%321 = getelementptr inbounds i32, i32* %317, i64 %320
%322 = load i32, i32* %321
%323 = icmp slt i32 %316, %322
br i1 %323, label %324, label %436
324: ; preds = %315
%325 = load double, double* %71
%326 = load double, double* %69
%327 = fmul double %325, %326
%328 = load double*, double** %38
%329 = load i32, i32* %51
%330 = load i32, i32* %77
%331 = mul nsw i32 %329, %330
%332 = load i32, i32* %52
%333 = add nsw i32 %331, %332
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds double, double* %328, i64 %334
%336 = load double, double* %335
%337 = fmul double %327, %336
%338 = load double*, double** %33
%339 = load i32*, i32** %29
%340 = load i32, i32* %52
%341 = sext i32 %340 to i64
%342 = getelementptr inbounds i32, i32* %339, i64 %341
%343 = load i32, i32* %342
%344 = sext i32 %343 to i64
%345 = getelementptr inbounds double, double* %338, i64 %344
%346 = load double, double* %345
%347 = load double*, double** %42
%348 = load i32, i32* %49
%349 = load i32, i32* %26
%350 = mul nsw i32 %348, %349
%351 = load i32, i32* %50
%352 = add nsw i32 %350, %351
%353 = sext i32 %352 to i64
%354 = getelementptr inbounds double, double* %347, i64 %353
%355 = load double, double* %354
%356 = call double @llvm.fmuladd.f64(double %337, double %346, double %355)
store double %356, double* %354
%357 = load double, double* %71
%358 = fneg double %357
%359 = load double, double* %70
%360 = fmul double %358, %359
%361 = load double*, double** %38
%362 = load i32, i32* %51
%363 = load i32, i32* %77
%364 = mul nsw i32 %362, %363
%365 = load i32, i32* %52
%366 = add nsw i32 %364, %365
%367 = sext i32 %366 to i64
%368 = getelementptr inbounds double, double* %361, i64 %367
%369 = load double, double* %368
%370 = fmul double %360, %369
%371 = load double*, double** %33
%372 = load i32*, i32** %29
%373 = load i32, i32* %52
%374 = sext i32 %373 to i64
%375 = getelementptr inbounds i32, i32* %372, i64 %374
%376 = load i32, i32* %375
%377 = sext i32 %376 to i64
%378 = getelementptr inbounds double, double* %371, i64 %377
%379 = load double, double* %378
%380 = load double*, double** %43
%381 = load i32, i32* %49
%382 = load i32, i32* %26
%383 = mul nsw i32 %381, %382
%384 = load i32, i32* %50
%385 = add nsw i32 %383, %384
%386 = sext i32 %385 to i64
%387 = getelementptr inbounds double, double* %380, i64 %386
%388 = load double, double* %387
%389 = call double @llvm.fmuladd.f64(double %370, double %379, double %388)
store double %389, double* %387
%390 = load double, double* %31
%391 = load double, double* %69
%392 = fmul double %390, %391
%393 = load double*, double** %38
%394 = load i32, i32* %51
%395 = load i32, i32* %77
%396 = mul nsw i32 %394, %395
%397 = load i32, i32* %52
%398 = add nsw i32 %396, %397
%399 = sext i32 %398 to i64
%400 = getelementptr inbounds double, double* %393, i64 %399
%401 = load double, double* %400
%402 = fmul double %392, %401
%403 = load double*, double** %44
%404 = load i32, i32* %49
%405 = load i32, i32* %77
%406 = mul nsw i32 %404, %405
%407 = load i32, i32* %52
%408 = add nsw i32 %406, %407
%409 = sext i32 %408 to i64
%410 = getelementptr inbounds double, double* %403, i64 %409
store double %402, double* %410
%411 = load double, double* %31
%412 = fneg double %411
%413 = load double, double* %70
%414 = fmul double %412, %413
%415 = load double*, double** %38
%416 = load i32, i32* %51
%417 = load i32, i32* %77
%418 = mul nsw i32 %416, %417
%419 = load i32, i32* %52
%420 = add nsw i32 %418, %419
%421 = sext i32 %420 to i64
%422 = getelementptr inbounds double, double* %415, i64 %421
%423 = load double, double* %422
%424 = fmul double %414, %423
%425 = load double*, double** %45
%426 = load i32, i32* %49
%427 = load i32, i32* %77
%428 = mul nsw i32 %426, %427
%429 = load i32, i32* %52
%430 = add nsw i32 %428, %429
%431 = sext i32 %430 to i64
%432 = getelementptr inbounds double, double* %425, i64 %431
store double %424, double* %432
br label %433
433: ; preds = %324
%434 = load i32, i32* %52
%435 = add nsw i32 %434, 1
store i32 %435, i32* %52
br label %315
436: ; preds = %315
br label %437
437: ; preds = %436
%438 = load i32, i32* %50
%439 = add nsw i32 %438, 1
store i32 %439, i32* %50
br label %289
440: ; preds = %289
br label %441
441: ; preds = %440
%442 = load i32, i32* %48
%443 = add nsw i32 %442, 1
store i32 %443, i32* %48
br label %99
444: ; preds = %99
br label %445
445: ; preds = %444
%446 = load i32, i32* %47
%447 = add nsw i32 %446, 1
store i32 %447, i32* %47
br label %89
448: ; preds = %89
ret void
}

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