void matrix_ij_GT(int n, double *mat, double ex, double ey, double ez,
                  double xg, double yg) {
  double g1, g2, g3;
  double g1x, g1y, g1z;
  double g2x, g2y, g2z;
  double g3xxx, g3xxy, g3xxz, g3xyy, g3xyz, g3yyy, g3yyz, g3yzz, g3xzz, g3zzz;
  double exx, eyy, ezz, exy, eyz, exz;
  double exxx, exxy, exxz, exyy, exyz, exzz, eyyy, eyyz, eyzz, ezzz;
  g1 = -1.0 / 3.0 * xg;
  g2 = yg;
  g3 = xg - 2.0 * yg;
  exx = ex * ex;
  eyy = ey * ey;
  ezz = ez * ez;
  exy = ex * ey;
  eyz = ey * ez;
  exz = ez * ex;
  exxx = exx * ex;
  exxy = exx * ey;
  exxz = exx * ez;
  exyy = exy * ey;
  exyz = exy * ez;
  exzz = exz * ez;
  eyyy = eyy * ey;
  eyyz = eyy * ez;
  eyzz = eyz * ez;
  ezzz = ezz * ez;
  g1x = g1 * ex;
  g1y = g1 * ey;
  g1z = g1 * ez;
  g2x = g2 * ex;
  g2y = g2 * ey;
  g2z = g2 * ez;
  g3xxx = g3 * exxx;
  g3xxy = g3 * exxy;
  g3xxz = g3 * exxz;
  g3xyy = g3 * exyy;
  g3xyz = g3 * exyz;
  g3xzz = g3 * exzz;
  g3yyy = g3 * eyyy;
  g3yyz = g3 * eyyz;
  g3yzz = g3 * eyzz;
  g3zzz = g3 * ezzz;
  mat[0 * n + 0] += g1x;
  mat[1 * n + 0] += g1y;
  mat[2 * n + 0] += g1z;
  mat[0 * n + 4] += g1x;
  mat[1 * n + 4] += g1y;
  mat[2 * n + 4] += g1z;
  mat[0 * n + 0] += 2.0 * g2x;
  mat[0 * n + 1] += g2y;
  mat[1 * n + 1] += g2x;
  mat[0 * n + 2] += g2z;
  mat[2 * n + 2] += g2x;
  mat[1 * n + 3] += g2z;
  mat[2 * n + 3] += g2y;
  mat[1 * n + 4] += 2.0 * g2y;
  mat[0 * n + 0] += g3xxx;
  mat[1 * n + 0] += g3xxy;
  mat[2 * n + 0] += g3xxz;
  mat[0 * n + 1] += g3xxy;
  mat[1 * n + 1] += g3xyy;
  mat[2 * n + 1] += g3xyz;
  mat[0 * n + 2] += g3xxz;
  mat[1 * n + 2] += g3xyz;
  mat[2 * n + 2] += g3xzz;
  mat[0 * n + 3] += g3xyz;
  mat[1 * n + 3] += g3yyz;
  mat[2 * n + 3] += g3yzz;
  mat[0 * n + 4] += g3xyy;
  mat[1 * n + 4] += g3yyy;
  mat[2 * n + 4] += g3yyz;
}


x86 assembly (clang, -O0):
<matrix_ij_GT>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
movsd  0xecd(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x108(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x110(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x128(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x130(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x138(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x140(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x148(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x150(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xc8(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xc0(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
imul   $0x0,-0x4(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xb0(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x0,%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_ij_GT>:
movsd  0xef8(%rip),%xmm5
mulsd  %xmm3,%xmm5
movapd %xmm0,%xmm14
mulsd  %xmm0,%xmm14
movapd %xmm1,%xmm11
mulsd  %xmm1,%xmm11
movapd %xmm0,%xmm12
mulsd  %xmm1,%xmm12
movapd %xmm1,%xmm8
mulsd  %xmm2,%xmm8
movapd %xmm0,%xmm9
mulsd  %xmm2,%xmm9
movapd %xmm14,%xmm10
mulsd  %xmm0,%xmm10
movapd %xmm5,%xmm7
mulsd  %xmm0,%xmm7
movapd %xmm5,%xmm13
mulsd  %xmm1,%xmm13
mulsd  %xmm2,%xmm5
movsd  (%rsi),%xmm6
addsd  %xmm7,%xmm6
movsd  %xmm6,(%rsi)
movslq %edi,%rax
movsd  (%rsi,%rax,8),%xmm6
addsd  %xmm13,%xmm6
movsd  %xmm6,(%rsi,%rax,8)
lea    (%rax,%rax,1),%ecx
movslq %ecx,%rcx
movsd  (%rsi,%rcx,8),%xmm6
addsd  %xmm5,%xmm6
movsd  %xmm6,(%rsi,%rcx,8)
movapd %xmm14,%xmm6
mulsd  %xmm1,%xmm6
addsd  0x20(%rsi),%xmm7
mulsd  %xmm2,%xmm14
movsd  %xmm7,0x20(%rsi)
movapd %xmm12,%xmm15
mulsd  %xmm1,%xmm15
mulsd  %xmm2,%xmm12
mulsd  %xmm2,%xmm9
addsd  0x20(%rsi,%rax,8),%xmm13
movsd  %xmm13,0x20(%rsi,%rax,8)
movapd %xmm11,%xmm13
mulsd  %xmm1,%xmm13
mulsd  %xmm2,%xmm11
mulsd  %xmm2,%xmm8
mulsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm1
mulsd  %xmm4,%xmm2
addsd  0x20(%rsi,%rcx,8),%xmm5
movsd  %xmm5,0x20(%rsi,%rcx,8)
movapd %xmm0,%xmm5
addsd  %xmm0,%xmm5
addsd  (%rsi),%xmm5
movsd  %xmm5,(%rsi)
movsd  0x8(%rsi),%xmm5
addsd  %xmm1,%xmm5
movsd  %xmm5,0x8(%rsi)
movsd  0x8(%rsi,%rax,8),%xmm5
addsd  %xmm0,%xmm5
movsd  %xmm5,0x8(%rsi,%rax,8)
movsd  0x10(%rsi),%xmm5
addsd  %xmm2,%xmm5
movsd  %xmm5,0x10(%rsi)
addsd  0x10(%rsi,%rcx,8),%xmm0
movsd  %xmm0,0x10(%rsi,%rcx,8)
addsd  %xmm4,%xmm4
addsd  0x18(%rsi,%rax,8),%xmm2
subsd  %xmm4,%xmm3
movsd  %xmm2,0x18(%rsi,%rax,8)
movsd  0x18(%rsi,%rcx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsi,%rcx,8)
addsd  %xmm1,%xmm1
addsd  0x20(%rsi,%rax,8),%xmm1
movsd  %xmm1,0x20(%rsi,%rax,8)
mulsd  %xmm3,%xmm10
mulsd  %xmm3,%xmm6
mulsd  %xmm3,%xmm14
addsd  (%rsi),%xmm10
movsd  %xmm10,(%rsi)
movsd  (%rsi,%rax,8),%xmm0
addsd  %xmm6,%xmm0
movsd  %xmm0,(%rsi,%rax,8)
movsd  (%rsi,%rcx,8),%xmm0
addsd  %xmm14,%xmm0
movsd  %xmm0,(%rsi,%rcx,8)
mulsd  %xmm3,%xmm15
addsd  0x8(%rsi),%xmm6
mulsd  %xmm3,%xmm12
movsd  %xmm6,0x8(%rsi)
movsd  0x8(%rsi,%rax,8),%xmm0
addsd  %xmm15,%xmm0
movsd  %xmm0,0x8(%rsi,%rax,8)
lea    0x1(%rax,%rax,1),%edx
movslq %edx,%rdx
movsd  (%rsi,%rdx,8),%xmm0
addsd  %xmm12,%xmm0
movsd  %xmm0,(%rsi,%rdx,8)
addsd  0x10(%rsi),%xmm14
movsd  %xmm14,0x10(%rsi)
movsd  0x10(%rsi,%rax,8),%xmm0
addsd  %xmm12,%xmm0
movsd  %xmm0,0x10(%rsi,%rax,8)
mulsd  %xmm3,%xmm9
addsd  0x10(%rsi,%rcx,8),%xmm9
movsd  %xmm9,0x10(%rsi,%rcx,8)
addsd  0x18(%rsi),%xmm12
mulsd  %xmm3,%xmm11
movsd  %xmm12,0x18(%rsi)
movsd  0x18(%rsi,%rax,8),%xmm0
addsd  %xmm11,%xmm0
movsd  %xmm0,0x18(%rsi,%rax,8)
mulsd  %xmm3,%xmm8
addsd  0x18(%rsi,%rcx,8),%xmm8
movsd  %xmm8,0x18(%rsi,%rcx,8)
addsd  0x20(%rsi),%xmm15
mulsd  %xmm3,%xmm13
movsd  %xmm15,0x20(%rsi)
addsd  0x20(%rsi,%rax,8),%xmm13
movsd  %xmm13,0x20(%rsi,%rax,8)
addsd  0x20(%rsi,%rcx,8),%xmm11
movsd  %xmm11,0x20(%rsi,%rcx,8)
ret

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

LLVM IR (-O2):
define void @matrix_ij_GT(i32 %0, double* nocapture %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fmul double %5, 0xBFD5555555555555
%9 = tail call double @llvm.fmuladd.f64(double %6, double -2.000000e+00, double %5)
%10 = fmul double %2, %2
%11 = fmul double %3, %3
%12 = fmul double %2, %3
%13 = fmul double %3, %4
%14 = fmul double %2, %4
%15 = fmul double %10, %2
%16 = fmul double %10, %3
%17 = fmul double %10, %4
%18 = fmul double %12, %3
%19 = fmul double %12, %4
%20 = fmul double %14, %4
%21 = fmul double %11, %3
%22 = fmul double %11, %4
%23 = fmul double %13, %4
%24 = fmul double %8, %2
%25 = fmul double %8, %3
%26 = fmul double %8, %4
%27 = fmul double %2, %6
%28 = fmul double %3, %6
%29 = fmul double %4, %6
%30 = fmul double %15, %9
%31 = fmul double %16, %9
%32 = fmul double %17, %9
%33 = fmul double %18, %9
%34 = fmul double %19, %9
%35 = fmul double %20, %9
%36 = fmul double %21, %9
%37 = fmul double %22, %9
%38 = fmul double %23, %9
%39 = load double, double* %1
%40 = fadd double %24, %39
store double %40, double* %1
%41 = sext i32 %0 to i64
%42 = getelementptr inbounds double, double* %1, i64 %41
%43 = load double, double* %42
%44 = fadd double %25, %43
store double %44, double* %42
%45 = shl nsw i32 %0, 1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %1, i64 %46
%48 = load double, double* %47
%49 = fadd double %26, %48
store double %49, double* %47
%50 = getelementptr inbounds double, double* %1, i64 4
%51 = load double, double* %50
%52 = fadd double %24, %51
store double %52, double* %50
%53 = add nsw i32 %0, 4
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %1, i64 %54
%56 = load double, double* %55
%57 = fadd double %25, %56
store double %57, double* %55
%58 = add nsw i32 %45, 4
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %1, i64 %59
%61 = load double, double* %60
%62 = fadd double %26, %61
store double %62, double* %60
%63 = load double, double* %1
%64 = tail call double @llvm.fmuladd.f64(double %27, double 2.000000e+00, double %63)
store double %64, double* %1
%65 = getelementptr inbounds double, double* %1, i64 1
%66 = load double, double* %65
%67 = fadd double %28, %66
store double %67, double* %65
%68 = add nsw i32 %0, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %1, i64 %69
%71 = load double, double* %70
%72 = fadd double %27, %71
store double %72, double* %70
%73 = getelementptr inbounds double, double* %1, i64 2
%74 = load double, double* %73
%75 = fadd double %29, %74
store double %75, double* %73
%76 = add nsw i32 %45, 2
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %1, i64 %77
%79 = load double, double* %78
%80 = fadd double %27, %79
store double %80, double* %78
%81 = add nsw i32 %0, 3
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %1, i64 %82
%84 = load double, double* %83
%85 = fadd double %29, %84
store double %85, double* %83
%86 = add nsw i32 %45, 3
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %1, i64 %87
%89 = load double, double* %88
%90 = fadd double %28, %89
store double %90, double* %88
%91 = load double, double* %55
%92 = tail call double @llvm.fmuladd.f64(double %28, double 2.000000e+00, double %91)
store double %92, double* %55
%93 = load double, double* %1
%94 = fadd double %30, %93
store double %94, double* %1
%95 = load double, double* %42
%96 = fadd double %31, %95
store double %96, double* %42
%97 = load double, double* %47
%98 = fadd double %32, %97
store double %98, double* %47
%99 = load double, double* %65
%100 = fadd double %31, %99
store double %100, double* %65
%101 = load double, double* %70
%102 = fadd double %33, %101
store double %102, double* %70
%103 = or i32 %45, 1
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %1, i64 %104
%106 = load double, double* %105
%107 = fadd double %34, %106
store double %107, double* %105
%108 = load double, double* %73
%109 = fadd double %32, %108
store double %109, double* %73
%110 = add nsw i32 %0, 2
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %1, i64 %111
%113 = load double, double* %112
%114 = fadd double %34, %113
store double %114, double* %112
%115 = load double, double* %78
%116 = fadd double %35, %115
store double %116, double* %78
%117 = getelementptr inbounds double, double* %1, i64 3
%118 = load double, double* %117
%119 = fadd double %34, %118
store double %119, double* %117
%120 = load double, double* %83
%121 = fadd double %37, %120
store double %121, double* %83
%122 = load double, double* %88
%123 = fadd double %38, %122
store double %123, double* %88
%124 = load double, double* %50
%125 = fadd double %33, %124
store double %125, double* %50
%126 = load double, double* %55
%127 = fadd double %36, %126
store double %127, double* %55
%128 = load double, double* %60
%129 = fadd double %37, %128
store double %129, double* %60
ret void
}