#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(
    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 * nSpace2 + k * nSpace2 +
                    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>:
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    1542 <calculateSubgridErrorNavierStokes2D_generic_tau+0x432>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    152f <calculateSubgridErrorNavierStokes2D_generic_tau+0x41f>
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+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+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+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+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+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+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   -0x34(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x34(%rbp),%edx
add    %edx,%ecx
add    -0xc(%rbp),%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  0xbde(%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  0xba1(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0xb80(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    14ea <calculateSubgridErrorNavierStokes2D_generic_tau+0x3da>
movsd  0xb7e(%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    151c <calculateSubgridErrorNavierStokes2D_generic_tau+0x40c>
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    1521 <calculateSubgridErrorNavierStokes2D_generic_tau+0x411>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1188 <calculateSubgridErrorNavierStokes2D_generic_tau+0x78>
jmp    1534 <calculateSubgridErrorNavierStokes2D_generic_tau+0x424>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1175 <calculateSubgridErrorNavierStokes2D_generic_tau+0x65>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridErrorNavierStokes2D_generic_tau>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %r8,0x98(%rsp)
mov    %esi,0x14(%rsp)
test   %edi,%edi
jle    1565 <calculateSubgridErrorNavierStokes2D_generic_tau+0x455>
mov    %rcx,%r15
mov    %edx,%ecx
imul   %edx,%ecx
lea    0x1(%rdx),%eax
mov    %eax,0x48(%rsp)
movslq %edx,%rsi
mov    0x14(%rsp),%eax
movslq %eax,%rbp
mov    %edi,%edi
mov    %rdi,0x80(%rsp)
mov    %rbp,0x78(%rsp)
mov    %ebp,%edi
mov    %rdi,0x90(%rsp)
mov    %esi,%r12d
mov    %r12d,%r13d
and    $0xfffffffe,%r13d
mov    %ecx,0x4(%rsp)
imul   %eax,%ecx
mov    %ecx,0x44(%rsp)
mov    %rsi,%r14
shl    $0x4,%r14
xorpd  %xmm4,%xmm4
mov    %rsi,0xa0(%rsp)
lea    0x0(,%rsi,8),%rax
mov    %rax,0x88(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
mov    %rdx,0x18(%rsp)
jmp    11ed <calculateSubgridErrorNavierStokes2D_generic_tau+0xdd>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
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    0x80(%rsp),%rcx
je     1565 <calculateSubgridErrorNavierStokes2D_generic_tau+0x455>
cmpl   $0x0,0x14(%rsp)
jle    11c0 <calculateSubgridErrorNavierStokes2D_generic_tau+0xb0>
mov    0x20(%rsp),%rax
imul   0x78(%rsp),%rax
mov    %rax,0x68(%rsp)
mov    0x28(%rsp),%rax
xor    %ecx,%ecx
jmp    1250 <calculateSubgridErrorNavierStokes2D_generic_tau+0x140>
nopl   (%rax)
mov    0xf0(%rsp),%rax
movq   $0x0,(%rax,%rbp,8)
xorpd  %xmm0,%xmm0
mov    0xf8(%rsp),%rax
movsd  %xmm0,(%rax,%rbp,8)
mov    0x70(%rsp),%rcx
add    $0x1,%rcx
mov    0x4c(%rsp),%eax
add    0x4(%rsp),%eax
cmp    0x90(%rsp),%rcx
je     11c0 <calculateSubgridErrorNavierStokes2D_generic_tau+0xb0>
test   %edx,%edx
mov    %rcx,0x70(%rsp)
mov    %eax,0x4c(%rsp)
jle    1400 <calculateSubgridErrorNavierStokes2D_generic_tau+0x2f0>
movslq %eax,%rsi
mov    0x88(%rsp),%rax
lea    (%rax,%rsi,8),%rbp
shl    $0x3,%rsi
mov    0x68(%rsp),%rax
add    %ecx,%eax
mov    %eax,%ecx
imul   0x4(%rsp),%ecx
imul   %edx,%eax
mov    %rcx,0x30(%rsp)
movslq %ecx,%rcx
mov    %rcx,0x50(%rsp)
movslq %eax,%rdi
xorpd  %xmm1,%xmm1
xorpd  %xmm5,%xmm5
mov    %rsi,0x8(%rsp)
mov    %rsi,%rax
mov    %rbp,0x38(%rsp)
mov    %rbp,%rcx
xor    %r11d,%r11d
jmp    12fb <calculateSubgridErrorNavierStokes2D_generic_tau+0x1eb>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r11,%rdi,1),%rsi
mov    0xe0(%rsp),%rbp
movsd  0x0(%rbp,%rsi,8),%xmm2
unpcklpd %xmm1,%xmm2
unpcklpd %xmm1,%xmm6
mulpd  %xmm2,%xmm6
movapd %xmm6,%xmm1
addpd  %xmm0,%xmm1
add    $0x1,%r11
add    $0x8,%rcx
add    $0x8,%rax
cmp    %r12,%r11
je     13f0 <calculateSubgridErrorNavierStokes2D_generic_tau+0x2e0>
movapd %xmm1,%xmm0
mov    0x30(%rsp),%rsi
lea    (%rsi,%r11,1),%ebp
mov    0x8(%rsp),%rsi
mov    0x38(%rsp),%r8
xor    %r9d,%r9d
xorpd  %xmm1,%xmm1
xorpd  %xmm6,%xmm6
jmp    136c <calculateSubgridErrorNavierStokes2D_generic_tau+0x25c>
nop
lea    (%r9,%rdi,1),%rbx
mov    0xe0(%rsp),%rdx
movsd  (%rdx,%rbx,8),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm6
mulsd  %xmm2,%xmm2
addsd  %xmm2,%xmm5
mov    %r9d,%ebx
mov    0x18(%rsp),%rdx
imul   %edx,%ebx
add    %ebp,%ebx
movslq %ebx,%rbx
addsd  (%r15,%rbx,8),%xmm1
add    $0x1,%r9
add    $0x8,%r8
add    $0x8,%rsi
cmp    %r12,%r9
je     12c0 <calculateSubgridErrorNavierStokes2D_generic_tau+0x1b0>
xorpd  %xmm2,%xmm2
cmp    $0x1,%edx
jne    1380 <calculateSubgridErrorNavierStokes2D_generic_tau+0x270>
xor    %r10d,%r10d
jmp    13b9 <calculateSubgridErrorNavierStokes2D_generic_tau+0x2a9>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rbx
xor    %r10d,%r10d
cs nopw 0x0(%rax,%rax,1)
movsd  (%rbx,%rax,1),%xmm3
mulsd  (%rbx,%rsi,1),%xmm3
addsd  %xmm2,%xmm3
movsd  (%rbx,%rcx,1),%xmm2
mulsd  (%rbx,%r8,1),%xmm2
addsd  %xmm3,%xmm2
add    $0x2,%r10
add    %r14,%rbx
cmp    %r10,%r13
jne    1390 <calculateSubgridErrorNavierStokes2D_generic_tau+0x280>
test   $0x1,%r12b
je     1320 <calculateSubgridErrorNavierStokes2D_generic_tau+0x210>
imul   0xa0(%rsp),%r10
add    0x50(%rsp),%r10
lea    (%r10,%r11,1),%rbx
movsd  (%r15,%rbx,8),%xmm3
add    %r9,%r10
mulsd  (%r15,%r10,8),%xmm3
addsd  %xmm3,%xmm2
jmp    1320 <calculateSubgridErrorNavierStokes2D_generic_tau+0x210>
nopl   (%rax)
addpd  %xmm0,%xmm6
mov    0x70(%rsp),%rcx
jmp    1408 <calculateSubgridErrorNavierStokes2D_generic_tau+0x2f8>
nopl   0x0(%rax,%rax,1)
xorpd  %xmm6,%xmm6
xorpd  %xmm5,%xmm5
mov    0x68(%rsp),%rax
lea    (%rcx,%rax,1),%rbp
mov    0x4(%rsp),%eax
imul   %ebp,%eax
add    0x48(%rsp),%eax
cltq
mov    0xe8(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm1
movapd %xmm1,%xmm2
mulsd  0xbc9(%rip),%xmm2
ucomisd %xmm4,%xmm6
movapd %xmm6,0x50(%rsp)
jb     1450 <calculateSubgridErrorNavierStokes2D_generic_tau+0x340>
xorps  %xmm0,%xmm0
sqrtsd %xmm6,%xmm0
jmp    1487 <calculateSubgridErrorNavierStokes2D_generic_tau+0x377>
nopl   0x0(%rax)
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,%rbp,8)
mov    0x98(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm1
movapd %xmm1,%xmm0
mulsd  0xb53(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm6,%xmm0
addsd  %xmm5,%xmm0
addsd  0xb47(%rip),%xmm0
ucomisd %xmm4,%xmm0
jb     14e0 <calculateSubgridErrorNavierStokes2D_generic_tau+0x3d0>
sqrtsd %xmm0,%xmm0
jmp    14fb <calculateSubgridErrorNavierStokes2D_generic_tau+0x3eb>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm5,0x8(%rsp)
call   1030 <sqrt@plt>
movapd 0x50(%rsp),%xmm6
movsd  0x8(%rsp),%xmm5
xorpd  %xmm4,%xmm4
mov    0x18(%rsp),%rdx
ucomisd 0xb08(%rip),%xmm0
jbe    1210 <calculateSubgridErrorNavierStokes2D_generic_tau+0x100>
movsd  0xb02(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    0xf0(%rsp),%rax
movsd  %xmm1,(%rax,%rbp,8)
addsd  %xmm6,%xmm5
ucomisd %xmm4,%xmm5
jb     1540 <calculateSubgridErrorNavierStokes2D_generic_tau+0x430>
xorps  %xmm0,%xmm0
sqrtsd %xmm5,%xmm0
jmp    1558 <calculateSubgridErrorNavierStokes2D_generic_tau+0x448>
nopw   0x0(%rax,%rax,1)
movapd %xmm5,%xmm0
call   1030 <sqrt@plt>
movapd 0x50(%rsp),%xmm6
xorpd  %xmm4,%xmm4
mov    0x18(%rsp),%rdx
unpckhpd %xmm6,%xmm6
divsd  %xmm6,%xmm0
jmp    1224 <calculateSubgridErrorNavierStokes2D_generic_tau+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(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 = %303, %11
%46 = load i32, i32* %23
%47 = load i32, i32* %12
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %306
49: ; preds = %45
store i32 0, i32* %24
br label %50
50: ; preds = %299, %49
%51 = load i32, i32* %24
%52 = load i32, i32* %13
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %302
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* %25
%201 = mul nsw i32 %199, %200
%202 = load i32, i32* %24
%203 = load i32, i32* %25
%204 = mul nsw i32 %202, %203
%205 = add nsw i32 %201, %204
%206 = load i32, i32* %14
%207 = add nsw i32 %205, %206
%208 = add nsw i32 %207, 1
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds double, double* %196, i64 %209
%211 = load double, double* %210
store double %211, double* %30
%212 = load double, double* %38
%213 = load double, double* %30
%214 = fmul double %212, %213
%215 = load double, double* %30
%216 = fmul double %214, %215
%217 = load double, double* %36
%218 = fmul double %217, %216
store double %218, double* %36
%219 = load double, double* %35
%220 = call double @sqrt(double %219)
%221 = load double*, double** %22
%222 = load i32, i32* %23
%223 = load i32, i32* %13
%224 = mul nsw i32 %222, %223
%225 = load i32, i32* %24
%226 = add nsw i32 %224, %225
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double, double* %221, i64 %227
store double %220, double* %228
%229 = load double*, double** %16
%230 = load i32, i32* %23
%231 = load i32, i32* %13
%232 = mul nsw i32 %230, %231
%233 = load i32, i32* %24
%234 = add nsw i32 %232, %233
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds double, double* %229, i64 %235
%237 = load double, double* %236
%238 = fmul double 4.000000e+00, %237
%239 = load double*, double** %16
%240 = load i32, i32* %23
%241 = load i32, i32* %13
%242 = mul nsw i32 %240, %241
%243 = load i32, i32* %24
%244 = add nsw i32 %242, %243
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds double, double* %239, i64 %245
%247 = load double, double* %246
%248 = load double, double* %35
%249 = call double @llvm.fmuladd.f64(double %238, double %247, double %248)
%250 = load double, double* %36
%251 = fadd double %249, %250
%252 = fadd double %251, 1.000000e-08
%253 = call double @sqrt(double %252)
store double %253, double* %41
%254 = load double, double* %41
%255 = fcmp ogt double %254, 1.000000e-08
br i1 %255, label %256, label %281
256: ; preds = %186
%257 = load double, double* %41
%258 = fdiv double 1.000000e+00, %257
%259 = load double*, double** %20
%260 = load i32, i32* %23
%261 = load i32, i32* %13
%262 = mul nsw i32 %260, %261
%263 = load i32, i32* %24
%264 = add nsw i32 %262, %263
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds double, double* %259, i64 %265
store double %258, double* %266
%267 = load double, double* %35
%268 = load double, double* %36
%269 = fadd double %267, %268
%270 = call double @sqrt(double %269)
%271 = load double, double* %40
%272 = fdiv double %270, %271
%273 = load double*, double** %21
%274 = load i32, i32* %23
%275 = load i32, i32* %13
%276 = mul nsw i32 %274, %275
%277 = load i32, i32* %24
%278 = add nsw i32 %276, %277
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds double, double* %273, i64 %279
store double %272, double* %280
br label %298
281: ; preds = %186
%282 = load double*, double** %20
%283 = load i32, i32* %23
%284 = load i32, i32* %13
%285 = mul nsw i32 %283, %284
%286 = load i32, i32* %24
%287 = add nsw i32 %285, %286
%288 = sext i32 %287 to i64
%289 = getelementptr inbounds double, double* %282, i64 %288
store double 0.000000e+00, double* %289
%290 = load double*, double** %21
%291 = load i32, i32* %23
%292 = load i32, i32* %13
%293 = mul nsw i32 %291, %292
%294 = load i32, i32* %24
%295 = add nsw i32 %293, %294
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds double, double* %290, i64 %296
store double 0.000000e+00, double* %297
br label %298
298: ; preds = %281, %256
br label %299
299: ; preds = %298
%300 = load i32, i32* %24
%301 = add nsw i32 %300, 1
store i32 %301, i32* %24
br label %50
302: ; preds = %50
br label %303
303: ; preds = %302
%304 = load i32, i32* %23
%305 = add nsw i32 %304, 1
store i32 %305, i32* %23
br label %45
306: ; preds = %45
ret void
}

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