#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);
double fmax(double, double);
double sqrt(double);
void calculateSubgridErrorNavierStokes2D_GLS_tau_sd(
    int nElements_global, int nQuadraturePoints_element, int nSpace,
    double hFactor, double *elementDiameter, double *dmt, double *dm, double *f,
    double *a, double *tau0, double *tau1, double *cfl) {
  int eN, k, nSpace2 = nSpace * nSpace, I;
  double h, oneByAbsdt, density, viscosity, Re_max = 0.0, CFL_max = 0.0, nrm_v;
  for (eN = 0; eN < nElements_global; eN++) {
    h = hFactor * elementDiameter[eN];
    for (k = 0; k < nQuadraturePoints_element; k++) {
      density = dm[eN * nQuadraturePoints_element + k];
      viscosity = a[eN * nQuadraturePoints_element * nSpace + k * nSpace + 1];
      nrm_v = 0.0;
      for (I = 0; I < nSpace; I++)
        nrm_v += f[eN * nQuadraturePoints_element * nSpace + k * nSpace + I] *
                 f[eN * nQuadraturePoints_element * nSpace + k * nSpace + I];
      nrm_v = sqrt(nrm_v);
      Re_max = fmax(nrm_v * h / (viscosity / density), Re_max);
      CFL_max = fmax(nrm_v / h, CFL_max);
      cfl[eN * nQuadraturePoints_element + k] = nrm_v / h;
      if (0) {
        oneByAbsdt = 10.0 * (density * nrm_v / h);
      } else {
        oneByAbsdt = fabs(dmt[eN * nQuadraturePoints_element + k]);
      }
      tau0[eN * nQuadraturePoints_element + k] =
          1.0 /
          (4.0 * viscosity / (h * h) + 2.0 * density * nrm_v / h + oneByAbsdt);
      tau1[eN * nQuadraturePoints_element + k] =
          4.0 * viscosity + 2.0 * density * nrm_v * h + oneByAbsdt * h * h;
    }
  }
}


x86 assembly (clang, -O0):
<calculateSubgridErrorNavierStokes2D_GLS_tau_sd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
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)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1402 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x2f2>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13ef <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x2df>
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x38(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1264 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x154>
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x38(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x38(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11f2 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0xe2>
movsd  -0x78(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm3
mulsd  -0x48(%rbp),%xmm3
movsd  -0x60(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
divsd  %xmm0,%xmm3
movsd  -0x68(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x78(%rbp),%xmm3
divsd  -0x48(%rbp),%xmm3
movsd  -0x70(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x78(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
mov    0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xcfe(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xccd(%rip),%xmm1
mulsd  -0x60(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xcba(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
addsd  %xmm0,%xmm1
addsd  -0x50(%rbp),%xmm1
movsd  0xca2(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm1
movsd  0xc73(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  0xc54(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1194 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x84>
jmp    13f4 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x2e4>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    116a <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x5a>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridErrorNavierStokes2D_GLS_tau_sd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rcx,0x30(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    %esi,(%rsp)
test   %edi,%edi
jle    1448 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x338>
mov    0xe0(%rsp),%r10
mov    0xd8(%rsp),%r11
mov    0xd0(%rsp),%rbx
mov    0xc8(%rsp),%rbp
mov    0xc0(%rsp),%rcx
mov    (%rsp),%eax
movslq %eax,%rsi
mov    %edi,%edi
mov    %rdi,0x38(%rsp)
mov    %rsi,0x20(%rsp)
mov    %esi,%esi
mov    %rsi,0x78(%rsp)
mov    %edx,%r13d
lea    -0x1(%r13),%rsi
mov    %rsi,0x60(%rsp)
mov    %r13d,%r12d
and    $0x3,%r12d
and    $0xfffffffc,%r13d
add    $0x18,%rcx
mov    %rcx,0x40(%rsp)
mov    %edx,%ecx
imul   %eax,%ecx
mov    %ecx,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xorpd  %xmm8,%xmm8
movapd 0xe4b(%rip),%xmm4
movsd  0xe53(%rip),%xmm5
movsd  0xe53(%rip),%xmm6
xor    %eax,%eax
mov    %rax,0x8(%rsp)
mov    %edx,0x1c(%rsp)
mov    %r9,0x48(%rsp)
jmp    120a <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0xfa>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rcx
add    $0x1,%rcx
mov    0x10(%rsp),%rax
add    0x18(%rsp),%eax
mov    %rax,0x10(%rsp)
mov    %rcx,%rax
mov    %rcx,0x8(%rsp)
cmp    0x38(%rsp),%rcx
je     1448 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x338>
cmpl   $0x0,(%rsp)
jle    11e0 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0xd0>
mov    0x30(%rsp),%rax
mov    0x8(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm10
mulsd  0x28(%rsp),%xmm10
imul   0x20(%rsp),%rcx
mov    %rcx,0x80(%rsp)
movapd %xmm10,%xmm9
mulsd  %xmm10,%xmm9
mov    0x10(%rsp),%rax
mov    %eax,%esi
xor    %r15d,%r15d
movsd  %xmm10,0x58(%rsp)
movsd  %xmm9,0x50(%rsp)
jmp    1354 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x244>
nopl   0x0(%rax)
mov    %r8,%rbx
mov    %r10,%rbp
movsd  %xmm3,0x70(%rsp)
movsd  %xmm7,0x68(%rsp)
call   1030 <sqrt@plt>
movsd  0x68(%rsp),%xmm7
movsd  0x70(%rsp),%xmm3
movsd  0x50(%rsp),%xmm9
movsd  0x58(%rsp),%xmm10
movsd  0xd7f(%rip),%xmm6
movsd  0xd6f(%rip),%xmm5
movapd 0xd57(%rip),%xmm4
xorpd  %xmm8,%xmm8
mov    0xd8(%rsp),%r11
mov    %rbp,%r10
mov    0xc8(%rsp),%rbp
mov    0x1c(%rsp),%edx
mov    %rbx,%r8
mov    0xd0(%rsp),%rbx
mov    0x48(%rsp),%r9
mov    0x4(%rsp),%esi
movapd %xmm0,%xmm1
divsd  %xmm10,%xmm1
movsd  %xmm1,(%r10,%r14,8)
movsd  (%r8,%r14,8),%xmm1
andpd  %xmm4,%xmm1
mulsd  %xmm5,%xmm3
movapd %xmm3,%xmm2
divsd  %xmm9,%xmm2
addsd  %xmm7,%xmm7
mulsd  %xmm0,%xmm7
movapd %xmm10,%xmm0
mulsd  %xmm7,%xmm0
divsd  %xmm10,%xmm7
addsd  %xmm2,%xmm7
addsd  %xmm1,%xmm7
movapd %xmm6,%xmm2
divsd  %xmm7,%xmm2
movsd  %xmm2,(%rbx,%r14,8)
addsd  %xmm3,%xmm0
mulsd  %xmm10,%xmm1
mulsd  %xmm10,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r11,%r14,8)
add    $0x1,%r15
add    %edx,%esi
cmp    0x78(%rsp),%r15
je     11e0 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0xd0>
mov    0x80(%rsp),%rax
lea    (%r15,%rax,1),%r14
mov    %r14d,%eax
imul   %edx,%eax
test   %edx,%edx
mov    %esi,0x4(%rsp)
jle    1390 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x280>
movslq %esi,%rcx
cmpq   $0x3,0x60(%rsp)
jae    13a0 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x290>
xorpd  %xmm0,%xmm0
xor    %edi,%edi
jmp    13f0 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x2e0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
jmp    1426 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x316>
nopl   0x0(%rax)
mov    0x40(%rsp),%rsi
lea    (%rsi,%rcx,8),%rsi
xorpd  %xmm0,%xmm0
xor    %edi,%edi
nop
movsd  -0x18(%rsi,%rdi,8),%xmm1
movsd  -0x10(%rsi,%rdi,8),%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x8(%rsi,%rdi,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  (%rsi,%rdi,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x4,%rdi
cmp    %rdi,%r13
jne    13b0 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x2a0>
test   %r12,%r12
je     1426 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x316>
add    %rcx,%rdi
mov    0xc0(%rsp),%rcx
lea    (%rcx,%rdi,8),%rcx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
movsd  (%rcx,%rsi,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rsi
cmp    %rsi,%r12
jne    1410 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x300>
movsd  (%r9,%r14,8),%xmm7
cltq
movsd  0x8(%rbp,%rax,8),%xmm3
ucomisd %xmm8,%xmm0
jb     1260 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x150>
sqrtsd %xmm0,%xmm0
jmp    12d5 <calculateSubgridErrorNavierStokes2D_GLS_tau_sd+0x1c5>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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