#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 pow(double const, double const);
double sqrt(double);
void conservativeSatRichardsMualemVanGenuchtenHomEvaluate(
    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;
  const double eps = 1.0e-8;
  register double psiC, pcBar, pcBar_n, pcBar_nM1, pcBar_nM2, onePlus_pcBar_n,
      sBar, sqrt_sBar, DsBar_DpsiC, thetaW, vBar, vBar2, DvBar_DpsiC, KW,
      DKW_DpsiC, rho2 = rho * rho, thetaS = thetaR + thetaSR;
  for (k = 0; k < nPoints; k++) {
    sBar = u[k];
    thetaW = thetaS * u[k];
    if (u[k] < 1.0 - eps && u[k] > 0.0 + eps) {
      psiC = pow(pow(sBar, -1.0 / m) - 1.0, 1.0 / n) / alpha;
      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;
      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;
      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 if (u[k] >= 1.0 - eps) {
      psiC = 0.0;
      DsBar_DpsiC = -1.0;
      KW = KWs;
      DKW_DpsiC = 0.0;
    } else {
      psiC = pow(pow(eps, -1.0 / m) - 1.0, 1.0 / n) / alpha;
      DsBar_DpsiC = -1.0;
      KW = 0.0;
      DKW_DpsiC = 0.0;
    }
    mass[k] = rho * thetaW;
    dmass[k] = rho * thetaS;
    phi[k] = -psiC;
    dphi[k] = -1.0 / DsBar_DpsiC;
    for (I = 0; I < nSpace; I++) {
      f[k * nSpace + I] = rho2 * KW * gravity[I];
      df[k * nSpace + I] = rho2 * DKW_DpsiC * gravity[I] / DsBar_DpsiC;
      a[k * nSpace2 + I * nSpace + I] = rho * KW;
      da[k * nSpace2 + I * nSpace + I] = rho * DKW_DpsiC / DsBar_DpsiC;
    }
  }
}


x86 assembly (clang, -O0):
<conservativeSatRichardsMualemVanGenuchtenHomEvaluate>:
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  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    16d2 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x5b2>
mov    -0x58(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
mov    -0x58(%rbp),%rax
movslq -0x64(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x58(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  0xdf8(%rip),%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    1495 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x375>
mov    -0x58(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xdd0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1495 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x375>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  0xdc6(%rip),%xmm1
divsd  -0x38(%rbp),%xmm1
call   1030 <pow@plt>
movsd  0xdbc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xdb0(%rip),%xmm1
divsd  -0x30(%rbp),%xmm1
call   1030 <pow@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x30(%rbp),%xmm1
movsd  0xd7d(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1030 <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  0xd2c(%rip),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  0xd0f(%rip),%xmm1
subsd  -0x30(%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  0xcaf(%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  0xc62(%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,-0xe0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
call   1040 <sqrt@plt>
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
mulsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  0xbe4(%rip),%xmm1
divsd  -0xb8(%rbp),%xmm1
ff
mulsd  -0xc0(%rbp),%xmm1
ff
movsd  -0xd8(%rbp),%xmm3
ff
movsd  0xbbc(%rip),%xmm2
mulsd  -0xb8(%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    1556 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x436>
mov    -0x58(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xb5e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     14e9 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x3c9>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xb4c(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
jmp    1551 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x431>
movsd  0xb1f(%rip),%xmm1
divsd  -0x38(%rbp),%xmm1
movsd  0xb02(%rip),%xmm0
call   1030 <pow@plt>
movsd  0xb0d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xb01(%rip),%xmm1
divsd  -0x30(%rbp),%xmm1
call   1030 <pow@plt>
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xadd(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
jmp    1556 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x436>
movsd  -0x10(%rbp),%xmm0
mulsd  -0xc8(%rbp),%xmm0
ff
mov    -0x60(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x100(%rbp),%xmm0
ff
mov    0x10(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%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)
movsd  0xa55(%rip),%xmm0
divsd  -0xc0(%rbp),%xmm0
ff
mov    0x40(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    16bf <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x59f>
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  -0xe8(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movslq -0x68(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x18(%rbp),%rax
mov    -0x64(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  -0xf0(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movslq -0x68(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
divsd  -0xc0(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
mov    -0x64(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
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
mulsd  -0xf0(%rbp),%xmm0
ff
divsd  -0xc0(%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    15d7 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x4b7>
jmp    16c4 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x5a4>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11c2 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0xa2>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conservativeSatRichardsMualemVanGenuchtenHomEvaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %r9,0xb8(%rsp)
mov    %r8,0xb0(%rsp)
movsd  %xmm6,0x48(%rsp)
movapd %xmm1,0x50(%rsp)
mov    %esi,0xc(%rsp)
test   %edi,%edi
jle    159f <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x47f>
mov    %rdx,%rbx
movapd %xmm0,%xmm8
mov    0x130(%rsp),%rdx
mov    0x128(%rsp),%rsi
mov    0x120(%rsp),%r14
mov    0x118(%rsp),%r15
mulsd  %xmm8,%xmm0
movsd  %xmm0,0x88(%rsp)
addsd  %xmm5,%xmm4
movsd  0xe64(%rip),%xmm10
movapd %xmm10,%xmm0
divsd  %xmm3,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0xe55(%rip),%xmm0
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,0x30(%rsp)
movsd  0xe47(%rip),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x78(%rsp)
subsd  %xmm2,%xmm0
movapd 0x50(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x70(%rsp)
movapd 0xe51(%rip),%xmm0
xorpd  %xmm1,%xmm0
addsd  %xmm10,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x80(%rsp)
movsd  %xmm4,0xa8(%rsp)
mulsd  %xmm8,%xmm4
movsd  %xmm4,0xa0(%rsp)
movslq 0xc(%rsp),%rax
mov    %edi,%ecx
mov    %rcx,0x90(%rsp)
mov    %eax,%ebp
mov    %eax,%ecx
imul   %eax,%ecx
mov    %ecx,0x2c(%rsp)
lea    0x1(%rax),%r12d
shl    $0x3,%rax
mov    %rax,0x98(%rsp)
xor    %edi,%edi
movsd  0xdc7(%rip),%xmm9
xor    %r13d,%r13d
movsd  %xmm8,0x20(%rsp)
jmp    1284 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x164>
nopl   (%rax)
add    $0x1,%r13
add    0x2c(%rsp),%edi
mov    0x98(%rsp),%rax
add    %rax,%r15
add    %rax,%r14
cmp    0x90(%rsp),%r13
je     159f <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x47f>
mov    0xb0(%rsp),%rax
movsd  (%rax,%r13,8),%xmm5
ucomisd %xmm5,%xmm9
jbe    1330 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x210>
ucomisd 0xd7b(%rip),%xmm5
jbe    1330 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x210>
mov    %rdi,0x10(%rsp)
movapd %xmm5,%xmm0
movsd  0x38(%rsp),%xmm1
movsd  %xmm5,0x18(%rsp)
call   1030 <pow@plt>
addsd  0xd33(%rip),%xmm0
movsd  0x30(%rsp),%xmm1
call   1030 <pow@plt>
movapd 0x50(%rsp),%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,0xc0(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x78(%rsp),%xmm1
call   1030 <pow@plt>
movsd  0x18(%rsp),%xmm5
movapd %xmm0,%xmm2
ucomisd 0xd1e(%rip),%xmm5
jb     13e0 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x2c0>
xorps  %xmm0,%xmm0
sqrtsd %xmm5,%xmm0
jmp    13fb <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x2db>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorpd  %xmm11,%xmm11
ucomisd %xmm9,%xmm5
movapd %xmm10,%xmm1
movsd  0x48(%rsp),%xmm2
xorpd  %xmm3,%xmm3
jae    14c2 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x3a2>
movsd  0xcc9(%rip),%xmm0
movsd  0x38(%rsp),%xmm1
mov    %rdi,0x10(%rsp)
movsd  %xmm5,0x18(%rsp)
call   1030 <pow@plt>
addsd  0xc8b(%rip),%xmm0
movsd  0x30(%rsp),%xmm1
call   1030 <pow@plt>
movsd  0x18(%rsp),%xmm5
movsd  0xc89(%rip),%xmm9
mov    0x10(%rsp),%rdi
movsd  0xc63(%rip),%xmm10
mov    0x128(%rsp),%rsi
mov    0x130(%rsp),%rdx
movsd  0x20(%rsp),%xmm8
movapd %xmm0,%xmm11
divsd  0x50(%rsp),%xmm11
xorpd  %xmm2,%xmm2
movapd %xmm10,%xmm1
xorpd  %xmm3,%xmm3
jmp    14c2 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x3a2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm5,%xmm0
movsd  %xmm2,0x68(%rsp)
call   1040 <sqrt@plt>
movsd  0x68(%rsp),%xmm2
movsd  0x18(%rsp),%xmm5
movsd  0x20(%rsp),%xmm8
mov    0x130(%rsp),%rdx
mov    0x128(%rsp),%rsi
movsd  0xbe5(%rip),%xmm10
mov    0x10(%rsp),%rdi
movsd  0xbef(%rip),%xmm9
movapd 0xc0(%rsp),%xmm11
movsd  0x40(%rsp),%xmm3
movsd  0x80(%rsp),%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm3
movsd  0xbb2(%rip),%xmm6
addsd  %xmm6,%xmm3
movapd %xmm5,%xmm1
divsd  %xmm3,%xmm1
mulsd  0x70(%rsp),%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm1,%xmm7
mulsd  %xmm2,%xmm7
mulsd  %xmm5,%xmm2
subsd  %xmm2,%xmm6
movapd %xmm0,%xmm2
movsd  0xba0(%rip),%xmm3
divsd  %xmm0,%xmm3
addsd  %xmm0,%xmm0
mulsd  %xmm6,%xmm0
mulsd  %xmm6,%xmm6
mulsd  %xmm5,%xmm4
subsd  %xmm7,%xmm4
movsd  0x48(%rsp),%xmm7
mulsd  %xmm7,%xmm2
mulsd  %xmm6,%xmm2
mulsd  %xmm1,%xmm3
mulsd  %xmm4,%xmm0
mulsd  %xmm6,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm7,%xmm3
xorpd  0xb75(%rip),%xmm11
mulsd  0xa8(%rsp),%xmm5
mulsd  %xmm8,%xmm5
mov    0xb8(%rsp),%rax
movsd  %xmm5,(%rax,%r13,8)
mov    0x110(%rsp),%rax
movsd  0xa0(%rsp),%xmm0
movsd  %xmm0,(%rax,%r13,8)
mov    0x138(%rsp),%rax
movlpd %xmm11,(%rax,%r13,8)
movapd %xmm10,%xmm0
divsd  %xmm1,%xmm0
mov    0x140(%rsp),%rax
movsd  %xmm0,(%rax,%r13,8)
cmpl   $0x0,0xc(%rsp)
jle    1260 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x140>
movsd  0x88(%rsp),%xmm4
movapd %xmm4,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm4
mulsd  %xmm8,%xmm2
mulsd  %xmm8,%xmm3
divsd  %xmm1,%xmm3
mov    %edi,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rbx,%rcx,8),%xmm5
mulsd  %xmm0,%xmm5
movsd  %xmm5,(%r15,%rcx,8)
movsd  (%rbx,%rcx,8),%xmm5
mulsd  %xmm4,%xmm5
divsd  %xmm1,%xmm5
movsd  %xmm5,(%r14,%rcx,8)
cltq
movsd  %xmm2,(%rsi,%rax,8)
movsd  %xmm3,(%rdx,%rax,8)
add    $0x1,%rcx
add    %r12d,%eax
cmp    %rcx,%rbp
jne    1560 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x440>
jmp    1260 <conservativeSatRichardsMualemVanGenuchtenHomEvaluate+0x140>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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