#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 */
int pow(double, int);
void conservativeHeadRichardsBCBfromMVGHomEvaluate(
    const int nPoints, const int nSpace, const double rho,
    const double *gravity, 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) {
  int k, I;
  const int nSpace2 = nSpace * nSpace;
  register double psiC, pcBar, pd, lambda, sBar, DsBar_DpsiC, thetaW,
      DthetaW_DpsiC, KW, DKW_DpsiC, rho2 = rho * rho, thetaS = thetaR + thetaSR;
  for (k = 0; k < nPoints; k++) {
    psiC = -u[k];
    pd = 1 / alpha;
    lambda = n - 1;
    if (psiC > pd) {
      pcBar = psiC / pd;
      sBar = pow(pcBar, -lambda);
      DsBar_DpsiC = -lambda * sBar / (pcBar * pd);
      KW = KWs * pow(sBar, (2 + 3 * lambda) / lambda);
      DKW_DpsiC = KWs * ((2 + 3 * lambda) / lambda *
                         pow(sBar, 2 / lambda * (1 + lambda)) * DsBar_DpsiC);
      thetaW = thetaSR * sBar + thetaR;
      DthetaW_DpsiC = thetaSR * DsBar_DpsiC;
    } else {
      thetaW = thetaS;
      DthetaW_DpsiC = 0.0;
      KW = KWs;
      DKW_DpsiC = 0.0;
    }
    mass[k] = rho * thetaW;
    dmass[k] = -rho * DthetaW_DpsiC;
    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):
<conservativeHeadRichardsBCBfromMVGHomEvaluate>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
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)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
movsd  %xmm5,-0x40(%rbp)
movsd  %xmm6,-0x48(%rbp)
mov    %rcx,-0x50(%rbp)
mov    %r8,-0x58(%rbp)
mov    %r9,-0x60(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x6c(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1570 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x460>
mov    -0x50(%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  0xe2a(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  0xe10(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
ucomisd -0x88(%rbp),%xmm0
ff
jbe    13d2 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x2c2>
movsd  -0x78(%rbp),%xmm0
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  0xd51(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd3d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  -0x90(%rbp),%xmm1
ff
cvttsd2si %xmm1,%edi
call   1030 <pow@plt>
movsd  -0xe8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  0xcfb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xce7(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xcc3(%rip),%xmm1
divsd  -0x90(%rbp),%xmm1
ff
movsd  0xcab(%rip),%xmm2
addsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <pow@plt>
movsd  -0xe0(%rbp),%xmm1
ff
movsd  -0xd8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm1
mulsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
jmp    1405 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x2f5>
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
mov    -0x58(%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  -0xb0(%rbp),%xmm0
ff
mov    -0x60(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    155d <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x44d>
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  -0xb8(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movslq -0x68(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x64(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x68(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xc8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0xc0(%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  -0x10(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
mov    0x20(%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  -0xc0(%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)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1457 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x347>
jmp    1562 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x452>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1199 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x89>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conservativeHeadRichardsBCBfromMVGHomEvaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
movsd  %xmm5,0x30(%rsp)
movsd  %xmm4,0x28(%rsp)
test   %edi,%edi
jle    147d <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x36d>
mov    %rdx,%rbx
movapd %xmm0,%xmm11
mov    0x148(%rsp),%r10
mov    0x140(%rsp),%r11
mov    0x138(%rsp),%r15
mov    0x130(%rsp),%r12
movapd %xmm0,%xmm9
mulsd  %xmm11,%xmm9
movsd  0x28(%rsp),%xmm10
addsd  0x30(%rsp),%xmm10
movsd  0xe82(%rip),%xmm8
addsd  0xe82(%rip),%xmm2
movapd 0xe92(%rip),%xmm0
movapd %xmm2,%xmm3
xorpd  %xmm0,%xmm3
movapd %xmm3,0xb0(%rsp)
cvttsd2si %xmm3,%eax
mov    %eax,0x1c(%rsp)
movsd  0xe61(%rip),%xmm5
mulsd  %xmm2,%xmm5
movsd  0xe5d(%rip),%xmm3
addsd  %xmm3,%xmm5
divsd  %xmm2,%xmm5
movsd  %xmm5,0x68(%rsp)
cvttsd2si %xmm5,%eax
mov    %eax,0x18(%rsp)
divsd  %xmm2,%xmm3
addsd  %xmm8,%xmm2
mulsd  %xmm3,%xmm2
cvttsd2si %xmm2,%eax
mov    %eax,0x14(%rsp)
divsd  %xmm1,%xmm8
movapd %xmm11,%xmm5
xorpd  %xmm0,%xmm5
movapd %xmm9,0xe0(%rsp)
xorpd  %xmm9,%xmm0
movapd %xmm0,0xd0(%rsp)
movslq %esi,%rax
mov    %edi,%edx
mov    %rdx,0x98(%rsp)
mov    %rax,%rdi
mov    %edi,%ebp
imul   %eax,%eax
mov    %eax,0x24(%rsp)
lea    0x1(%rdi),%r13d
shl    $0x3,%rdi
xor    %eax,%eax
mov    %rax,0x8(%rsp)
movapd 0xde3(%rip),%xmm9
xor    %r14d,%r14d
mov    %r9,0x88(%rsp)
mov    %r8,0x80(%rsp)
mov    %rcx,0x78(%rsp)
movsd  %xmm6,0x40(%rsp)
movapd %xmm11,0xc0(%rsp)
mov    %esi,0x20(%rsp)
movsd  %xmm10,0x70(%rsp)
movsd  %xmm8,0x38(%rsp)
movapd %xmm5,0xa0(%rsp)
mov    %rdi,0x60(%rsp)
jmp    12b6 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x1a6>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14
mov    0x8(%rsp),%rax
add    0x24(%rsp),%eax
mov    %rax,0x8(%rsp)
add    %rdi,%r12
add    %rdi,%r15
cmp    0x98(%rsp),%r14
je     147d <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x36d>
movsd  (%rcx,%r14,8),%xmm0
xorpd  %xmm9,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm8,%xmm0
movapd %xmm10,%xmm2
movapd %xmm6,%xmm4
xorpd  %xmm7,%xmm7
jbe    13f3 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x2e3>
divsd  %xmm8,%xmm0
movapd %xmm0,0x50(%rsp)
mov    0x1c(%rsp),%edi
call   1030 <pow@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x48(%rsp)
movapd 0xb0(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movapd 0x50(%rsp),%xmm2
mulsd  0x38(%rsp),%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,0x50(%rsp)
movapd %xmm1,%xmm0
mov    0x18(%rsp),%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x90(%rsp)
movsd  0x48(%rsp),%xmm0
mov    0x14(%rsp),%edi
call   1030 <pow@plt>
movsd  0x48(%rsp),%xmm2
movsd  0x90(%rsp),%xmm4
movapd 0xcb5(%rip),%xmm9
mov    0x60(%rsp),%rdi
movapd 0xa0(%rsp),%xmm5
movsd  0x38(%rsp),%xmm8
movsd  0x70(%rsp),%xmm10
mov    0x140(%rsp),%r11
mov    0x148(%rsp),%r10
mov    0x20(%rsp),%esi
movapd 0xc0(%rsp),%xmm11
movsd  0x40(%rsp),%xmm6
mov    0x78(%rsp),%rcx
mov    0x80(%rsp),%r8
mov    0x88(%rsp),%r9
xorps  %xmm7,%xmm7
cvtsi2sd %eax,%xmm7
mulsd  0x68(%rsp),%xmm7
movsd  0x50(%rsp),%xmm3
mulsd  %xmm3,%xmm7
mulsd  %xmm6,%xmm7
movsd  0x30(%rsp),%xmm1
mulsd  %xmm1,%xmm2
addsd  0x28(%rsp),%xmm2
mulsd  %xmm1,%xmm3
movapd %xmm3,%xmm1
mulsd  %xmm11,%xmm2
movsd  %xmm2,(%r8,%r14,8)
mulsd  %xmm5,%xmm1
movsd  %xmm1,(%r9,%r14,8)
test   %esi,%esi
jle    1290 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x180>
movapd 0xe0(%rsp),%xmm1
mulsd  %xmm4,%xmm1
movapd %xmm7,%xmm2
mulsd  0xd0(%rsp),%xmm2
mulsd  %xmm11,%xmm4
mulsd  %xmm5,%xmm7
mov    0x8(%rsp),%rax
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rdx,8),%xmm3
mulsd  %xmm1,%xmm3
movsd  %xmm3,(%r12,%rdx,8)
movsd  (%rbx,%rdx,8),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%r15,%rdx,8)
cltq
movsd  %xmm4,(%r11,%rax,8)
movsd  %xmm7,(%r10,%rax,8)
add    $0x1,%rdx
add    %r13d,%eax
cmp    %rdx,%rbp
jne    1440 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x330>
jmp    1290 <conservativeHeadRichardsBCBfromMVGHomEvaluate+0x180>
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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