double ERI_Gaunt_R(int l, int m, int l1, int m1, int l2, int m2) {
  double a[2], b[2], a1[2], b1[2], a2[2], b2[2];
  double aaa, aab, aba, abb, baa, bab, bba, bbb, s;
  ERI_RCSH_Coeff(m, a, b);
  ERI_RCSH_Coeff(m1, a1, b1);
  ERI_RCSH_Coeff(m2, a2, b2);
  s = (0 == m % 2) ? 1.0 : -1.0;
  aaa = (a[0] * a1[0] - a[1] * a1[1]) * a2[0] -
        (a[0] * a1[1] + a[1] * a1[0]) * a2[1];
  aab = (a[0] * a1[0] - a[1] * a1[1]) * b2[0] -
        (a[0] * a1[1] + a[1] * a1[0]) * b2[1];
  aba = (a[0] * b1[0] - a[1] * b1[1]) * a2[0] -
        (a[0] * b1[1] + a[1] * b1[0]) * a2[1];
  abb = (a[0] * b1[0] - a[1] * b1[1]) * b2[0] -
        (a[0] * b1[1] + a[1] * b1[0]) * b2[1];
  baa = (b[0] * a1[0] - b[1] * a1[1]) * a2[0] -
        (b[0] * a1[1] + b[1] * a1[0]) * a2[1];
  bab = (b[0] * a1[0] - b[1] * a1[1]) * b2[0] -
        (b[0] * a1[1] + b[1] * a1[0]) * b2[1];
  bba = (b[0] * b1[0] - b[1] * b1[1]) * a2[0] -
        (b[0] * b1[1] + b[1] * b1[0]) * a2[1];
  bbb = (b[0] * b1[0] - b[1] * b1[1]) * b2[0] -
        (b[0] * b1[1] + b[1] * b1[0]) * b2[1];
  return s * (aaa * ERI_Gaunt(l, -m, l1, m1, l2, m2) +
              aab * ERI_Gaunt(l, -m, l1, m1, l2, -m2) +
              aba * ERI_Gaunt(l, -m, l1, -m1, l2, m2) +
              abb * ERI_Gaunt(l, -m, l1, -m1, l2, -m2) +
              baa * ERI_Gaunt(l, m, l1, m1, l2, m2) +
              bab * ERI_Gaunt(l, m, l1, m1, l2, -m2) +
              bba * ERI_Gaunt(l, m, l1, -m1, l2, m2) +
              bbb * ERI_Gaunt(l, m, l1, -m1, l2, -m2));
}


x86 assembly (clang, -O0):
<ERI_Gaunt_R>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x30(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1040 <ERI_RCSH_Coeff@plt>
mov    -0x10(%rbp),%edi
lea    -0x50(%rbp),%rsi
lea    -0x60(%rbp),%rdx
mov    $0x0,%al
call   1040 <ERI_RCSH_Coeff@plt>
mov    -0x18(%rbp),%edi
lea    -0x70(%rbp),%rsi
lea    -0x80(%rbp),%rdx
mov    $0x0,%al
call   1040 <ERI_RCSH_Coeff@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
movsd  0xe76(%rip),%xmm0
movsd  0xe76(%rip),%xmm1
movsd  %xmm1,-0xd8(%rbp)
ff
cmp    %edx,%eax
movsd  %xmm0,-0xd0(%rbp)
ff
je     11ba <ERI_Gaunt_R+0x9a>
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm3
mulsd  -0x50(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm3
mulsd  -0x50(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x78(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm3
mulsd  -0x60(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm3
mulsd  -0x60(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x78(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm3
mulsd  -0x50(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm3
mulsd  -0x50(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x78(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm3
mulsd  -0x60(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm3
mulsd  -0x60(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
mulsd  -0x78(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x150(%rbp)
ff
mov    -0x4(%rbp),%edi
xor    %esi,%esi
sub    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x0,%al
call   1030 <ERI_Gaunt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x158(%rbp)
ff
mov    -0x4(%rbp),%edi
xor    %esi,%esi
sub    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %r9d,%r9d
sub    -0x18(%rbp),%r9d
mov    $0x0,%al
call   1030 <ERI_Gaunt@plt>
movsd  -0x158(%rbp),%xmm1
ff
movsd  -0x150(%rbp),%xmm0
ff
movsd  -0x148(%rbp),%xmm2
ff
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
mov    -0x4(%rbp),%edi
xor    %esi,%esi
sub    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x0,%al
call   1030 <ERI_Gaunt@plt>
movsd  -0x140(%rbp),%xmm0
ff
movsd  -0x138(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
mov    -0x4(%rbp),%edi
xor    %esi,%esi
sub    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %r9d,%r9d
sub    -0x18(%rbp),%r9d
mov    $0x0,%al
call   1030 <ERI_Gaunt@plt>
movsd  -0x130(%rbp),%xmm0
ff
movsd  -0x128(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x120(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x0,%al
call   1030 <ERI_Gaunt@plt>
movsd  -0x120(%rbp),%xmm0
ff
movsd  -0x118(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %r9d,%r9d
sub    -0x18(%rbp),%r9d
mov    $0x0,%al
call   1030 <ERI_Gaunt@plt>
movsd  -0x110(%rbp),%xmm0
ff
movsd  -0x108(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x0,%al
call   1030 <ERI_Gaunt@plt>
movsd  -0x100(%rbp),%xmm0
ff
movsd  -0xf8(%rbp),%xmm1
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %r9d,%r9d
sub    -0x18(%rbp),%r9d
mov    $0x0,%al
call   1030 <ERI_Gaunt@plt>
movsd  -0xf0(%rbp),%xmm1
ff
movsd  -0xe8(%rbp),%xmm2
ff
movsd  -0xe0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERI_Gaunt_R>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %r9d,%r15d
mov    %r8d,0xc(%rsp)
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %edi,%r12d
lea    0xe0(%rsp),%rsi
lea    0xd0(%rsp),%rdx
mov    %r14d,%edi
mov    %r14d,0x18(%rsp)
xor    %eax,%eax
call   1040 <ERI_RCSH_Coeff@plt>
lea    0xc0(%rsp),%rsi
lea    0xb0(%rsp),%rdx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <ERI_RCSH_Coeff@plt>
lea    0xa0(%rsp),%rsi
lea    0x90(%rsp),%rdx
mov    %r15d,%edi
xor    %eax,%eax
call   1040 <ERI_RCSH_Coeff@plt>
movsd  0xe0(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  0xe8(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0xc0(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0xc8(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0xa0(%rsp),%xmm0
movsd  %xmm0,0x58(%rsp)
movsd  0xa8(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  0x90(%rsp),%xmm0
movsd  %xmm0,0x70(%rsp)
movsd  0x98(%rsp),%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0xb0(%rsp),%xmm0
movsd  %xmm0,0x78(%rsp)
movsd  0xb8(%rsp),%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  0xd0(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  0xd8(%rsp),%xmm0
movsd  %xmm0,0x88(%rsp)
neg    %r14d
mov    %r12d,0x10(%rsp)
mov    %r12d,%edi
mov    %r14d,%esi
mov    %ebp,%r13d
mov    %ebp,%edx
mov    %ebx,0x4(%rsp)
mov    %ebx,%ecx
mov    0xc(%rsp),%ebp
mov    %ebp,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
call   1030 <ERI_Gaunt@plt>
mov    %eax,0x2c(%rsp)
mov    %r15d,%r9d
neg    %r9d
mov    %r9d,0x8(%rsp)
mov    %r12d,%edi
mov    %r14d,%esi
mov    %r13d,%edx
mov    %r13d,%r12d
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %ebp,%r13d
xor    %eax,%eax
call   1030 <ERI_Gaunt@plt>
mov    %eax,0x28(%rsp)
mov    %ebx,%ebp
neg    %ebp
mov    0x10(%rsp),%ebx
mov    %ebx,%edi
mov    %r14d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %ebp,0x14(%rsp)
mov    %r13d,%r8d
mov    %r15d,(%rsp)
mov    %r15d,%r9d
xor    %eax,%eax
call   1030 <ERI_Gaunt@plt>
mov    %eax,0x24(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %r13d,%r8d
mov    0x8(%rsp),%r9d
xor    %eax,%eax
call   1030 <ERI_Gaunt@plt>
mov    %eax,0x20(%rsp)
mov    %ebx,%edi
mov    0x18(%rsp),%r14d
mov    %r14d,%esi
mov    %r12d,%edx
mov    %r12d,%ebp
mov    0x4(%rsp),%r13d
mov    %r13d,%ecx
mov    0xc(%rsp),%r12d
mov    %r12d,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
call   1030 <ERI_Gaunt@plt>
mov    %eax,0x1c(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    0x8(%rsp),%r15d
mov    %r15d,%r9d
xor    %eax,%eax
call   1030 <ERI_Gaunt@plt>
mov    %eax,0x4(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebp,%edx
mov    0x14(%rsp),%r13d
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    (%rsp),%r9d
xor    %eax,%eax
call   1030 <ERI_Gaunt@plt>
mov    %eax,(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %r15d,%r9d
xor    %eax,%eax
call   1030 <ERI_Gaunt@plt>
movsd  0x38(%rsp),%xmm7
movapd %xmm7,%xmm1
movsd  0x40(%rsp),%xmm3
mulsd  %xmm3,%xmm1
movsd  0x48(%rsp),%xmm4
movapd %xmm4,%xmm0
movsd  0x30(%rsp),%xmm2
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm3,%xmm5
movapd %xmm4,%xmm2
movapd %xmm4,%xmm6
mulsd  %xmm7,%xmm2
addsd  %xmm1,%xmm2
movsd  0x50(%rsp),%xmm4
movapd %xmm4,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm0,%xmm8
movsd  0x58(%rsp),%xmm9
mulsd  %xmm9,%xmm8
subsd  %xmm3,%xmm8
movsd  0x60(%rsp),%xmm10
mulsd  %xmm10,%xmm2
movsd  0x70(%rsp),%xmm1
mulsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
movsd  0x68(%rsp),%xmm13
movapd %xmm13,%xmm3
mulsd  %xmm5,%xmm3
movapd %xmm6,%xmm2
movsd  0x78(%rsp),%xmm12
mulsd  %xmm12,%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm12,%xmm5
movapd %xmm6,%xmm3
mulsd  %xmm13,%xmm3
addsd  %xmm5,%xmm3
movapd %xmm3,%xmm5
movapd %xmm4,%xmm3
mulsd  %xmm5,%xmm3
movapd %xmm2,%xmm11
mulsd  %xmm9,%xmm11
subsd  %xmm3,%xmm11
mulsd  %xmm10,%xmm5
mulsd  %xmm1,%xmm2
subsd  %xmm5,%xmm2
movsd  0x80(%rsp),%xmm6
movapd %xmm6,%xmm5
movapd %xmm7,%xmm3
mulsd  %xmm7,%xmm5
movsd  0x88(%rsp),%xmm7
mulsd  %xmm7,%xmm3
movapd %xmm3,%xmm15
movapd %xmm6,%xmm3
movapd %xmm6,%xmm14
movsd  0x30(%rsp),%xmm6
mulsd  %xmm6,%xmm3
subsd  %xmm15,%xmm3
mulsd  %xmm7,%xmm6
movapd %xmm7,%xmm15
addsd  %xmm5,%xmm6
movapd %xmm4,%xmm5
mulsd  %xmm6,%xmm5
movapd %xmm6,%xmm7
movapd %xmm3,%xmm6
mulsd  %xmm9,%xmm6
subsd  %xmm5,%xmm6
mulsd  %xmm10,%xmm7
mulsd  %xmm1,%xmm3
subsd  %xmm7,%xmm3
movapd %xmm13,%xmm7
mulsd  %xmm15,%xmm7
movapd %xmm14,%xmm5
mulsd  %xmm12,%xmm5
subsd  %xmm7,%xmm5
mulsd  %xmm15,%xmm12
movapd %xmm14,%xmm7
mulsd  %xmm13,%xmm7
addsd  %xmm12,%xmm7
mulsd  %xmm7,%xmm4
mulsd  %xmm5,%xmm9
subsd  %xmm4,%xmm9
mulsd  %xmm10,%xmm7
mulsd  %xmm1,%xmm5
subsd  %xmm7,%xmm5
xorps  %xmm7,%xmm7
cvtsi2sdl 0x2c(%rsp),%xmm7
xorps  %xmm1,%xmm1
cvtsi2sdl 0x28(%rsp),%xmm1
mulsd  %xmm8,%xmm7
mulsd  %xmm0,%xmm1
cvtsi2sdl 0x24(%rsp),%xmm0
addsd  %xmm7,%xmm1
mulsd  %xmm11,%xmm0
xorps  %xmm4,%xmm4
cvtsi2sdl 0x20(%rsp),%xmm4
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm4
xorps  %xmm1,%xmm1
cvtsi2sdl 0x1c(%rsp),%xmm1
addsd  %xmm0,%xmm4
mulsd  %xmm6,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sdl 0x4(%rsp),%xmm2
addsd  %xmm4,%xmm1
mulsd  %xmm3,%xmm2
xorps  %xmm3,%xmm3
cvtsi2sdl (%rsp),%xmm3
addsd  %xmm1,%xmm2
mulsd  %xmm9,%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm2,%xmm3
mulsd  %xmm5,%xmm0
addsd  %xmm3,%xmm0
test   $0x1,%r14b
je     15a0 <ERI_Gaunt_R+0x480>
xorpd  0xa60(%rip),%xmm0
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define double @ERI_Gaunt_R(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca [2 x double]
%8 = alloca [2 x double]
%9 = alloca [2 x double]
%10 = alloca [2 x double]
%11 = alloca [2 x double]
%12 = alloca [2 x double]
%13 = bitcast [2 x double]* %7 to i8*
%14 = bitcast [2 x double]* %8 to i8*
%15 = bitcast [2 x double]* %9 to i8*
%16 = bitcast [2 x double]* %10 to i8*
%17 = bitcast [2 x double]* %11 to i8*
%18 = bitcast [2 x double]* %12 to i8*
%19 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%20 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%21 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @ERI_RCSH_Coeff to i32 (i32, double*, double*, ...)*)(i32 %1, double* %19, double* %20)
%22 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%23 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%24 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @ERI_RCSH_Coeff to i32 (i32, double*, double*, ...)*)(i32 %3, double* %22, double* %23)
%25 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
%26 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%27 = call i32 (i32, double*, double*, ...) bitcast (i32 (...)* @ERI_RCSH_Coeff to i32 (i32, double*, double*, ...)*)(i32 %5, double* %25, double* %26)
%28 = and i32 %1, 1
%29 = icmp eq i32 %28, 0
%30 = load double, double* %19
%31 = load double, double* %22
%32 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 1
%33 = load double, double* %32
%34 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
%35 = load double, double* %34
%36 = fneg double %33
%37 = fmul double %35, %36
%38 = call double @llvm.fmuladd.f64(double %30, double %31, double %37)
%39 = load double, double* %25
%40 = fmul double %31, %33
%41 = call double @llvm.fmuladd.f64(double %30, double %35, double %40)
%42 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 1
%43 = load double, double* %42
%44 = fneg double %41
%45 = fmul double %43, %44
%46 = call double @llvm.fmuladd.f64(double %38, double %39, double %45)
%47 = load double, double* %26
%48 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 1
%49 = load double, double* %48
%50 = fmul double %49, %44
%51 = call double @llvm.fmuladd.f64(double %38, double %47, double %50)
%52 = load double, double* %23
%53 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 1
%54 = load double, double* %53
%55 = fmul double %54, %36
%56 = call double @llvm.fmuladd.f64(double %30, double %52, double %55)
%57 = fmul double %33, %52
%58 = call double @llvm.fmuladd.f64(double %30, double %54, double %57)
%59 = fneg double %58
%60 = fmul double %43, %59
%61 = call double @llvm.fmuladd.f64(double %56, double %39, double %60)
%62 = fmul double %49, %59
%63 = call double @llvm.fmuladd.f64(double %56, double %47, double %62)
%64 = load double, double* %20
%65 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%66 = load double, double* %65
%67 = fneg double %66
%68 = fmul double %35, %67
%69 = call double @llvm.fmuladd.f64(double %64, double %31, double %68)
%70 = fmul double %31, %66
%71 = call double @llvm.fmuladd.f64(double %64, double %35, double %70)
%72 = fneg double %71
%73 = fmul double %43, %72
%74 = call double @llvm.fmuladd.f64(double %69, double %39, double %73)
%75 = fmul double %49, %72
%76 = call double @llvm.fmuladd.f64(double %69, double %47, double %75)
%77 = fmul double %54, %67
%78 = call double @llvm.fmuladd.f64(double %64, double %52, double %77)
%79 = fmul double %52, %66
%80 = call double @llvm.fmuladd.f64(double %64, double %54, double %79)
%81 = fneg double %80
%82 = fmul double %43, %81
%83 = call double @llvm.fmuladd.f64(double %78, double %39, double %82)
%84 = fmul double %49, %81
%85 = call double @llvm.fmuladd.f64(double %78, double %47, double %84)
%86 = sub nsw i32 0, %1
%87 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @ERI_Gaunt to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %86, i32 %2, i32 %3, i32 %4, i32 %5)
%88 = sitofp i32 %87 to double
%89 = sub nsw i32 0, %5
%90 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @ERI_Gaunt to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %86, i32 %2, i32 %3, i32 %4, i32 %89)
%91 = sitofp i32 %90 to double
%92 = fmul double %51, %91
%93 = call double @llvm.fmuladd.f64(double %46, double %88, double %92)
%94 = sub nsw i32 0, %3
%95 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @ERI_Gaunt to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %86, i32 %2, i32 %94, i32 %4, i32 %5)
%96 = sitofp i32 %95 to double
%97 = call double @llvm.fmuladd.f64(double %61, double %96, double %93)
%98 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @ERI_Gaunt to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %86, i32 %2, i32 %94, i32 %4, i32 %89)
%99 = sitofp i32 %98 to double
%100 = call double @llvm.fmuladd.f64(double %63, double %99, double %97)
%101 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @ERI_Gaunt to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%102 = sitofp i32 %101 to double
%103 = call double @llvm.fmuladd.f64(double %74, double %102, double %100)
%104 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @ERI_Gaunt to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %89)
%105 = sitofp i32 %104 to double
%106 = call double @llvm.fmuladd.f64(double %76, double %105, double %103)
%107 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @ERI_Gaunt to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2, i32 %94, i32 %4, i32 %5)
%108 = sitofp i32 %107 to double
%109 = call double @llvm.fmuladd.f64(double %83, double %108, double %106)
%110 = call i32 (i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @ERI_Gaunt to i32 (i32, i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2, i32 %94, i32 %4, i32 %89)
%111 = sitofp i32 %110 to double
%112 = call double @llvm.fmuladd.f64(double %85, double %111, double %109)
%113 = fneg double %112
%114 = select i1 %29, double %112, double %113
ret double %114
}