#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double eri(double, double, double, double, int, int, int, double, double,
           double, double, double, int, int, int, double, double, double,
           double, double, int, int, int, double, double, double, double,
           double, int, int, int, double);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
double contr_grad_eri(int lena, double *aexps, double *acoefs, double *anorms,
                      double xa, double ya, double za, int la, int ma, int na,
                      int lenb, double *bexps, double *bcoefs, double *bnorms,
                      double xb, double yb, double zb, int lb, int mb, int nb,
                      int lenc, double *cexps, double *ccoefs, double *cnorms,
                      double xc, double yc, double zc, int lc, int mc, int nc,
                      int lend, double *dexps, double *dcoefs, double *dnorms,
                      double xd, double yd, double zd, int ld, int md, int nd,
                      int direction) {
  double val;
  int p, q, r, s;
  int l, m, n;
  double EE;
  switch (direction) {
  case 0:
    l = 1;
    m = 0;
    n = 0;
    break;
  case 1:
    l = 0;
    m = 1;
    n = 0;
    break;
  case 2:
    l = 0;
    m = 0;
    n = 1;
    break;
  default:
    printf("contr_grad_eri: error unrecognized direction flag\n");
    exit(-1);
  }
  val = 0.0;
  if ((l * la + m * ma + n * na) > 0) {
    for (p = lena - 1; p >= 0; p--)
      for (q = lenb - 1; q >= 0; q--)
        for (r = lenc - 1; r >= 0; r--)
          for (s = lend - 1; s >= 0; s--)
            val += acoefs[p] * bcoefs[q] * ccoefs[r] * dcoefs[s] *
                   eri(xa, ya, za, anorms[p], la - l, ma - m, na - n, aexps[p],
                       xb, yb, zb, bnorms[q], lb, mb, nb, bexps[q], xc, yc, zc,
                       cnorms[r], lc, mc, nc, cexps[r], xd, yd, zd, dnorms[s],
                       ld, md, nd, dexps[s]);
    ;
    val = val * (l * la + m * ma + n * na);
  }
  EE = -val;
  val = 0.0;
  for (p = lena - 1; p >= 0; p--)
    for (q = lenb - 1; q >= 0; q--)
      for (r = lenc - 1; r >= 0; r--)
        for (s = lend - 1; s >= 0; s--)
          val += aexps[p] * acoefs[p] * bcoefs[q] * ccoefs[r] * dcoefs[s] *
                 eri(xa, ya, za, anorms[p], la + l, ma + m, na + n, aexps[p],
                     xb, yb, zb, bnorms[q], lb, mb, nb, bexps[q], xc, yc, zc,
                     cnorms[r], lc, mc, nc, cexps[r], xd, yd, zd, dnorms[s], ld,
                     md, nd, dexps[s]);
  ;
  EE = EE + val + val;
  return EE;
}


x86 assembly (clang, -O0):
<contr_grad_eri>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
mov    0xe0(%rbp),%eax
mov    0xd8(%rbp),%eax
mov    0xd0(%rbp),%eax
mov    0xc8(%rbp),%eax
movsd  0xc0(%rbp),%xmm8
movsd  0xb8(%rbp),%xmm8
movsd  0xb0(%rbp),%xmm8
mov    0xa8(%rbp),%rax
mov    0xa0(%rbp),%rax
mov    0x98(%rbp),%rax
mov    0x90(%rbp),%eax
mov    0x88(%rbp),%eax
mov    0x80(%rbp),%eax
mov    0x78(%rbp),%eax
movsd  0x70(%rbp),%xmm8
mov    0x68(%rbp),%rax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x2c(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
movsd  %xmm0,-0x50(%rbp)
movsd  %xmm1,-0x58(%rbp)
movsd  %xmm2,-0x60(%rbp)
mov    %r8d,-0x64(%rbp)
mov    %r9d,-0x68(%rbp)
movsd  %xmm3,-0x70(%rbp)
movsd  %xmm4,-0x78(%rbp)
movsd  %xmm5,-0x80(%rbp)
movsd  %xmm6,-0x88(%rbp)
ff
movsd  %xmm7,-0x90(%rbp)
ff
mov    0xe0(%rbp),%eax
mov    %eax,-0xc4(%rbp)
test   %eax,%eax
je     1257 <contr_grad_eri+0x127>
jmp    122f <contr_grad_eri+0xff>
mov    -0xc4(%rbp),%eax
sub    $0x1,%eax
je     127a <contr_grad_eri+0x14a>
jmp    1243 <contr_grad_eri+0x113>
mov    -0xc4(%rbp),%eax
sub    $0x2,%eax
je     129d <contr_grad_eri+0x16d>
jmp    12c0 <contr_grad_eri+0x190>
movl   $0x1,-0xac(%rbp)
movl   $0x0,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
jmp    12d6 <contr_grad_eri+0x1a6>
movl   $0x0,-0xac(%rbp)
movl   $0x1,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
jmp    12d6 <contr_grad_eri+0x1a6>
movl   $0x0,-0xac(%rbp)
movl   $0x0,-0xb0(%rbp)
movl   $0x1,-0xb4(%rbp)
jmp    12d6 <contr_grad_eri+0x1a6>
lea    0xd39(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0xac(%rbp),%eax
imul   -0x64(%rbp),%eax
mov    -0xb0(%rbp),%ecx
imul   -0x68(%rbp),%ecx
add    %ecx,%eax
mov    -0xb4(%rbp),%ecx
imul   0x10(%rbp),%ecx
add    %ecx,%eax
cmp    $0x0,%eax
jle    166e <contr_grad_eri+0x53e>
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x9c(%rbp)
cmpl   $0x0,-0x9c(%rbp)
jl     1634 <contr_grad_eri+0x504>
mov    0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xa0(%rbp)
cmpl   $0x0,-0xa0(%rbp)
jl     161b <contr_grad_eri+0x4eb>
mov    0x50(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xa4(%rbp)
cmpl   $0x0,-0xa4(%rbp)
jl     1602 <contr_grad_eri+0x4d2>
mov    0x90(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xa8(%rbp)
cmpl   $0x0,-0xa8(%rbp)
jl     15e9 <contr_grad_eri+0x4b9>
mov    -0x40(%rbp),%rax
movslq -0x9c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x28(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x60(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0xa0(%rbp),%rax
movslq -0xa8(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mov    -0x48(%rbp),%rax
movslq -0x9c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x64(%rbp),%edi
sub    -0xac(%rbp),%edi
mov    -0x68(%rbp),%esi
sub    -0xb0(%rbp),%esi
mov    0x10(%rbp),%edx
sub    -0xb4(%rbp),%edx
mov    -0x38(%rbp),%rax
movslq -0x9c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
movsd  -0x70(%rbp),%xmm5
movsd  -0x78(%rbp),%xmm6
movsd  -0x80(%rbp),%xmm7
mov    0x30(%rbp),%rax
movslq -0xa0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm8
mov    0x38(%rbp),%ecx
mov    0x40(%rbp),%r8d
mov    0x48(%rbp),%r9d
mov    0x20(%rbp),%rax
movslq -0xa0(%rbp),%r10
movsd  (%rax,%r10,8),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0x70(%rbp),%xmm15
mov    0x68(%rbp),%rax
movslq -0xa4(%rbp),%r10
movsd  (%rax,%r10,8),%xmm14
mov    0x78(%rbp),%r15d
mov    0x80(%rbp),%r14d
mov    0x88(%rbp),%ebx
mov    0x58(%rbp),%rax
movslq -0xa4(%rbp),%r10
movsd  (%rax,%r10,8),%xmm13
movsd  0xb0(%rbp),%xmm12
movsd  0xb8(%rbp),%xmm11
movsd  0xc0(%rbp),%xmm10
mov    0xa8(%rbp),%rax
movslq -0xa8(%rbp),%r10
movsd  (%rax,%r10,8),%xmm9
mov    0xc8(%rbp),%r11d
mov    0xd0(%rbp),%r10d
mov    0xd8(%rbp),%eax
mov    0x98(%rbp),%r12
movslq -0xa8(%rbp),%r13
movsd  (%r12,%r13,8),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm8,(%rsp)
movsd  -0xf0(%rbp),%xmm8
ff ff
movsd  %xmm8,0x8(%rsp)
movsd  -0xe8(%rbp),%xmm8
ff ff
movsd  %xmm8,0x10(%rsp)
movsd  -0xe0(%rbp),%xmm8
ff ff
movsd  %xmm8,0x18(%rsp)
movsd  -0xd8(%rbp),%xmm8
ff ff
movsd  %xmm15,0x20(%rsp)
movsd  %xmm14,0x28(%rsp)
mov    %r15d,0x30(%rsp)
mov    %r14d,0x38(%rsp)
mov    %ebx,0x40(%rsp)
movsd  %xmm13,0x48(%rsp)
movsd  %xmm12,0x50(%rsp)
movsd  %xmm11,0x58(%rsp)
movsd  %xmm10,0x60(%rsp)
movsd  %xmm9,0x68(%rsp)
mov    %r11d,0x70(%rsp)
mov    %r10d,0x78(%rsp)
mov    %eax,0x80(%rsp)
movsd  %xmm8,0x88(%rsp)
call   1040 <eri@plt>
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0xa8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xa8(%rbp)
jmp    1366 <contr_grad_eri+0x236>
jmp    15ee <contr_grad_eri+0x4be>
mov    -0xa4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xa4(%rbp)
jmp    134a <contr_grad_eri+0x21a>
jmp    1607 <contr_grad_eri+0x4d7>
mov    -0xa0(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xa0(%rbp)
jmp    1331 <contr_grad_eri+0x201>
jmp    1620 <contr_grad_eri+0x4f0>
mov    -0x9c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x9c(%rbp)
jmp    1318 <contr_grad_eri+0x1e8>
movsd  -0x98(%rbp),%xmm0
ff
mov    -0xac(%rbp),%eax
imul   -0x64(%rbp),%eax
mov    -0xb0(%rbp),%ecx
imul   -0x68(%rbp),%ecx
add    %ecx,%eax
mov    -0xb4(%rbp),%ecx
imul   0x10(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x2c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x9c(%rbp)
cmpl   $0x0,-0x9c(%rbp)
jl     19d8 <contr_grad_eri+0x8a8>
mov    0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xa0(%rbp)
cmpl   $0x0,-0xa0(%rbp)
jl     19bf <contr_grad_eri+0x88f>
mov    0x50(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xa4(%rbp)
cmpl   $0x0,-0xa4(%rbp)
jl     19a6 <contr_grad_eri+0x876>
mov    0x90(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xa8(%rbp)
cmpl   $0x0,-0xa8(%rbp)
jl     198d <contr_grad_eri+0x85d>
mov    -0x38(%rbp),%rax
movslq -0x9c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x9c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x28(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x60(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0xa0(%rbp),%rax
movslq -0xa8(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mov    -0x48(%rbp),%rax
movslq -0x9c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x64(%rbp),%edi
add    -0xac(%rbp),%edi
mov    -0x68(%rbp),%esi
add    -0xb0(%rbp),%esi
mov    0x10(%rbp),%edx
add    -0xb4(%rbp),%edx
mov    -0x38(%rbp),%rax
movslq -0x9c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
movsd  -0x70(%rbp),%xmm5
movsd  -0x78(%rbp),%xmm6
movsd  -0x80(%rbp),%xmm7
mov    0x30(%rbp),%rax
movslq -0xa0(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm8
mov    0x38(%rbp),%ecx
mov    0x40(%rbp),%r8d
mov    0x48(%rbp),%r9d
mov    0x20(%rbp),%rax
movslq -0xa0(%rbp),%r10
movsd  (%rax,%r10,8),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  0x70(%rbp),%xmm15
mov    0x68(%rbp),%rax
movslq -0xa4(%rbp),%r10
movsd  (%rax,%r10,8),%xmm14
mov    0x78(%rbp),%r15d
mov    0x80(%rbp),%r14d
mov    0x88(%rbp),%ebx
mov    0x58(%rbp),%rax
movslq -0xa4(%rbp),%r10
movsd  (%rax,%r10,8),%xmm13
movsd  0xb0(%rbp),%xmm12
movsd  0xb8(%rbp),%xmm11
movsd  0xc0(%rbp),%xmm10
mov    0xa8(%rbp),%rax
movslq -0xa8(%rbp),%r10
movsd  (%rax,%r10,8),%xmm9
mov    0xc8(%rbp),%r11d
mov    0xd0(%rbp),%r10d
mov    0xd8(%rbp),%eax
mov    0x98(%rbp),%r12
movslq -0xa8(%rbp),%r13
movsd  (%r12,%r13,8),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
movsd  %xmm8,(%rsp)
movsd  -0x120(%rbp),%xmm8
ff ff
movsd  %xmm8,0x8(%rsp)
movsd  -0x118(%rbp),%xmm8
ff ff
movsd  %xmm8,0x10(%rsp)
movsd  -0x110(%rbp),%xmm8
ff ff
movsd  %xmm8,0x18(%rsp)
movsd  -0x108(%rbp),%xmm8
ff ff
movsd  %xmm15,0x20(%rsp)
movsd  %xmm14,0x28(%rsp)
mov    %r15d,0x30(%rsp)
mov    %r14d,0x38(%rsp)
mov    %ebx,0x40(%rsp)
movsd  %xmm13,0x48(%rsp)
movsd  %xmm12,0x50(%rsp)
movsd  %xmm11,0x58(%rsp)
movsd  %xmm10,0x60(%rsp)
movsd  %xmm9,0x68(%rsp)
mov    %r11d,0x70(%rsp)
mov    %r10d,0x78(%rsp)
mov    %eax,0x80(%rsp)
movsd  %xmm8,0x88(%rsp)
call   1040 <eri@plt>
movaps %xmm0,%xmm2
movsd  -0x100(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0xa8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xa8(%rbp)
jmp    16fa <contr_grad_eri+0x5ca>
jmp    1992 <contr_grad_eri+0x862>
mov    -0xa4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xa4(%rbp)
jmp    16de <contr_grad_eri+0x5ae>
jmp    19ab <contr_grad_eri+0x87b>
mov    -0xa0(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xa0(%rbp)
jmp    16c5 <contr_grad_eri+0x595>
jmp    19c4 <contr_grad_eri+0x894>
mov    -0x9c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x9c(%rbp)
jmp    16ac <contr_grad_eri+0x57c>
movsd  -0xc0(%rbp),%xmm0
ff
addsd  -0x98(%rbp),%xmm0
ff
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<contr_grad_eri>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
mov    0x270(%rsp),%eax
cmp    $0x3,%eax
jae    1968 <contr_grad_eri+0x838>
movaps %xmm5,%xmm10
movapd %xmm4,%xmm11
movapd %xmm3,%xmm5
mov    %r9d,%r13d
movapd %xmm0,%xmm15
mov    %rcx,%rbx
mov    %edi,%ecx
mov    0x268(%rsp),%r9d
mov    0x260(%rsp),%edi
mov    0x238(%rsp),%r10
mov    0x230(%rsp),%r11
cltq
lea    0xea1(%rip),%rbp
mov    0x0(%rbp,%rax,4),%r12d
lea    0xea1(%rip),%rbp
mov    0x0(%rbp,%rax,4),%r14d
lea    0xea1(%rip),%rbp
mov    0x0(%rbp,%rax,4),%r15d
mov    %r12d,0xa4(%rsp)
mov    %r12d,%eax
imul   %r8d,%eax
mov    %r14d,0xa0(%rsp)
mov    %r14d,%ebp
imul   %r13d,%ebp
add    %eax,%ebp
mov    %r15d,0x9c(%rsp)
imul   0x1a0(%rsp),%r15d
xorpd  %xmm3,%xmm3
xorpd  %xmm0,%xmm0
mov    0x220(%rsp),%eax
mov    %rax,0x100(%rsp)
mov    %ecx,%r12d
add    %ebp,%r15d
movsd  %xmm7,0x158(%rsp)
movsd  %xmm6,0x150(%rsp)
movsd  %xmm10,0x148(%rsp)
movsd  %xmm4,0x140(%rsp)
movsd  %xmm5,0x138(%rsp)
movsd  %xmm2,0x130(%rsp)
movsd  %xmm1,0x128(%rsp)
movsd  %xmm15,0x120(%rsp)
mov    %rsi,0x110(%rsp)
mov    %rbx,0x108(%rsp)
mov    %rdx,0x118(%rsp)
jle    15f9 <contr_grad_eri+0x4c9>
mov    %r15d,0xf0(%rsp)
mov    %ecx,0xf4(%rsp)
test   %ecx,%ecx
mov    0xa4(%rsp),%eax
mov    0xa0(%rsp),%ecx
mov    0x9c(%rsp),%ebp
mov    %r13d,0xfc(%rsp)
mov    %r8d,0xf8(%rsp)
mov    %r12,0xa8(%rsp)
jle    15c2 <contr_grad_eri+0x492>
sub    %eax,%r8d
mov    %r13d,%edx
sub    %ecx,%edx
mov    0x1a0(%rsp),%eax
sub    %ebp,%eax
mov    %eax,0xd8(%rsp)
movslq 0x1e0(%rsp),%rax
mov    %rax,0xb8(%rsp)
movslq 0x1a8(%rsp),%rax
mov    %rax,0x160(%rsp)
mov    0x220(%rsp),%eax
add    $0x1,%rax
mov    %rax,0xc8(%rsp)
xorpd  %xmm3,%xmm3
jmp    130f <contr_grad_eri+0x1df>
nopl   0x0(%rax,%rax,1)
cmpq   $0x2,0xb0(%rsp)
jl     15c6 <contr_grad_eri+0x496>
mov    %r12,0xb0(%rsp)
add    $0xffffffffffffffff,%r12
mov    0x160(%rsp),%r14
cmpl   $0x0,0x1a8(%rsp)
jg     133b <contr_grad_eri+0x20b>
jmp    1300 <contr_grad_eri+0x1d0>
nop
cmpq   $0x2,0xc0(%rsp)
jl     1300 <contr_grad_eri+0x1d0>
mov    %r14,0xc0(%rsp)
add    $0xffffffffffffffff,%r14
mov    0xb8(%rsp),%rbx
cmpl   $0x0,0x1e0(%rsp)
jg     136b <contr_grad_eri+0x23b>
jmp    1330 <contr_grad_eri+0x200>
nopl   0x0(%rax,%rax,1)
cmpq   $0x2,0xd0(%rsp)
jl     1330 <contr_grad_eri+0x200>
mov    %rbx,0xd0(%rsp)
add    $0xffffffffffffffff,%rbx
cmpl   $0x0,0x220(%rsp)
jle    1360 <contr_grad_eri+0x230>
mov    0xc8(%rsp),%r15
nopl   0x0(%rax)
movsd  %xmm3,0xe8(%rsp)
lea    -0x2(%r15),%eax
mov    0x118(%rsp),%rcx
movsd  (%rcx,%r12,8),%xmm0
mov    0x1b8(%rsp),%rcx
mulsd  (%rcx,%r14,8),%xmm0
mov    0x1f0(%rsp),%rcx
mulsd  (%rcx,%rbx,8),%xmm0
mulsd  (%r11,%rax,8),%xmm0
movsd  %xmm0,0xe0(%rsp)
movsd  (%r10,%rax,8),%xmm14
mov    0x228(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm0
mov    0x108(%rsp),%rax
movsd  (%rax,%r12,8),%xmm3
movsd  (%rsi,%r12,8),%xmm4
mov    0x1c0(%rsp),%rax
movsd  (%rax,%r14,8),%xmm8
mov    0x1b0(%rsp),%rax
movsd  (%rax,%r14,8),%xmm9
mov    0x1f8(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm12
mov    0x1e8(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm13
movsd  %xmm0,0x88(%rsp)
mov    %r9d,0x80(%rsp)
mov    %edi,0x78(%rsp)
mov    0x258(%rsp),%eax
mov    %eax,0x70(%rsp)
movsd  %xmm14,0x68(%rsp)
movsd  0x250(%rsp),%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0x248(%rsp),%xmm0
movsd  %xmm0,0x58(%rsp)
movsd  0x240(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  %xmm13,0x48(%rsp)
mov    0x218(%rsp),%eax
mov    %eax,0x40(%rsp)
mov    0x210(%rsp),%eax
mov    %eax,0x38(%rsp)
mov    0x208(%rsp),%eax
mov    %eax,0x30(%rsp)
movsd  %xmm12,0x28(%rsp)
movsd  0x200(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  %xmm7,0x18(%rsp)
movsd  %xmm6,0x10(%rsp)
movsd  %xmm9,0x8(%rsp)
movsd  %xmm8,(%rsp)
movapd %xmm15,%xmm0
mov    %r8d,%edi
mov    %edx,%esi
mov    %r8d,%r13d
mov    %r12,%rbp
mov    %edx,%r12d
mov    0xd8(%rsp),%edx
movapd %xmm11,%xmm6
movaps %xmm10,%xmm7
mov    0x1c8(%rsp),%ecx
mov    0x1d0(%rsp),%r8d
mov    0x1d8(%rsp),%r9d
call   1040 <eri@plt>
movsd  0xe8(%rsp),%xmm3
mov    0x230(%rsp),%r11
mov    0x238(%rsp),%r10
mov    0x260(%rsp),%edi
mov    0x268(%rsp),%r9d
mov    %r12d,%edx
mov    %rbp,%r12
mov    %r13d,%r8d
mov    0x110(%rsp),%rsi
movsd  0x120(%rsp),%xmm15
movsd  0x128(%rsp),%xmm1
movsd  0x130(%rsp),%xmm2
movsd  0x138(%rsp),%xmm5
movsd  0x140(%rsp),%xmm11
movsd  0x148(%rsp),%xmm10
movsd  0x150(%rsp),%xmm6
movsd  0x158(%rsp),%xmm7
mulsd  0xe0(%rsp),%xmm0
addsd  %xmm0,%xmm3
add    $0xffffffffffffffff,%r15
cmp    $0x1,%r15
jg     1390 <contr_grad_eri+0x260>
jmp    1360 <contr_grad_eri+0x230>
xorpd  %xmm3,%xmm3
xorps  %xmm0,%xmm0
cvtsi2sdl 0xf0(%rsp),%xmm0
mulsd  %xmm3,%xmm0
xorpd  %xmm3,%xmm3
mov    0xfc(%rsp),%r13d
mov    0xf8(%rsp),%r8d
mov    0xf4(%rsp),%ecx
mov    0xa8(%rsp),%r12
movsd  %xmm0,0xb0(%rsp)
test   %ecx,%ecx
mov    0xa4(%rsp),%ecx
jle    1945 <contr_grad_eri+0x815>
movslq 0x1e0(%rsp),%rax
mov    %rax,0xc8(%rsp)
movslq 0x1a8(%rsp),%rax
mov    %rax,0xb8(%rsp)
add    %r8d,%ecx
add    %r13d,0xa0(%rsp)
mov    0x1a0(%rsp),%eax
add    %eax,0x9c(%rsp)
addq   $0x1,0x100(%rsp)
xorpd  %xmm3,%xmm3
mov    0x108(%rsp),%r13
jmp    1687 <contr_grad_eri+0x557>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpq   $0x2,0xc0(%rsp)
mov    0xa8(%rsp),%r12
jl     1945 <contr_grad_eri+0x815>
mov    %r12,0xc0(%rsp)
lea    -0x1(%r12),%rax
mov    %rax,0xa8(%rsp)
mov    0xb8(%rsp),%r12
cmpl   $0x0,0x1a8(%rsp)
jg     16bb <contr_grad_eri+0x58b>
jmp    1670 <contr_grad_eri+0x540>
cmpq   $0x2,0xd0(%rsp)
jl     1670 <contr_grad_eri+0x540>
mov    %r12,0xd0(%rsp)
add    $0xffffffffffffffff,%r12
mov    0xc8(%rsp),%rbp
cmpl   $0x0,0x1e0(%rsp)
jg     16eb <contr_grad_eri+0x5bb>
jmp    16b0 <contr_grad_eri+0x580>
nopl   0x0(%rax,%rax,1)
cmpq   $0x2,0xd8(%rsp)
jl     16b0 <contr_grad_eri+0x580>
mov    %rbp,0xd8(%rsp)
add    $0xffffffffffffffff,%rbp
cmpl   $0x0,0x220(%rsp)
jle    16e0 <contr_grad_eri+0x5b0>
mov    0x100(%rsp),%r14
mov    0xa8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm3,0xe8(%rsp)
lea    -0x2(%r14),%eax
movsd  (%rsi,%r15,8),%xmm4
mov    0x118(%rsp),%rdx
movsd  (%rdx,%r15,8),%xmm0
mulsd  %xmm4,%xmm0
mov    0x1b8(%rsp),%rdx
mulsd  (%rdx,%r12,8),%xmm0
mov    0x1f0(%rsp),%rdx
mulsd  (%rdx,%rbp,8),%xmm0
mulsd  (%r11,%rax,8),%xmm0
movsd  %xmm0,0xe0(%rsp)
movsd  (%r10,%rax,8),%xmm14
mov    0x228(%rsp),%rsi
movsd  (%rsi,%rax,8),%xmm0
movsd  0x0(%r13,%r15,8),%xmm3
mov    0x1c0(%rsp),%rax
movsd  (%rax,%r12,8),%xmm8
mov    0x1b0(%rsp),%rax
movsd  (%rax,%r12,8),%xmm9
mov    0x1f8(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm12
mov    0x1e8(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm13
movsd  %xmm0,0x88(%rsp)
mov    %r9d,0x80(%rsp)
mov    %edi,0x78(%rsp)
mov    0x258(%rsp),%eax
mov    %eax,0x70(%rsp)
movsd  %xmm14,0x68(%rsp)
movsd  0x250(%rsp),%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0x248(%rsp),%xmm0
movsd  %xmm0,0x58(%rsp)
movsd  0x240(%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  %xmm13,0x48(%rsp)
mov    0x218(%rsp),%eax
mov    %eax,0x40(%rsp)
mov    0x210(%rsp),%eax
mov    %eax,0x38(%rsp)
mov    0x208(%rsp),%eax
mov    %eax,0x30(%rsp)
movsd  %xmm12,0x28(%rsp)
movsd  0x200(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  %xmm7,0x18(%rsp)
movsd  %xmm6,0x10(%rsp)
movsd  %xmm9,0x8(%rsp)
movsd  %xmm8,(%rsp)
movapd %xmm15,%xmm0
mov    %ecx,%edi
mov    0xa0(%rsp),%esi
mov    0x9c(%rsp),%edx
movapd %xmm11,%xmm6
movaps %xmm10,%xmm7
mov    %ecx,%ebx
mov    0x1c8(%rsp),%ecx
mov    0x1d0(%rsp),%r8d
mov    0x1d8(%rsp),%r9d
call   1040 <eri@plt>
movsd  0xe8(%rsp),%xmm3
mov    %ebx,%ecx
mov    0x230(%rsp),%r11
mov    0x238(%rsp),%r10
mov    0x260(%rsp),%edi
mov    0x268(%rsp),%r9d
mov    0x110(%rsp),%rsi
movsd  0x120(%rsp),%xmm15
movsd  0x128(%rsp),%xmm1
movsd  0x130(%rsp),%xmm2
movsd  0x138(%rsp),%xmm5
movsd  0x140(%rsp),%xmm11
movsd  0x148(%rsp),%xmm10
movsd  0x150(%rsp),%xmm6
movsd  0x158(%rsp),%xmm7
mulsd  0xe0(%rsp),%xmm0
addsd  %xmm0,%xmm3
add    $0xffffffffffffffff,%r14
cmp    $0x1,%r14
jg     1720 <contr_grad_eri+0x5f0>
jmp    16e0 <contr_grad_eri+0x5b0>
movapd %xmm3,%xmm0
subsd  0xb0(%rsp),%xmm0
addsd  %xmm3,%xmm0
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x691(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

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

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