void calculateSubgridErrorStokes3D_GLS_velocity_pressure(
    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 *dpdeResidualP_dw, double *pdeResidualU, double *dpdeResidualU_dp,
    double *dpdeResidualU_du, double *pdeResidualV, double *dpdeResidualV_dp,
    double *dpdeResidualV_dv, double *pdeResidualW, double *dpdeResidualW_dp,
    double *dpdeResidualW_dw, double *subgridErrorP, double *dsubgridErrorP_du,
    double *dsubgridErrorP_dv, double *dsubgridErrorP_dw, double *subgridErrorU,
    double *dsubgridErrorU_dp, double *dsubgridErrorU_du, double *subgridErrorV,
    double *dsubgridErrorV_dp, double *dsubgridErrorV_dv, double *subgridErrorW,
    double *dsubgridErrorW_dp, double *dsubgridErrorW_dw) {
  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 * 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];
      subgridErrorW[eN * nQuadraturePoints_element + k] =
          tau1 * pdeResidualW[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];
        dsubgridErrorW_dp[eN * nQuadraturePoints_element * nDOF_trial_element +
                          k * nDOF_trial_element + j] =
            tau1 * dpdeResidualW_dp[eN * nQuadraturePoints_element *
                                        nDOF_trial_element +
                                    k * nDOF_trial_element + j];
        dsubgridErrorW_dw[eN * nQuadraturePoints_element * nDOF_trial_element +
                          k * nDOF_trial_element + j] =
            tau1 * dpdeResidualW_dw[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):
<calculateSubgridErrorStokes3D_GLS_velocity_pressure>:
push   %rbp
mov    %rsp,%rbp
mov    0xd8(%rbp),%rax
mov    0xd0(%rbp),%rax
mov    0xc8(%rbp),%rax
mov    0xc0(%rbp),%rax
mov    0xb8(%rbp),%rax
mov    0xb0(%rbp),%rax
mov    0xa8(%rbp),%rax
mov    0xa0(%rbp),%rax
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    15c1 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x4c1>
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    15ae <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x4ae>
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  0xdeb(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x98(%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    0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0xb0(%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    0x60(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0xc8(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xd31(%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    0x78(%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    159b <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x49b>
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    0xa0(%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    0x40(%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    0xa8(%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    0xb8(%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    0x58(%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    0xc0(%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    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
mulsd  (%rax,%rcx,8),%xmm0
mov    0xd0(%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    0x70(%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    0xd8(%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    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  -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    0x88(%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    1311 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x211>
jmp    15a0 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x4a0>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11da <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0xda>
jmp    15b3 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x4b3>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b5 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0xb5>
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridErrorStokes3D_GLS_velocity_pressure>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r9,-0x40(%rsp)
mov    %r8,-0x58(%rsp)
mov    %ecx,-0x78(%rsp)
mov    %esi,-0x7c(%rsp)
test   %edi,%edi
jle    142a <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x32a>
mov    %edx,%ebp
mov    -0x78(%rsp),%eax
imul   %eax,%eax
mov    %eax,-0x78(%rsp)
mov    %edi,%eax
mov    %rax,-0x50(%rsp)
mov    %edx,%ecx
mov    -0x7c(%rsp),%eax
imul   %eax,%edx
mov    %edx,-0x60(%rsp)
shl    $0x3,%rcx
mov    %rcx,-0x28(%rsp)
movsd  0xeaa(%rip),%xmm0
movsd  0xeaa(%rip),%xmm1
mov    %eax,%eax
mov    %rax,-0x48(%rsp)
xor    %eax,%eax
mov    %rax,-0x68(%rsp)
xor    %eax,%eax
mov    %rax,-0x70(%rsp)
mov    %ebp,-0x5c(%rsp)
jmp    11aa <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0xaa>
nopl   0x0(%rax)
mov    -0x70(%rsp),%rcx
add    $0x1,%rcx
mov    -0x68(%rsp),%rax
add    -0x60(%rsp),%eax
mov    %rax,-0x68(%rsp)
mov    %rcx,%rax
mov    %rcx,-0x70(%rsp)
cmp    -0x50(%rsp),%rcx
je     142a <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x32a>
cmpl   $0x0,-0x7c(%rsp)
jle    1180 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x80>
mov    -0x58(%rsp),%rax
mov    -0x70(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm2
imul   -0x7c(%rsp),%ecx
mov    %rcx,-0x38(%rsp)
mulsd  %xmm2,%xmm2
mov    -0x68(%rsp),%rax
mov    %eax,-0x74(%rsp)
xor    %ecx,%ecx
jmp    11f8 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0xf8>
nopl   0x0(%rax,%rax,1)
mov    -0x30(%rsp),%rcx
add    $0x1,%rcx
mov    -0x5c(%rsp),%ebp
add    %ebp,-0x74(%rsp)
cmp    -0x48(%rsp),%rcx
je     1180 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x80>
mov    -0x38(%rsp),%rax
mov    %rcx,-0x30(%rsp)
add    %ecx,%eax
mov    -0x78(%rsp),%ecx
imul   %eax,%ecx
movslq %ecx,%rcx
mov    -0x40(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm3
movapd %xmm3,%xmm5
mulsd  %xmm0,%xmm5
movapd %xmm2,%xmm4
divsd  %xmm5,%xmm4
cltq
mov    0x58(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm5
mulsd  %xmm4,%xmm5
mov    0xc0(%rsp),%rcx
movsd  %xmm5,(%rcx,%rax,8)
mov    0x70(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm5
mulsd  %xmm4,%xmm5
mov    0xd8(%rsp),%rcx
movsd  %xmm5,(%rcx,%rax,8)
mov    0x88(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm5
mulsd  %xmm4,%xmm5
mov    0xf0(%rsp),%rcx
movsd  %xmm5,(%rcx,%rax,8)
mulsd  %xmm1,%xmm3
mov    0x38(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm5
mulsd  %xmm3,%xmm5
mov    0xa0(%rsp),%rcx
movsd  %xmm5,(%rcx,%rax,8)
test   %ebp,%ebp
jle    11e0 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0xe0>
movslq -0x74(%rsp),%r8
mov    0x60(%rsp),%rax
lea    (%rax,%r8,8),%rax
mov    %rax,-0x8(%rsp)
mov    0xc8(%rsp),%rax
lea    (%rax,%r8,8),%rax
mov    %rax,-0x10(%rsp)
mov    0x68(%rsp),%rax
lea    (%rax,%r8,8),%rax
mov    %rax,-0x18(%rsp)
mov    0xd0(%rsp),%rax
lea    (%rax,%r8,8),%rax
mov    %rax,-0x20(%rsp)
mov    0x78(%rsp),%rax
lea    (%rax,%r8,8),%r10
mov    0xe0(%rsp),%rax
lea    (%rax,%r8,8),%r14
mov    0x80(%rsp),%rax
lea    (%rax,%r8,8),%r15
mov    0xe8(%rsp),%rax
lea    (%rax,%r8,8),%r11
mov    0x90(%rsp),%rax
lea    (%rax,%r8,8),%r9
mov    0xf8(%rsp),%rax
lea    (%rax,%r8,8),%rcx
mov    0x98(%rsp),%rax
lea    (%rax,%r8,8),%r13
mov    0x100(%rsp),%rax
lea    (%rax,%r8,8),%rax
mov    0x40(%rsp),%rdx
lea    (%rdx,%r8,8),%rdx
mov    0xa8(%rsp),%rsi
lea    (%rsi,%r8,8),%rbx
mov    0x48(%rsp),%rsi
lea    (%rsi,%r8,8),%rsi
mov    0xb0(%rsp),%rbp
lea    0x0(%rbp,%r8,8),%rbp
xor    %r8d,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x8(%rsp),%r12
movsd  (%r12,%r8,1),%xmm5
mulsd  %xmm4,%xmm5
mov    -0x10(%rsp),%rdi
movsd  %xmm5,(%rdi,%r8,1)
mov    -0x18(%rsp),%rdi
movsd  (%rdi,%r8,1),%xmm5
mulsd  %xmm4,%xmm5
mov    -0x20(%rsp),%rdi
movsd  %xmm5,(%rdi,%r8,1)
movsd  (%r10,%r8,1),%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,(%r14,%r8,1)
movsd  (%r15,%r8,1),%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,(%r11,%r8,1)
movsd  (%r9,%r8,1),%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,(%rcx,%r8,1)
movsd  0x0(%r13,%r8,1),%xmm5
mulsd  %xmm4,%xmm5
movsd  %xmm5,(%rax,%r8,1)
movsd  (%rdx,%r8,1),%xmm5
mulsd  %xmm3,%xmm5
movsd  %xmm5,(%rbx,%r8,1)
movsd  (%rsi,%r8,1),%xmm5
mulsd  %xmm3,%xmm5
movsd  %xmm5,0x0(%rbp,%r8,1)
add    $0x8,%r8
cmp    %r8,-0x28(%rsp)
jne    1380 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0x280>
jmp    11e0 <calculateSubgridErrorStokes3D_GLS_velocity_pressure+0xe0>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @calculateSubgridErrorStokes3D_GLS_velocity_pressure(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, double* %24, double* %25, double* %26, double* %27, double* %28, double* %29, double* %30, double* %31) {
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%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 double*
%50 = alloca double*
%51 = alloca double*
%52 = alloca double*
%53 = alloca double*
%54 = alloca double*
%55 = alloca double*
%56 = alloca double*
%57 = alloca double*
%58 = alloca double*
%59 = alloca double*
%60 = alloca double*
%61 = alloca double*
%62 = alloca double*
%63 = alloca double*
%64 = alloca double*
%65 = alloca i32
%66 = alloca i32
%67 = alloca i32
%68 = alloca i32
%69 = alloca double
%70 = alloca double
%71 = alloca double
%72 = alloca double
store i32 %0, i32* %33
store i32 %1, i32* %34
store i32 %2, i32* %35
store i32 %3, i32* %36
store double* %4, double** %37
store double* %5, double** %38
store double* %6, double** %39
store double* %7, double** %40
store double* %8, double** %41
store double* %9, double** %42
store double* %10, double** %43
store double* %11, double** %44
store double* %12, double** %45
store double* %13, double** %46
store double* %14, double** %47
store double* %15, double** %48
store double* %16, double** %49
store double* %17, double** %50
store double* %18, double** %51
store double* %19, double** %52
store double* %20, double** %53
store double* %21, double** %54
store double* %22, double** %55
store double* %23, double** %56
store double* %24, double** %57
store double* %25, double** %58
store double* %26, double** %59
store double* %27, double** %60
store double* %28, double** %61
store double* %29, double** %62
store double* %30, double** %63
store double* %31, double** %64
%73 = load i32, i32* %36
%74 = load i32, i32* %36
%75 = mul nsw i32 %73, %74
store i32 %75, i32* %67
store i32 0, i32* %65
br label %76
76: ; preds = %449, %32
%77 = load i32, i32* %65
%78 = load i32, i32* %33
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %452
80: ; preds = %76
%81 = load double*, double** %37
%82 = load i32, i32* %65
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
%85 = load double, double* %84
store double %85, double* %69
store i32 0, i32* %66
br label %86
86: ; preds = %445, %80
%87 = load i32, i32* %66
%88 = load i32, i32* %34
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %448
90: ; preds = %86
%91 = load double*, double** %38
%92 = load i32, i32* %65
%93 = load i32, i32* %34
%94 = mul nsw i32 %92, %93
%95 = load i32, i32* %67
%96 = mul nsw i32 %94, %95
%97 = load i32, i32* %66
%98 = load i32, i32* %67
%99 = mul nsw i32 %97, %98
%100 = add nsw i32 %96, %99
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %91, i64 %101
%103 = load double, double* %102
store double %103, double* %70
%104 = load double, double* %69
%105 = load double, double* %69
%106 = fmul double %104, %105
%107 = load double, double* %70
%108 = fmul double 1.200000e+01, %107
%109 = fdiv double %106, %108
store double %109, double* %71
%110 = load double, double* %71
%111 = load double*, double** %43
%112 = load i32, i32* %65
%113 = load i32, i32* %34
%114 = mul nsw i32 %112, %113
%115 = load i32, i32* %66
%116 = add nsw i32 %114, %115
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %111, i64 %117
%119 = load double, double* %118
%120 = fmul double %110, %119
%121 = load double*, double** %56
%122 = load i32, i32* %65
%123 = load i32, i32* %34
%124 = mul nsw i32 %122, %123
%125 = load i32, i32* %66
%126 = add nsw i32 %124, %125
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %121, i64 %127
store double %120, double* %128
%129 = load double, double* %71
%130 = load double*, double** %46
%131 = load i32, i32* %65
%132 = load i32, i32* %34
%133 = mul nsw i32 %131, %132
%134 = load i32, i32* %66
%135 = add nsw i32 %133, %134
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds double, double* %130, i64 %136
%138 = load double, double* %137
%139 = fmul double %129, %138
%140 = load double*, double** %59
%141 = load i32, i32* %65
%142 = load i32, i32* %34
%143 = mul nsw i32 %141, %142
%144 = load i32, i32* %66
%145 = add nsw i32 %143, %144
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %140, i64 %146
store double %139, double* %147
%148 = load double, double* %71
%149 = load double*, double** %49
%150 = load i32, i32* %65
%151 = load i32, i32* %34
%152 = mul nsw i32 %150, %151
%153 = load i32, i32* %66
%154 = add nsw i32 %152, %153
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds double, double* %149, i64 %155
%157 = load double, double* %156
%158 = fmul double %148, %157
%159 = load double*, double** %62
%160 = load i32, i32* %65
%161 = load i32, i32* %34
%162 = mul nsw i32 %160, %161
%163 = load i32, i32* %66
%164 = add nsw i32 %162, %163
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double, double* %159, i64 %165
store double %158, double* %166
%167 = load double, double* %70
%168 = fmul double 6.000000e+00, %167
store double %168, double* %72
%169 = load double, double* %72
%170 = load double*, double** %39
%171 = load i32, i32* %65
%172 = load i32, i32* %34
%173 = mul nsw i32 %171, %172
%174 = load i32, i32* %66
%175 = add nsw i32 %173, %174
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds double, double* %170, i64 %176
%178 = load double, double* %177
%179 = fmul double %169, %178
%180 = load double*, double** %52
%181 = load i32, i32* %65
%182 = load i32, i32* %34
%183 = mul nsw i32 %181, %182
%184 = load i32, i32* %66
%185 = add nsw i32 %183, %184
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %180, i64 %186
store double %179, double* %187
store i32 0, i32* %68
br label %188
188: ; preds = %441, %90
%189 = load i32, i32* %68
%190 = load i32, i32* %35
%191 = icmp slt i32 %189, %190
br i1 %191, label %192, label %444
192: ; preds = %188
%193 = load double, double* %71
%194 = load double*, double** %44
%195 = load i32, i32* %65
%196 = load i32, i32* %34
%197 = mul nsw i32 %195, %196
%198 = load i32, i32* %35
%199 = mul nsw i32 %197, %198
%200 = load i32, i32* %66
%201 = load i32, i32* %35
%202 = mul nsw i32 %200, %201
%203 = add nsw i32 %199, %202
%204 = load i32, i32* %68
%205 = add nsw i32 %203, %204
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds double, double* %194, i64 %206
%208 = load double, double* %207
%209 = fmul double %193, %208
%210 = load double*, double** %57
%211 = load i32, i32* %65
%212 = load i32, i32* %34
%213 = mul nsw i32 %211, %212
%214 = load i32, i32* %35
%215 = mul nsw i32 %213, %214
%216 = load i32, i32* %66
%217 = load i32, i32* %35
%218 = mul nsw i32 %216, %217
%219 = add nsw i32 %215, %218
%220 = load i32, i32* %68
%221 = add nsw i32 %219, %220
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds double, double* %210, i64 %222
store double %209, double* %223
%224 = load double, double* %71
%225 = load double*, double** %45
%226 = load i32, i32* %65
%227 = load i32, i32* %34
%228 = mul nsw i32 %226, %227
%229 = load i32, i32* %35
%230 = mul nsw i32 %228, %229
%231 = load i32, i32* %66
%232 = load i32, i32* %35
%233 = mul nsw i32 %231, %232
%234 = add nsw i32 %230, %233
%235 = load i32, i32* %68
%236 = add nsw i32 %234, %235
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds double, double* %225, i64 %237
%239 = load double, double* %238
%240 = fmul double %224, %239
%241 = load double*, double** %58
%242 = load i32, i32* %65
%243 = load i32, i32* %34
%244 = mul nsw i32 %242, %243
%245 = load i32, i32* %35
%246 = mul nsw i32 %244, %245
%247 = load i32, i32* %66
%248 = load i32, i32* %35
%249 = mul nsw i32 %247, %248
%250 = add nsw i32 %246, %249
%251 = load i32, i32* %68
%252 = add nsw i32 %250, %251
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds double, double* %241, i64 %253
store double %240, double* %254
%255 = load double, double* %71
%256 = load double*, double** %47
%257 = load i32, i32* %65
%258 = load i32, i32* %34
%259 = mul nsw i32 %257, %258
%260 = load i32, i32* %35
%261 = mul nsw i32 %259, %260
%262 = load i32, i32* %66
%263 = load i32, i32* %35
%264 = mul nsw i32 %262, %263
%265 = add nsw i32 %261, %264
%266 = load i32, i32* %68
%267 = add nsw i32 %265, %266
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds double, double* %256, i64 %268
%270 = load double, double* %269
%271 = fmul double %255, %270
%272 = load double*, double** %60
%273 = load i32, i32* %65
%274 = load i32, i32* %34
%275 = mul nsw i32 %273, %274
%276 = load i32, i32* %35
%277 = mul nsw i32 %275, %276
%278 = load i32, i32* %66
%279 = load i32, i32* %35
%280 = mul nsw i32 %278, %279
%281 = add nsw i32 %277, %280
%282 = load i32, i32* %68
%283 = add nsw i32 %281, %282
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds double, double* %272, i64 %284
store double %271, double* %285
%286 = load double, double* %71
%287 = load double*, double** %48
%288 = load i32, i32* %65
%289 = load i32, i32* %34
%290 = mul nsw i32 %288, %289
%291 = load i32, i32* %35
%292 = mul nsw i32 %290, %291
%293 = load i32, i32* %66
%294 = load i32, i32* %35
%295 = mul nsw i32 %293, %294
%296 = add nsw i32 %292, %295
%297 = load i32, i32* %68
%298 = add nsw i32 %296, %297
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds double, double* %287, i64 %299
%301 = load double, double* %300
%302 = fmul double %286, %301
%303 = load double*, double** %61
%304 = load i32, i32* %65
%305 = load i32, i32* %34
%306 = mul nsw i32 %304, %305
%307 = load i32, i32* %35
%308 = mul nsw i32 %306, %307
%309 = load i32, i32* %66
%310 = load i32, i32* %35
%311 = mul nsw i32 %309, %310
%312 = add nsw i32 %308, %311
%313 = load i32, i32* %68
%314 = add nsw i32 %312, %313
%315 = sext i32 %314 to i64
%316 = getelementptr inbounds double, double* %303, i64 %315
store double %302, double* %316
%317 = load double, double* %71
%318 = load double*, double** %50
%319 = load i32, i32* %65
%320 = load i32, i32* %34
%321 = mul nsw i32 %319, %320
%322 = load i32, i32* %35
%323 = mul nsw i32 %321, %322
%324 = load i32, i32* %66
%325 = load i32, i32* %35
%326 = mul nsw i32 %324, %325
%327 = add nsw i32 %323, %326
%328 = load i32, i32* %68
%329 = add nsw i32 %327, %328
%330 = sext i32 %329 to i64
%331 = getelementptr inbounds double, double* %318, i64 %330
%332 = load double, double* %331
%333 = fmul double %317, %332
%334 = load double*, double** %63
%335 = load i32, i32* %65
%336 = load i32, i32* %34
%337 = mul nsw i32 %335, %336
%338 = load i32, i32* %35
%339 = mul nsw i32 %337, %338
%340 = load i32, i32* %66
%341 = load i32, i32* %35
%342 = mul nsw i32 %340, %341
%343 = add nsw i32 %339, %342
%344 = load i32, i32* %68
%345 = add nsw i32 %343, %344
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds double, double* %334, i64 %346
store double %333, double* %347
%348 = load double, double* %71
%349 = load double*, double** %51
%350 = load i32, i32* %65
%351 = load i32, i32* %34
%352 = mul nsw i32 %350, %351
%353 = load i32, i32* %35
%354 = mul nsw i32 %352, %353
%355 = load i32, i32* %66
%356 = load i32, i32* %35
%357 = mul nsw i32 %355, %356
%358 = add nsw i32 %354, %357
%359 = load i32, i32* %68
%360 = add nsw i32 %358, %359
%361 = sext i32 %360 to i64
%362 = getelementptr inbounds double, double* %349, i64 %361
%363 = load double, double* %362
%364 = fmul double %348, %363
%365 = load double*, double** %64
%366 = load i32, i32* %65
%367 = load i32, i32* %34
%368 = mul nsw i32 %366, %367
%369 = load i32, i32* %35
%370 = mul nsw i32 %368, %369
%371 = load i32, i32* %66
%372 = load i32, i32* %35
%373 = mul nsw i32 %371, %372
%374 = add nsw i32 %370, %373
%375 = load i32, i32* %68
%376 = add nsw i32 %374, %375
%377 = sext i32 %376 to i64
%378 = getelementptr inbounds double, double* %365, i64 %377
store double %364, double* %378
%379 = load double, double* %72
%380 = load double*, double** %40
%381 = load i32, i32* %65
%382 = load i32, i32* %34
%383 = mul nsw i32 %381, %382
%384 = load i32, i32* %35
%385 = mul nsw i32 %383, %384
%386 = load i32, i32* %66
%387 = load i32, i32* %35
%388 = mul nsw i32 %386, %387
%389 = add nsw i32 %385, %388
%390 = load i32, i32* %68
%391 = add nsw i32 %389, %390
%392 = sext i32 %391 to i64
%393 = getelementptr inbounds double, double* %380, i64 %392
%394 = load double, double* %393
%395 = fmul double %379, %394
%396 = load double*, double** %53
%397 = load i32, i32* %65
%398 = load i32, i32* %34
%399 = mul nsw i32 %397, %398
%400 = load i32, i32* %35
%401 = mul nsw i32 %399, %400
%402 = load i32, i32* %66
%403 = load i32, i32* %35
%404 = mul nsw i32 %402, %403
%405 = add nsw i32 %401, %404
%406 = load i32, i32* %68
%407 = add nsw i32 %405, %406
%408 = sext i32 %407 to i64
%409 = getelementptr inbounds double, double* %396, i64 %408
store double %395, double* %409
%410 = load double, double* %72
%411 = load double*, double** %41
%412 = load i32, i32* %65
%413 = load i32, i32* %34
%414 = mul nsw i32 %412, %413
%415 = load i32, i32* %35
%416 = mul nsw i32 %414, %415
%417 = load i32, i32* %66
%418 = load i32, i32* %35
%419 = mul nsw i32 %417, %418
%420 = add nsw i32 %416, %419
%421 = load i32, i32* %68
%422 = add nsw i32 %420, %421
%423 = sext i32 %422 to i64
%424 = getelementptr inbounds double, double* %411, i64 %423
%425 = load double, double* %424
%426 = fmul double %410, %425
%427 = load double*, double** %54
%428 = load i32, i32* %65
%429 = load i32, i32* %34
%430 = mul nsw i32 %428, %429
%431 = load i32, i32* %35
%432 = mul nsw i32 %430, %431
%433 = load i32, i32* %66
%434 = load i32, i32* %35
%435 = mul nsw i32 %433, %434
%436 = add nsw i32 %432, %435
%437 = load i32, i32* %68
%438 = add nsw i32 %436, %437
%439 = sext i32 %438 to i64
%440 = getelementptr inbounds double, double* %427, i64 %439
store double %426, double* %440
br label %441
441: ; preds = %192
%442 = load i32, i32* %68
%443 = add nsw i32 %442, 1
store i32 %443, i32* %68
br label %188
444: ; preds = %188
br label %445
445: ; preds = %444
%446 = load i32, i32* %66
%447 = add nsw i32 %446, 1
store i32 %447, i32* %66
br label %86
448: ; preds = %86
br label %449
449: ; preds = %448
%450 = load i32, i32* %65
%451 = add nsw i32 %450, 1
store i32 %451, i32* %65
br label %76
452: ; preds = %76
ret void
}

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