#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 smoothedHeaviside(double const, double const);
void TwoPhaseAdvection_2D_Evaluate(
    const int nPoints, const double eps, const double rho_0, const double nu_0,
    const double rho_1, const double nu_1, const double *phi, const double *p,
    const double *u, const double *v, double *mass_adv, double *dmass_adv_p,
    double *dmass_adv_u, double *dmass_adv_v, double *mom_u_adv,
    double *dmom_u_adv_u, double *dmom_u_adv_v, double *mom_v_adv,
    double *dmom_v_adv_u, double *dmom_v_adv_v) {
  int k;
  double rho, nu, mu, H;
  for (k = 0; k < nPoints; k++) {
    H = smoothedHeaviside(eps, phi[k]);
    rho = rho_0 * (1.0 - H) + rho_1 * H;
    nu = nu_0 * (1.0 - H) + nu_1 * H;
    mu = rho_0 * nu_0 * (1.0 - H) + rho_1 * nu_1 * H;
    mass_adv[k * 2 + 0] = rho * u[k] * p[k];
    mass_adv[k * 2 + 1] = rho * v[k] * p[k];
    dmass_adv_p[k * 2 + 0] = rho * u[k];
    dmass_adv_p[k * 2 + 1] = rho * v[k];
    dmass_adv_u[k * 2 + 0] = 0.0;
    dmass_adv_v[k * 2 + 1] = 0.0;
    mom_u_adv[k * 2 + 0] = rho * u[k] * u[k];
    mom_u_adv[k * 2 + 1] = rho * u[k] * v[k];
    dmom_u_adv_u[k * 2 + 0] = rho * 2.0 * u[k];
    dmom_u_adv_u[k * 2 + 1] = rho * v[k];
    dmom_u_adv_v[k * 2 + 1] = rho * u[k];
    mom_v_adv[k * 2 + 0] = rho * v[k] * u[k];
    mom_v_adv[k * 2 + 1] = rho * v[k] * v[k];
    dmom_v_adv_u[k * 2 + 0] = rho * v[k];
    dmom_v_adv_v[k * 2 + 0] = rho * u[k];
    dmom_v_adv_v[k * 2 + 1] = rho * 2.0 * v[k];
  }
}


x86 assembly (clang, -O0):
<TwoPhaseAdvection_2D_Evaluate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14e1 <TwoPhaseAdvection_2D_Evaluate+0x3d1>
movsd  -0x10(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <smoothedHeaviside@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe5d(%rip),%xmm2
subsd  -0x80(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe34(%rip),%xmm2
subsd  -0x80(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe06(%rip),%xmm2
subsd  -0x80(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x20(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x28(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x28(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xc87(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x30(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x30(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x38(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x40(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x40(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x48(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x50(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xb54(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x50(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1176 <TwoPhaseAdvection_2D_Evaluate+0x66>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TwoPhaseAdvection_2D_Evaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
test   %edi,%edi
jle    12ed <TwoPhaseAdvection_2D_Evaluate+0x1dd>
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
mov    %rdx,%r12
mov    %rsi,%r13
mov    %edi,%eax
shl    $0x3,%rax
mov    %rax,0x8(%rsp)
xor    %ebp,%ebp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  0x0(%r13,%rbp,1),%xmm1
movsd  0x10(%rsp),%xmm0
call   1030 <smoothedHeaviside@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm3
movsd  0xe7a(%rip),%xmm5
subsd  %xmm0,%xmm5
mulsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm5
addsd  %xmm0,%xmm5
movsd  (%rbx,%rbp,1),%xmm0
mulsd  %xmm5,%xmm0
mulsd  (%r12,%rbp,1),%xmm0
movsd  %xmm0,(%r14,%rbp,2)
movsd  (%r15,%rbp,1),%xmm0
mulsd  %xmm5,%xmm0
mulsd  (%r12,%rbp,1),%xmm0
movsd  %xmm0,0x8(%r14,%rbp,2)
movsd  (%rbx,%rbp,1),%xmm0
mulsd  %xmm5,%xmm0
mov    0x60(%rsp),%rax
movsd  %xmm0,(%rax,%rbp,2)
movsd  (%r15,%rbp,1),%xmm0
mulsd  %xmm5,%xmm0
movsd  %xmm0,0x8(%rax,%rbp,2)
mov    0x68(%rsp),%rax
movq   $0x0,(%rax,%rbp,2)
mov    0x70(%rsp),%rax
movq   $0x0,0x8(%rax,%rbp,2)
movsd  (%rbx,%rbp,1),%xmm0
movapd %xmm5,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mov    0x78(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,2)
movsd  (%rbx,%rbp,1),%xmm0
mulsd  %xmm5,%xmm0
mulsd  (%r15,%rbp,1),%xmm0
movsd  %xmm0,0x8(%rax,%rbp,2)
movapd %xmm5,%xmm0
addsd  %xmm5,%xmm0
movsd  (%rbx,%rbp,1),%xmm2
mulsd  %xmm0,%xmm2
mov    0x80(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,2)
movsd  (%r15,%rbp,1),%xmm2
mulsd  %xmm5,%xmm2
movsd  %xmm2,0x8(%rax,%rbp,2)
movsd  (%rbx,%rbp,1),%xmm2
mulsd  %xmm5,%xmm2
mov    0x88(%rsp),%rax
movsd  %xmm2,0x8(%rax,%rbp,2)
movsd  (%r15,%rbp,1),%xmm2
mulsd  %xmm5,%xmm2
mulsd  (%rbx,%rbp,1),%xmm2
mov    0x90(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,2)
movsd  (%r15,%rbp,1),%xmm2
movapd %xmm5,%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm4
movsd  %xmm4,0x8(%rax,%rbp,2)
movsd  (%r15,%rbp,1),%xmm2
mulsd  %xmm5,%xmm2
mov    0x98(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,2)
mulsd  (%rbx,%rbp,1),%xmm5
mov    0xa0(%rsp),%rax
movsd  %xmm5,(%rax,%rbp,2)
mulsd  (%r15,%rbp,1),%xmm0
movsd  %xmm0,0x8(%rax,%rbp,2)
add    $0x8,%rbp
cmp    %rbp,0x8(%rsp)
jne    1160 <TwoPhaseAdvection_2D_Evaluate+0x50>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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