void calc_tetrads(double al, double *be, double *gam, double *igam,
                  double sqrtgam, int xx, double *e, double *ie) {
  if (0)
    printf("  In calc_tetrads\n");
  int yy = (xx + 1) % 3;
  int zz = (xx + 2) % 3;
  double ial = 1.0 / al;
  double xfac = 1.0 / sqrt(igam[3 * xx + xx]);
  e[4 * 0 + 0] = ial;
  e[4 * 0 + xx + 1] = -be[xx] * ial;
  e[4 * 0 + yy + 1] = -be[yy] * ial;
  e[4 * 0 + zz + 1] = -be[zz] * ial;
  e[4 * 1 + 0] = 0.0;
  e[4 * 1 + xx + 1] = igam[3 * xx + xx] * xfac;
  e[4 * 1 + yy + 1] = igam[3 * xx + yy] * xfac;
  e[4 * 1 + zz + 1] = igam[3 * xx + zz] * xfac;
  e[4 * 2 + 0] = 0.0;
  e[4 * 2 + xx + 1] = 0.0;
  e[4 * 2 + yy + 1] =
      sqrt(gam[3 * zz + zz] / (igam[3 * xx + xx] * sqrtgam * sqrtgam));
  e[4 * 2 + zz + 1] = -gam[3 * yy + zz] /
                      (sqrtgam * sqrt(igam[3 * xx + xx] * gam[3 * zz + zz]));
  e[4 * 3 + 0] = 0.0;
  e[4 * 3 + xx + 1] = 0.0;
  e[4 * 3 + yy + 1] = 0.0;
  e[4 * 3 + zz + 1] = 1.0 / sqrt(gam[3 * zz + zz]);
  ie[4 * 0 + 0] = al;
  ie[4 * 0 + xx + 1] = 0.0;
  ie[4 * 0 + yy + 1] = 0.0;
  ie[4 * 0 + zz + 1] = 0.0;
  ie[4 * 1 + 0] = 0.0;
  ie[4 * 1 + xx + 1] = gam[3 * xx + xx] * e[4 * 1 + xx + 1] +
                       gam[3 * xx + yy] * e[4 * 1 + yy + 1] +
                       gam[3 * xx + zz] * e[4 * 1 + zz + 1];
  ie[4 * 1 + yy + 1] = gam[3 * yy + xx] * e[4 * 1 + xx + 1] +
                       gam[3 * yy + yy] * e[4 * 1 + yy + 1] +
                       gam[3 * yy + zz] * e[4 * 1 + zz + 1];
  ie[4 * 1 + zz + 1] = gam[3 * zz + xx] * e[4 * 1 + xx] +
                       gam[3 * zz + yy] * e[4 * 1 + yy] +
                       gam[3 * zz + zz] * e[4 * 1 + zz];
  ie[4 * 2 + 0] = 0.0;
  ie[4 * 2 + xx + 1] = 0.0;
  ie[4 * 2 + yy + 1] = gam[3 * yy + yy] * e[4 * 2 + yy + 1] +
                       gam[3 * yy + zz] * e[4 * 2 + zz + 1];
  ie[4 * 2 + zz + 1] = gam[3 * zz + yy] * e[4 * 2 + yy + 1] +
                       gam[3 * zz + zz] * e[4 * 2 + zz + 1];
  ie[4 * 3 + 0] = 0.0;
  ie[4 * 3 + xx + 1] = 0.0;
  ie[4 * 3 + yy + 1] = 0.0;
  ie[4 * 3 + zz + 1] = gam[3 * zz + zz] * e[4 * 3 + zz + 1];
  if (0)
    printf("  Done calc_tetrads\n");
}


x86 assembly (clang, -O0):
<calc_tetrads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x44(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x48(%rbp)
movsd  0xe9d(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x20(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe70(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x0,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x0,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x0,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x20(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x40(%rax)
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x44(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   1030 <sqrt@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x60(%rax)
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0xc,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0xc,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xbae(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0xc,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x8(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x0,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x0,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x0,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x44(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
imul   $0x3,-0x44(%rbp),%ecx
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
imul   $0x3,-0x44(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x4,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x40(%rax)
mov    -0x40(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x44(%rbp),%ecx
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
imul   $0x3,-0x44(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0x8,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x60(%rax)
mov    -0x40(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0xc,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0xc,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
imul   $0x3,-0x48(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0xc,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    $0xc,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_tetrads>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r9,%r14
mov    %r8,%rbx
mov    %ecx,%r12d
movsd  %xmm1,0x10(%rsp)
mov    %rsi,%r15
lea    0x1(%r12),%eax
movslq %eax,%rcx
mov    %rcx,%rax
mov    %rcx,0x48(%rsp)
imul   $0x55555556,%rcx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
lea    (%r12,%rax,1),%r9d
add    $0x1,%r9d
lea    0x2(%r12),%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
lea    (%r12,%rax,1),%r10d
add    $0x2,%r10d
movsd  0xe6c(%rip),%xmm4
movsd  %xmm0,0xb0(%rsp)
divsd  %xmm0,%xmm4
lea    (%r12,%r12,2),%ebp
lea    0x0(,%r12,4),%eax
cltq
mov    %rax,0x38(%rsp)
movsd  (%rdx,%rax,8),%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
mov    %r10,0x28(%rsp)
mov    %r9,0x20(%rsp)
jb     11d3 <calc_tetrads+0xc3>
sqrtsd %xmm0,%xmm0
jmp    1200 <calc_tetrads+0xf0>
mov    %rdx,0x8(%rsp)
mov    %rdi,%r13
movsd  %xmm4,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm4
xorpd  %xmm3,%xmm3
mov    %r13,%rdi
mov    0x8(%rsp),%rdx
mov    0x20(%rsp),%r9
mov    0x28(%rsp),%r10
movsd  0xdf8(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm4,(%rbx)
movslq %r12d,%rcx
movsd  (%rdi,%rcx,8),%xmm0
movapd 0xdf0(%rip),%xmm2
xorpd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
mov    0x48(%rsp),%rax
movsd  %xmm0,(%rbx,%rax,8)
movslq %r9d,%rsi
movsd  (%rdi,%rsi,8),%xmm0
xorpd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,0x8(%rbx,%rsi,8)
movslq %r10d,%r13
movsd  (%rdi,%r13,8),%xmm0
xorpd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,0x8(%rbx,%r13,8)
movq   $0x0,0x20(%rbx)
mov    0x38(%rsp),%r8
movsd  (%rdx,%r8,8),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rbx,%rcx,8)
lea    (%r9,%rbp,1),%eax
cltq
mov    %rax,0x88(%rsp)
movsd  (%rdx,%rax,8),%xmm0
mulsd  %xmm1,%xmm0
lea    0x5(%rsi),%eax
mov    %rax,0xa0(%rsp)
movsd  %xmm0,(%rbx,%rax,8)
add    %r10d,%ebp
movslq %ebp,%rax
mov    %rax,0x68(%rsp)
mulsd  (%rdx,%rax,8),%xmm1
lea    0x5(%r13),%eax
mov    %rax,0xa8(%rsp)
movsd  %xmm1,(%rbx,%rax,8)
movq   $0x0,0x40(%rbx)
movq   $0x0,0x48(%rbx,%rcx,8)
lea    0x0(,%r10,4),%eax
movslq %eax,%r11
movsd  (%r15,%r11,8),%xmm0
movsd  (%rdx,%r8,8),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
ucomisd %xmm3,%xmm0
mov    %r11,0x30(%rsp)
mov    %r13,(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rcx,0x8(%rsp)
jb     131e <calc_tetrads+0x20e>
sqrtsd %xmm0,%xmm0
jmp    1338 <calc_tetrads+0x228>
mov    %rdx,%rbp
call   1030 <sqrt@plt>
mov    %rbp,%rdx
mov    0x30(%rsp),%r11
mov    0x20(%rsp),%r9
mov    0x28(%rsp),%r10
lea    0x9(%r9),%eax
mov    %rax,0x98(%rsp)
movsd  %xmm0,(%rbx,%rax,8)
lea    (%r9,%r9,2),%eax
mov    %rax,0x78(%rsp)
add    %r10d,%eax
cltq
mov    %rax,0x90(%rsp)
movsd  (%r15,%rax,8),%xmm2
xorpd  0xca3(%rip),%xmm2
mov    0x38(%rsp),%rax
movsd  (%rdx,%rax,8),%xmm0
mulsd  (%r15,%r11,8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     138d <calc_tetrads+0x27d>
sqrtsd %xmm0,%xmm0
jmp    13b1 <calc_tetrads+0x2a1>
movapd %xmm2,0x50(%rsp)
call   1030 <sqrt@plt>
movapd 0x50(%rsp),%xmm2
xorpd  %xmm1,%xmm1
mov    0x30(%rsp),%r11
mov    0x20(%rsp),%r9
mov    0x28(%rsp),%r10
mov    0x8(%rsp),%rdi
mov    (%rsp),%r8
mov    0x18(%rsp),%rdx
lea    0x1(%rdx),%rcx
lea    0x1(%r8),%rbp
lea    0x4(%r12),%eax
mov    %eax,0x44(%rsp)
lea    0x5(%rdi),%rax
mov    %rax,0x70(%rsp)
add    $0x4,%edx
add    $0x4,%r8d
lea    0x9(%rdi),%rax
mov    %rax,0x80(%rsp)
lea    (%r10,%r10,2),%r13d
mulsd  0x10(%rsp),%xmm0
divsd  %xmm0,%xmm2
lea    0x9(%r10),%eax
mov    %rax,0x10(%rsp)
movsd  %xmm2,(%rbx,%rax,8)
movq   $0x0,0x60(%rbx)
movq   $0x0,0x68(%rbx,%rdi,8)
add    $0xd,%rdi
lea    0xd(%r9),%eax
mov    %rax,0x50(%rsp)
movq   $0x0,(%rbx,%rax,8)
movsd  (%r15,%r11,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1440 <calc_tetrads+0x330>
sqrtsd %xmm0,%xmm0
jmp    147a <calc_tetrads+0x36a>
mov    %rdi,0x8(%rsp)
mov    %r8,(%rsp)
mov    %rdx,0x18(%rsp)
mov    %rcx,0x60(%rsp)
call   1030 <sqrt@plt>
mov    0x60(%rsp),%rcx
mov    0x30(%rsp),%r11
mov    0x18(%rsp),%rdx
mov    (%rsp),%r8
mov    0x8(%rsp),%rdi
mov    0x20(%rsp),%r9
mov    0x28(%rsp),%r10
movsd  0xb7e(%rip),%xmm1
divsd  %xmm0,%xmm1
add    $0xd,%r10d
movsd  %xmm1,(%rbx,%r10,8)
movsd  0xb0(%rsp),%xmm0
movsd  %xmm0,(%r14)
mov    0x48(%rsp),%rax
movq   $0x0,(%r14,%rax,8)
movq   $0x0,(%r14,%rcx,8)
movq   $0x0,(%r14,%rbp,8)
movq   $0x0,0x20(%r14)
mov    0x38(%rsp),%rax
movsd  (%r15,%rax,8),%xmm0
mov    0x88(%rsp),%rax
movsd  (%r15,%rax,8),%xmm1
mov    0x68(%rsp),%rax
movsd  (%r15,%rax,8),%xmm2
mov    0xa0(%rsp),%rcx
mulsd  (%rbx,%rcx,8),%xmm1
mov    0x70(%rsp),%rbp
mulsd  (%rbx,%rbp,8),%xmm0
mov    0xa8(%rsp),%rsi
mulsd  (%rbx,%rsi,8),%xmm2
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
movsd  %xmm2,(%r14,%rbp,8)
mov    0x78(%rsp),%rax
add    %r12d,%eax
cltq
movsd  (%r15,%rax,8),%xmm0
mulsd  (%rbx,%rbp,8),%xmm0
lea    0x0(,%r9,4),%eax
cltq
movsd  (%r15,%rax,8),%xmm1
mulsd  (%rbx,%rcx,8),%xmm1
addsd  %xmm1,%xmm0
mov    0x90(%rsp),%rbp
movsd  (%r15,%rbp,8),%xmm1
mulsd  (%rbx,%rsi,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rcx,8)
add    %r13d,%r12d
add    %r9d,%r13d
movslq %r13d,%rcx
movsd  (%r15,%rcx,8),%xmm0
mov    %edx,%edx
mulsd  (%rbx,%rdx,8),%xmm0
movslq %r12d,%rdx
movsd  (%r15,%rdx,8),%xmm1
movslq 0x44(%rsp),%rdx
mulsd  (%rbx,%rdx,8),%xmm1
movsd  (%r15,%r11,8),%xmm2
mov    %r8d,%edx
mulsd  (%rbx,%rdx,8),%xmm2
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r14,%rsi,8)
movq   $0x0,0x40(%r14)
mov    0x80(%rsp),%rdx
movq   $0x0,(%r14,%rdx,8)
movsd  (%r15,%rbp,8),%xmm0
mov    0x10(%rsp),%rdx
mulsd  (%rbx,%rdx,8),%xmm0
movsd  (%r15,%rax,8),%xmm1
mov    0x98(%rsp),%rax
mulsd  (%rbx,%rax,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rax,8)
movsd  (%r15,%rcx,8),%xmm0
mulsd  (%rbx,%rax,8),%xmm0
movsd  (%r15,%r11,8),%xmm1
mulsd  (%rbx,%rdx,8),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14,%rdx,8)
movq   $0x0,0x60(%r14)
movq   $0x0,(%r14,%rdi,8)
mov    0x50(%rsp),%rax
movq   $0x0,(%r14,%rax,8)
movsd  (%r15,%r11,8),%xmm0
mulsd  (%rbx,%r10,8),%xmm0
movsd  %xmm0,(%r14,%r10,8)
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @calc_tetrads(double %0, double* %1, double* %2, double* %3, double %4, i32 %5, double* %6, double* %7) {
%9 = alloca double
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca i32
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
%20 = alloca double
store double %0, double* %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double %4, double* %13
store i32 %5, i32* %14
store double* %6, double** %15
store double* %7, double** %16
%21 = load i32, i32* %14
%22 = add nsw i32 %21, 1
%23 = srem i32 %22, 3
store i32 %23, i32* %17
%24 = load i32, i32* %14
%25 = add nsw i32 %24, 2
%26 = srem i32 %25, 3
store i32 %26, i32* %18
%27 = load double, double* %9
%28 = fdiv double 1.000000e+00, %27
store double %28, double* %19
%29 = load double*, double** %12
%30 = load i32, i32* %14
%31 = mul nsw i32 3, %30
%32 = load i32, i32* %14
%33 = add nsw i32 %31, %32
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %29, i64 %34
%36 = load double, double* %35
%37 = call double @sqrt(double %36)
%38 = fdiv double 1.000000e+00, %37
store double %38, double* %20
%39 = load double, double* %19
%40 = load double*, double** %15
%41 = getelementptr inbounds double, double* %40, i64 0
store double %39, double* %41
%42 = load double*, double** %10
%43 = load i32, i32* %14
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
%46 = load double, double* %45
%47 = fneg double %46
%48 = load double, double* %19
%49 = fmul double %47, %48
%50 = load double*, double** %15
%51 = load i32, i32* %14
%52 = add nsw i32 0, %51
%53 = add nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %50, i64 %54
store double %49, double* %55
%56 = load double*, double** %10
%57 = load i32, i32* %17
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
%60 = load double, double* %59
%61 = fneg double %60
%62 = load double, double* %19
%63 = fmul double %61, %62
%64 = load double*, double** %15
%65 = load i32, i32* %17
%66 = add nsw i32 0, %65
%67 = add nsw i32 %66, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %64, i64 %68
store double %63, double* %69
%70 = load double*, double** %10
%71 = load i32, i32* %18
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
%74 = load double, double* %73
%75 = fneg double %74
%76 = load double, double* %19
%77 = fmul double %75, %76
%78 = load double*, double** %15
%79 = load i32, i32* %18
%80 = add nsw i32 0, %79
%81 = add nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %78, i64 %82
store double %77, double* %83
%84 = load double*, double** %15
%85 = getelementptr inbounds double, double* %84, i64 4
store double 0.000000e+00, double* %85
%86 = load double*, double** %12
%87 = load i32, i32* %14
%88 = mul nsw i32 3, %87
%89 = load i32, i32* %14
%90 = add nsw i32 %88, %89
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %86, i64 %91
%93 = load double, double* %92
%94 = load double, double* %20
%95 = fmul double %93, %94
%96 = load double*, double** %15
%97 = load i32, i32* %14
%98 = add nsw i32 4, %97
%99 = add nsw i32 %98, 1
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %96, i64 %100
store double %95, double* %101
%102 = load double*, double** %12
%103 = load i32, i32* %14
%104 = mul nsw i32 3, %103
%105 = load i32, i32* %17
%106 = add nsw i32 %104, %105
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %102, i64 %107
%109 = load double, double* %108
%110 = load double, double* %20
%111 = fmul double %109, %110
%112 = load double*, double** %15
%113 = load i32, i32* %17
%114 = add nsw i32 4, %113
%115 = add nsw i32 %114, 1
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds double, double* %112, i64 %116
store double %111, double* %117
%118 = load double*, double** %12
%119 = load i32, i32* %14
%120 = mul nsw i32 3, %119
%121 = load i32, i32* %18
%122 = add nsw i32 %120, %121
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %118, i64 %123
%125 = load double, double* %124
%126 = load double, double* %20
%127 = fmul double %125, %126
%128 = load double*, double** %15
%129 = load i32, i32* %18
%130 = add nsw i32 4, %129
%131 = add nsw i32 %130, 1
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %128, i64 %132
store double %127, double* %133
%134 = load double*, double** %15
%135 = getelementptr inbounds double, double* %134, i64 8
store double 0.000000e+00, double* %135
%136 = load double*, double** %15
%137 = load i32, i32* %14
%138 = add nsw i32 8, %137
%139 = add nsw i32 %138, 1
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %136, i64 %140
store double 0.000000e+00, double* %141
%142 = load double*, double** %11
%143 = load i32, i32* %18
%144 = mul nsw i32 3, %143
%145 = load i32, i32* %18
%146 = add nsw i32 %144, %145
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds double, double* %142, i64 %147
%149 = load double, double* %148
%150 = load double*, double** %12
%151 = load i32, i32* %14
%152 = mul nsw i32 3, %151
%153 = load i32, i32* %14
%154 = add nsw i32 %152, %153
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds double, double* %150, i64 %155
%157 = load double, double* %156
%158 = load double, double* %13
%159 = fmul double %157, %158
%160 = load double, double* %13
%161 = fmul double %159, %160
%162 = fdiv double %149, %161
%163 = call double @sqrt(double %162)
%164 = load double*, double** %15
%165 = load i32, i32* %17
%166 = add nsw i32 8, %165
%167 = add nsw i32 %166, 1
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double, double* %164, i64 %168
store double %163, double* %169
%170 = load double*, double** %11
%171 = load i32, i32* %17
%172 = mul nsw i32 3, %171
%173 = load i32, i32* %18
%174 = add nsw i32 %172, %173
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds double, double* %170, i64 %175
%177 = load double, double* %176
%178 = fneg double %177
%179 = load double, double* %13
%180 = load double*, double** %12
%181 = load i32, i32* %14
%182 = mul nsw i32 3, %181
%183 = load i32, i32* %14
%184 = add nsw i32 %182, %183
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds double, double* %180, i64 %185
%187 = load double, double* %186
%188 = load double*, double** %11
%189 = load i32, i32* %18
%190 = mul nsw i32 3, %189
%191 = load i32, i32* %18
%192 = add nsw i32 %190, %191
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds double, double* %188, i64 %193
%195 = load double, double* %194
%196 = fmul double %187, %195
%197 = call double @sqrt(double %196)
%198 = fmul double %179, %197
%199 = fdiv double %178, %198
%200 = load double*, double** %15
%201 = load i32, i32* %18
%202 = add nsw i32 8, %201
%203 = add nsw i32 %202, 1
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds double, double* %200, i64 %204
store double %199, double* %205
%206 = load double*, double** %15
%207 = getelementptr inbounds double, double* %206, i64 12
store double 0.000000e+00, double* %207
%208 = load double*, double** %15
%209 = load i32, i32* %14
%210 = add nsw i32 12, %209
%211 = add nsw i32 %210, 1
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds double, double* %208, i64 %212
store double 0.000000e+00, double* %213
%214 = load double*, double** %15
%215 = load i32, i32* %17
%216 = add nsw i32 12, %215
%217 = add nsw i32 %216, 1
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds double, double* %214, i64 %218
store double 0.000000e+00, double* %219
%220 = load double*, double** %11
%221 = load i32, i32* %18
%222 = mul nsw i32 3, %221
%223 = load i32, i32* %18
%224 = add nsw i32 %222, %223
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds double, double* %220, i64 %225
%227 = load double, double* %226
%228 = call double @sqrt(double %227)
%229 = fdiv double 1.000000e+00, %228
%230 = load double*, double** %15
%231 = load i32, i32* %18
%232 = add nsw i32 12, %231
%233 = add nsw i32 %232, 1
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds double, double* %230, i64 %234
store double %229, double* %235
%236 = load double, double* %9
%237 = load double*, double** %16
%238 = getelementptr inbounds double, double* %237, i64 0
store double %236, double* %238
%239 = load double*, double** %16
%240 = load i32, i32* %14
%241 = add nsw i32 0, %240
%242 = add nsw i32 %241, 1
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds double, double* %239, i64 %243
store double 0.000000e+00, double* %244
%245 = load double*, double** %16
%246 = load i32, i32* %17
%247 = add nsw i32 0, %246
%248 = add nsw i32 %247, 1
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds double, double* %245, i64 %249
store double 0.000000e+00, double* %250
%251 = load double*, double** %16
%252 = load i32, i32* %18
%253 = add nsw i32 0, %252
%254 = add nsw i32 %253, 1
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds double, double* %251, i64 %255
store double 0.000000e+00, double* %256
%257 = load double*, double** %16
%258 = getelementptr inbounds double, double* %257, i64 4
store double 0.000000e+00, double* %258
%259 = load double*, double** %11
%260 = load i32, i32* %14
%261 = mul nsw i32 3, %260
%262 = load i32, i32* %14
%263 = add nsw i32 %261, %262
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds double, double* %259, i64 %264
%266 = load double, double* %265
%267 = load double*, double** %15
%268 = load i32, i32* %14
%269 = add nsw i32 4, %268
%270 = add nsw i32 %269, 1
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds double, double* %267, i64 %271
%273 = load double, double* %272
%274 = load double*, double** %11
%275 = load i32, i32* %14
%276 = mul nsw i32 3, %275
%277 = load i32, i32* %17
%278 = add nsw i32 %276, %277
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds double, double* %274, i64 %279
%281 = load double, double* %280
%282 = load double*, double** %15
%283 = load i32, i32* %17
%284 = add nsw i32 4, %283
%285 = add nsw i32 %284, 1
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds double, double* %282, i64 %286
%288 = load double, double* %287
%289 = fmul double %281, %288
%290 = call double @llvm.fmuladd.f64(double %266, double %273, double %289)
%291 = load double*, double** %11
%292 = load i32, i32* %14
%293 = mul nsw i32 3, %292
%294 = load i32, i32* %18
%295 = add nsw i32 %293, %294
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds double, double* %291, i64 %296
%298 = load double, double* %297
%299 = load double*, double** %15
%300 = load i32, i32* %18
%301 = add nsw i32 4, %300
%302 = add nsw i32 %301, 1
%303 = sext i32 %302 to i64
%304 = getelementptr inbounds double, double* %299, i64 %303
%305 = load double, double* %304
%306 = call double @llvm.fmuladd.f64(double %298, double %305, double %290)
%307 = load double*, double** %16
%308 = load i32, i32* %14
%309 = add nsw i32 4, %308
%310 = add nsw i32 %309, 1
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds double, double* %307, i64 %311
store double %306, double* %312
%313 = load double*, double** %11
%314 = load i32, i32* %17
%315 = mul nsw i32 3, %314
%316 = load i32, i32* %14
%317 = add nsw i32 %315, %316
%318 = sext i32 %317 to i64
%319 = getelementptr inbounds double, double* %313, i64 %318
%320 = load double, double* %319
%321 = load double*, double** %15
%322 = load i32, i32* %14
%323 = add nsw i32 4, %322
%324 = add nsw i32 %323, 1
%325 = sext i32 %324 to i64
%326 = getelementptr inbounds double, double* %321, i64 %325
%327 = load double, double* %326
%328 = load double*, double** %11
%329 = load i32, i32* %17
%330 = mul nsw i32 3, %329
%331 = load i32, i32* %17
%332 = add nsw i32 %330, %331
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds double, double* %328, i64 %333
%335 = load double, double* %334
%336 = load double*, double** %15
%337 = load i32, i32* %17
%338 = add nsw i32 4, %337
%339 = add nsw i32 %338, 1
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds double, double* %336, i64 %340
%342 = load double, double* %341
%343 = fmul double %335, %342
%344 = call double @llvm.fmuladd.f64(double %320, double %327, double %343)
%345 = load double*, double** %11
%346 = load i32, i32* %17
%347 = mul nsw i32 3, %346
%348 = load i32, i32* %18
%349 = add nsw i32 %347, %348
%350 = sext i32 %349 to i64
%351 = getelementptr inbounds double, double* %345, i64 %350
%352 = load double, double* %351
%353 = load double*, double** %15
%354 = load i32, i32* %18
%355 = add nsw i32 4, %354
%356 = add nsw i32 %355, 1
%357 = sext i32 %356 to i64
%358 = getelementptr inbounds double, double* %353, i64 %357
%359 = load double, double* %358
%360 = call double @llvm.fmuladd.f64(double %352, double %359, double %344)
%361 = load double*, double** %16
%362 = load i32, i32* %17
%363 = add nsw i32 4, %362
%364 = add nsw i32 %363, 1
%365 = sext i32 %364 to i64
%366 = getelementptr inbounds double, double* %361, i64 %365
store double %360, double* %366
%367 = load double*, double** %11
%368 = load i32, i32* %18
%369 = mul nsw i32 3, %368
%370 = load i32, i32* %14
%371 = add nsw i32 %369, %370
%372 = sext i32 %371 to i64
%373 = getelementptr inbounds double, double* %367, i64 %372
%374 = load double, double* %373
%375 = load double*, double** %15
%376 = load i32, i32* %14
%377 = add nsw i32 4, %376
%378 = sext i32 %377 to i64
%379 = getelementptr inbounds double, double* %375, i64 %378
%380 = load double, double* %379
%381 = load double*, double** %11
%382 = load i32, i32* %18
%383 = mul nsw i32 3, %382
%384 = load i32, i32* %17
%385 = add nsw i32 %383, %384
%386 = sext i32 %385 to i64
%387 = getelementptr inbounds double, double* %381, i64 %386
%388 = load double, double* %387
%389 = load double*, double** %15
%390 = load i32, i32* %17
%391 = add nsw i32 4, %390
%392 = sext i32 %391 to i64
%393 = getelementptr inbounds double, double* %389, i64 %392
%394 = load double, double* %393
%395 = fmul double %388, %394
%396 = call double @llvm.fmuladd.f64(double %374, double %380, double %395)
%397 = load double*, double** %11
%398 = load i32, i32* %18
%399 = mul nsw i32 3, %398
%400 = load i32, i32* %18
%401 = add nsw i32 %399, %400
%402 = sext i32 %401 to i64
%403 = getelementptr inbounds double, double* %397, i64 %402
%404 = load double, double* %403
%405 = load double*, double** %15
%406 = load i32, i32* %18
%407 = add nsw i32 4, %406
%408 = sext i32 %407 to i64
%409 = getelementptr inbounds double, double* %405, i64 %408
%410 = load double, double* %409
%411 = call double @llvm.fmuladd.f64(double %404, double %410, double %396)
%412 = load double*, double** %16
%413 = load i32, i32* %18
%414 = add nsw i32 4, %413
%415 = add nsw i32 %414, 1
%416 = sext i32 %415 to i64
%417 = getelementptr inbounds double, double* %412, i64 %416
store double %411, double* %417
%418 = load double*, double** %16
%419 = getelementptr inbounds double, double* %418, i64 8
store double 0.000000e+00, double* %419
%420 = load double*, double** %16
%421 = load i32, i32* %14
%422 = add nsw i32 8, %421
%423 = add nsw i32 %422, 1
%424 = sext i32 %423 to i64
%425 = getelementptr inbounds double, double* %420, i64 %424
store double 0.000000e+00, double* %425
%426 = load double*, double** %11
%427 = load i32, i32* %17
%428 = mul nsw i32 3, %427
%429 = load i32, i32* %17
%430 = add nsw i32 %428, %429
%431 = sext i32 %430 to i64
%432 = getelementptr inbounds double, double* %426, i64 %431
%433 = load double, double* %432
%434 = load double*, double** %15
%435 = load i32, i32* %17
%436 = add nsw i32 8, %435
%437 = add nsw i32 %436, 1
%438 = sext i32 %437 to i64
%439 = getelementptr inbounds double, double* %434, i64 %438
%440 = load double, double* %439
%441 = load double*, double** %11
%442 = load i32, i32* %17
%443 = mul nsw i32 3, %442
%444 = load i32, i32* %18
%445 = add nsw i32 %443, %444
%446 = sext i32 %445 to i64
%447 = getelementptr inbounds double, double* %441, i64 %446
%448 = load double, double* %447
%449 = load double*, double** %15
%450 = load i32, i32* %18
%451 = add nsw i32 8, %450
%452 = add nsw i32 %451, 1
%453 = sext i32 %452 to i64
%454 = getelementptr inbounds double, double* %449, i64 %453
%455 = load double, double* %454
%456 = fmul double %448, %455
%457 = call double @llvm.fmuladd.f64(double %433, double %440, double %456)
%458 = load double*, double** %16
%459 = load i32, i32* %17
%460 = add nsw i32 8, %459
%461 = add nsw i32 %460, 1
%462 = sext i32 %461 to i64
%463 = getelementptr inbounds double, double* %458, i64 %462
store double %457, double* %463
%464 = load double*, double** %11
%465 = load i32, i32* %18
%466 = mul nsw i32 3, %465
%467 = load i32, i32* %17
%468 = add nsw i32 %466, %467
%469 = sext i32 %468 to i64
%470 = getelementptr inbounds double, double* %464, i64 %469
%471 = load double, double* %470
%472 = load double*, double** %15
%473 = load i32, i32* %17
%474 = add nsw i32 8, %473
%475 = add nsw i32 %474, 1
%476 = sext i32 %475 to i64
%477 = getelementptr inbounds double, double* %472, i64 %476
%478 = load double, double* %477
%479 = load double*, double** %11
%480 = load i32, i32* %18
%481 = mul nsw i32 3, %480
%482 = load i32, i32* %18
%483 = add nsw i32 %481, %482
%484 = sext i32 %483 to i64
%485 = getelementptr inbounds double, double* %479, i64 %484
%486 = load double, double* %485
%487 = load double*, double** %15
%488 = load i32, i32* %18
%489 = add nsw i32 8, %488
%490 = add nsw i32 %489, 1
%491 = sext i32 %490 to i64
%492 = getelementptr inbounds double, double* %487, i64 %491
%493 = load double, double* %492
%494 = fmul double %486, %493
%495 = call double @llvm.fmuladd.f64(double %471, double %478, double %494)
%496 = load double*, double** %16
%497 = load i32, i32* %18
%498 = add nsw i32 8, %497
%499 = add nsw i32 %498, 1
%500 = sext i32 %499 to i64
%501 = getelementptr inbounds double, double* %496, i64 %500
store double %495, double* %501
%502 = load double*, double** %16
%503 = getelementptr inbounds double, double* %502, i64 12
store double 0.000000e+00, double* %503
%504 = load double*, double** %16
%505 = load i32, i32* %14
%506 = add nsw i32 12, %505
%507 = add nsw i32 %506, 1
%508 = sext i32 %507 to i64
%509 = getelementptr inbounds double, double* %504, i64 %508
store double 0.000000e+00, double* %509
%510 = load double*, double** %16
%511 = load i32, i32* %17
%512 = add nsw i32 12, %511
%513 = add nsw i32 %512, 1
%514 = sext i32 %513 to i64
%515 = getelementptr inbounds double, double* %510, i64 %514
store double 0.000000e+00, double* %515
%516 = load double*, double** %11
%517 = load i32, i32* %18
%518 = mul nsw i32 3, %517
%519 = load i32, i32* %18
%520 = add nsw i32 %518, %519
%521 = sext i32 %520 to i64
%522 = getelementptr inbounds double, double* %516, i64 %521
%523 = load double, double* %522
%524 = load double*, double** %15
%525 = load i32, i32* %18
%526 = add nsw i32 12, %525
%527 = add nsw i32 %526, 1
%528 = sext i32 %527 to i64
%529 = getelementptr inbounds double, double* %524, i64 %528
%530 = load double, double* %529
%531 = fmul double %523, %530
%532 = load double*, double** %16
%533 = load i32, i32* %18
%534 = add nsw i32 12, %533
%535 = add nsw i32 %534, 1
%536 = sext i32 %535 to i64
%537 = getelementptr inbounds double, double* %532, i64 %536
store double %531, double* %537
ret void
}

LLVM IR (-O2):
define void @calc_tetrads(double %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, double %4, i32 %5, double* nocapture %6, double* nocapture writeonly %7) {
%9 = add nsw i32 %5, 1
%10 = srem i32 %9, 3
%11 = add nsw i32 %5, 2
%12 = srem i32 %11, 3
%13 = fdiv double 1.000000e+00, %0
%14 = mul nsw i32 %5, 3
%15 = shl nsw i32 %5, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %3, i64 %16
%18 = load double, double* %17
%19 = tail call double @sqrt(double %18)
%20 = fdiv double 1.000000e+00, %19
store double %13, double* %6
%21 = sext i32 %5 to i64
%22 = getelementptr inbounds double, double* %1, i64 %21
%23 = load double, double* %22
%24 = fneg double %23
%25 = fmul double %13, %24
%26 = sext i32 %9 to i64
%27 = getelementptr inbounds double, double* %6, i64 %26
store double %25, double* %27
%28 = sext i32 %10 to i64
%29 = getelementptr inbounds double, double* %1, i64 %28
%30 = load double, double* %29
%31 = fneg double %30
%32 = fmul double %13, %31
%33 = add nsw i32 %10, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %6, i64 %34
store double %32, double* %35
%36 = sext i32 %12 to i64
%37 = getelementptr inbounds double, double* %1, i64 %36
%38 = load double, double* %37
%39 = fneg double %38
%40 = fmul double %13, %39
%41 = add nsw i32 %12, 1
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %6, i64 %42
store double %40, double* %43
%44 = getelementptr inbounds double, double* %6, i64 4
store double 0.000000e+00, double* %44
%45 = load double, double* %17
%46 = fmul double %20, %45
%47 = add nsw i32 %5, 4
%48 = add nsw i32 %5, 5
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %6, i64 %49
store double %46, double* %50
%51 = add nsw i32 %10, %14
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %3, i64 %52
%54 = load double, double* %53
%55 = fmul double %20, %54
%56 = add nsw i32 %10, 4
%57 = add nsw i32 %10, 5
%58 = zext i32 %57 to i64
%59 = getelementptr inbounds double, double* %6, i64 %58
store double %55, double* %59
%60 = add nsw i32 %12, %14
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %3, i64 %61
%63 = load double, double* %62
%64 = fmul double %20, %63
%65 = add nsw i32 %12, 4
%66 = add nsw i32 %12, 5
%67 = zext i32 %66 to i64
%68 = getelementptr inbounds double, double* %6, i64 %67
store double %64, double* %68
%69 = getelementptr inbounds double, double* %6, i64 8
store double 0.000000e+00, double* %69
%70 = add nsw i32 %5, 9
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %6, i64 %71
store double 0.000000e+00, double* %72
%73 = mul nsw i32 %12, 3
%74 = shl nsw i32 %12, 2
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %2, i64 %75
%77 = load double, double* %76
%78 = load double, double* %17
%79 = fmul double %78, %4
%80 = fmul double %79, %4
%81 = fdiv double %77, %80
%82 = tail call double @sqrt(double %81)
%83 = add nsw i32 %10, 9
%84 = zext i32 %83 to i64
%85 = getelementptr inbounds double, double* %6, i64 %84
store double %82, double* %85
%86 = mul nsw i32 %10, 3
%87 = add nsw i32 %86, %12
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %2, i64 %88
%90 = load double, double* %89
%91 = fneg double %90
%92 = load double, double* %17
%93 = load double, double* %76
%94 = fmul double %92, %93
%95 = tail call double @sqrt(double %94)
%96 = fmul double %95, %4
%97 = fdiv double %91, %96
%98 = add nsw i32 %12, 9
%99 = zext i32 %98 to i64
%100 = getelementptr inbounds double, double* %6, i64 %99
store double %97, double* %100
%101 = getelementptr inbounds double, double* %6, i64 12
store double 0.000000e+00, double* %101
%102 = add nsw i32 %5, 13
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds double, double* %6, i64 %103
store double 0.000000e+00, double* %104
%105 = add nsw i32 %10, 13
%106 = zext i32 %105 to i64
%107 = getelementptr inbounds double, double* %6, i64 %106
store double 0.000000e+00, double* %107
%108 = load double, double* %76
%109 = tail call double @sqrt(double %108)
%110 = fdiv double 1.000000e+00, %109
%111 = add nsw i32 %12, 13
%112 = zext i32 %111 to i64
%113 = getelementptr inbounds double, double* %6, i64 %112
store double %110, double* %113
store double %0, double* %7
%114 = getelementptr inbounds double, double* %7, i64 %26
store double 0.000000e+00, double* %114
%115 = getelementptr inbounds double, double* %7, i64 %34
store double 0.000000e+00, double* %115
%116 = getelementptr inbounds double, double* %7, i64 %42
store double 0.000000e+00, double* %116
%117 = getelementptr inbounds double, double* %7, i64 4
store double 0.000000e+00, double* %117
%118 = getelementptr inbounds double, double* %2, i64 %16
%119 = load double, double* %118
%120 = load double, double* %50
%121 = getelementptr inbounds double, double* %2, i64 %52
%122 = load double, double* %121
%123 = load double, double* %59
%124 = fmul double %122, %123
%125 = tail call double @llvm.fmuladd.f64(double %119, double %120, double %124)
%126 = getelementptr inbounds double, double* %2, i64 %61
%127 = load double, double* %126
%128 = load double, double* %68
%129 = tail call double @llvm.fmuladd.f64(double %127, double %128, double %125)
%130 = getelementptr inbounds double, double* %7, i64 %49
store double %129, double* %130
%131 = add nsw i32 %86, %5
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %2, i64 %132
%134 = load double, double* %133
%135 = load double, double* %50
%136 = shl nsw i32 %10, 2
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %2, i64 %137
%139 = load double, double* %138
%140 = load double, double* %59
%141 = fmul double %139, %140
%142 = tail call double @llvm.fmuladd.f64(double %134, double %135, double %141)
%143 = load double, double* %89
%144 = load double, double* %68
%145 = tail call double @llvm.fmuladd.f64(double %143, double %144, double %142)
%146 = getelementptr inbounds double, double* %7, i64 %58
store double %145, double* %146
%147 = add nsw i32 %73, %5
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double, double* %2, i64 %148
%150 = load double, double* %149
%151 = sext i32 %47 to i64
%152 = getelementptr inbounds double, double* %6, i64 %151
%153 = load double, double* %152
%154 = add nsw i32 %73, %10
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds double, double* %2, i64 %155
%157 = load double, double* %156
%158 = zext i32 %56 to i64
%159 = getelementptr inbounds double, double* %6, i64 %158
%160 = load double, double* %159
%161 = fmul double %157, %160
%162 = tail call double @llvm.fmuladd.f64(double %150, double %153, double %161)
%163 = load double, double* %76
%164 = zext i32 %65 to i64
%165 = getelementptr inbounds double, double* %6, i64 %164
%166 = load double, double* %165
%167 = tail call double @llvm.fmuladd.f64(double %163, double %166, double %162)
%168 = getelementptr inbounds double, double* %7, i64 %67
store double %167, double* %168
%169 = getelementptr inbounds double, double* %7, i64 8
store double 0.000000e+00, double* %169
%170 = getelementptr inbounds double, double* %7, i64 %71
store double 0.000000e+00, double* %170
%171 = load double, double* %138
%172 = load double, double* %85
%173 = load double, double* %89
%174 = load double, double* %100
%175 = fmul double %173, %174
%176 = tail call double @llvm.fmuladd.f64(double %171, double %172, double %175)
%177 = getelementptr inbounds double, double* %7, i64 %84
store double %176, double* %177
%178 = load double, double* %156
%179 = load double, double* %85
%180 = load double, double* %76
%181 = load double, double* %100
%182 = fmul double %180, %181
%183 = tail call double @llvm.fmuladd.f64(double %178, double %179, double %182)
%184 = getelementptr inbounds double, double* %7, i64 %99
store double %183, double* %184
%185 = getelementptr inbounds double, double* %7, i64 12
store double 0.000000e+00, double* %185
%186 = getelementptr inbounds double, double* %7, i64 %103
store double 0.000000e+00, double* %186
%187 = getelementptr inbounds double, double* %7, i64 %106
store double 0.000000e+00, double* %187
%188 = load double, double* %76
%189 = load double, double* %113
%190 = fmul double %188, %189
%191 = getelementptr inbounds double, double* %7, i64 %112
store double %190, double* %191
ret void
}