void calculateSubgridErrorStokes2D_GLS_velocity(
    int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element,
    int nSpace, double *elementDiameter, double *a, double *pdeResidualU,
    double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV,
    double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *subgridErrorU,
    double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV,
    double *dsubgridErrorV_dp, double *dsubgridErrorV_dv) {
  int eN, k, nSpace2 = nSpace * nSpace, j;
  double h, viscosity, tau1;
  for (eN = 0; eN < nElements_global; eN++) {
    h = elementDiameter[eN];
    for (k = 0; k < nQuadraturePoints_element; k++) {
      viscosity = a[eN * nQuadraturePoints_element * nSpace2 + k * nSpace2];
      tau1 = h * h / (12.0 * viscosity);
      subgridErrorU[eN * nQuadraturePoints_element + k] =
          tau1 * pdeResidualU[eN * nQuadraturePoints_element + k];
      subgridErrorV[eN * nQuadraturePoints_element + k] =
          tau1 * pdeResidualV[eN * nQuadraturePoints_element + k];
      for (j = 0; j < nDOF_trial_element; j++) {
        dsubgridErrorU_dp[eN * nQuadraturePoints_element * nDOF_trial_element +
                          k * nDOF_trial_element + j] =
            tau1 * dpdeResidualU_dp[eN * nQuadraturePoints_element *
                                        nDOF_trial_element +
                                    k * nDOF_trial_element + j];
        dsubgridErrorU_du[eN * nQuadraturePoints_element * nDOF_trial_element +
                          k * nDOF_trial_element + j] =
            tau1 * dpdeResidualU_du[eN * nQuadraturePoints_element *
                                        nDOF_trial_element +
                                    k * nDOF_trial_element + j];
        dsubgridErrorV_dp[eN * nQuadraturePoints_element * nDOF_trial_element +
                          k * nDOF_trial_element + j] =
            tau1 * dpdeResidualV_dp[eN * nQuadraturePoints_element *
                                        nDOF_trial_element +
                                    k * nDOF_trial_element + j];
        dsubgridErrorV_dv[eN * nQuadraturePoints_element * nDOF_trial_element +
                          k * nDOF_trial_element + j] =
            tau1 * dpdeResidualV_dv[eN * nQuadraturePoints_element *
                                        nDOF_trial_element +
                                    k * nDOF_trial_element + j];
      }
    }
  }
}


x86 assembly (clang, -O0):
<calculateSubgridErrorStokes2D_GLS_velocity>:
push   %rbp
mov    %rsp,%rbp
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)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13a4 <calculateSubgridErrorStokes2D_GLS_velocity+0x2a4>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1391 <calculateSubgridErrorStokes2D_GLS_velocity+0x291>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0x2c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xe3f(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x40(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    0x28(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x58(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    137e <calculateSubgridErrorStokes2D_GLS_velocity+0x27e>
movsd  -0x48(%rbp),%xmm0
mov    0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x50(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x60(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x68(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1238 <calculateSubgridErrorStokes2D_GLS_velocity+0x138>
jmp    1383 <calculateSubgridErrorStokes2D_GLS_velocity+0x283>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    117e <calculateSubgridErrorStokes2D_GLS_velocity+0x7e>
jmp    1396 <calculateSubgridErrorStokes2D_GLS_velocity+0x296>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1159 <calculateSubgridErrorStokes2D_GLS_velocity+0x59>
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridErrorStokes2D_GLS_velocity>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9,-0x10(%rsp)
mov    %r8,-0x28(%rsp)
mov    %ecx,-0x44(%rsp)
mov    %esi,-0x48(%rsp)
test   %edi,%edi
jle    12ef <calculateSubgridErrorStokes2D_GLS_velocity+0x1ef>
mov    -0x44(%rsp),%eax
imul   %eax,%eax
mov    %eax,-0x44(%rsp)
mov    %edi,%eax
mov    %rax,-0x20(%rsp)
mov    %edx,%r15d
mov    %edx,%ecx
mov    -0x48(%rsp),%eax
imul   %eax,%ecx
mov    %ecx,-0x2c(%rsp)
shl    $0x3,%r15
movsd  0xeae(%rip),%xmm0
mov    %eax,%eax
mov    %rax,-0x18(%rsp)
xor    %eax,%eax
mov    %rax,-0x38(%rsp)
xor    %eax,%eax
mov    %rax,-0x40(%rsp)
jmp    119a <calculateSubgridErrorStokes2D_GLS_velocity+0x9a>
nopl   0x0(%rax)
mov    -0x40(%rsp),%rcx
add    $0x1,%rcx
mov    -0x38(%rsp),%rax
add    -0x2c(%rsp),%eax
mov    %rax,-0x38(%rsp)
mov    %rcx,%rax
mov    %rcx,-0x40(%rsp)
cmp    -0x20(%rsp),%rcx
je     12ef <calculateSubgridErrorStokes2D_GLS_velocity+0x1ef>
cmpl   $0x0,-0x48(%rsp)
jle    1170 <calculateSubgridErrorStokes2D_GLS_velocity+0x70>
mov    -0x28(%rsp),%rax
mov    -0x40(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm1
imul   -0x48(%rsp),%ecx
mov    %rcx,-0x8(%rsp)
mulsd  %xmm1,%xmm1
mov    -0x38(%rsp),%rax
mov    %eax,%r13d
xor    %r10d,%r10d
jmp    11de <calculateSubgridErrorStokes2D_GLS_velocity+0xde>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r10
add    %edx,%r13d
cmp    -0x18(%rsp),%r10
je     1170 <calculateSubgridErrorStokes2D_GLS_velocity+0x70>
mov    -0x8(%rsp),%rax
add    %r10d,%eax
mov    -0x44(%rsp),%edi
imul   %eax,%edi
movslq %edi,%rdi
mov    -0x10(%rsp),%rcx
movsd  (%rcx,%rdi,8),%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm1,%xmm2
divsd  %xmm3,%xmm2
cltq
mov    0x38(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm3
mulsd  %xmm2,%xmm3
mov    0x68(%rsp),%rcx
movsd  %xmm3,(%rcx,%rax,8)
mov    0x50(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm3
mulsd  %xmm2,%xmm3
mov    0x80(%rsp),%rcx
movsd  %xmm3,(%rcx,%rax,8)
test   %edx,%edx
jle    11d0 <calculateSubgridErrorStokes2D_GLS_velocity+0xd0>
movslq %r13d,%rcx
mov    0x40(%rsp),%rax
lea    (%rax,%rcx,8),%rdi
mov    0x70(%rsp),%rax
lea    (%rax,%rcx,8),%r14
mov    0x48(%rsp),%rax
lea    (%rax,%rcx,8),%rax
mov    0x78(%rsp),%rsi
lea    (%rsi,%rcx,8),%r12
mov    0x58(%rsp),%rsi
lea    (%rsi,%rcx,8),%rbx
mov    0x88(%rsp),%rsi
lea    (%rsi,%rcx,8),%rbp
mov    0x60(%rsp),%rsi
lea    (%rsi,%rcx,8),%r8
mov    0x90(%rsp),%rsi
lea    (%rsi,%rcx,8),%r11
xor    %r9d,%r9d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rdi,%r9,1),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%r14,%r9,1)
movsd  (%rax,%r9,1),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%r12,%r9,1)
movsd  (%rbx,%r9,1),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,0x0(%rbp,%r9,1)
movsd  (%r8,%r9,1),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%r11,%r9,1)
add    $0x8,%r9
cmp    %r9,%r15
jne    12a0 <calculateSubgridErrorStokes2D_GLS_velocity+0x1a0>
jmp    11d0 <calculateSubgridErrorStokes2D_GLS_velocity+0xd0>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @calculateSubgridErrorStokes2D_GLS_velocity(i32 %0, i32 %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double* nocapture %7, double* nocapture %8, double* nocapture %9, double* nocapture %10, double* nocapture %11, double* nocapture writeonly %12, double* nocapture writeonly %13, double* nocapture writeonly %14, double* nocapture writeonly %15, double* nocapture writeonly %16, double* nocapture writeonly %17) {
%19 = mul nsw i32 %3, %3
%20 = icmp sgt i32 %0, 0
br i1 %20, label %21, label %84
21: ; preds = %18
%22 = icmp sgt i32 %1, 0
%23 = icmp sgt i32 %2, 0
%24 = zext i32 %0 to i64
%25 = zext i32 %1 to i64
%26 = zext i32 %2 to i64
br label %27
27: ; preds = %21, %81
%28 = phi i64 [ 0, %21 ], [ %82, %81 ]
br i1 %22, label %29, label %81
29: ; preds = %27
%30 = getelementptr inbounds double, double* %4, i64 %28
%31 = load double, double* %30
%32 = trunc i64 %28 to i32
%33 = mul nsw i32 %32, %1
%34 = fmul double %31, %31
br label %35
35: ; preds = %29, %78
%36 = phi i64 [ 0, %29 ], [ %79, %78 ]
%37 = trunc i64 %36 to i32
%38 = add i32 %33, %37
%39 = mul i32 %19, %38
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %5, i64 %40
%42 = load double, double* %41
%43 = fmul double %42, 1.200000e+01
%44 = fdiv double %34, %43
%45 = sext i32 %38 to i64
%46 = getelementptr inbounds double, double* %6, i64 %45
%47 = load double, double* %46
%48 = fmul double %47, %44
%49 = getelementptr inbounds double, double* %12, i64 %45
store double %48, double* %49
%50 = getelementptr inbounds double, double* %9, i64 %45
%51 = load double, double* %50
%52 = fmul double %44, %51
%53 = getelementptr inbounds double, double* %15, i64 %45
store double %52, double* %53
br i1 %23, label %54, label %78
54: ; preds = %35
%55 = mul i32 %38, %2
%56 = sext i32 %55 to i64
br label %57
57: ; preds = %54, %57
%58 = phi i64 [ 0, %54 ], [ %76, %57 ]
%59 = add nsw i64 %58, %56
%60 = getelementptr inbounds double, double* %7, i64 %59
%61 = load double, double* %60
%62 = fmul double %44, %61
%63 = getelementptr inbounds double, double* %13, i64 %59
store double %62, double* %63
%64 = getelementptr inbounds double, double* %8, i64 %59
%65 = load double, double* %64
%66 = fmul double %44, %65
%67 = getelementptr inbounds double, double* %14, i64 %59
store double %66, double* %67
%68 = getelementptr inbounds double, double* %10, i64 %59
%69 = load double, double* %68
%70 = fmul double %44, %69
%71 = getelementptr inbounds double, double* %16, i64 %59
store double %70, double* %71
%72 = getelementptr inbounds double, double* %11, i64 %59
%73 = load double, double* %72
%74 = fmul double %44, %73
%75 = getelementptr inbounds double, double* %17, i64 %59
store double %74, double* %75
%76 = add nuw nsw i64 %58, 1
%77 = icmp eq i64 %76, %26
br i1 %77, label %78, label %57
78: ; preds = %57, %35
%79 = add nuw nsw i64 %36, 1
%80 = icmp eq i64 %79, %25
br i1 %80, label %81, label %35
81: ; preds = %78, %27
%82 = add nuw nsw i64 %28, 1
%83 = icmp eq i64 %82, %24
br i1 %83, label %84, label %27
84: ; preds = %81, %18
ret void
}