void calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure(
    int nElements_global, int nQuadraturePoints_element, int nDOF_trial_element,
    int nSpace, double *elementDiameter, double *dm, double *f, 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):
<calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure>:
push   %rbp
mov    %rsp,%rbp
mov    0xe8(%rbp),%rax
mov    0xe0(%rbp),%rax
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    15d5 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure+0x4d5>
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    15c2 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure+0x4c2>
mov    0x18(%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  0xddd(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
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    0xa8(%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    0x58(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0xc0(%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    0x70(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0xd8(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xd23(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    0x20(%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)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    15af <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure+0x4af>
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    0xb0(%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    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
mulsd  (%rax,%rcx,8),%xmm0
mov    0xc8(%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    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
mulsd  (%rax,%rcx,8),%xmm0
mov    0xe0(%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    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
mulsd  (%rax,%rcx,8),%xmm0
mov    0xe8(%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    0x28(%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  -0x50(%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    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)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1322 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure+0x222>
jmp    15b4 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure+0x4b4>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e8 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure+0xe8>
jmp    15c7 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure+0x4c7>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c3 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure+0xc3>
pop    %rbp
ret

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

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

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