#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double pow(double, double const);
double sqrt(double);
void conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate(
    const int nPoints, const int nSpace, const double rho,
    const double *gravity, const double *x, const double alpha, const double n,
    const double m, const double thetaR, const double thetaSR, const double KWs,
    double *u, double *mass, double *dmass, double *f, double *df, double *a,
    double *da, double *phi, double *dphi) {
  int k, I;
  const int nSpace2 = nSpace * nSpace;
  register double psiC, pcBar, pcBar_n, pcBar_nM1, pcBar_nM2, onePlus_pcBar_n,
      sBar, sqrt_sBar, DsBar_DpsiC, thetaW, DthetaW_DpsiC, vBar, vBar2,
      DvBar_DpsiC, KW, DKW_DpsiC, thetaS = thetaR + thetaSR;
  register double elev;
  for (k = 0; k < nPoints; k++) {
    elev = 0.0;
    for (I = 0; I < nSpace; I++)
      elev += gravity[I] * x[k * 3 + I];
    psiC = -u[k];
    if (psiC > 0.0) {
      pcBar = alpha * psiC;
      pcBar_nM2 = pow(pcBar, n - 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 * (1.0 - n) * (sBar / onePlus_pcBar_n) * pcBar_nM1;
      vBar = 1.0 - pcBar_nM1 * sBar;
      vBar2 = vBar * vBar;
      DvBar_DpsiC =
          -alpha * (n - 1.0) * pcBar_nM2 * sBar - pcBar_nM1 * DsBar_DpsiC;
      thetaW = thetaSR * sBar + thetaR;
      DthetaW_DpsiC = thetaSR * DsBar_DpsiC;
      sqrt_sBar = sqrt(sBar);
      KW = KWs * sqrt_sBar * vBar2;
      DKW_DpsiC = KWs * ((0.5 / sqrt_sBar) * DsBar_DpsiC * vBar2 +
                         2.0 * sqrt_sBar * vBar * DvBar_DpsiC);
    } else {
      thetaW = thetaS;
      DthetaW_DpsiC = 0.0;
      KW = KWs;
      DKW_DpsiC = 0.0;
    }
    mass[k] = rho * thetaW;
    dmass[k] = -rho * DthetaW_DpsiC;
    phi[k] = -psiC;
    dphi[k] = 1.0;
    for (I = 0; I < nSpace; I++) {
      f[k * nSpace + I] = 0.0;
      df[k * nSpace + I] = 0.0;
      phi[k] -= rho * gravity[I] * x[k * 3 + I];
      a[k * nSpace2 + I * nSpace + I] = rho * KW;
      da[k * nSpace2 + I * nSpace + I] = -rho * DKW_DpsiC;
    }
  }
}


x86 assembly (clang, -O0):
<conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
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)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
movsd  %xmm4,-0x40(%rbp)
movsd  %xmm5,-0x48(%rbp)
movsd  %xmm6,-0x50(%rbp)
mov    %r8,-0x58(%rbp)
mov    %r9,-0x60(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x6c(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    16aa <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x58a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1213 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0xf3>
mov    -0x18(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
imul   $0x3,-0x64(%rbp),%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x100(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11c1 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0xa1>
mov    -0x58(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    14c3 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x3a3>
movsd  -0x28(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xd91(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xd5e(%rip),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  0xd10(%rip),%xmm1
subsd  -0x30(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
divsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xcb0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xc63(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm1
ff
mulsd  -0xb8(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
call   1040 <sqrt@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
mulsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  0xb96(%rip),%xmm1
divsd  -0xb0(%rbp),%xmm1
ff
mulsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xd8(%rbp),%xmm3
ff
movsd  0xb6e(%rip),%xmm2
mulsd  -0xb0(%rbp),%xmm2
ff
mulsd  -0xd0(%rbp),%xmm2
ff
mulsd  -0xe0(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
jmp    14f6 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x3d6>
movsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
mulsd  -0xc0(%rbp),%xmm0
ff
mov    -0x60(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0xc8(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x38(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x40(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  0xa96(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1697 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x577>
mov    0x18(%rbp),%rax
mov    -0x64(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%rax
mov    -0x64(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x68(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
imul   $0x3,-0x64(%rbp),%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x38(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
mulsd  -0xe8(%rbp),%xmm0
ff
mov    0x28(%rbp),%rax
mov    -0x64(%rbp),%ecx
imul   -0x6c(%rbp),%ecx
mov    -0x68(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0xf0(%rbp),%xmm0
ff
mov    0x30(%rbp),%rax
mov    -0x64(%rbp),%ecx
imul   -0x6c(%rbp),%ecx
mov    -0x68(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1586 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x466>
jmp    169c <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x57c>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11a3 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x83>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %r9,0xa0(%rsp)
movsd  %xmm5,0x40(%rsp)
movsd  %xmm4,0x38(%rsp)
movapd %xmm3,0x60(%rsp)
movapd %xmm1,0xd0(%rsp)
test   %edi,%edi
jle    1517 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x3f7>
movapd %xmm0,%xmm7
mov    0x170(%rsp),%r9
mov    0x168(%rsp),%rbx
mov    0x160(%rsp),%r11
mov    0x150(%rsp),%r15
mov    0x148(%rsp),%r14
movsd  0x38(%rsp),%xmm8
addsd  0x40(%rsp),%xmm8
movsd  0xe62(%rip),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x80(%rsp)
movapd 0xe6c(%rip),%xmm9
movapd 0x60(%rsp),%xmm0
xorpd  %xmm9,%xmm0
movapd %xmm0,0x60(%rsp)
movsd  0xe3b(%rip),%xmm1
subsd  %xmm2,%xmm1
movapd 0xd0(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x78(%rsp)
addsd  0xe24(%rip),%xmm2
xorpd  %xmm9,%xmm0
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x88(%rsp)
xorpd  %xmm7,%xmm9
movslq %esi,%rax
mov    %edi,%edi
mov    %rdi,0x90(%rsp)
mov    %eax,%edi
mov    %rdi,0xa8(%rsp)
mov    %eax,%edi
imul   %eax,%edi
mov    %edi,0x8(%rsp)
lea    0x1(%rax),%edi
mov    %edi,0xc(%rsp)
shl    $0x3,%rax
mov    %rax,0x98(%rsp)
xor    %r12d,%r12d
xorpd  %xmm10,%xmm10
movl   $0x0,(%rsp)
xor    %r13d,%r13d
mov    %r8,0x30(%rsp)
movsd  %xmm6,0x28(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rdx,0x18(%rsp)
movapd %xmm7,0xc0(%rsp)
mov    %esi,0x4(%rsp)
movsd  %xmm8,0x10(%rsp)
movapd %xmm9,0xb0(%rsp)
jmp    12ae <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x18e>
nopl   (%rax)
add    $0x1,%r13
mov    (%rsp),%eax
add    0x8(%rsp),%eax
mov    %eax,(%rsp)
add    $0x3,%r12
mov    0x98(%rsp),%rax
add    %rax,%r14
add    %rax,%r15
cmp    0x90(%rsp),%r13
je     1517 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x3f7>
movsd  (%r8,%r13,8),%xmm11
ucomisd %xmm11,%xmm10
xorpd  %xmm3,%xmm3
movapd %xmm8,%xmm4
movapd %xmm6,%xmm1
xorpd  %xmm2,%xmm2
jbe    1468 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x348>
mov    %r9,%rbp
movapd %xmm11,0xf0(%rsp)
movapd %xmm11,%xmm0
xorpd  0xd36(%rip),%xmm0
mulsd  0xd0(%rsp),%xmm0
movapd %xmm0,0x50(%rsp)
movsd  0x80(%rsp),%xmm1
call   1030 <pow@plt>
movapd 0x50(%rsp),%xmm2
movapd %xmm2,%xmm1
movsd  %xmm0,0x48(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm1,0xe0(%rsp)
mulsd  %xmm1,%xmm2
addsd  0xcd8(%rip),%xmm2
movapd %xmm2,0x50(%rsp)
movapd %xmm2,%xmm0
movaps 0x60(%rsp),%xmm1
call   1030 <pow@plt>
xorpd  %xmm10,%xmm10
movapd %xmm0,%xmm4
ucomisd %xmm10,%xmm0
jb     1360 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x240>
xorps  %xmm0,%xmm0
sqrtsd %xmm4,%xmm0
jmp    137a <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x25a>
nopl   (%rax)
movapd %xmm4,%xmm0
movsd  %xmm4,0x70(%rsp)
call   1040 <sqrt@plt>
movsd  0x70(%rsp),%xmm4
xorpd  %xmm10,%xmm10
mov    0x30(%rsp),%r8
movsd  0x28(%rsp),%xmm6
mov    0x20(%rsp),%rcx
mov    0x18(%rsp),%rdx
movapd 0xc0(%rsp),%xmm7
mov    0x4(%rsp),%esi
mov    %rbp,%r9
mov    0x160(%rsp),%r11
movsd  0x10(%rsp),%xmm8
movapd 0xb0(%rsp),%xmm9
movapd 0xf0(%rsp),%xmm11
movsd  0x48(%rsp),%xmm13
movapd 0x50(%rsp),%xmm1
movapd 0xe0(%rsp),%xmm2
movapd %xmm4,%xmm3
divsd  %xmm1,%xmm3
mulsd  0x78(%rsp),%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm3,%xmm12
mulsd  %xmm2,%xmm12
mulsd  %xmm4,%xmm2
movsd  0xc08(%rip),%xmm5
subsd  %xmm2,%xmm5
movapd %xmm0,%xmm1
movsd  0xc08(%rip),%xmm2
divsd  %xmm0,%xmm2
addsd  %xmm0,%xmm0
mulsd  %xmm5,%xmm0
mulsd  %xmm5,%xmm5
mulsd  0x88(%rsp),%xmm13
mulsd  %xmm4,%xmm13
subsd  %xmm12,%xmm13
movsd  0x40(%rsp),%xmm12
mulsd  %xmm12,%xmm4
addsd  0x38(%rsp),%xmm4
mulsd  %xmm6,%xmm1
mulsd  %xmm5,%xmm1
mulsd  %xmm3,%xmm2
mulsd  %xmm12,%xmm3
mulsd  %xmm13,%xmm0
mulsd  %xmm5,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm6,%xmm2
mulsd  %xmm7,%xmm4
mov    0xa0(%rsp),%rax
movsd  %xmm4,(%rax,%r13,8)
mulsd  %xmm9,%xmm3
mov    0x140(%rsp),%rax
movsd  %xmm3,(%rax,%r13,8)
movsd  %xmm11,(%rbx,%r13,8)
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r9,%r13,8)
test   %esi,%esi
mov    0x158(%rsp),%r10
jle    1280 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x160>
mulsd  %xmm7,%xmm1
mulsd  %xmm9,%xmm2
mov    (%rsp),%eax
xor    %ebp,%ebp
nop
movq   $0x0,(%r14,%rbp,8)
movq   $0x0,(%r15,%rbp,8)
lea    (%r12,%rbp,1),%edi
movsd  (%rbx,%r13,8),%xmm0
movsd  (%rdx,%rbp,8),%xmm3
mulsd  %xmm7,%xmm3
mulsd  (%rcx,%rdi,8),%xmm3
subsd  %xmm3,%xmm0
movsd  %xmm0,(%rbx,%r13,8)
cltq
movsd  %xmm1,(%r10,%rax,8)
movsd  %xmm2,(%r11,%rax,8)
add    $0x1,%rbp
add    0xc(%rsp),%eax
cmp    %rbp,0xa8(%rsp)
jne    14c0 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x3a0>
jmp    1280 <conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate+0x160>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate(i32 %0, i32 %1, double %2, double* nocapture %3, double* nocapture %4, double %5, double %6, double %7, double %8, double %9, double %10, double* nocapture %11, double* nocapture writeonly %12, double* nocapture writeonly %13, double* nocapture writeonly %14, double* nocapture writeonly %15, double* nocapture writeonly %16, double* nocapture writeonly %17, double* nocapture %18, double* nocapture writeonly %19) {
%21 = fadd double %8, %9
%22 = icmp sgt i32 %0, 0
br i1 %22, label %23, label %116
23: ; preds = %20
%24 = icmp sgt i32 %1, 0
%25 = fadd double %6, -2.000000e+00
%26 = fneg double %7
%27 = fsub double 1.000000e+00, %6
%28 = fmul double %27, %5
%29 = fneg double %5
%30 = fadd double %6, -1.000000e+00
%31 = fmul double %30, %29
%32 = fneg double %2
%33 = sext i32 %1 to i64
%34 = zext i32 %0 to i64
%35 = zext i32 %1 to i64
br label %36
36: ; preds = %23, %113
%37 = phi i64 [ 0, %23 ], [ %114, %113 ]
%38 = getelementptr inbounds double, double* %11, i64 %37
%39 = load double, double* %38
%40 = fcmp olt double %39, 0.000000e+00
br i1 %40, label %41, label %70
41: ; preds = %36
%42 = fneg double %39
%43 = fmul double %42, %5
%44 = tail call double @pow(double %43, double %25)
%45 = fmul double %43, %44
%46 = fmul double %43, %45
%47 = fadd double %46, 1.000000e+00
%48 = tail call double @pow(double %47, double %26)
%49 = fdiv double %48, %47
%50 = fmul double %28, %49
%51 = fmul double %45, %50
%52 = fneg double %45
%53 = tail call double @llvm.fmuladd.f64(double %52, double %48, double 1.000000e+00)
%54 = fmul double %53, %53
%55 = fmul double %31, %44
%56 = fmul double %51, %52
%57 = tail call double @llvm.fmuladd.f64(double %55, double %48, double %56)
%58 = tail call double @llvm.fmuladd.f64(double %9, double %48, double %8)
%59 = fmul double %51, %9
%60 = tail call double @sqrt(double %48)
%61 = fmul double %60, %10
%62 = fmul double %61, %54
%63 = fdiv double 5.000000e-01, %60
%64 = fmul double %63, %51
%65 = fmul double %60, 2.000000e+00
%66 = fmul double %53, %65
%67 = fmul double %66, %57
%68 = tail call double @llvm.fmuladd.f64(double %64, double %54, double %67)
%69 = fmul double %68, %10
br label %70
70: ; preds = %36, %41
%71 = phi double [ %59, %41 ], [ 0.000000e+00, %36 ]
%72 = phi double [ %58, %41 ], [ %21, %36 ]
%73 = phi double [ %62, %41 ], [ %10, %36 ]
%74 = phi double [ %69, %41 ], [ 0.000000e+00, %36 ]
%75 = fmul double %72, %2
%76 = getelementptr inbounds double, double* %12, i64 %37
store double %75, double* %76
%77 = fmul double %71, %32
%78 = getelementptr inbounds double, double* %13, i64 %37
store double %77, double* %78
%79 = getelementptr inbounds double, double* %18, i64 %37
store double %39, double* %79
%80 = getelementptr inbounds double, double* %19, i64 %37
store double 1.000000e+00, double* %80
br i1 %24, label %81, label %113
81: ; preds = %70
%82 = mul nsw i64 %37, %33
%83 = mul nuw nsw i64 %37, 3
%84 = fmul double %73, %2
%85 = trunc i64 %37 to i32
%86 = mul i32 %85, %1
%87 = fmul double %74, %32
br label %88
88: ; preds = %81, %88
%89 = phi i64 [ 0, %81 ], [ %111, %88 ]
%90 = add nsw i64 %89, %82
%91 = getelementptr inbounds double, double* %14, i64 %90
store double 0.000000e+00, double* %91
%92 = getelementptr inbounds double, double* %15, i64 %90
store double 0.000000e+00, double* %92
%93 = getelementptr inbounds double, double* %3, i64 %89
%94 = load double, double* %93
%95 = add nuw nsw i64 %89, %83
%96 = and i64 %95, 4294967295
%97 = getelementptr inbounds double, double* %4, i64 %96
%98 = load double, double* %97
%99 = load double, double* %79
%100 = fneg double %94
%101 = fmul double %100, %2
%102 = tail call double @llvm.fmuladd.f64(double %101, double %98, double %99)
store double %102, double* %79
%103 = trunc i64 %89 to i32
%104 = add i32 %86, %103
%105 = mul i32 %104, %1
%106 = trunc i64 %89 to i32
%107 = add i32 %105, %106
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %16, i64 %108
store double %84, double* %109
%110 = getelementptr inbounds double, double* %17, i64 %108
store double %87, double* %110
%111 = add nuw nsw i64 %89, 1
%112 = icmp eq i64 %111, %35
br i1 %112, label %113, label %88
113: ; preds = %88, %70
%114 = add nuw nsw i64 %37, 1
%115 = icmp eq i64 %114, %34
br i1 %115, label %116, label %36
116: ; preds = %113, %20
ret void
}