void calculateSubgridErrorStokes2D_GLS_velocity_sd(
    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 * nSpace + k * nSpace];
      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_sd>:
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_sd+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_sd+0x291>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
mov    -0x28(%rbp),%edx
imul   -0x10(%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_sd+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_sd+0x138>
jmp    1383 <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x283>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    117e <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x7e>
jmp    1396 <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x296>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1159 <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x59>
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridErrorStokes2D_GLS_velocity_sd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9,-0x10(%rsp)
mov    %r8,-0x28(%rsp)
mov    %ecx,-0x2c(%rsp)
mov    %esi,-0x44(%rsp)
test   %edi,%edi
jle    12df <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x1df>
mov    %edi,%eax
mov    %rax,-0x20(%rsp)
mov    %edx,%r15d
mov    %edx,%ecx
mov    -0x44(%rsp),%eax
imul   %eax,%ecx
mov    %ecx,-0x30(%rsp)
shl    $0x3,%r15
movsd  0xeb9(%rip),%xmm0
mov    %eax,%eax
mov    %rax,-0x18(%rsp)
xor    %eax,%eax
mov    %rax,-0x38(%rsp)
xor    %eax,%eax
mov    %rax,-0x40(%rsp)
jmp    118a <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x8a>
xchg   %ax,%ax
mov    -0x40(%rsp),%rcx
add    $0x1,%rcx
mov    -0x38(%rsp),%rax
add    -0x30(%rsp),%eax
mov    %rax,-0x38(%rsp)
mov    %rcx,%rax
mov    %rcx,-0x40(%rsp)
cmp    -0x20(%rsp),%rcx
je     12df <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x1df>
cmpl   $0x0,-0x44(%rsp)
jle    1160 <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x60>
mov    -0x28(%rsp),%rax
mov    -0x40(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm1
imul   -0x44(%rsp),%ecx
mov    %rcx,-0x8(%rsp)
mulsd  %xmm1,%xmm1
mov    -0x38(%rsp),%rax
mov    %eax,%r13d
xor    %r10d,%r10d
jmp    11ce <calculateSubgridErrorStokes2D_GLS_velocity_sd+0xce>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r10
add    %edx,%r13d
cmp    -0x18(%rsp),%r10
je     1160 <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x60>
mov    -0x8(%rsp),%rax
add    %r10d,%eax
movslq %eax,%rdi
imul   -0x2c(%rsp),%eax
cltq
mov    -0x10(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm1,%xmm2
divsd  %xmm3,%xmm2
mov    0x38(%rsp),%rax
movsd  (%rax,%rdi,8),%xmm3
mulsd  %xmm2,%xmm3
mov    0x68(%rsp),%rax
movsd  %xmm3,(%rax,%rdi,8)
mov    0x50(%rsp),%rax
movsd  (%rax,%rdi,8),%xmm3
mulsd  %xmm2,%xmm3
mov    0x80(%rsp),%rax
movsd  %xmm3,(%rax,%rdi,8)
test   %edx,%edx
jle    11c0 <calculateSubgridErrorStokes2D_GLS_velocity_sd+0xc0>
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),%r12
mov    0x78(%rsp),%rax
lea    (%rax,%rcx,8),%rax
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   0x0(%rax,%rax,1)
movsd  (%rdi,%r9,1),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%r14,%r9,1)
movsd  (%r12,%r9,1),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%rax,%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    1290 <calculateSubgridErrorStokes2D_GLS_velocity_sd+0x190>
jmp    11c0 <calculateSubgridErrorStokes2D_GLS_velocity_sd+0xc0>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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