#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 fabs(double const);
double fmax(double, double const);
double const pow(double, double const);
void shallowWater_1D_Evaluate(
    const int nPoints, const double h_eps, const double g,
    const double bedFrictionCoefficient, const double bedFrictionPower,
    const double eddyViscosity, const double *x, const double *db_dx,
    const double *h, const double *hu, double *H, double *mass_acc,
    double *dmass_acc_dh, double *mom_acc, double *dmom_acc_dhu,
    double *mass_adv, double *dmass_adv_dhu, double *mom_adv,
    double *dmom_adv_dh, double *dmom_adv_dhu, double *mom_source,
    double *dmom_source_dh, double *dmom_source_dhu, double *mom_diff) {
  int k;
  double u, du_dh, du_dhu, heval, hpow, hunorm;
  for (k = 0; k < nPoints; k++) {
    if (h[k] < h_eps) {
      u = 0.0;
      du_dh = 0.0;
      du_dhu = 0.0;
    } else {
      u = hu[k] / h[k];
      du_dh = -hu[k] / (h[k] * h[k]);
      du_dhu = 1.0 / h[k];
    }
    H[k] = h[k] + x[k * 3 + 1];
    mass_acc[k] = h[k];
    dmass_acc_dh[k] = 1.0;
    mom_acc[k] = hu[k];
    dmom_acc_dhu[k] = 1.0;
    mass_adv[k] = hu[k];
    dmass_adv_dhu[k] = 1.0;
    mom_adv[k] = hu[k] * u + 0.5 * g * h[k] * h[k];
    dmom_adv_dh[k] = hu[k] * du_dh + g * h[k];
    dmom_adv_dhu[k] = u + hu[k] * du_dhu;
    mom_diff[k] = eddyViscosity;
    mom_source[k] = g * h[k] * db_dx[k];
    dmom_source_dh[k] = g * db_dx[k];
    heval = fmax(1.0e-3, h[k]);
    hpow = pow(heval, -bedFrictionPower - 2.0);
    hunorm = fabs(hu[k]);
    mom_source[k] += g * hu[k] * bedFrictionCoefficient * hunorm * hpow;
    dmom_source_dh[k] += -(bedFrictionPower + 2.0) * g * hu[k] *
                         bedFrictionCoefficient * hunorm *
                         pow(heval, -bedFrictionPower - 3.0);
    dmom_source_dhu[k] =
        g * bedFrictionCoefficient * hunorm * hpow +
        g * bedFrictionCoefficient * hu[k] * hu[k] * hpow / (hunorm + h_eps);
  }
}


x86 assembly (clang, -O0):
<shallowWater_1D_Evaluate>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x70(%rbp),%rax
mov    0x68(%rbp),%rax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
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    15ea <shallowWater_1D_Evaluate+0x4da>
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11cb <shallowWater_1D_Evaluate+0xbb>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    124b <shallowWater_1D_Evaluate+0x13b>
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  0xdbf(%rip),%xmm0
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
imul   $0x3,-0x5c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  0xd5e(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  0xd2f(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  0xd00(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  0xd01(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x40(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm1
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x30(%rbp),%xmm0
mov    0x70(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%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
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x60(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xbee(%rip),%xmm1
maxsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xbb4(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xbaf(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
mov    0x58(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xb3a(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xac6(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x98(%rbp),%xmm0
ff
mov    0x60(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm3
ff
addsd  -0x10(%rbp),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x68(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1186 <shallowWater_1D_Evaluate+0x76>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shallowWater_1D_Evaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %r9,0x60(%rsp)
mov    %rdx,0x48(%rsp)
mov    %rsi,0x58(%rsp)
movsd  %xmm4,0x50(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
test   %edi,%edi
jle    146e <shallowWater_1D_Evaluate+0x35e>
mov    %r8,%rbx
mov    %rcx,%r15
movsd  0xea8(%rip),%xmm2
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x38(%rsp)
movsd  0xe98(%rip),%xmm2
subsd  %xmm3,%xmm2
movsd  %xmm2,0x30(%rsp)
movsd  0xe8e(%rip),%xmm2
addsd  %xmm3,%xmm2
xorpd  0xea2(%rip),%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,0x80(%rsp)
movsd  0xe75(%rip),%xmm2
subsd  %xmm3,%xmm2
movsd  %xmm2,0x28(%rsp)
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %edi,%eax
shl    $0x3,%rax
mov    %rax,0x18(%rsp)
mov    $0x1,%r13d
xor    %ebp,%ebp
movsd  %xmm0,0x40(%rsp)
jmp    1451 <shallowWater_1D_Evaluate+0x341>
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rbp,1),%xmm3
movapd %xmm3,%xmm0
divsd  %xmm2,%xmm0
xorpd  0xe3b(%rip),%xmm3
movapd 0xe43(%rip),%xmm1
unpcklpd %xmm3,%xmm1
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm2,%xmm4
unpcklpd %xmm3,%xmm4
divpd  %xmm4,%xmm1
mov    %r13d,%eax
mov    0x58(%rsp),%rcx
addsd  (%rcx,%rax,8),%xmm2
mov    0x60(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,1)
movsd  (%r15,%rbp,1),%xmm2
mov    0xe0(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,1)
mov    0xe8(%rsp),%rax
movabs $0x3ff0000000000000,%rcx
mov    %rcx,(%rax,%rbp,1)
movsd  (%rbx,%rbp,1),%xmm2
mov    0xf0(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,1)
mov    0xf8(%rsp),%rax
mov    %rcx,(%rax,%rbp,1)
movsd  (%rbx,%rbp,1),%xmm2
mov    0x100(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,1)
mov    0x108(%rsp),%rax
mov    %rcx,(%rax,%rbp,1)
movsd  (%r15,%rbp,1),%xmm2
movsd  0x38(%rsp),%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movsd  (%rbx,%rbp,1),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
mov    0x110(%rsp),%rax
movsd  %xmm2,(%rax,%rbp,1)
movsd  (%r15,%rbp,1),%xmm2
movsd  0x8(%rsp),%xmm4
mulsd  %xmm4,%xmm2
movapd %xmm1,%xmm3
unpckhpd %xmm1,%xmm3
mulsd  (%rbx,%rbp,1),%xmm3
addsd  %xmm2,%xmm3
mov    0x118(%rsp),%rax
movsd  %xmm3,(%rax,%rbp,1)
mulsd  (%rbx,%rbp,1),%xmm1
addsd  %xmm0,%xmm1
mov    0x120(%rsp),%rax
movsd  %xmm1,(%rax,%rbp,1)
movsd  0x50(%rsp),%xmm0
mov    0x140(%rsp),%rax
movsd  %xmm0,(%rax,%rbp,1)
movsd  (%r15,%rbp,1),%xmm0
mulsd  %xmm4,%xmm0
mov    0x48(%rsp),%rcx
mulsd  (%rcx,%rbp,1),%xmm0
mov    0x128(%rsp),%r12
movsd  %xmm0,(%r12,%rbp,1)
movsd  (%rcx,%rbp,1),%xmm0
mulsd  %xmm4,%xmm0
mov    0x130(%rsp),%r14
movsd  %xmm0,(%r14,%rbp,1)
movsd  (%r15,%rbp,1),%xmm0
maxsd  0xcc3(%rip),%xmm0
movsd  %xmm0,0x70(%rsp)
movsd  0x30(%rsp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,0x78(%rsp)
movsd  (%rbx,%rbp,1),%xmm3
movapd %xmm3,%xmm2
andpd  0xccb(%rip),%xmm2
mulsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm2,0x90(%rsp)
mulsd  %xmm0,%xmm3
addsd  (%r12,%rbp,1),%xmm3
movsd  %xmm3,(%r12,%rbp,1)
movsd  (%rbx,%rbp,1),%xmm0
mulsd  0x80(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  0x70(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
call   1030 <pow@plt>
mulsd  0x68(%rsp),%xmm0
addsd  (%r14,%rbp,1),%xmm0
movsd  %xmm0,(%r14,%rbp,1)
movsd  0x20(%rsp),%xmm2
movapd %xmm2,%xmm3
movapd 0x90(%rsp),%xmm4
mulsd  %xmm4,%xmm3
movsd  (%rbx,%rbp,1),%xmm1
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  0x78(%rsp),%xmm1
mulsd  %xmm1,%xmm2
movsd  0x40(%rsp),%xmm0
addsd  %xmm0,%xmm4
divsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
mov    0x138(%rsp),%rax
movsd  %xmm3,(%rax,%rbp,1)
add    $0x3,%r13
add    $0x8,%rbp
cmp    %rbp,0x18(%rsp)
je     146e <shallowWater_1D_Evaluate+0x35e>
movsd  (%r15,%rbp,1),%xmm2
ucomisd %xmm2,%xmm0
jbe    11e0 <shallowWater_1D_Evaluate+0xd0>
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
jmp    1215 <shallowWater_1D_Evaluate+0x105>
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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