void calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd(
    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, 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];
      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_sd>:
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)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    15cb <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x4cb>
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    15b8 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x4b8>
mov    0x18(%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  0xde7(%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  0xd2d(%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,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    15a5 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x4a5>
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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%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    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1318 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x218>
jmp    15aa <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x4aa>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11de <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0xde>
jmp    15bd <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x4bd>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b9 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0xb9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,-0x50(%rsp)
mov    %ecx,-0x54(%rsp)
mov    %esi,-0x78(%rsp)
test   %edi,%edi
jle    1412 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x312>
mov    %edi,%eax
mov    %rax,-0x48(%rsp)
mov    %edx,%ecx
mov    %edx,%esi
mov    -0x78(%rsp),%eax
imul   %eax,%esi
mov    %esi,-0x5c(%rsp)
shl    $0x3,%rcx
mov    %rcx,-0x28(%rsp)
movsd  0xeba(%rip),%xmm0
movsd  0xeba(%rip),%xmm1
mov    %eax,%eax
mov    %rax,-0x40(%rsp)
xor    %eax,%eax
mov    %rax,-0x68(%rsp)
xor    %eax,%eax
mov    %rax,-0x70(%rsp)
mov    %edx,-0x58(%rsp)
jmp    119a <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x9a>
nopl   0x0(%rax)
mov    -0x70(%rsp),%rcx
add    $0x1,%rcx
mov    -0x68(%rsp),%rax
add    -0x5c(%rsp),%eax
mov    %rax,-0x68(%rsp)
mov    %rcx,%rax
mov    %rcx,-0x70(%rsp)
cmp    -0x48(%rsp),%rcx
je     1412 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x312>
cmpl   $0x0,-0x78(%rsp)
jle    1170 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x70>
mov    -0x50(%rsp),%rax
mov    -0x70(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm2
imul   -0x78(%rsp),%ecx
mov    %rcx,-0x38(%rsp)
mulsd  %xmm2,%xmm2
mov    -0x68(%rsp),%rax
mov    %eax,-0x74(%rsp)
xor    %ecx,%ecx
jmp    11e8 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0xe8>
nopl   0x0(%rax,%rax,1)
mov    -0x30(%rsp),%rcx
add    $0x1,%rcx
mov    -0x58(%rsp),%edx
add    %edx,-0x74(%rsp)
cmp    -0x40(%rsp),%rcx
je     1170 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x70>
mov    -0x38(%rsp),%rax
mov    %rcx,-0x30(%rsp)
add    %ecx,%eax
movslq %eax,%rcx
imul   -0x54(%rsp),%eax
cltq
mov    0x40(%rsp),%rsi
movsd  (%rsi,%rax,8),%xmm3
movapd %xmm3,%xmm5
mulsd  %xmm0,%xmm5
movapd %xmm2,%xmm4
divsd  %xmm5,%xmm4
mov    0x68(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm5
mulsd  %xmm4,%xmm5
mov    0xd0(%rsp),%rax
movsd  %xmm5,(%rax,%rcx,8)
mov    0x80(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm5
mulsd  %xmm4,%xmm5
mov    0xe8(%rsp),%rax
movsd  %xmm5,(%rax,%rcx,8)
mov    0x98(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm5
mulsd  %xmm4,%xmm5
mov    0x100(%rsp),%rax
movsd  %xmm5,(%rax,%rcx,8)
mulsd  %xmm1,%xmm3
mov    0x48(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm5
mulsd  %xmm3,%xmm5
mov    0xb0(%rsp),%rax
movsd  %xmm5,(%rax,%rcx,8)
test   %edx,%edx
jle    11d0 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0xd0>
movslq -0x74(%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
cs nopw 0x0(%rax,%rax,1)
nop
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    1370 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0x270>
jmp    11d0 <calculateSubgridErrorNavierStokes3D_GLS_velocity_pressure_sd+0xd0>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @calculateSubgridErrorNavierStokes3D_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, 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 double
%73 = alloca double
%74 = alloca double
%75 = 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
store i32 0, i32* %69
br label %76
76: ; preds = %449, %34
%77 = load i32, i32* %69
%78 = load i32, i32* %35
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %452
80: ; preds = %76
%81 = load double*, double** %39
%82 = load i32, i32* %69
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
%85 = load double, double* %84
store double %85, double* %72
store i32 0, i32* %70
br label %86
86: ; preds = %445, %80
%87 = load i32, i32* %70
%88 = load i32, i32* %36
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %448
90: ; preds = %86
%91 = load double*, double** %42
%92 = load i32, i32* %69
%93 = load i32, i32* %36
%94 = mul nsw i32 %92, %93
%95 = load i32, i32* %38
%96 = mul nsw i32 %94, %95
%97 = load i32, i32* %70
%98 = load i32, i32* %38
%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* %73
%104 = load double, double* %72
%105 = load double, double* %72
%106 = fmul double %104, %105
%107 = load double, double* %73
%108 = fmul double 1.200000e+01, %107
%109 = fdiv double %106, %108
store double %109, double* %74
%110 = load double, double* %74
%111 = load double*, double** %47
%112 = load i32, i32* %69
%113 = load i32, i32* %36
%114 = mul nsw i32 %112, %113
%115 = load i32, i32* %70
%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** %60
%122 = load i32, i32* %69
%123 = load i32, i32* %36
%124 = mul nsw i32 %122, %123
%125 = load i32, i32* %70
%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* %74
%130 = load double*, double** %50
%131 = load i32, i32* %69
%132 = load i32, i32* %36
%133 = mul nsw i32 %131, %132
%134 = load i32, i32* %70
%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** %63
%141 = load i32, i32* %69
%142 = load i32, i32* %36
%143 = mul nsw i32 %141, %142
%144 = load i32, i32* %70
%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* %74
%149 = load double*, double** %53
%150 = load i32, i32* %69
%151 = load i32, i32* %36
%152 = mul nsw i32 %150, %151
%153 = load i32, i32* %70
%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** %66
%160 = load i32, i32* %69
%161 = load i32, i32* %36
%162 = mul nsw i32 %160, %161
%163 = load i32, i32* %70
%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* %73
%168 = fmul double 6.000000e+00, %167
store double %168, double* %75
%169 = load double, double* %75
%170 = load double*, double** %43
%171 = load i32, i32* %69
%172 = load i32, i32* %36
%173 = mul nsw i32 %171, %172
%174 = load i32, i32* %70
%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** %56
%181 = load i32, i32* %69
%182 = load i32, i32* %36
%183 = mul nsw i32 %181, %182
%184 = load i32, i32* %70
%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* %71
br label %188
188: ; preds = %441, %90
%189 = load i32, i32* %71
%190 = load i32, i32* %37
%191 = icmp slt i32 %189, %190
br i1 %191, label %192, label %444
192: ; preds = %188
%193 = load double, double* %74
%194 = load double*, double** %48
%195 = load i32, i32* %69
%196 = load i32, i32* %36
%197 = mul nsw i32 %195, %196
%198 = load i32, i32* %37
%199 = mul nsw i32 %197, %198
%200 = load i32, i32* %70
%201 = load i32, i32* %37
%202 = mul nsw i32 %200, %201
%203 = add nsw i32 %199, %202
%204 = load i32, i32* %71
%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** %61
%211 = load i32, i32* %69
%212 = load i32, i32* %36
%213 = mul nsw i32 %211, %212
%214 = load i32, i32* %37
%215 = mul nsw i32 %213, %214
%216 = load i32, i32* %70
%217 = load i32, i32* %37
%218 = mul nsw i32 %216, %217
%219 = add nsw i32 %215, %218
%220 = load i32, i32* %71
%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* %74
%225 = load double*, double** %49
%226 = load i32, i32* %69
%227 = load i32, i32* %36
%228 = mul nsw i32 %226, %227
%229 = load i32, i32* %37
%230 = mul nsw i32 %228, %229
%231 = load i32, i32* %70
%232 = load i32, i32* %37
%233 = mul nsw i32 %231, %232
%234 = add nsw i32 %230, %233
%235 = load i32, i32* %71
%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** %62
%242 = load i32, i32* %69
%243 = load i32, i32* %36
%244 = mul nsw i32 %242, %243
%245 = load i32, i32* %37
%246 = mul nsw i32 %244, %245
%247 = load i32, i32* %70
%248 = load i32, i32* %37
%249 = mul nsw i32 %247, %248
%250 = add nsw i32 %246, %249
%251 = load i32, i32* %71
%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* %74
%256 = load double*, double** %51
%257 = load i32, i32* %69
%258 = load i32, i32* %36
%259 = mul nsw i32 %257, %258
%260 = load i32, i32* %37
%261 = mul nsw i32 %259, %260
%262 = load i32, i32* %70
%263 = load i32, i32* %37
%264 = mul nsw i32 %262, %263
%265 = add nsw i32 %261, %264
%266 = load i32, i32* %71
%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** %64
%273 = load i32, i32* %69
%274 = load i32, i32* %36
%275 = mul nsw i32 %273, %274
%276 = load i32, i32* %37
%277 = mul nsw i32 %275, %276
%278 = load i32, i32* %70
%279 = load i32, i32* %37
%280 = mul nsw i32 %278, %279
%281 = add nsw i32 %277, %280
%282 = load i32, i32* %71
%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* %74
%287 = load double*, double** %52
%288 = load i32, i32* %69
%289 = load i32, i32* %36
%290 = mul nsw i32 %288, %289
%291 = load i32, i32* %37
%292 = mul nsw i32 %290, %291
%293 = load i32, i32* %70
%294 = load i32, i32* %37
%295 = mul nsw i32 %293, %294
%296 = add nsw i32 %292, %295
%297 = load i32, i32* %71
%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** %65
%304 = load i32, i32* %69
%305 = load i32, i32* %36
%306 = mul nsw i32 %304, %305
%307 = load i32, i32* %37
%308 = mul nsw i32 %306, %307
%309 = load i32, i32* %70
%310 = load i32, i32* %37
%311 = mul nsw i32 %309, %310
%312 = add nsw i32 %308, %311
%313 = load i32, i32* %71
%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* %74
%318 = load double*, double** %54
%319 = load i32, i32* %69
%320 = load i32, i32* %36
%321 = mul nsw i32 %319, %320
%322 = load i32, i32* %37
%323 = mul nsw i32 %321, %322
%324 = load i32, i32* %70
%325 = load i32, i32* %37
%326 = mul nsw i32 %324, %325
%327 = add nsw i32 %323, %326
%328 = load i32, i32* %71
%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** %67
%335 = load i32, i32* %69
%336 = load i32, i32* %36
%337 = mul nsw i32 %335, %336
%338 = load i32, i32* %37
%339 = mul nsw i32 %337, %338
%340 = load i32, i32* %70
%341 = load i32, i32* %37
%342 = mul nsw i32 %340, %341
%343 = add nsw i32 %339, %342
%344 = load i32, i32* %71
%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* %74
%349 = load double*, double** %55
%350 = load i32, i32* %69
%351 = load i32, i32* %36
%352 = mul nsw i32 %350, %351
%353 = load i32, i32* %37
%354 = mul nsw i32 %352, %353
%355 = load i32, i32* %70
%356 = load i32, i32* %37
%357 = mul nsw i32 %355, %356
%358 = add nsw i32 %354, %357
%359 = load i32, i32* %71
%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** %68
%366 = load i32, i32* %69
%367 = load i32, i32* %36
%368 = mul nsw i32 %366, %367
%369 = load i32, i32* %37
%370 = mul nsw i32 %368, %369
%371 = load i32, i32* %70
%372 = load i32, i32* %37
%373 = mul nsw i32 %371, %372
%374 = add nsw i32 %370, %373
%375 = load i32, i32* %71
%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* %75
%380 = load double*, double** %44
%381 = load i32, i32* %69
%382 = load i32, i32* %36
%383 = mul nsw i32 %381, %382
%384 = load i32, i32* %37
%385 = mul nsw i32 %383, %384
%386 = load i32, i32* %70
%387 = load i32, i32* %37
%388 = mul nsw i32 %386, %387
%389 = add nsw i32 %385, %388
%390 = load i32, i32* %71
%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** %57
%397 = load i32, i32* %69
%398 = load i32, i32* %36
%399 = mul nsw i32 %397, %398
%400 = load i32, i32* %37
%401 = mul nsw i32 %399, %400
%402 = load i32, i32* %70
%403 = load i32, i32* %37
%404 = mul nsw i32 %402, %403
%405 = add nsw i32 %401, %404
%406 = load i32, i32* %71
%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* %75
%411 = load double*, double** %45
%412 = load i32, i32* %69
%413 = load i32, i32* %36
%414 = mul nsw i32 %412, %413
%415 = load i32, i32* %37
%416 = mul nsw i32 %414, %415
%417 = load i32, i32* %70
%418 = load i32, i32* %37
%419 = mul nsw i32 %417, %418
%420 = add nsw i32 %416, %419
%421 = load i32, i32* %71
%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** %58
%428 = load i32, i32* %69
%429 = load i32, i32* %36
%430 = mul nsw i32 %428, %429
%431 = load i32, i32* %37
%432 = mul nsw i32 %430, %431
%433 = load i32, i32* %70
%434 = load i32, i32* %37
%435 = mul nsw i32 %433, %434
%436 = add nsw i32 %432, %435
%437 = load i32, i32* %71
%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* %71
%443 = add nsw i32 %442, 1
store i32 %443, i32* %71
br label %188
444: ; preds = %188
br label %445
445: ; preds = %444
%446 = load i32, i32* %70
%447 = add nsw i32 %446, 1
store i32 %447, i32* %70
br label %86
448: ; preds = %86
br label %449
449: ; preds = %448
%450 = load i32, i32* %69
%451 = add nsw i32 %450, 1
store i32 %451, i32* %69
br label %76
452: ; preds = %76
ret void
}

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