void calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd(
    int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element,
    int nSpace, double *elementDiameter, double *a, double *pdeResidualP,
    double *dpdeResidualP_du, double *dpdeResidualP_dv, double *pdeResidualU,
    double *dpdeResidualU_dp, double *dpdeResidualU_du, double *pdeResidualV,
    double *dpdeResidualV_dp, double *dpdeResidualV_dv, double *subgridErrorP,
    double *dsubgridErrorP_du, double *dsubgridErrorP_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, tau2;
  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];
      tau2 = 6.0 * viscosity;
      subgridErrorP[eN * nQuadraturePoints_element + k] =
          tau2 * pdeResidualP[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];
        dsubgridErrorP_du[eN * nQuadraturePoints_element * nDOF_trial_element +
                          k * nDOF_trial_element + j] =
            tau2 * dpdeResidualP_du[eN * nQuadraturePoints_element *
                                        nDOF_trial_element +
                                    k * nDOF_trial_element + j];
        dsubgridErrorP_dv[eN * nQuadraturePoints_element * nDOF_trial_element +
                          k * nDOF_trial_element + j] =
            tau2 * dpdeResidualP_dv[eN * nQuadraturePoints_element *
                                        nDOF_trial_element +
                                    k * nDOF_trial_element + j];
      }
    }
  }
}


x86 assembly (clang, -O0):
<calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd>:
push   %rbp
mov    %rsp,%rbp
mov    0x98(%rbp),%rax
mov    0x90(%rbp),%rax
mov    0x88(%rbp),%rax
mov    0x80(%rbp),%rax
mov    0x78(%rbp),%rax
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)
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    14ad <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x3ad>
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    149a <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x39a>
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  0xe23(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
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    0x70(%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    0x40(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x88(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xda0(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%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    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    1487 <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x387>
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    0x78(%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    0x80(%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    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
mulsd  (%rax,%rcx,8),%xmm0
mov    0x90(%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    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
mulsd  (%rax,%rcx,8),%xmm0
mov    0x98(%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  -0x50(%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    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  -0x50(%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    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    12a2 <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x1a2>
jmp    148c <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x38c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11a2 <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0xa2>
jmp    149f <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x39f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117d <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x7d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9,-0x18(%rsp)
mov    %r8,-0x30(%rsp)
mov    %ecx,-0x38(%rsp)
mov    %esi,-0x54(%rsp)
test   %edi,%edi
jle    136b <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x26b>
mov    %edx,%ebp
mov    %edi,%eax
mov    %rax,-0x28(%rsp)
mov    %edx,%r11d
mov    %edx,%ecx
mov    -0x54(%rsp),%eax
imul   %eax,%ecx
mov    %ecx,-0x40(%rsp)
shl    $0x3,%r11
movsd  0xeb7(%rip),%xmm0
movsd  0xeb7(%rip),%xmm1
mov    %eax,%eax
mov    %rax,-0x20(%rsp)
xor    %eax,%eax
mov    %rax,-0x48(%rsp)
xor    %eax,%eax
mov    %rax,-0x50(%rsp)
mov    %edx,-0x3c(%rsp)
jmp    119a <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x9a>
nopl   0x0(%rax)
mov    -0x50(%rsp),%rcx
add    $0x1,%rcx
mov    -0x48(%rsp),%rax
add    -0x40(%rsp),%eax
mov    %rax,-0x48(%rsp)
mov    %rcx,%rax
mov    %rcx,-0x50(%rsp)
cmp    -0x28(%rsp),%rcx
je     136b <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x26b>
cmpl   $0x0,-0x54(%rsp)
jle    1170 <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x70>
mov    -0x30(%rsp),%rax
mov    -0x50(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm2
imul   -0x54(%rsp),%ecx
mov    %rcx,-0x10(%rsp)
mulsd  %xmm2,%xmm2
mov    -0x48(%rsp),%rax
mov    %eax,%esi
xor    %ecx,%ecx
jmp    11e6 <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0xe6>
nopl   0x0(%rax)
mov    -0x8(%rsp),%rcx
add    $0x1,%rcx
mov    -0x3c(%rsp),%ebp
add    %ebp,%esi
cmp    -0x20(%rsp),%rcx
je     1170 <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x70>
mov    -0x10(%rsp),%rax
mov    %rcx,-0x8(%rsp)
add    %ecx,%eax
movslq %eax,%rcx
imul   -0x38(%rsp),%eax
cltq
mov    -0x18(%rsp),%rdx
movsd  (%rdx,%rax,8),%xmm3
movapd %xmm3,%xmm5
mulsd  %xmm0,%xmm5
movapd %xmm2,%xmm4
divsd  %xmm5,%xmm4
mov    0x50(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm5
mulsd  %xmm4,%xmm5
mov    0x98(%rsp),%rax
movsd  %xmm5,(%rax,%rcx,8)
mov    0x68(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm5
mulsd  %xmm4,%xmm5
mov    0xb0(%rsp),%rax
movsd  %xmm5,(%rax,%rcx,8)
mulsd  %xmm1,%xmm3
mov    0x38(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm5
mulsd  %xmm3,%xmm5
mov    0x80(%rsp),%rax
movsd  %xmm5,(%rax,%rcx,8)
test   %ebp,%ebp
jle    11d0 <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0xd0>
movslq %esi,%rdx
mov    0x58(%rsp),%rax
lea    (%rax,%rdx,8),%rax
mov    0xa0(%rsp),%rcx
lea    (%rcx,%rdx,8),%rbx
mov    0x60(%rsp),%rcx
lea    (%rcx,%rdx,8),%r12
mov    0xa8(%rsp),%rcx
lea    (%rcx,%rdx,8),%rbp
mov    0x70(%rsp),%rcx
lea    (%rcx,%rdx,8),%r8
mov    0xb8(%rsp),%rcx
lea    (%rcx,%rdx,8),%r15
mov    0x78(%rsp),%rcx
lea    (%rcx,%rdx,8),%r10
mov    0xc0(%rsp),%rcx
lea    (%rcx,%rdx,8),%rdi
mov    0x40(%rsp),%rcx
lea    (%rcx,%rdx,8),%r9
mov    0x88(%rsp),%rcx
lea    (%rcx,%rdx,8),%rcx
mov    %esi,-0x34(%rsp)
mov    0x48(%rsp),%rsi
lea    (%rsi,%rdx,8),%r14
mov    0x90(%rsp),%rsi
lea    (%rsi,%rdx,8),%r13
mov    -0x34(%rsp),%esi
xor    %edx,%edx
xchg   %ax,%ax
movsd  (%rax,%rdx,1),%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,(%rbx,%rdx,1)
movsd  (%r12,%rdx,1),%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,0x0(%rbp,%rdx,1)
movsd  (%r8,%rdx,1),%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,(%r15,%rdx,1)
movsd  (%r10,%rdx,1),%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,(%rdi,%rdx,1)
movsd  (%r9,%rdx,1),%xmm5
mulsd  %xmm3,%xmm5
movsd  %xmm5,(%rcx,%rdx,1)
movsd  (%r14,%rdx,1),%xmm5
mulsd  %xmm3,%xmm5
movsd  %xmm5,0x0(%r13,%rdx,1)
add    $0x8,%rdx
cmp    %rdx,%r11
jne    1300 <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0x200>
jmp    11d0 <calculateSubgridErrorStokes2D_GLS_velocity_pressure_sd+0xd0>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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