void EPIdiag2D(double *diag, const double *yc1, const double *yc2,
               const double *m, const double *Jac1, const double *Jac2,
               const double *dI1, const double *dI2, const double *I1,
               const double *I2, const double *v1, const double *v2,
               const double *h) {
  int idn, i1, i2, r, comp, id;
  double yc1A[2], yc1B[2], yc1C[2], yc1D[2], yc1M[2];
  double yc2A[2], yc2B[2], yc2C[2], yc2D[2], yc2M[2];
  double dI1i[2], Jac1i, I1i, dI2i[2], Jac2i, I2i;
  double rA, rB, rC, rD;
  const int m1 = m[0], m2 = m[1];
  const int nn = (m1 + 1) * (m2 + 1);
  const int n = (m1) * (m2);
  const double hd = h[0] * h[1];
  const int inc_x = 1;
  const int inc_y = m1 + 1;
  const double *ptr;
  double *wptr;
#pragma omp parallel private(                                                  \
    wptr, ptr, idn, i1, i2, r, comp, dI1i, Jac1i, I1i, dI2i, Jac2i, I2i, yc1A, \
    yc1B, yc1C, yc1D, yc1M, yc2A, yc2B, yc2C, yc2D, yc2M, rA, rB, rC, rD)
  {
#pragma omp for
    for (i1 = 0; i1 < m1; i1++) {
      for (i2 = 0; i2 < m2; i2++) {
        idn = i1 + i2 * (m1 + 1);
        id = i1 + i2 * (m1);
        comp = 0;
        I1i = I1[id] / hd;
        dI1i[0] = dI1[id];
        dI1i[1] = dI1[id + n];
        I2i = I2[id] / hd;
        dI2i[0] = dI2[id];
        dI2i[1] = dI2[id + n];
        Jac1i = Jac1[id];
        Jac2i = Jac2[id];
        rA = 0.0;
        for (r = 0; r < 2; r++) {
          ptr = yc1 + idn + comp;
          yc1A[r] = *ptr;
          ptr = ptr + inc_x;
          yc1B[r] = *ptr;
          ptr = ptr + inc_y;
          yc1D[r] = *ptr;
          ptr = ptr - inc_x;
          yc1C[r] = *ptr;
          yc1M[r] = 0.25 * (yc1A[r] + yc1B[r] + yc1C[r] + yc1D[r]);
          ptr = yc2 + idn + comp;
          yc2A[r] = *ptr;
          ptr = ptr + inc_x;
          yc2B[r] = *ptr;
          ptr = ptr + inc_y;
          yc2D[r] = *ptr;
          ptr = ptr - inc_x;
          yc2C[r] = *ptr;
          yc2M[r] = 0.25 * (yc2A[r] + yc2B[r] + yc2C[r] + yc2D[r]);
          rA += 0.25 * (Jac1i * dI1i[r] * v1[r] - Jac2i * dI2i[r] * v2[r]);
          comp += nn;
        }
        rB = rA;
        rC = rA;
        rD = rA;
        EPIdiagTriangle(yc1A, yc1B, yc1M, &rA, &rB, &rD, &rC, v1, I1i);
        EPIdiagTriangle(yc1B, yc1D, yc1M, &rB, &rD, &rC, &rA, v1, I1i);
        EPIdiagTriangle(yc1D, yc1C, yc1M, &rD, &rC, &rA, &rB, v1, I1i);
        EPIdiagTriangle(yc1C, yc1A, yc1M, &rC, &rA, &rB, &rD, v1, I1i);
        EPIdiagTriangle(yc2A, yc2B, yc2M, &rA, &rB, &rD, &rC, v2, -I2i);
        EPIdiagTriangle(yc2B, yc2D, yc2M, &rB, &rD, &rC, &rA, v2, -I2i);
        EPIdiagTriangle(yc2D, yc2C, yc2M, &rD, &rC, &rA, &rB, v2, -I2i);
        EPIdiagTriangle(yc2C, yc2A, yc2M, &rC, &rA, &rB, &rD, v2, -I2i);
        wptr = diag + idn;
#pragma omp atomic
        *wptr += hd * rA * rA;
        wptr += inc_x;
#pragma omp atomic
        *wptr += hd * rB * rB;
        wptr += inc_y;
#pragma omp atomic
        *wptr += hd * rD * rD;
        wptr -= inc_x;
#pragma omp atomic
        *wptr += hd * rC * rC;
      }
    }
  }
}


x86 assembly (clang, -O0):
<EPIdiag2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
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    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x20(%rbp),%rax
cvttsd2si (%rax),%eax
mov    %eax,-0x154(%rbp)
mov    -0x20(%rbp),%rax
cvttsd2si 0x8(%rax),%eax
mov    %eax,-0x158(%rbp)
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    -0x158(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x15c(%rbp)
mov    -0x154(%rbp),%eax
imul   -0x158(%rbp),%eax
mov    %eax,-0x160(%rbp)
mov    0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x40(%rbp),%rax
mulsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movl   $0x1,-0x16c(%rbp)
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x170(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x154(%rbp),%eax
jge    19ca <EPIdiag2D+0x8ba>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x158(%rbp),%eax
jge    19b7 <EPIdiag2D+0x8a7>
mov    -0x38(%rbp),%eax
mov    -0x3c(%rbp),%ecx
mov    -0x154(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x3c(%rbp),%ecx
imul   -0x154(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
mov    0x20(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x168(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
mov    0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
mov    0x10(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    -0x160(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
mov    0x28(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x168(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
mov    0x18(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
mov    0x18(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    -0x160(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movl   $0x0,-0x40(%rbp)
cmpl   $0x2,-0x40(%rbp)
jge    15b3 <EPIdiag2D+0x4a3>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x44(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
movsd  (%rax),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x60(%rbp,%rax,8)
mov    -0x178(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
movsd  (%rax),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x178(%rbp),%rax
movslq -0x170(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
movsd  (%rax),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x178(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
movsd  (%rax),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x80(%rbp,%rax,8)
movslq -0x40(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm1
movslq -0x40(%rbp),%rax
addsd  -0x70(%rbp,%rax,8),%xmm1
movslq -0x40(%rbp),%rax
addsd  -0x80(%rbp,%rax,8),%xmm1
movslq -0x40(%rbp),%rax
addsd  -0x90(%rbp,%rax,8),%xmm1
ff ff
movsd  0xc09(%rip),%xmm0
mulsd  %xmm1,%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x44(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
movsd  (%rax),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
mov    -0x178(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
movsd  (%rax),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0xc0(%rbp,%rax,8)
ff ff
mov    -0x178(%rbp),%rax
movslq -0x170(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
movsd  (%rax),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0xe0(%rbp,%rax,8)
ff ff
mov    -0x178(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rax
movsd  (%rax),%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0xd0(%rbp,%rax,8)
ff ff
movslq -0x40(%rbp),%rax
movsd  -0xb0(%rbp,%rax,8),%xmm1
ff ff
movslq -0x40(%rbp),%rax
addsd  -0xc0(%rbp,%rax,8),%xmm1
ff ff
movslq -0x40(%rbp),%rax
addsd  -0xd0(%rbp,%rax,8),%xmm1
ff ff
movslq -0x40(%rbp),%rax
addsd  -0xe0(%rbp,%rax,8),%xmm1
ff ff
movsd  0xafb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0xf0(%rbp,%rax,8)
ff ff
movsd  -0x108(%rbp),%xmm0
ff
movslq -0x40(%rbp),%rax
mulsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
mov    0x30(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x128(%rbp),%xmm1
ff
movslq -0x40(%rbp),%rax
mulsd  -0x120(%rbp,%rax,8),%xmm1
ff ff
mov    0x38(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x138(%rbp),%xmm1
ff
movsd  0xa77(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
mov    -0x15c(%rbp),%eax
add    -0x44(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1302 <EPIdiag2D+0x1f2>
movsd  -0x138(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x138(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x138(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
lea    -0x60(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
mov    0x30(%rbp),%rax
movsd  -0x110(%rbp),%xmm0
ff
lea    -0x138(%rbp),%rcx
lea    -0x140(%rbp),%r8
lea    -0x150(%rbp),%r9
lea    -0x148(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x1,%al
call   1030 <EPIdiagTriangle@plt>
lea    -0x70(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
mov    0x30(%rbp),%rax
movsd  -0x110(%rbp),%xmm0
ff
lea    -0x140(%rbp),%rcx
lea    -0x150(%rbp),%r8
lea    -0x148(%rbp),%r9
lea    -0x138(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x1,%al
call   1030 <EPIdiagTriangle@plt>
lea    -0x90(%rbp),%rdi
lea    -0x80(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
mov    0x30(%rbp),%rax
movsd  -0x110(%rbp),%xmm0
ff
lea    -0x150(%rbp),%rcx
lea    -0x148(%rbp),%r8
lea    -0x138(%rbp),%r9
lea    -0x140(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x1,%al
call   1030 <EPIdiagTriangle@plt>
lea    -0x80(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
mov    0x30(%rbp),%rax
movsd  -0x110(%rbp),%xmm0
ff
lea    -0x148(%rbp),%rcx
lea    -0x138(%rbp),%r8
lea    -0x140(%rbp),%r9
lea    -0x150(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x1,%al
call   1030 <EPIdiagTriangle@plt>
lea    -0xb0(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
mov    0x38(%rbp),%rax
movsd  -0x130(%rbp),%xmm0
ff
movq   %xmm0,%rcx
movabs $0x8000000000000000,%r8
xor    %r8,%rcx
movq   %rcx,%xmm0
lea    -0x138(%rbp),%rcx
lea    -0x140(%rbp),%r8
lea    -0x150(%rbp),%r9
lea    -0x148(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x1,%al
call   1030 <EPIdiagTriangle@plt>
lea    -0xc0(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
mov    0x38(%rbp),%rax
movsd  -0x130(%rbp),%xmm0
ff
movq   %xmm0,%rcx
movabs $0x8000000000000000,%r8
xor    %r8,%rcx
movq   %rcx,%xmm0
lea    -0x140(%rbp),%rcx
lea    -0x150(%rbp),%r8
lea    -0x148(%rbp),%r9
lea    -0x138(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x1,%al
call   1030 <EPIdiagTriangle@plt>
lea    -0xe0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
mov    0x38(%rbp),%rax
movsd  -0x130(%rbp),%xmm0
ff
movq   %xmm0,%rcx
movabs $0x8000000000000000,%r8
xor    %r8,%rcx
movq   %rcx,%xmm0
lea    -0x150(%rbp),%rcx
lea    -0x148(%rbp),%r8
lea    -0x138(%rbp),%r9
lea    -0x140(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x1,%al
call   1030 <EPIdiagTriangle@plt>
lea    -0xd0(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
mov    0x38(%rbp),%rax
movsd  -0x130(%rbp),%xmm0
ff
movq   %xmm0,%rcx
movabs $0x8000000000000000,%r8
xor    %r8,%rcx
movq   %rcx,%xmm0
lea    -0x148(%rbp),%rcx
lea    -0x138(%rbp),%r8
lea    -0x140(%rbp),%r9
lea    -0x150(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x1,%al
call   1030 <EPIdiagTriangle@plt>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x180(%rbp)
movsd  -0x168(%rbp),%xmm0
ff
mulsd  -0x138(%rbp),%xmm0
ff
movsd  -0x138(%rbp),%xmm2
ff
mov    -0x180(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x180(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x180(%rbp)
movsd  -0x168(%rbp),%xmm0
ff
mulsd  -0x140(%rbp),%xmm0
ff
movsd  -0x140(%rbp),%xmm2
ff
mov    -0x180(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x170(%rbp),%ecx
mov    -0x180(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x180(%rbp)
movsd  -0x168(%rbp),%xmm0
ff
mulsd  -0x150(%rbp),%xmm0
ff
movsd  -0x150(%rbp),%xmm2
ff
mov    -0x180(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x180(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x180(%rbp)
movsd  -0x168(%rbp),%xmm0
ff
mulsd  -0x148(%rbp),%xmm0
ff
movsd  -0x148(%rbp),%xmm2
ff
mov    -0x180(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11e9 <EPIdiag2D+0xd9>
jmp    19bc <EPIdiag2D+0x8ac>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11d3 <EPIdiag2D+0xc3>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIdiag2D>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x248,%rsp
mov    %r9,0x198(%rsp)
mov    %r8,0x190(%rsp)
mov    %rdi,0x28(%rsp)
cvttsd2si (%rcx),%eax
test   %eax,%eax
jle    1911 <EPIdiag2D+0x801>
mov    0x288(%rsp),%r8
mov    0x280(%rsp),%r9
cvttsd2si 0x8(%rcx),%r11d
mov    0x2b0(%rsp),%rcx
movsd  (%rcx),%xmm3
mulsd  0x8(%rcx),%xmm3
lea    0x1(%rax),%ecx
mov    %r11d,%edi
imul   %eax,%edi
lea    0x1(%r11),%ebp
imul   %ecx,%ebp
mov    %ecx,%ebx
movslq %ebp,%rbp
mov    %eax,%r10d
movslq %edi,%rax
movapd %xmm3,%xmm14
unpcklpd %xmm3,%xmm3
lea    (%r9,%rax,8),%rdi
mov    %rdi,0x188(%rsp)
lea    (%r8,%rax,8),%rax
mov    %rax,0x180(%rsp)
lea    0x8(%rsi),%rax
mov    %rax,0x178(%rsp)
lea    0x8(%rsi,%rbx,8),%rax
mov    %rax,0x170(%rsp)
lea    0x0(%rbp,%rbx,1),%rax
lea    0x8(%rsi,%rax,8),%rdi
mov    %rdi,0x168(%rsp)
lea    0x8(%rsi,%rbp,8),%rsi
mov    %rsi,0x160(%rsp)
lea    0x8(%rdx),%rsi
mov    %rsi,0x158(%rsp)
lea    0x8(%rdx,%rax,8),%rax
mov    %rax,0x150(%rsp)
lea    0x8(%rdx,%rbp,8),%rax
mov    %rax,0x148(%rsp)
lea    0x8(%rdx,%rbx,8),%rax
mov    %rax,0x140(%rsp)
lea    0x0(,%rbx,8),%rbp
mov    0x28(%rsp),%rax
lea    (%rax,%rbx,8),%rax
mov    %rax,0x138(%rsp)
mov    %r11,0x1a8(%rsp)
mov    %r11d,%eax
mov    %rax,0x130(%rsp)
mov    %r10,0x1a0(%rsp)
lea    0x0(,%r10,8),%r11
xor    %ebx,%ebx
xor    %eax,%eax
movapd %xmm14,0x220(%rsp)
movapd %xmm3,0x230(%rsp)
mov    %r11,0x1c0(%rsp)
mov    %rbp,0x1b8(%rsp)
jmp    129e <EPIdiag2D+0x18e>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x1b0(%rsp),%rax
add    $0x1,%rax
add    $0x8,%rbx
cmp    0x1a0(%rsp),%rax
je     1911 <EPIdiag2D+0x801>
mov    %rax,0x1b0(%rsp)
cmpl   $0x0,0x1a8(%rsp)
jle    1280 <EPIdiag2D+0x170>
mov    0x130(%rsp),%r9
mov    0x138(%rsp),%r10
mov    0x28(%rsp),%rdi
mov    0x148(%rsp),%rax
mov    %rax,0x60(%rsp)
mov    0x150(%rsp),%rax
mov    %rax,0x68(%rsp)
mov    0x140(%rsp),%rax
mov    %rax,0x48(%rsp)
mov    0x158(%rsp),%rax
mov    %rax,0x30(%rsp)
mov    0x160(%rsp),%rax
mov    %rax,0x50(%rsp)
mov    0x168(%rsp),%rax
mov    %rax,0x58(%rsp)
mov    0x170(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    0x178(%rsp),%r14
mov    0x180(%rsp),%r15
mov    0x188(%rsp),%r13
mov    0x198(%rsp),%rdx
mov    0x190(%rsp),%r8
mov    0x288(%rsp),%r12
mov    0x298(%rsp),%rax
mov    %rax,0x38(%rsp)
mov    0x280(%rsp),%rcx
mov    0x290(%rsp),%rax
nopl   (%rax)
mov    %rax,0x200(%rsp)
mov    %rdi,0x208(%rsp)
mov    %r10,0x210(%rsp)
mov    %r9,0x218(%rsp)
movsd  (%rax,%rbx,1),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r8,0x1f0(%rsp)
movsd  (%r8,%rbx,1),%xmm0
mov    %rdx,0x1f8(%rsp)
movsd  (%rdx,%rbx,1),%xmm9
movsd  -0x8(%r14,%rbx,1),%xmm11
mov    %r14,0x1d0(%rsp)
mov    %rcx,0x1c8(%rsp)
movsd  (%rcx,%rbx,1),%xmm1
mulsd  %xmm0,%xmm1
mov    %r12,0x1d8(%rsp)
movsd  (%r12,%rbx,1),%xmm8
mulsd  %xmm9,%xmm8
mov    %r13,0x1e0(%rsp)
mulsd  0x0(%r13,%rbx,1),%xmm0
mov    %r15,0x1e8(%rsp)
mulsd  (%r15,%rbx,1),%xmm9
mov    0x38(%rsp),%rax
movsd  (%rax,%rbx,1),%xmm15
movsd  %xmm11,0x120(%rsp)
movsd  (%r14,%rbx,1),%xmm7
movsd  %xmm7,0x110(%rsp)
mov    0x40(%rsp),%rax
movsd  (%rax,%rbx,1),%xmm2
movsd  %xmm2,0xf0(%rsp)
movsd  -0x8(%rax,%rbx,1),%xmm3
movsd  %xmm3,0x100(%rsp)
mov    0x30(%rsp),%rsi
movsd  -0x8(%rsi,%rbx,1),%xmm10
movsd  %xmm10,0xe0(%rsp)
movsd  (%rsi,%rbx,1),%xmm12
movsd  %xmm12,0xd0(%rsp)
mov    0x48(%rsp),%rax
movsd  (%rax,%rbx,1),%xmm4
movsd  %xmm4,0xb0(%rsp)
movsd  -0x8(%rax,%rbx,1),%xmm13
movsd  %xmm13,0xc0(%rsp)
mov    0x2a8(%rsp),%r15
mulsd  (%r15),%xmm8
mov    0x2a0(%rsp),%rax
mulsd  (%rax),%xmm1
mov    0x50(%rsp),%rdx
movsd  -0x8(%rdx,%rbx,1),%xmm5
movsd  %xmm5,0x128(%rsp)
unpcklpd %xmm5,%xmm11
movsd  (%rdx,%rbx,1),%xmm5
movsd  %xmm5,0x118(%rsp)
unpcklpd %xmm5,%xmm7
mov    0x58(%rsp),%rdx
movsd  (%rdx,%rbx,1),%xmm5
movsd  %xmm5,0xf8(%rsp)
addpd  %xmm11,%xmm7
movsd  -0x8(%rdx,%rbx,1),%xmm6
movsd  %xmm6,0x108(%rsp)
unpcklpd %xmm6,%xmm3
addpd  %xmm7,%xmm3
unpcklpd %xmm5,%xmm2
addpd  %xmm3,%xmm2
movapd 0xaf6(%rip),%xmm5
mulpd  %xmm5,%xmm2
movapd %xmm2,0xa0(%rsp)
mov    0x60(%rsp),%rdx
movsd  -0x8(%rdx,%rbx,1),%xmm2
movsd  %xmm2,0xe8(%rsp)
unpcklpd %xmm2,%xmm10
movsd  (%rdx,%rbx,1),%xmm2
movsd  %xmm2,0xd8(%rsp)
unpcklpd %xmm2,%xmm12
mov    0x68(%rsp),%rdx
movsd  (%rdx,%rbx,1),%xmm2
movsd  %xmm2,0xb8(%rsp)
addpd  %xmm10,%xmm12
movsd  -0x8(%rdx,%rbx,1),%xmm3
movsd  %xmm3,0xc8(%rsp)
unpcklpd %xmm3,%xmm13
addpd  %xmm12,%xmm13
unpcklpd %xmm2,%xmm4
addpd  %xmm13,%xmm4
mulpd  %xmm5,%xmm4
movapd %xmm4,0x90(%rsp)
mulsd  0x8(%r15),%xmm9
mulsd  0x8(%rax),%xmm0
subsd  %xmm8,%xmm1
subsd  %xmm9,%xmm0
movsd  0xa49(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  0xa45(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x88(%rsp)
movsd  %xmm0,0x80(%rsp)
movsd  %xmm0,0x78(%rsp)
movsd  %xmm0,0x70(%rsp)
xorps  0xa2f(%rip),%xmm15
movaps %xmm15,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  %xmm14,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x120(%rsp),%rdi
lea    0x110(%rsp),%rsi
lea    0xa0(%rsp),%rdx
lea    0x88(%rsp),%rcx
mov    %rcx,%rbp
lea    0x80(%rsp),%r8
mov    %r8,%r14
lea    0x70(%rsp),%r9
mov    $0x1,%al
push   0x2a0(%rsp)
lea    0x80(%rsp),%r12
push   %r12
mov    %r9,%r13
call   1030 <EPIdiagTriangle@plt>
add    $0x10,%rsp
lea    0x110(%rsp),%rdi
lea    0xf0(%rsp),%rsi
lea    0xa0(%rsp),%rdx
mov    %r14,%rcx
mov    %r13,%r8
mov    %r12,%r9
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
push   0x2a0(%rsp)
push   %rbp
call   1030 <EPIdiagTriangle@plt>
add    $0x10,%rsp
lea    0xf0(%rsp),%rdi
lea    0x100(%rsp),%rsi
lea    0xa0(%rsp),%rdx
mov    %r13,%rcx
mov    %r12,%r8
mov    %rbp,%r9
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
push   0x2a0(%rsp)
push   %r14
call   1030 <EPIdiagTriangle@plt>
add    $0x10,%rsp
lea    0x100(%rsp),%rdi
lea    0x120(%rsp),%rsi
lea    0xa0(%rsp),%rdx
mov    %r12,%rcx
mov    %rbp,%r8
mov    %r14,%r9
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
push   0x2a0(%rsp)
push   %r13
call   1030 <EPIdiagTriangle@plt>
add    $0x10,%rsp
movapd 0x10(%rsp),%xmm0
divsd  0x220(%rsp),%xmm0
movapd %xmm0,0x10(%rsp)
lea    0xe0(%rsp),%rdi
lea    0xd0(%rsp),%rsi
lea    0x90(%rsp),%rdx
mov    %rbp,%rcx
mov    %r14,%r8
mov    %r13,%r9
mov    $0x1,%al
push   %r15
push   %r12
call   1030 <EPIdiagTriangle@plt>
add    $0x10,%rsp
lea    0xd0(%rsp),%rdi
lea    0xb0(%rsp),%rsi
lea    0x90(%rsp),%rdx
mov    %r14,%rcx
mov    %r13,%r8
mov    %r12,%r9
movaps 0x10(%rsp),%xmm0
mov    $0x1,%al
push   %r15
push   %rbp
call   1030 <EPIdiagTriangle@plt>
add    $0x10,%rsp
lea    0xb0(%rsp),%rdi
lea    0xc0(%rsp),%rsi
lea    0x90(%rsp),%rdx
mov    %r13,%rcx
mov    %r12,%r8
mov    %rbp,%r9
movaps 0x10(%rsp),%xmm0
mov    $0x1,%al
push   %r15
push   %r14
call   1030 <EPIdiagTriangle@plt>
add    $0x10,%rsp
lea    0xc0(%rsp),%rdi
lea    0xe0(%rsp),%rsi
lea    0x90(%rsp),%rdx
mov    %r12,%rcx
mov    %rbp,%r8
mov    %r14,%r9
movaps 0x10(%rsp),%xmm0
mov    $0x1,%al
push   %r15
push   %r13
call   1030 <EPIdiagTriangle@plt>
mov    0x210(%rsp),%rax
mov    0x220(%rsp),%r10
mov    0x228(%rsp),%r9
mov    0x218(%rsp),%rdi
mov    0x1c8(%rsp),%rbp
mov    0x1d0(%rsp),%r11
movapd 0x240(%rsp),%xmm3
movapd 0x230(%rsp),%xmm14
add    $0x10,%rsp
movsd  0x88(%rsp),%xmm0
movhpd 0x80(%rsp),%xmm0
movapd %xmm3,%xmm1
mulpd  %xmm0,%xmm1
movupd (%rdi,%rbx,1),%xmm2
mulpd  %xmm0,%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,(%rdi,%rbx,1)
movsd  0x78(%rsp),%xmm0
movhpd 0x70(%rsp),%xmm0
movapd %xmm3,%xmm1
mulpd  %xmm0,%xmm1
movupd (%r10,%rbx,1),%xmm2
mulpd  %xmm0,%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,(%r10,%rbx,1)
add    %r11,%rax
mov    0x1c8(%rsp),%rcx
add    %r11,%rcx
add    %r11,0x38(%rsp)
mov    0x1d8(%rsp),%r12
add    %r11,%r12
mov    0x1f0(%rsp),%r8
add    %r11,%r8
mov    0x1f8(%rsp),%rdx
add    %r11,%rdx
mov    0x1e0(%rsp),%r13
add    %r11,%r13
mov    0x1e8(%rsp),%r15
add    %r11,%r15
mov    0x1d0(%rsp),%r14
add    %rbp,%r14
add    %rbp,0x40(%rsp)
add    %rbp,0x58(%rsp)
add    %rbp,0x50(%rsp)
add    %rbp,0x30(%rsp)
add    %rbp,0x48(%rsp)
add    %rbp,0x68(%rsp)
add    %rbp,0x60(%rsp)
add    %rbp,%rdi
add    %rbp,%r10
add    $0xffffffffffffffff,%r9
jne    1370 <EPIdiag2D+0x260>
jmp    1280 <EPIdiag2D+0x170>
add    $0x248,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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