#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double sqrt(double);
void calculateSubgridErrorNavierStokes2D_generic_tau_sd(
    int nElements_global, int nQuadraturePoints_element, int nSpace,
    double *inverseJ, double *dmt, double *dm, double *f, double *a,
    double *tau0, double *tau1, double *cfl) {
  int eN, k, nSpace2 = nSpace * nSpace, I, J, K;
  double density, viscosity, Re_max = 0.0, CFL_max = 0.0, nrm_v, G_IJ, v_dot_Gv,
                             CI_nu2_G_ddot_G, Gv_I, CI = 36.0 * 36.0, g_I,
                             g_dot_g, den;
  for (eN = 0; eN < nElements_global; eN++) {
    for (k = 0; k < nQuadraturePoints_element; k++) {
      v_dot_Gv = 0.0;
      CI_nu2_G_ddot_G = 0.0;
      g_dot_g = 0.0;
      for (I = 0; I < nSpace; I++) {
        Gv_I = 0.0;
        g_I = 0.0;
        for (J = 0; J < nSpace; J++) {
          G_IJ = 0.0;
          for (K = 0; K < nSpace; K++)
            G_IJ += inverseJ[eN * nQuadraturePoints_element * nSpace2 +
                             k * nSpace2 + K * nSpace + I] *
                    inverseJ[eN * nQuadraturePoints_element * nSpace2 +
                             k * nSpace2 + K * nSpace + J];
          Gv_I += G_IJ *
                  f[eN * nQuadraturePoints_element * nSpace + k * nSpace + J];
          CI_nu2_G_ddot_G += G_IJ * G_IJ;
          g_I += inverseJ[eN * nQuadraturePoints_element * nSpace2 +
                          k * nSpace2 + J * nSpace + I];
        }
        g_dot_g += g_I * g_I;
        v_dot_Gv +=
            f[eN * nQuadraturePoints_element * nSpace + k * nSpace + I] * Gv_I;
      }
      density = dm[eN * nQuadraturePoints_element + k];
      viscosity = a[eN * nQuadraturePoints_element * nSpace + k * nSpace + 1];
      CI_nu2_G_ddot_G *= CI * viscosity * viscosity;
      cfl[eN * nQuadraturePoints_element + k] = sqrt(v_dot_Gv);
      den = sqrt(4.0 * dmt[eN * nQuadraturePoints_element + k] *
                     dmt[eN * nQuadraturePoints_element + k] +
                 v_dot_Gv + CI_nu2_G_ddot_G + 1.0e-8);
      if (den > 1.0e-8) {
        tau0[eN * nQuadraturePoints_element + k] = 1.0 / den;
        tau1[eN * nQuadraturePoints_element + k] =
            sqrt(v_dot_Gv + CI_nu2_G_ddot_G) / g_dot_g;
      } else {
        tau0[eN * nQuadraturePoints_element + k] = 0.0;
        tau1[eN * nQuadraturePoints_element + k] = 0.0;
      }
    }
  }
}


x86 assembly (clang, -O0):
<calculateSubgridErrorNavierStokes2D_generic_tau_sd>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
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    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe9a(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    153f <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x42f>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    152c <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x41c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1397 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x287>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1324 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x214>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    127e <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x16e>
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x34(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x34(%rbp),%edx
add    %edx,%ecx
mov    -0x40(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x34(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x34(%rbp),%edx
add    %edx,%ecx
mov    -0x40(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11fa <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0xea>
movsd  -0x70(%rbp),%xmm0
mov    0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x34(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x34(%rbp),%edx
add    %edx,%ecx
mov    -0x3c(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11df <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0xcf>
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11b6 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0xa6>
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1030 <sqrt@plt>
mov    0x30(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  0xbe1(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  0xba4(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0xb83(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14e7 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x3d7>
movsd  0xb81(%rip),%xmm0
divsd  -0xa8(%rbp),%xmm0
ff
mov    0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
call   1030 <sqrt@plt>
divsd  -0xa0(%rbp),%xmm0
ff
mov    0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1519 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x409>
mov    0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    151e <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x40e>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1188 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x78>
jmp    1531 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x421>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1175 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x65>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridErrorNavierStokes2D_generic_tau_sd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %r8,0x90(%rsp)
mov    %esi,0x10(%rsp)
test   %edi,%edi
jle    1580 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x470>
mov    %rcx,%r15
mov    %edx,%ebp
mov    %edx,%ecx
imul   %ebp,%ecx
movslq %edx,%r12
mov    0x10(%rsp),%eax
movslq %eax,%rdx
mov    %edi,%esi
mov    %rsi,0x70(%rsp)
mov    %rdx,0x68(%rsp)
mov    %edx,%edx
mov    %rdx,0x88(%rsp)
mov    %r12d,%r14d
mov    %r14,0xa0(%rsp)
and    $0xfffffffe,%r14d
lea    0x0(,%r12,8),%rdx
mov    %rdx,0x78(%rsp)
mov    %ecx,0x14(%rsp)
imul   %eax,%ecx
mov    %ecx,0x44(%rsp)
mov    %r12,0x98(%rsp)
shl    $0x4,%r12
xorpd  %xmm4,%xmm4
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
mov    %ebp,0x4c(%rsp)
jmp    11da <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0xca>
nopw   0x0(%rax,%rax,1)
mov    0x20(%rsp),%rcx
add    $0x1,%rcx
mov    0x28(%rsp),%rax
add    0x44(%rsp),%eax
mov    %rax,0x28(%rsp)
mov    %rcx,%rax
mov    %rcx,0x20(%rsp)
cmp    0x70(%rsp),%rcx
je     1580 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x470>
cmpl   $0x0,0x10(%rsp)
jle    11b0 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0xa0>
mov    0x20(%rsp),%r13
imul   0x68(%rsp),%r13
mov    0x28(%rsp),%rax
xor    %ecx,%ecx
mov    %rcx,0x18(%rsp)
mov    %r13,0x80(%rsp)
jmp    1258 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x148>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xf0(%rsp),%rax
movq   $0x0,(%rax,%rbx,8)
xorpd  %xmm0,%xmm0
mov    0xf8(%rsp),%rax
movsd  %xmm0,(%rax,%rbx,8)
mov    0x18(%rsp),%rdx
add    $0x1,%rdx
mov    0x48(%rsp),%eax
add    0x14(%rsp),%eax
mov    %rdx,%rcx
mov    %rdx,0x18(%rsp)
cmp    0x88(%rsp),%rdx
je     11b0 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0xa0>
test   %ebp,%ebp
mov    %eax,0x48(%rsp)
jle    1410 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x300>
movslq %eax,%rcx
mov    0x78(%rsp),%rax
lea    (%rax,%rcx,8),%rdx
shl    $0x3,%rcx
mov    0x18(%rsp),%rax
add    %r13d,%eax
mov    %eax,%esi
imul   0x14(%rsp),%esi
imul   %ebp,%eax
mov    %rsi,0x30(%rsp)
movslq %esi,%rsi
mov    %rsi,0x50(%rsp)
movslq %eax,%rdi
xorpd  %xmm1,%xmm1
xorpd  %xmm5,%xmm5
mov    %rcx,0x8(%rsp)
mov    %rcx,%rax
mov    %rdx,0x38(%rsp)
mov    %rdx,%rcx
xor    %edx,%edx
jmp    12fa <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x1ea>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rdx,%rdi,1),%rsi
mov    0xe0(%rsp),%rbx
movsd  (%rbx,%rsi,8),%xmm2
unpcklpd %xmm1,%xmm2
unpcklpd %xmm1,%xmm6
mulpd  %xmm2,%xmm6
movapd %xmm6,%xmm1
addpd  %xmm0,%xmm1
add    $0x1,%rdx
add    $0x8,%rcx
add    $0x8,%rax
cmp    %r11,%rdx
je     1400 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x2f0>
movapd %xmm1,%xmm0
mov    0x30(%rsp),%rsi
add    %edx,%esi
mov    0x8(%rsp),%r9
mov    0x38(%rsp),%r8
xor    %r10d,%r10d
xorpd  %xmm1,%xmm1
xorpd  %xmm6,%xmm6
jmp    136c <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x25c>
nopl   0x0(%rax)
lea    (%r10,%rdi,1),%rbx
mov    0xe0(%rsp),%rbp
movsd  0x0(%rbp,%rbx,8),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm6
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm5
mov    %r10d,%ebx
mov    0x4c(%rsp),%ebp
imul   %ebp,%ebx
add    %esi,%ebx
movslq %ebx,%rbx
addsd  (%r15,%rbx,8),%xmm1
add    $0x1,%r10
add    $0x8,%r8
add    $0x8,%r9
cmp    %r11,%r10
je     12c0 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x1b0>
xorpd  %xmm2,%xmm2
cmp    $0x1,%ebp
jne    1380 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x270>
xor    %r13d,%r13d
jmp    13ba <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x2aa>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rbx
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
movsd  (%rbx,%rax,1),%xmm3
mulsd  (%rbx,%r9,1),%xmm3
addsd  %xmm2,%xmm3
movsd  (%rbx,%rcx,1),%xmm2
mulsd  (%rbx,%r8,1),%xmm2
addsd  %xmm3,%xmm2
add    $0x2,%r13
add    %r12,%rbx
cmp    %r13,%r14
jne    1390 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x280>
mov    0xa0(%rsp),%r11
test   $0x1,%r11b
je     1320 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x210>
imul   0x98(%rsp),%r13
add    0x50(%rsp),%r13
lea    (%rdx,%r13,1),%rbx
movsd  (%r15,%rbx,8),%xmm3
add    %r10,%r13
mulsd  (%r15,%r13,8),%xmm3
addsd  %xmm3,%xmm2
jmp    1320 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x210>
cs nopw 0x0(%rax,%rax,1)
addpd  %xmm0,%xmm6
mov    0x80(%rsp),%r13
jmp    1418 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x308>
xchg   %ax,%ax
xorpd  %xmm6,%xmm6
xorpd  %xmm5,%xmm5
mov    0x18(%rsp),%rax
lea    (%rax,%r13,1),%rbx
mov    %ebx,%eax
imul   %ebp,%eax
cltq
mov    0xe8(%rsp),%rcx
movsd  0x8(%rcx,%rax,8),%xmm1
movapd %xmm1,%xmm2
mulsd  0xbbe(%rip),%xmm2
ucomisd %xmm4,%xmm6
movapd %xmm6,0x50(%rsp)
jb     1460 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x350>
xorps  %xmm0,%xmm0
sqrtsd %xmm6,%xmm0
jmp    1497 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x387>
nopw   0x0(%rax,%rax,1)
movapd %xmm6,%xmm0
movsd  %xmm5,0x8(%rsp)
movsd  %xmm1,0x38(%rsp)
movsd  %xmm2,0x30(%rsp)
call   1030 <sqrt@plt>
movsd  0x30(%rsp),%xmm2
movsd  0x38(%rsp),%xmm1
movapd 0x50(%rsp),%xmm6
movsd  0x8(%rsp),%xmm5
xorpd  %xmm4,%xmm4
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm5
mov    0x100(%rsp),%rax
movsd  %xmm0,(%rax,%rbx,8)
mov    0x90(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm1
movapd %xmm1,%xmm0
mulsd  0xb43(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm5,%xmm0
addsd  0xb37(%rip),%xmm0
ucomisd %xmm4,%xmm0
jb     1500 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x3f0>
sqrtsd %xmm0,%xmm0
ucomisd 0xb25(%rip),%xmm0
jbe    1210 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x100>
jmp    1529 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x419>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm5,0x8(%rsp)
call   1030 <sqrt@plt>
movapd 0x50(%rsp),%xmm6
movsd  0x8(%rsp),%xmm5
xorpd  %xmm4,%xmm4
ucomisd 0xaed(%rip),%xmm0
jbe    1210 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x100>
movsd  0xae7(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    0xf0(%rsp),%rax
movsd  %xmm1,(%rax,%rbx,8)
addsd  %xmm6,%xmm5
ucomisd %xmm4,%xmm5
jb     1560 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x450>
xorps  %xmm0,%xmm0
sqrtsd %xmm5,%xmm0
jmp    1573 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x463>
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm5,%xmm0
call   1030 <sqrt@plt>
movapd 0x50(%rsp),%xmm6
xorpd  %xmm4,%xmm4
unpckhpd %xmm6,%xmm6
divsd  %xmm6,%xmm0
jmp    1224 <calculateSubgridErrorNavierStokes2D_generic_tau_sd+0x114>
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @calculateSubgridErrorNavierStokes2D_generic_tau_sd(i32 %0, i32 %1, i32 %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, double* %9, double* %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
store i32 %0, i32* %12
store i32 %1, i32* %13
store i32 %2, i32* %14
store double* %3, double** %15
store double* %4, double** %16
store double* %5, double** %17
store double* %6, double** %18
store double* %7, double** %19
store double* %8, double** %20
store double* %9, double** %21
store double* %10, double** %22
%42 = load i32, i32* %14
%43 = load i32, i32* %14
%44 = mul nsw i32 %42, %43
store i32 %44, i32* %25
store double 0.000000e+00, double* %31
store double 0.000000e+00, double* %32
store double 1.296000e+03, double* %38
store i32 0, i32* %23
br label %45
45: ; preds = %301, %11
%46 = load i32, i32* %23
%47 = load i32, i32* %12
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %304
49: ; preds = %45
store i32 0, i32* %24
br label %50
50: ; preds = %297, %49
%51 = load i32, i32* %24
%52 = load i32, i32* %13
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %300
54: ; preds = %50
store double 0.000000e+00, double* %35
store double 0.000000e+00, double* %36
store double 0.000000e+00, double* %40
store i32 0, i32* %26
br label %55
55: ; preds = %183, %54
%56 = load i32, i32* %26
%57 = load i32, i32* %14
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %186
59: ; preds = %55
store double 0.000000e+00, double* %37
store double 0.000000e+00, double* %39
store i32 0, i32* %27
br label %60
60: ; preds = %157, %59
%61 = load i32, i32* %27
%62 = load i32, i32* %14
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %160
64: ; preds = %60
store double 0.000000e+00, double* %34
store i32 0, i32* %28
br label %65
65: ; preds = %110, %64
%66 = load i32, i32* %28
%67 = load i32, i32* %14
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %113
69: ; preds = %65
%70 = load double*, double** %15
%71 = load i32, i32* %23
%72 = load i32, i32* %13
%73 = mul nsw i32 %71, %72
%74 = load i32, i32* %25
%75 = mul nsw i32 %73, %74
%76 = load i32, i32* %24
%77 = load i32, i32* %25
%78 = mul nsw i32 %76, %77
%79 = add nsw i32 %75, %78
%80 = load i32, i32* %28
%81 = load i32, i32* %14
%82 = mul nsw i32 %80, %81
%83 = add nsw i32 %79, %82
%84 = load i32, i32* %26
%85 = add nsw i32 %83, %84
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %70, i64 %86
%88 = load double, double* %87
%89 = load double*, double** %15
%90 = load i32, i32* %23
%91 = load i32, i32* %13
%92 = mul nsw i32 %90, %91
%93 = load i32, i32* %25
%94 = mul nsw i32 %92, %93
%95 = load i32, i32* %24
%96 = load i32, i32* %25
%97 = mul nsw i32 %95, %96
%98 = add nsw i32 %94, %97
%99 = load i32, i32* %28
%100 = load i32, i32* %14
%101 = mul nsw i32 %99, %100
%102 = add nsw i32 %98, %101
%103 = load i32, i32* %27
%104 = add nsw i32 %102, %103
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %89, i64 %105
%107 = load double, double* %106
%108 = load double, double* %34
%109 = call double @llvm.fmuladd.f64(double %88, double %107, double %108)
store double %109, double* %34
br label %110
110: ; preds = %69
%111 = load i32, i32* %28
%112 = add nsw i32 %111, 1
store i32 %112, i32* %28
br label %65
113: ; preds = %65
%114 = load double, double* %34
%115 = load double*, double** %18
%116 = load i32, i32* %23
%117 = load i32, i32* %13
%118 = mul nsw i32 %116, %117
%119 = load i32, i32* %14
%120 = mul nsw i32 %118, %119
%121 = load i32, i32* %24
%122 = load i32, i32* %14
%123 = mul nsw i32 %121, %122
%124 = add nsw i32 %120, %123
%125 = load i32, i32* %27
%126 = add nsw i32 %124, %125
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %115, i64 %127
%129 = load double, double* %128
%130 = load double, double* %37
%131 = call double @llvm.fmuladd.f64(double %114, double %129, double %130)
store double %131, double* %37
%132 = load double, double* %34
%133 = load double, double* %34
%134 = load double, double* %36
%135 = call double @llvm.fmuladd.f64(double %132, double %133, double %134)
store double %135, double* %36
%136 = load double*, double** %15
%137 = load i32, i32* %23
%138 = load i32, i32* %13
%139 = mul nsw i32 %137, %138
%140 = load i32, i32* %25
%141 = mul nsw i32 %139, %140
%142 = load i32, i32* %24
%143 = load i32, i32* %25
%144 = mul nsw i32 %142, %143
%145 = add nsw i32 %141, %144
%146 = load i32, i32* %27
%147 = load i32, i32* %14
%148 = mul nsw i32 %146, %147
%149 = add nsw i32 %145, %148
%150 = load i32, i32* %26
%151 = add nsw i32 %149, %150
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %136, i64 %152
%154 = load double, double* %153
%155 = load double, double* %39
%156 = fadd double %155, %154
store double %156, double* %39
br label %157
157: ; preds = %113
%158 = load i32, i32* %27
%159 = add nsw i32 %158, 1
store i32 %159, i32* %27
br label %60
160: ; preds = %60
%161 = load double, double* %39
%162 = load double, double* %39
%163 = load double, double* %40
%164 = call double @llvm.fmuladd.f64(double %161, double %162, double %163)
store double %164, double* %40
%165 = load double*, double** %18
%166 = load i32, i32* %23
%167 = load i32, i32* %13
%168 = mul nsw i32 %166, %167
%169 = load i32, i32* %14
%170 = mul nsw i32 %168, %169
%171 = load i32, i32* %24
%172 = load i32, i32* %14
%173 = mul nsw i32 %171, %172
%174 = add nsw i32 %170, %173
%175 = load i32, i32* %26
%176 = add nsw i32 %174, %175
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double, double* %165, i64 %177
%179 = load double, double* %178
%180 = load double, double* %37
%181 = load double, double* %35
%182 = call double @llvm.fmuladd.f64(double %179, double %180, double %181)
store double %182, double* %35
br label %183
183: ; preds = %160
%184 = load i32, i32* %26
%185 = add nsw i32 %184, 1
store i32 %185, i32* %26
br label %55
186: ; preds = %55
%187 = load double*, double** %17
%188 = load i32, i32* %23
%189 = load i32, i32* %13
%190 = mul nsw i32 %188, %189
%191 = load i32, i32* %24
%192 = add nsw i32 %190, %191
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds double, double* %187, i64 %193
%195 = load double, double* %194
store double %195, double* %29
%196 = load double*, double** %19
%197 = load i32, i32* %23
%198 = load i32, i32* %13
%199 = mul nsw i32 %197, %198
%200 = load i32, i32* %14
%201 = mul nsw i32 %199, %200
%202 = load i32, i32* %24
%203 = load i32, i32* %14
%204 = mul nsw i32 %202, %203
%205 = add nsw i32 %201, %204
%206 = add nsw i32 %205, 1
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds double, double* %196, i64 %207
%209 = load double, double* %208
store double %209, double* %30
%210 = load double, double* %38
%211 = load double, double* %30
%212 = fmul double %210, %211
%213 = load double, double* %30
%214 = fmul double %212, %213
%215 = load double, double* %36
%216 = fmul double %215, %214
store double %216, double* %36
%217 = load double, double* %35
%218 = call double @sqrt(double %217)
%219 = load double*, double** %22
%220 = load i32, i32* %23
%221 = load i32, i32* %13
%222 = mul nsw i32 %220, %221
%223 = load i32, i32* %24
%224 = add nsw i32 %222, %223
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds double, double* %219, i64 %225
store double %218, double* %226
%227 = load double*, double** %16
%228 = load i32, i32* %23
%229 = load i32, i32* %13
%230 = mul nsw i32 %228, %229
%231 = load i32, i32* %24
%232 = add nsw i32 %230, %231
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds double, double* %227, i64 %233
%235 = load double, double* %234
%236 = fmul double 4.000000e+00, %235
%237 = load double*, double** %16
%238 = load i32, i32* %23
%239 = load i32, i32* %13
%240 = mul nsw i32 %238, %239
%241 = load i32, i32* %24
%242 = add nsw i32 %240, %241
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds double, double* %237, i64 %243
%245 = load double, double* %244
%246 = load double, double* %35
%247 = call double @llvm.fmuladd.f64(double %236, double %245, double %246)
%248 = load double, double* %36
%249 = fadd double %247, %248
%250 = fadd double %249, 1.000000e-08
%251 = call double @sqrt(double %250)
store double %251, double* %41
%252 = load double, double* %41
%253 = fcmp ogt double %252, 1.000000e-08
br i1 %253, label %254, label %279
254: ; preds = %186
%255 = load double, double* %41
%256 = fdiv double 1.000000e+00, %255
%257 = load double*, double** %20
%258 = load i32, i32* %23
%259 = load i32, i32* %13
%260 = mul nsw i32 %258, %259
%261 = load i32, i32* %24
%262 = add nsw i32 %260, %261
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds double, double* %257, i64 %263
store double %256, double* %264
%265 = load double, double* %35
%266 = load double, double* %36
%267 = fadd double %265, %266
%268 = call double @sqrt(double %267)
%269 = load double, double* %40
%270 = fdiv double %268, %269
%271 = load double*, double** %21
%272 = load i32, i32* %23
%273 = load i32, i32* %13
%274 = mul nsw i32 %272, %273
%275 = load i32, i32* %24
%276 = add nsw i32 %274, %275
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds double, double* %271, i64 %277
store double %270, double* %278
br label %296
279: ; preds = %186
%280 = load double*, double** %20
%281 = load i32, i32* %23
%282 = load i32, i32* %13
%283 = mul nsw i32 %281, %282
%284 = load i32, i32* %24
%285 = add nsw i32 %283, %284
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds double, double* %280, i64 %286
store double 0.000000e+00, double* %287
%288 = load double*, double** %21
%289 = load i32, i32* %23
%290 = load i32, i32* %13
%291 = mul nsw i32 %289, %290
%292 = load i32, i32* %24
%293 = add nsw i32 %291, %292
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds double, double* %288, i64 %294
store double 0.000000e+00, double* %295
br label %296
296: ; preds = %279, %254
br label %297
297: ; preds = %296
%298 = load i32, i32* %24
%299 = add nsw i32 %298, 1
store i32 %299, i32* %24
br label %50
300: ; preds = %50
br label %301
301: ; preds = %300
%302 = load i32, i32* %23
%303 = add nsw i32 %302, 1
store i32 %303, i32* %23
br label %45
304: ; preds = %45
ret void
}

LLVM IR (-O2):
define void @calculateSubgridErrorNavierStokes2D_generic_tau_sd(i32 %0, i32 %1, i32 %2, double* nocapture %3, double* nocapture %4, double* nocapture readnone %5, double* nocapture %6, double* nocapture %7, double* nocapture writeonly %8, double* nocapture writeonly %9, double* nocapture writeonly %10) {
%12 = mul nsw i32 %2, %2
%13 = icmp sgt i32 %0, 0
br i1 %13, label %14, label %161
14: ; preds = %11
%15 = icmp sgt i32 %1, 0
%16 = icmp sgt i32 %2, 0
%17 = sext i32 %2 to i64
%18 = sext i32 %1 to i64
%19 = zext i32 %0 to i64
%20 = zext i32 %1 to i64
%21 = zext i32 %2 to i64
%22 = and i64 %21, 1
%23 = icmp eq i32 %2, 1
%24 = and i64 %21, 4294967294
%25 = icmp eq i64 %22, 0
br label %26
26: ; preds = %14, %158
%27 = phi i64 [ 0, %14 ], [ %159, %158 ]
br i1 %15, label %28, label %158
28: ; preds = %26
%29 = mul nsw i64 %27, %18
%30 = trunc i64 %29 to i32
br label %31
31: ; preds = %28, %153
%32 = phi i64 [ 0, %28 ], [ %156, %153 ]
br i1 %16, label %33, label %120
33: ; preds = %31
%34 = trunc i64 %32 to i32
%35 = add i32 %34, %30
%36 = mul i32 %35, %12
%37 = mul i32 %35, %2
%38 = sext i32 %36 to i64
%39 = sext i32 %37 to i64
br label %40
40: ; preds = %107, %33
%41 = phi i64 [ 0, %33 ], [ %116, %107 ]
%42 = phi double [ 0.000000e+00, %33 ], [ %97, %107 ]
%43 = phi <2 x double> [ zeroinitializer, %33 ], [ %115, %107 ]
%44 = trunc i64 %41 to i32
%45 = add i32 %36, %44
br label %46
46: ; preds = %91, %40
%47 = phi i64 [ 0, %40 ], [ %105, %91 ]
%48 = phi double [ 0.000000e+00, %40 ], [ %104, %91 ]
%49 = phi double [ 0.000000e+00, %40 ], [ %96, %91 ]
%50 = phi double [ %42, %40 ], [ %97, %91 ]
br i1 %23, label %77, label %51
51: ; preds = %46, %51
%52 = phi i64 [ %74, %51 ], [ 0, %46 ]
%53 = phi double [ %73, %51 ], [ 0.000000e+00, %46 ]
%54 = phi i64 [ %75, %51 ], [ 0, %46 ]
%55 = mul nsw i64 %52, %17
%56 = add nsw i64 %55, %38
%57 = add nsw i64 %56, %41
%58 = getelementptr inbounds double, double* %3, i64 %57
%59 = load double, double* %58
%60 = add nsw i64 %56, %47
%61 = getelementptr inbounds double, double* %3, i64 %60
%62 = load double, double* %61
%63 = tail call double @llvm.fmuladd.f64(double %59, double %62, double %53)
%64 = or i64 %52, 1
%65 = mul nsw i64 %64, %17
%66 = add nsw i64 %65, %38
%67 = add nsw i64 %66, %41
%68 = getelementptr inbounds double, double* %3, i64 %67
%69 = load double, double* %68
%70 = add nsw i64 %66, %47
%71 = getelementptr inbounds double, double* %3, i64 %70
%72 = load double, double* %71
%73 = tail call double @llvm.fmuladd.f64(double %69, double %72, double %63)
%74 = add nuw nsw i64 %52, 2
%75 = add i64 %54, 2
%76 = icmp eq i64 %75, %24
br i1 %76, label %77, label %51
77: ; preds = %51, %46
%78 = phi double [ undef, %46 ], [ %73, %51 ]
%79 = phi i64 [ 0, %46 ], [ %74, %51 ]
%80 = phi double [ 0.000000e+00, %46 ], [ %73, %51 ]
br i1 %25, label %91, label %81
81: ; preds = %77
%82 = mul nsw i64 %79, %17
%83 = add nsw i64 %82, %38
%84 = add nsw i64 %83, %41
%85 = getelementptr inbounds double, double* %3, i64 %84
%86 = load double, double* %85
%87 = add nsw i64 %83, %47
%88 = getelementptr inbounds double, double* %3, i64 %87
%89 = load double, double* %88
%90 = tail call double @llvm.fmuladd.f64(double %86, double %89, double %80)
br label %91
91: ; preds = %77, %81
%92 = phi double [ %78, %77 ], [ %90, %81 ]
%93 = add nsw i64 %47, %39
%94 = getelementptr inbounds double, double* %6, i64 %93
%95 = load double, double* %94
%96 = tail call double @llvm.fmuladd.f64(double %92, double %95, double %49)
%97 = tail call double @llvm.fmuladd.f64(double %92, double %92, double %50)
%98 = trunc i64 %47 to i32
%99 = mul i32 %98, %2
%100 = add i32 %45, %99
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %3, i64 %101
%103 = load double, double* %102
%104 = fadd double %48, %103
%105 = add nuw nsw i64 %47, 1
%106 = icmp eq i64 %105, %21
br i1 %106, label %107, label %46
107: ; preds = %91
%108 = add nsw i64 %41, %39
%109 = getelementptr inbounds double, double* %6, i64 %108
%110 = load double, double* %109
%111 = insertelement <2 x double> poison, double %110, i64 0
%112 = insertelement <2 x double> %111, double %104, i64 1
%113 = insertelement <2 x double> poison, double %96, i64 0
%114 = insertelement <2 x double> %113, double %104, i64 1
%115 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %112, <2 x double> %114, <2 x double> %43)
%116 = add nuw nsw i64 %41, 1
%117 = icmp eq i64 %116, %21
br i1 %117, label %118, label %40
118: ; preds = %107
%119 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %112, <2 x double> %114, <2 x double> %43)
br label %120
120: ; preds = %118, %31
%121 = phi double [ 0.000000e+00, %31 ], [ %97, %118 ]
%122 = phi <2 x double> [ zeroinitializer, %31 ], [ %119, %118 ]
%123 = add nsw i64 %32, %29
%124 = trunc i64 %123 to i32
%125 = mul i32 %124, %2
%126 = add nsw i32 %125, 1
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %7, i64 %127
%129 = load double, double* %128
%130 = fmul double %129, 1.296000e+03
%131 = fmul double %129, %130
%132 = fmul double %121, %131
%133 = extractelement <2 x double> %122, i64 0
%134 = tail call double @sqrt(double %133)
%135 = getelementptr inbounds double, double* %10, i64 %123
store double %134, double* %135
%136 = getelementptr inbounds double, double* %4, i64 %123
%137 = load double, double* %136
%138 = fmul double %137, 4.000000e+00
%139 = tail call double @llvm.fmuladd.f64(double %138, double %137, double %133)
%140 = fadd double %132, %139
%141 = fadd double %140, 1.000000e-08
%142 = tail call double @sqrt(double %141)
%143 = fcmp ogt double %142, 1.000000e-08
br i1 %143, label %144, label %151
144: ; preds = %120
%145 = fdiv double 1.000000e+00, %142
%146 = getelementptr inbounds double, double* %8, i64 %123
store double %145, double* %146
%147 = fadd double %133, %132
%148 = tail call double @sqrt(double %147)
%149 = extractelement <2 x double> %122, i64 1
%150 = fdiv double %148, %149
br label %153
151: ; preds = %120
%152 = getelementptr inbounds double, double* %8, i64 %123
store double 0.000000e+00, double* %152
br label %153
153: ; preds = %144, %151
%154 = phi double [ %150, %144 ], [ 0.000000e+00, %151 ]
%155 = getelementptr inbounds double, double* %9, i64 %123
store double %154, double* %155
%156 = add nuw nsw i64 %32, 1
%157 = icmp eq i64 %156, %20
br i1 %157, label %158, label %31
158: ; preds = %153, %26
%159 = add nuw nsw i64 %27, 1
%160 = icmp eq i64 %159, %19
br i1 %160, label %161, label %26
161: ; preds = %158, %11
ret void
}