#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 const exp(double const);
double pow(double, double const);
double sqrt(double);
void conservativeHeadRichardsMualemVanGenuchtenHomEvaluate(
    const int nPoints, const int nSpace, const double rho, const double beta,
    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, rho2 = rho * rho, thetaS = thetaR + thetaSR,
                                  rhom, drhom;
  for (k = 0; k < nPoints; k++) {
    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;
    }
    rhom = rho * exp(beta * u[k]);
    drhom = beta * rhom;
    mass[k] = rhom * thetaW;
    dmass[k] = -rhom * DthetaW_DpsiC + drhom * thetaW;
    for (I = 0; I < nSpace; I++) {
      f[k * nSpace + I] = rho2 * KW * gravity[I];
      df[k * nSpace + I] = -rho2 * DKW_DpsiC * gravity[I];
      a[k * nSpace2 + I * nSpace + I] = rho * KW;
      da[k * nSpace2 + I * nSpace + I] = -rho * DKW_DpsiC;
    }
  }
}


x86 assembly (clang, -O0):
<conservativeHeadRichardsMualemVanGenuchtenHomEvaluate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%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)
movsd  %xmm1,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
movsd  %xmm4,-0x40(%rbp)
movsd  %xmm5,-0x48(%rbp)
movsd  %xmm6,-0x50(%rbp)
movsd  %xmm7,-0x58(%rbp)
mov    %r8,-0x60(%rbp)
mov    %r9,-0x68(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x74(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    169e <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x56e>
mov    -0x60(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1492 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x362>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm1
movsd  0xdc8(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xd8f(%rip),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x40(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  0xd41(%rip),%xmm1
subsd  -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0xb0(%rbp),%xmm1
ff
divsd  -0xa8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xce1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  0xc94(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  -0xc0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
call   1050 <sqrt@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
mulsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  0xbc7(%rip),%xmm1
divsd  -0xb8(%rbp),%xmm1
ff
mulsd  -0xc0(%rbp),%xmm1
ff
movsd  -0xe0(%rbp),%xmm3
ff
movsd  0xb9f(%rip),%xmm2
mulsd  -0xb8(%rbp),%xmm2
ff
mulsd  -0xd8(%rbp),%xmm2
ff
mulsd  -0xe8(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
jmp    14c5 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x395>
movsd  -0x108(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x120(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
mulsd  -0x110(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
mulsd  -0xc8(%rbp),%xmm0
ff
mov    -0x68(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x110(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0xd0(%rbp),%xmm2
ff
movsd  -0x118(%rbp),%xmm1
ff
mulsd  -0xc8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movslq -0x6c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    168b <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x55b>
movsd  -0x100(%rbp),%xmm0
ff
mulsd  -0xf0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
mov    -0x6c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x70(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x100(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0xf8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movslq -0x70(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
mov    -0x6c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x70(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
mulsd  -0xf0(%rbp),%xmm0
ff
mov    0x28(%rbp),%rax
mov    -0x6c(%rbp),%ecx
imul   -0x74(%rbp),%ecx
mov    -0x70(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
add    -0x70(%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  -0xf8(%rbp),%xmm0
ff
mov    0x30(%rbp),%rax
mov    -0x6c(%rbp),%ecx
imul   -0x74(%rbp),%ecx
mov    -0x70(%rbp),%edx
imul   -0x8(%rbp),%edx
add    %edx,%ecx
add    -0x70(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1585 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x455>
jmp    1690 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x560>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    11ca <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x9a>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conservativeHeadRichardsMualemVanGenuchtenHomEvaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %r9,0xd0(%rsp)
mov    %r8,0x70(%rsp)
movsd  %xmm7,0x68(%rsp)
movsd  %xmm6,0x60(%rsp)
movsd  %xmm5,0x58(%rsp)
movapd %xmm4,0x80(%rsp)
movapd %xmm2,0xe0(%rsp)
movsd  %xmm1,0x78(%rsp)
movapd %xmm0,0x90(%rsp)
mov    %esi,0x14(%rsp)
test   %edi,%edi
jle    157b <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x44b>
mov    %rdx,%rbx
mov    0x170(%rsp),%r14
mov    0x168(%rsp),%r12
movapd 0x90(%rsp),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  0x58(%rsp),%xmm0
addsd  0x60(%rsp),%xmm0
movsd  %xmm0,0xb0(%rsp)
movsd  0xe32(%rip),%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,0xa8(%rsp)
movapd 0xe3d(%rip),%xmm4
movapd 0x80(%rsp),%xmm0
xorpd  %xmm4,%xmm0
movapd %xmm0,0x80(%rsp)
movsd  0xe07(%rip),%xmm5
subsd  %xmm3,%xmm5
movapd 0xe0(%rsp),%xmm0
mulsd  %xmm0,%xmm5
movsd  %xmm5,0xa0(%rsp)
xorpd  %xmm4,%xmm0
addsd  0xde9(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0xb8(%rsp)
movapd %xmm2,0x110(%rsp)
xorpd  %xmm4,%xmm2
movapd %xmm2,0xf0(%rsp)
xorpd  %xmm1,%xmm4
movapd %xmm4,0x100(%rsp)
movslq 0x14(%rsp),%rax
mov    %edi,%ecx
mov    %rcx,0xc0(%rsp)
mov    %eax,%r15d
mov    %eax,%ecx
imul   %eax,%ecx
mov    %ecx,0x3c(%rsp)
lea    0x1(%rax),%r13d
shl    $0x3,%rax
mov    %rax,0xc8(%rsp)
xor    %edi,%edi
xorpd  %xmm0,%xmm0
xor    %ebp,%ebp
jmp    12b8 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x188>
nopl   0x0(%rax)
add    $0x1,%rbp
add    0x3c(%rsp),%edi
mov    0xc8(%rsp),%rax
add    %rax,%r12
add    %rax,%r14
cmp    0xc0(%rsp),%rbp
xorpd  %xmm0,%xmm0
je     157b <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x44b>
mov    0x70(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm1
ucomisd %xmm1,%xmm0
mov    %rdi,0xd8(%rsp)
jbe    1360 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x230>
xorpd  0xd44(%rip),%xmm1
mulsd  0xe0(%rsp),%xmm1
movapd %xmm1,0x20(%rsp)
movapd %xmm1,%xmm0
movsd  0xa8(%rsp),%xmm1
call   1040 <pow@plt>
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm1,0x40(%rsp)
mulsd  %xmm1,%xmm2
addsd  0xce5(%rip),%xmm2
movapd %xmm2,0x20(%rsp)
movapd %xmm2,%xmm0
movaps 0x80(%rsp),%xmm1
call   1040 <pow@plt>
movapd %xmm0,%xmm5
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm5
jb     13a0 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x270>
xorps  %xmm0,%xmm0
sqrtsd %xmm5,%xmm0
jmp    13b5 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x285>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x68(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0xb0(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
jmp    147c <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x34c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm5,%xmm0
movsd  %xmm5,0x18(%rsp)
call   1050 <sqrt@plt>
movsd  0x18(%rsp),%xmm5
movsd  0x8(%rsp),%xmm1
movapd 0x20(%rsp),%xmm2
movapd 0x40(%rsp),%xmm3
movapd %xmm5,%xmm7
divsd  %xmm2,%xmm7
mulsd  0xa0(%rsp),%xmm7
mulsd  %xmm3,%xmm7
movapd %xmm7,%xmm8
mulsd  %xmm3,%xmm8
mulsd  %xmm5,%xmm3
movsd  0xc16(%rip),%xmm2
subsd  %xmm3,%xmm2
movapd %xmm0,%xmm4
movsd  0xc16(%rip),%xmm6
divsd  %xmm0,%xmm6
addsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm2
mulsd  0xb8(%rsp),%xmm1
mulsd  %xmm5,%xmm1
subsd  %xmm8,%xmm1
movsd  0x60(%rsp),%xmm3
mulsd  %xmm3,%xmm5
addsd  0x58(%rsp),%xmm5
movsd  %xmm5,0x18(%rsp)
movsd  0x68(%rsp),%xmm5
mulsd  %xmm5,%xmm4
mulsd  %xmm2,%xmm4
movsd  %xmm4,0x20(%rsp)
mulsd  %xmm7,%xmm6
mulsd  %xmm3,%xmm7
movsd  %xmm7,0x40(%rsp)
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm6
addsd  %xmm0,%xmm6
mulsd  %xmm5,%xmm6
movsd  %xmm6,0x8(%rsp)
mov    0x70(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm1
mulsd  0x78(%rsp),%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0x90(%rsp),%xmm0
movapd %xmm0,%xmm1
mulsd  0x78(%rsp),%xmm1
movsd  0x18(%rsp),%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm0,%xmm2
mov    0xd0(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,8)
mulsd  %xmm3,%xmm1
mulsd  0x40(%rsp),%xmm0
subsd  %xmm0,%xmm1
mov    0x160(%rsp),%rax
movsd  %xmm1,(%rax,%rbp,8)
cmpl   $0x0,0x14(%rsp)
mov    0x180(%rsp),%rdx
mov    0x178(%rsp),%rsi
mov    0xd8(%rsp),%rdi
movsd  0x20(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
jle    1290 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x160>
movapd 0x110(%rsp),%xmm0
mulsd  %xmm3,%xmm0
movapd %xmm4,%xmm1
mulsd  0xf0(%rsp),%xmm1
mulsd  0x90(%rsp),%xmm3
mulsd  0x100(%rsp),%xmm4
mov    %edi,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rbx,%rcx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%r12,%rcx,8)
movsd  (%rbx,%rcx,8),%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%r14,%rcx,8)
cltq
movsd  %xmm3,(%rsi,%rax,8)
movsd  %xmm4,(%rdx,%rax,8)
add    $0x1,%rcx
add    %r13d,%eax
cmp    %rcx,%r15
jne    1540 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x410>
jmp    1290 <conservativeHeadRichardsMualemVanGenuchtenHomEvaluate+0x160>
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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