#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 calculateSubgridError_ADR_generic_tau(int nElements_global,
                                           int nQuadraturePoints_element,
                                           int nSpace, double *inverseJ,
                                           double *dmt, double *df, double *a,
                                           double *da, double *grad_phi,
                                           double *dphi, double *dr, double *pe,
                                           double *cfl, double *tau) {
  int eN, k, I, J, K, nSpace2 = nSpace * nSpace;
  double Vlin, Alin, A_II, cfl1, cfl2, vlin[3], G_IJ, v_dot_Gv, CI_nu2_G_ddot_G,
      Gv_I, CI = 36.0 * 36.0, g_I, g_dot_g;
  for (eN = 0; eN < nElements_global; eN++) {
    for (k = 0; k < nQuadraturePoints_element; k++) {
      Vlin = 0.0;
      Alin = 0.0;
      for (I = 0; I < nSpace; I++) {
        vlin[I] = df[eN * nQuadraturePoints_element * nSpace + k * nSpace + I];
        for (J = 0; J < nSpace; J++) {
          vlin[I] -= da[eN * nQuadraturePoints_element * nSpace2 + k * nSpace2 +
                        I * nSpace + J] *
                     grad_phi[eN * nQuadraturePoints_element * nSpace +
                              k * nSpace + J];
        }
      }
      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 * vlin[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 += vlin[I] * Gv_I;
      }
      for (I = 0; I < nSpace; I++) {
        A_II = a[eN * nQuadraturePoints_element * nSpace2 + k * nSpace2 +
                 I * nSpace + I];
        Alin = (A_II > Alin) ? A_II : Alin;
      }
      Alin *= dphi[eN * nQuadraturePoints_element + k];
      CI_nu2_G_ddot_G *= CI * Alin * Alin;
      cfl1 = 0.5 * sqrt(v_dot_Gv);
      cfl2 = 0.25 * sqrt(CI_nu2_G_ddot_G);
      if (cfl1 > cfl2)
        cfl[eN * nQuadraturePoints_element + k] = cfl1;
      else
        cfl[eN * nQuadraturePoints_element + k] = cfl2;
      tau[eN * nQuadraturePoints_element + k] =
          1.0 / sqrt(v_dot_Gv + CI_nu2_G_ddot_G +
                     4.0 * dr[eN * nQuadraturePoints_element + k] *
                         dr[eN * nQuadraturePoints_element + k] +
                     4.0 * dmt[eN * nQuadraturePoints_element + k] *
                         dmt[eN * nQuadraturePoints_element + k] +
                     1.0e-8);
      pe[eN * nQuadraturePoints_element + k] =
          sqrt(v_dot_Gv) / sqrt(CI_nu2_G_ddot_G);
    }
  }
}


x86 assembly (clang, -O0):
<calculateSubgridError_ADR_generic_tau>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
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    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
movsd  0xe9e(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    170a <calculateSubgridError_ADR_generic_tau+0x5fa>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    16f7 <calculateSubgridError_ADR_generic_tau+0x5e7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1292 <calculateSubgridError_ADR_generic_tau+0x182>
mov    -0x28(%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    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x34(%rbp),%rax
movsd  %xmm0,-0x80(%rbp,%rax,8)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    127f <calculateSubgridError_ADR_generic_tau+0x16f>
mov    0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x40(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x40(%rbp),%edx
add    %edx,%ecx
mov    -0x34(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x20(%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),%xmm2
movslq -0x34(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm1
movq   %xmm0,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp,%rax,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11e7 <calculateSubgridError_ADR_generic_tau+0xd7>
jmp    1284 <calculateSubgridError_ADR_generic_tau+0x174>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11a7 <calculateSubgridError_ADR_generic_tau+0x97>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1487 <calculateSubgridError_ADR_generic_tau+0x377>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1427 <calculateSubgridError_ADR_generic_tau+0x317>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    138b <calculateSubgridError_ADR_generic_tau+0x27b>
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x40(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x40(%rbp),%edx
add    %edx,%ecx
mov    -0x3c(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x40(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x40(%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),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1301 <calculateSubgridError_ADR_generic_tau+0x1f1>
movsd  -0x88(%rbp),%xmm0
ff
movslq -0x38(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x40(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x40(%rbp),%edx
add    %edx,%ecx
mov    -0x38(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12e3 <calculateSubgridError_ADR_generic_tau+0x1d3>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm2
ff
movsd  -0xb8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movslq -0x34(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm0
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12ba <calculateSubgridError_ADR_generic_tau+0x1aa>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1515 <calculateSubgridError_ADR_generic_tau+0x405>
mov    0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x40(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x40(%rbp),%edx
add    %edx,%ecx
mov    -0x34(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    14ed <calculateSubgridError_ADR_generic_tau+0x3dd>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    14fa <calculateSubgridError_ADR_generic_tau+0x3ea>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    148e <calculateSubgridError_ADR_generic_tau+0x37e>
mov    0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xaa1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xa78(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    15c9 <calculateSubgridError_ADR_generic_tau+0x4b9>
movsd  -0x60(%rbp),%xmm0
mov    0x40(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    15e4 <calculateSubgridError_ADR_generic_tau+0x4d4>
movsd  -0x68(%rbp),%xmm0
mov    0x40(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0x98(%rbp),%xmm0
ff
mov    0x30(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  0xa1b(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
mov    0x30(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  0x9df(%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
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x9ac(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0x990(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    0x48(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x90(%rbp),%xmm0
ff
call   1030 <sqrt@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
mov    0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1184 <calculateSubgridError_ADR_generic_tau+0x74>
jmp    16fc <calculateSubgridError_ADR_generic_tau+0x5ec>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1171 <calculateSubgridError_ADR_generic_tau+0x61>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridError_ADR_generic_tau>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %r8,0xc8(%rsp)
mov    %rcx,0xb0(%rsp)
mov    %esi,0x24(%rsp)
test   %edi,%edi
jle    17e9 <calculateSubgridError_ADR_generic_tau+0x6d9>
mov    %edx,%r10d
mov    0x130(%rsp),%r11
mov    0x128(%rsp),%rbp
mov    %edx,%eax
imul   %r10d,%eax
movslq %edx,%rcx
mov    %edi,%edx
mov    %rdx,0x98(%rsp)
mov    %ecx,%r15d
mov    %r15d,%r12d
and    $0xfffffffe,%r12d
mov    %eax,0x10(%rsp)
mov    %eax,%edx
mov    0x24(%rsp),%eax
imul   %eax,%edx
mov    %edx,0x70(%rsp)
mov    %r10d,%edx
imul   %eax,%edx
mov    %edx,0x6c(%rsp)
mov    %rcx,%r14
shl    $0x4,%r14
xorpd  %xmm3,%xmm3
cltq
mov    %rax,0x90(%rsp)
mov    %eax,%eax
mov    %rax,0xc0(%rsp)
lea    -0x1(%r15),%rax
mov    %rax,0x60(%rsp)
lea    0x8(%rbp),%rax
mov    %rax,0xa8(%rsp)
lea    0x0(,%rcx,8),%rax
mov    %rax,0x80(%rsp)
lea    0x8(%r11),%rax
mov    %rax,0xa0(%rsp)
lea    0x1(%rcx),%eax
mov    %eax,0x2c(%rsp)
mov    %rcx,0x88(%rsp)
lea    (%rcx,%rcx,1),%eax
add    $0x2,%eax
mov    %eax,0x74(%rsp)
xor    %eax,%eax
mov    %rax,0x48(%rsp)
movl   $0x0,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x40(%rsp)
mov    %r9,0x78(%rsp)
mov    %r10d,0xc(%rsp)
jmp    1259 <calculateSubgridError_ADR_generic_tau+0x149>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x40(%rsp),%rdx
add    $0x1,%rdx
mov    0x70(%rsp),%eax
add    %eax,0x28(%rsp)
mov    0x48(%rsp),%rcx
add    0x6c(%rsp),%ecx
mov    %rcx,0x48(%rsp)
add    %eax,0x2c(%rsp)
mov    %rdx,%rax
mov    %rdx,0x40(%rsp)
cmp    0x98(%rsp),%rdx
je     17e9 <calculateSubgridError_ADR_generic_tau+0x6d9>
cmpl   $0x0,0x24(%rsp)
jle    1220 <calculateSubgridError_ADR_generic_tau+0x110>
mov    0x40(%rsp),%rax
imul   0x90(%rsp),%rax
mov    %rax,0x38(%rsp)
mov    0x2c(%rsp),%eax
mov    %eax,0x30(%rsp)
mov    0x48(%rsp),%rax
mov    %eax,%edx
mov    0x28(%rsp),%ecx
xor    %ebx,%ebx
jmp    12fb <calculateSubgridError_ADR_generic_tau+0x1eb>
nopw   0x0(%rax,%rax,1)
movsd  %xmm1,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm1
xorpd  %xmm3,%xmm3
mov    0x78(%rsp),%r9
mov    0x130(%rsp),%r11
mov    0x128(%rsp),%rbp
mov    0x34(%rsp),%edx
mov    0x14(%rsp),%ecx
mov    0x18(%rsp),%rbx
mov    0xc(%rsp),%r10d
divsd  %xmm0,%xmm1
mov    0x148(%rsp),%rax
movsd  %xmm1,(%rax,%r13,8)
add    $0x1,%rbx
mov    0x10(%rsp),%eax
add    %eax,%ecx
add    %r10d,%edx
add    %eax,0x30(%rsp)
cmp    0xc0(%rsp),%rbx
je     1220 <calculateSubgridError_ADR_generic_tau+0x110>
xorpd  %xmm5,%xmm5
test   %r10d,%r10d
mov    %rbx,0x18(%rsp)
mov    %edx,0x34(%rsp)
mov    %ecx,0x14(%rsp)
jle    15e0 <calculateSubgridError_ADR_generic_tau+0x4d0>
movslq %ecx,%rax
lea    0x0(,%rax,8),%rcx
mov    %rcx,(%rsp)
mov    0x80(%rsp),%rcx
lea    (%rcx,%rax,8),%r8
mov    0xa8(%rsp),%rcx
lea    (%rcx,%rax,8),%rax
movslq %edx,%rcx
mov    0xa0(%rsp),%rdx
lea    (%rdx,%rcx,8),%rcx
mov    0x38(%rsp),%rdx
lea    (%rbx,%rdx,1),%esi
mov    %esi,%edx
imul   %r10d,%edx
imul   0x10(%rsp),%esi
movslq %edx,%rdx
movslq %esi,%r10
xor    %esi,%esi
jmp    138e <calculateSubgridError_ADR_generic_tau+0x27e>
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0xd0(%rsp,%rsi,8)
add    $0x1,%rsi
add    0x80(%rsp),%rax
cmp    %r15,%rsi
je     1420 <calculateSubgridError_ADR_generic_tau+0x310>
lea    (%rsi,%rdx,1),%rbx
movsd  (%r9,%rbx,8),%xmm0
cmpq   $0x0,0x60(%rsp)
je     13e0 <calculateSubgridError_ADR_generic_tau+0x2d0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  -0x8(%rax,%rbx,8),%xmm1
movsd  (%rax,%rbx,8),%xmm2
mulsd  -0x8(%rcx,%rbx,8),%xmm1
mulsd  (%rcx,%rbx,8),%xmm2
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
add    $0x2,%rbx
cmp    %rbx,%r12
jne    13b0 <calculateSubgridError_ADR_generic_tau+0x2a0>
test   $0x1,%r15b
je     1370 <calculateSubgridError_ADR_generic_tau+0x260>
jmp    13e8 <calculateSubgridError_ADR_generic_tau+0x2d8>
nop
xor    %ebx,%ebx
test   $0x1,%r15b
je     1370 <calculateSubgridError_ADR_generic_tau+0x260>
mov    %rsi,%rdi
imul   0x88(%rsp),%rdi
add    %r10,%rdi
add    %rbx,%rdi
movsd  0x0(%rbp,%rdi,8),%xmm1
add    %rdx,%rbx
mulsd  (%r11,%rbx,8),%xmm1
subsd  %xmm1,%xmm0
jmp    1370 <calculateSubgridError_ADR_generic_tau+0x260>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorpd  %xmm0,%xmm0
xorpd  %xmm2,%xmm2
mov    0xc(%rsp),%r10d
test   %r10d,%r10d
mov    0xb0(%rsp),%r9
mov    0x18(%rsp),%rbx
jle    1640 <calculateSubgridError_ADR_generic_tau+0x530>
mov    0x38(%rsp),%rax
add    %ebx,%eax
imul   0x10(%rsp),%eax
movslq %eax,%r10
xorpd  %xmm5,%xmm5
mov    (%rsp),%rsi
mov    %r8,%rdi
xor    %r11d,%r11d
xorpd  %xmm0,%xmm0
jmp    1493 <calculateSubgridError_ADR_generic_tau+0x383>
cs nopw 0x0(%rax,%rax,1)
mulsd  0xd0(%rsp,%r11,8),%xmm4
addsd  %xmm4,%xmm0
add    $0x1,%r11
add    $0x8,%rdi
add    $0x8,%rsi
cmp    %r15,%r11
je     1570 <calculateSubgridError_ADR_generic_tau+0x460>
mov    (%rsp),%rcx
mov    %r8,%rbx
xor    %edx,%edx
xorpd  %xmm4,%xmm4
jmp    14da <calculateSubgridError_ADR_generic_tau+0x3ca>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0xd0(%rsp,%rdx,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm4
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm5
add    $0x1,%rdx
add    $0x8,%rbx
add    $0x8,%rcx
cmp    %r15,%rdx
je     1470 <calculateSubgridError_ADR_generic_tau+0x360>
cmpq   $0x0,0x60(%rsp)
je     1530 <calculateSubgridError_ADR_generic_tau+0x420>
xorpd  %xmm1,%xmm1
mov    %r9,%r13
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rsi,1),%xmm2
mulsd  0x0(%r13,%rcx,1),%xmm2
addsd  %xmm1,%xmm2
movsd  0x0(%r13,%rdi,1),%xmm1
mulsd  0x0(%r13,%rbx,1),%xmm1
addsd  %xmm2,%xmm1
add    $0x2,%rax
add    %r14,%r13
cmp    %rax,%r12
jne    14f0 <calculateSubgridError_ADR_generic_tau+0x3e0>
test   $0x1,%r15b
je     14b0 <calculateSubgridError_ADR_generic_tau+0x3a0>
jmp    1540 <calculateSubgridError_ADR_generic_tau+0x430>
nopl   0x0(%rax,%rax,1)
xorpd  %xmm1,%xmm1
xor    %eax,%eax
test   $0x1,%r15b
je     14b0 <calculateSubgridError_ADR_generic_tau+0x3a0>
imul   0x88(%rsp),%rax
add    %r10,%rax
lea    (%rax,%r11,1),%rbp
movsd  (%r9,%rbp,8),%xmm2
add    %rdx,%rax
mulsd  (%r9,%rax,8),%xmm2
addsd  %xmm2,%xmm1
jmp    14b0 <calculateSubgridError_ADR_generic_tau+0x3a0>
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%r10d
test   %r10d,%r10d
jle    15ea <calculateSubgridError_ADR_generic_tau+0x4da>
cmpq   $0x0,0x60(%rsp)
je     15f5 <calculateSubgridError_ADR_generic_tau+0x4e5>
xorpd  %xmm2,%xmm2
mov    0x14(%rsp),%eax
mov    %eax,%ecx
mov    0x30(%rsp),%eax
mov    %eax,%edx
xor    %eax,%eax
mov    0x120(%rsp),%rsi
mov    0x74(%rsp),%edi
mov    0x18(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movslq %ecx,%rcx
movsd  (%rsi,%rcx,8),%xmm1
maxsd  %xmm2,%xmm1
movslq %edx,%rdx
movsd  (%rsi,%rdx,8),%xmm2
maxsd  %xmm1,%xmm2
add    $0x2,%rax
add    %edi,%edx
add    %edi,%ecx
cmp    %rax,%r12
jne    15b0 <calculateSubgridError_ADR_generic_tau+0x4a0>
test   $0x1,%r15b
jne    160e <calculateSubgridError_ADR_generic_tau+0x4fe>
jmp    1640 <calculateSubgridError_ADR_generic_tau+0x530>
nopl   (%rax)
xorpd  %xmm0,%xmm0
xorpd  %xmm2,%xmm2
jmp    1640 <calculateSubgridError_ADR_generic_tau+0x530>
xorpd  %xmm2,%xmm2
mov    0x18(%rsp),%rbx
jmp    1640 <calculateSubgridError_ADR_generic_tau+0x530>
xorpd  %xmm2,%xmm2
xor    %eax,%eax
mov    0x120(%rsp),%rsi
mov    0x18(%rsp),%rbx
test   $0x1,%r15b
je     1640 <calculateSubgridError_ADR_generic_tau+0x530>
mov    0x38(%rsp),%rcx
add    %ebx,%ecx
imul   0x10(%rsp),%ecx
add    %eax,%ecx
imul   %r10d,%eax
add    %ecx,%eax
cltq
movsd  (%rsi,%rax,8),%xmm1
maxsd  %xmm2,%xmm1
movapd %xmm1,%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x38(%rsp),%rax
lea    (%rbx,%rax,1),%r13
mov    0x138(%rsp),%rax
mulsd  (%rax,%r13,8),%xmm2
movapd %xmm2,%xmm4
mulsd  0x99d(%rip),%xmm4
ucomisd %xmm3,%xmm0
movsd  %xmm0,0x58(%rsp)
jb     1680 <calculateSubgridError_ADR_generic_tau+0x570>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    16b5 <calculateSubgridError_ADR_generic_tau+0x5a5>
nopl   0x0(%rax,%rax,1)
movsd  %xmm5,(%rsp)
movsd  %xmm2,0x50(%rsp)
movsd  %xmm4,0xb8(%rsp)
call   1030 <sqrt@plt>
movsd  0xb8(%rsp),%xmm4
movsd  0x50(%rsp),%xmm2
movsd  (%rsp),%xmm5
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
mulsd  %xmm4,%xmm2
mulsd  %xmm2,%xmm5
mulsd  0x943(%rip),%xmm1
ucomisd %xmm3,%xmm5
movsd  %xmm5,(%rsp)
jb     16e0 <calculateSubgridError_ADR_generic_tau+0x5d0>
xorps  %xmm0,%xmm0
sqrtsd %xmm5,%xmm0
jmp    16fe <calculateSubgridError_ADR_generic_tau+0x5ee>
nopl   0x0(%rax)
movapd %xmm5,%xmm0
movsd  %xmm1,0x50(%rsp)
call   1030 <sqrt@plt>
movsd  0x50(%rsp),%xmm1
movsd  (%rsp),%xmm5
xorpd  %xmm3,%xmm3
movsd  0x58(%rsp),%xmm6
mulsd  0x904(%rip),%xmm0
maxsd  %xmm0,%xmm1
mov    0x150(%rsp),%rax
movsd  %xmm1,(%rax,%r13,8)
movapd %xmm6,%xmm0
addsd  %xmm5,%xmm0
mov    0x140(%rsp),%rax
movsd  (%rax,%r13,8),%xmm1
movapd %xmm1,%xmm2
movsd  0x8d8(%rip),%xmm4
mulsd  %xmm4,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
mov    0xc8(%rsp),%rax
movsd  (%rax,%r13,8),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm4,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  0x8ae(%rip),%xmm0
ucomisd %xmm3,%xmm0
jb     1780 <calculateSubgridError_ADR_generic_tau+0x670>
sqrtsd %xmm0,%xmm0
jmp    178f <calculateSubgridError_ADR_generic_tau+0x67f>
xchg   %ax,%ax
call   1030 <sqrt@plt>
movsd  0x58(%rsp),%xmm6
xorpd  %xmm3,%xmm3
movsd  0x891(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    0x158(%rsp),%rax
movsd  %xmm1,(%rax,%r13,8)
ucomisd %xmm3,%xmm6
jb     17c0 <calculateSubgridError_ADR_generic_tau+0x6b0>
xorps  %xmm1,%xmm1
sqrtsd %xmm6,%xmm1
jmp    17d1 <calculateSubgridError_ADR_generic_tau+0x6c1>
nopl   0x0(%rax,%rax,1)
movapd %xmm6,%xmm0
call   1030 <sqrt@plt>
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm0
ucomisd %xmm3,%xmm0
jb     1290 <calculateSubgridError_ADR_generic_tau+0x180>
sqrtsd %xmm0,%xmm0
jmp    12a3 <calculateSubgridError_ADR_generic_tau+0x193>
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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