user: Demonstrate the C code that generates the assembly output below:

```asm
<contr_grad_eri>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x148,%rsp
  mov    0x250(%rsp),%eax
  mov    %rsi,0xe8(%rsp)
  mov    %rdx,0xf0(%rsp)
  mov    0x1a8(%rsp),%r12d
  mov    %rcx,0xf8(%rsp)
  mov    0x1b0(%rsp),%ebx
  mov    %r8d,0x9c(%rsp)
  mov    0x1b8(%rsp),%r14d
  mov    %r9d,0xe0(%rsp)
  movsd  %xmm0,0x38(%rsp)
  movsd  %xmm3,0x100(%rsp)
  movsd  %xmm4,0x108(%rsp)
  movsd  %xmm5,0x110(%rsp)
  movsd  %xmm6,0x40(%rsp)
  movsd  %xmm7,0x48(%rsp)
  cmp    $0x2,%eax
  ja     L85
  lea    D19(%rip),%rdx
  mov    (%rdx,%rax,4),%esi
  lea    D37(%rip),%rdx
  mov    %esi,0x98(%rsp)
  mov    (%rdx,%rax,4),%esi
  lea    D17(%rip),%rdx
  mov    (%rdx,%rax,4),%eax
  mov    %esi,0xd4(%rsp)
  mov    %eax,0xe4(%rsp)
L211:
  mov    0x98(%rsp),%eax
  mov    0xd4(%rsp),%edx
  lea    -0x1(%rbp),%ecx
  imul   0xe0(%rsp),%edx
  mov    0xe4(%rsp),%esi
  mov    %ecx,0x13c(%rsp)
  imul   0x9c(%rsp),%eax
  add    %edx,%eax
  mov    0x180(%rsp),%edx
  imul   %esi,%edx
  add    %edx,%eax
  mov    %eax,0xd8(%rsp)
  test   %eax,%eax
  jle    L190
  test   %ecx,%ecx
  js     L89
  mov    0x188(%rsp),%eax
  pxor   %xmm4,%xmm4
  mov    %r12d,%r13d
  mov    %r14d,%r9d
  mov    0xe8(%rsp),%r11
  mov    0xf0(%rsp),%rdx
  movsd  %xmm4,(%rsp)
  movsd  %xmm4,0xc8(%rsp)
  lea    -0x1(%rax),%edi
  movslq %ecx,%rax
  shl    $0x3,%rax
  mov    %edi,0x138(%rsp)
  lea    (%r11,%rax,1),%r10
  mov    0xf8(%rsp),%r11
  lea    (%rdx,%rax,1),%rbp
  mov    %r10,0x80(%rsp)
  lea    -0x8(%rdx,%rax,1),%rdx
  mov    %rbp,%r12
  lea    (%r11,%rax,1),%r10
  mov    %ecx,%eax
  mov    0x198(%rsp),%rcx
  shl    $0x3,%rax
  mov    %r10,0x88(%rsp)
  sub    %rax,%rdx
  movslq %edi,%rax
  mov    %rdx,0x130(%rsp)
  mov    0x198(%rsp),%rdx
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    %rdx,0x118(%rsp)
  mov    0x190(%rsp),%rdx
  add    %rax,%rdx
  add    0x1a0(%rsp),%rax
  mov    %rax,0x128(%rsp)
  movslq 0x188(%rsp),%rax
  mov    %rdx,0x120(%rsp)
  lea    -0x10(%rcx,%rax,8),%rdx
  mov    %edi,%eax
  mov    0x1d0(%rsp),%rcx
  shl    $0x3,%rax
  sub    %rax,%rdx
  mov    0x1c0(%rsp),%eax
  mov    %rdx,0xa8(%rsp)
  sub    $0x1,%eax
  movslq %eax,%rdx
  mov    %eax,%eax
  shl    $0x3,%rdx
  shl    $0x3,%rax
  add    %rdx,%rcx
  mov    %rcx,0xb0(%rsp)
  mov    0x1c8(%rsp),%rcx
  add    %rdx,%rcx
  add    0x1d8(%rsp),%rdx
  mov    %rcx,0xb8(%rsp)
  mov    0x1d0(%rsp),%rcx
  mov    %rdx,0xc0(%rsp)
  movslq 0x1c0(%rsp),%rdx
  lea    -0x10(%rcx,%rdx,8),%rdx
  sub    %rax,%rdx
  mov    0x200(%rsp),%eax
  mov    %rdx,0xa0(%rsp)
  sub    $0x1,%eax
  mov    %eax,0xd0(%rsp)
  mov    0x180(%rsp),%eax
  sub    %esi,%eax
  mov    %eax,0x94(%rsp)
  movsd  0x100(%rsp),%xmm5
  movsd  0x108(%rsp),%xmm6
  movsd  0x110(%rsp),%xmm7
L105:
  mov    0x138(%rsp),%esi
  test   %esi,%esi
  js     L139
  mov    0x128(%rsp),%rax
  mov    0xe0(%rsp),%r15d
  mov    %r13d,%r14d
  mov    %ebx,%r13d
  sub    0xd4(%rsp),%r15d
  mov    %rax,0x78(%rsp)
  mov    0x120(%rsp),%rax
  mov    %rax,0x70(%rsp)
  mov    0x118(%rsp),%rax
  mov    %rax,0x68(%rsp)
L98:
  mov    0x1c0(%rsp),%ecx
  test   %ecx,%ecx
  jle    L67
  mov    0xc0(%rsp),%rax
  mov    %rax,0x60(%rsp)
  mov    0xb8(%rsp),%rax
  mov    %rax,0x58(%rsp)
  mov    0xb0(%rsp),%rax
  mov    %rax,0x50(%rsp)
  nopl   (%rax)
L77:
  mov    0xd0(%rsp),%eax
  test   %eax,%eax
  js     L12
  mov    %r13d,0x1b0(%rsp)
  mov    0x9c(%rsp),%ebx
  mov    %r14d,%r13d
  movslq %eax,%rbp
  sub    0x98(%rsp),%ebx
  mov    0x1b0(%rsp),%r14d
  mov    %ebx,0x90(%rsp)
  mov    %r15d,%ebx
  mov    %r9d,%r15d
  nopl   0x0(%rax,%rax,1)
L25:
  mov    0x68(%rsp),%rax
  movsd  (%r12),%xmm0
  mov    %r15d,%r9d
  mov    %ebx,%esi
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  mulsd  (%rax),%xmm0
  mov    0x50(%rsp),%rax
  mulsd  (%rax),%xmm0
  mov    0x210(%rsp),%rax
  mulsd  (%rax,%rbp,8),%xmm0
  mov    0x208(%rsp),%rax
  movsd  %xmm0,0x8(%rsp)
  push   (%rax,%rbp,8)
  mov    0x250(%rsp),%eax
  push   %rax
  mov    0x250(%rsp),%eax
  push   %rax
  mov    0x250(%rsp),%eax
  push   %rax
  mov    0x238(%rsp),%rax
  push   (%rax,%rbp,8)
  sub    $0x1,%rbp
  push   0x258(%rsp)
  push   0x258(%rsp)
  push   0x258(%rsp)
  mov    0x98(%rsp),%rax
  push   (%rax)
  mov    0x240(%rsp),%eax
  push   %rax
  mov    0x240(%rsp),%eax
  push   %rax
  mov    0x240(%rsp),%eax
  push   %rax
  mov    0xc0(%rsp),%rax
  push   (%rax)
  push   0x248(%rsp)
  push   0xb8(%rsp)
  push   0xb8(%rsp)
  mov    0xf0(%rsp),%rax
  push   (%rax)
  mov    0x100(%rsp),%rax
  push   (%rax)
  mov    0x110(%rsp),%rax
  mov    0x124(%rsp),%edx
  movsd  (%rax),%xmm4
  mov    0x120(%rsp),%edi
  mov    0x118(%rsp),%rax
  movsd  0xc8(%rsp),%xmm0
  movsd  %xmm7,0xc0(%rsp)
  movsd  %xmm6,0xb8(%rsp)
  movsd  %xmm5,0xb0(%rsp)
  movsd  (%rax),%xmm3
  movsd  %xmm2,0xa8(%rsp)
  movsd  %xmm1,0xa0(%rsp)
  call   <eri@plt>
  mulsd  0x98(%rsp),%xmm0
  addsd  0x90(%rsp),%xmm0
  movsd  %xmm0,0x90(%rsp)
  add    $0x90,%rsp
  test   %ebp,%ebp
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm5
  movsd  0x28(%rsp),%xmm6
  movsd  0x30(%rsp),%xmm7
  jns    L25
  mov    %r14d,0x1b0(%rsp)
  mov    %r13d,%r14d
  mov    %r15d,%r9d
  mov    0x1b0(%rsp),%r13d
  mov    %ebx,%r15d
L12:
  subq   $0x8,0x50(%rsp)
  mov    0x50(%rsp),%rax
  subq   $0x8,0x58(%rsp)
  subq   $0x8,0x60(%rsp)
  cmp    0xa0(%rsp),%rax
  jne    L77
L67:
  subq   $0x8,0x68(%rsp)
  mov    0x68(%rsp),%rax
  subq   $0x8,0x70(%rsp)
  subq   $0x8,0x78(%rsp)
  cmp    0xa8(%rsp),%rax
  jne    L98
  mov    %r13d,%ebx
  mov    %r14d,%r13d
L139:
  subq   $0x8,0x80(%rsp)
  sub    $0x8,%r12
  subq   $0x8,0x88(%rsp)
  cmp    0x130(%rsp),%r12
  jne    L105
  mov    %r13d,%r12d
  mov    %r9d,%r14d
L16:
  pxor   %xmm0,%xmm0
  mov    0x13c(%rsp),%esi
  cvtsi2sdl 0xd8(%rsp),%xmm0
  mulsd  (%rsp),%xmm0
  movsd  %xmm0,0xd8(%rsp)
  test   %esi,%esi
  js     L136
L210:
  mov    0x188(%rsp),%eax
  mov    %r12d,%r13d
  mov    %r14d,%r9d
  mov    0xf0(%rsp),%rdx
  mov    0xe8(%rsp),%rdi
  movsd  0xc8(%rsp),%xmm4
  lea    -0x1(%rax),%ecx
  movslq %esi,%rax
  shl    $0x3,%rax
  mov    %ecx,0x138(%rsp)
  add    %rax,%rdx
  lea    (%rdi,%rax,1),%rbp
  movsd  %xmm4,(%rsp)
  mov    %rdx,0x80(%rsp)
  mov    0xf8(%rsp),%rdx
  mov    %rbp,%r12
  add    %rax,%rdx
  mov    %rdx,0x88(%rsp)
  lea    -0x8(%rdi,%rax,1),%rdx
  mov    %esi,%eax
  mov    0x198(%rsp),%rsi
  shl    $0x3,%rax
  sub    %rax,%rdx
  movslq %ecx,%rax
  shl    $0x3,%rax
  mov    %rdx,0x118(%rsp)
  add    %rax,%rsi
  mov    %rsi,0xf0(%rsp)
  mov    0x190(%rsp),%rsi
  add    %rax,%rsi
  add    0x1a0(%rsp),%rax
  mov    %rsi,0xe8(%rsp)
  mov    0x198(%rsp),%rsi
  mov    %rax,0xf8(%rsp)
  movslq 0x188(%rsp),%rax
  lea    -0x10(%rsi,%rax,8),%rdx
  mov    %ecx,%eax
  mov    0x1d0(%rsp),%rsi
  shl    $0x3,%rax
  sub    %rax,%rdx
  mov    0x1c0(%rsp),%eax
  mov    %rdx,0xa8(%rsp)
  sub    $0x1,%eax
  movslq %eax,%rdx
  mov    %eax,%eax
  shl    $0x3,%rdx
  shl    $0x3,%rax
  add    %rdx,%rsi
  mov    %rsi,0xc0(%rsp)
  mov    0x1c8(%rsp),%rsi
  add    %rdx,%rsi
  add    0x1d8(%rsp),%rdx
  mov    %rsi,0xb8(%rsp)
  mov    0x1d0(%rsp),%rsi
  mov    %rdx,0xb0(%rsp)
  movslq 0x1c0(%rsp),%rdx
  lea    -0x10(%rsi,%rdx,8),%rdx
  sub    %rax,%rdx
  mov    0x200(%rsp),%eax
  mov    %rdx,0xa0(%rsp)
  sub    $0x1,%eax
  mov    %eax,0xd0(%rsp)
  mov    0xe4(%rsp),%eax
  add    0x180(%rsp),%eax
  movsd  0x100(%rsp),%xmm5
  movsd  0x108(%rsp),%xmm6
  mov    %eax,0x94(%rsp)
  movsd  0x110(%rsp),%xmm7
L101:
  mov    0x138(%rsp),%edx
  test   %edx,%edx
  js     L158
  mov    0xf8(%rsp),%rax
  mov    0xd4(%rsp),%r15d
  mov    %r13d,%r14d
  mov    %ebx,%r13d
  add    0xe0(%rsp),%r15d
  mov    %rax,0x78(%rsp)
  mov    0xe8(%rsp),%rax
  mov    %rax,0x70(%rsp)
  mov    0xf0(%rsp),%rax
  mov    %rax,0x68(%rsp)
  nopl   0x0(%rax)
L80:
  mov    0x1c0(%rsp),%eax
  test   %eax,%eax
  jle    L51
  mov    0xb0(%rsp),%rax
  mov    %rax,0x58(%rsp)
  mov    0xb8(%rsp),%rax
  mov    %rax,0x60(%rsp)
  mov    0xc0(%rsp),%rax
  mov    %rax,0x50(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L19:
  mov    0xd0(%rsp),%eax
  test   %eax,%eax
  js     L196
  mov    %r13d,0x1b0(%rsp)
  movslq %eax,%rbp
  mov    %r14d,%r13d
  mov    0x98(%rsp),%ebx
  mov    0x1b0(%rsp),%r14d
  add    0x9c(%rsp),%ebx
  mov    %ebx,0x90(%rsp)
  mov    %rbp,%rbx
  mov    %r15d,%ebp
  mov    %r9d,%r15d
  nopl   0x0(%rax,%rax,1)
L215:
  mov    0x80(%rsp),%rax
  mov    %r15d,%r9d
  mov    %r14d,%r8d
  mov    %ebp,%esi
  movsd  (%r12),%xmm4
  mov    %r13d,%ecx
  movsd  (%rax),%xmm0
  mov    0x68(%rsp),%rax
  mulsd  %xmm4,%xmm0
  mulsd  (%rax),%xmm0
  mov    0x50(%rsp),%rax
  mulsd  (%rax),%xmm0
  mov    0x210(%rsp),%rax
  mulsd  (%rax,%rbx,8),%xmm0
  mov    0x208(%rsp),%rax
  movsd  %xmm0,0x8(%rsp)
  push   (%rax,%rbx,8)
  mov    0x250(%rsp),%eax
  push   %rax
  mov    0x250(%rsp),%eax
  push   %rax
  mov    0x250(%rsp),%eax
  push   %rax
  mov    0x238(%rsp),%rax
  push   (%rax,%rbx,8)
  sub    $0x1,%rbx
  push   0x258(%rsp)
  push   0x258(%rsp)
  push   0x258(%rsp)
  mov    0xa0(%rsp),%rax
  push   (%rax)
  mov    0x240(%rsp),%eax
  push   %rax
  mov    0x240(%rsp),%eax
  push   %rax
  mov    0x240(%rsp),%eax
  push   %rax
  mov    0xb8(%rsp),%rax
  push   (%rax)
  push   0x248(%rsp)
  push   0xb8(%rsp)
  push   0xb8(%rsp)
  mov    0xf0(%rsp),%rax
  push   (%rax)
  mov    0x100(%rsp),%rax
  push   (%rax)
  mov    0x118(%rsp),%rax
  mov    0x124(%rsp),%edx
  mov    0x120(%rsp),%edi
  movsd  (%rax),%xmm3
  movsd  0xc8(%rsp),%xmm0
  movsd  %xmm7,0xc0(%rsp)
  movsd  %xmm6,0xb8(%rsp)
  movsd  %xmm5,0xb0(%rsp)
  movsd  %xmm2,0xa8(%rsp)
  movsd  %xmm1,0xa0(%rsp)
  call   <eri@plt>
  mulsd  0x98(%rsp),%xmm0
  addsd  0x90(%rsp),%xmm0
  movsd  %xmm0,0x90(%rsp)
  add    $0x90,%rsp
  test   %ebx,%ebx
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm5
  movsd  0x28(%rsp),%xmm6
  movsd  0x30(%rsp),%xmm7
  jns    L215
  mov    %r14d,0x1b0(%rsp)
  mov    %r13d,%r14d
  mov    %r15d,%r9d
  mov    0x1b0(%rsp),%r13d
  mov    %ebp,%r15d
L196:
  subq   $0x8,0x50(%rsp)
  mov    0x50(%rsp),%rax
  subq   $0x8,0x60(%rsp)
  subq   $0x8,0x58(%rsp)
  cmp    %rax,0xa0(%rsp)
  jne    L19
L51:
  subq   $0x8,0x68(%rsp)
  mov    0x68(%rsp),%rax
  subq   $0x8,0x70(%rsp)
  subq   $0x8,0x78(%rsp)
  cmp    0xa8(%rsp),%rax
  jne    L80
  mov    %r13d,%ebx
  mov    %r14d,%r13d
L158:
  subq   $0x8,0x80(%rsp)
  sub    $0x8,%r12
  subq   $0x8,0x88(%rsp)
  cmp    0x118(%rsp),%r12
  jne    L101
L14:
  movsd  (%rsp),%xmm4
  movapd %xmm4,%xmm0
  subsd  0xd8(%rsp),%xmm0
  add    $0x148,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  addsd  %xmm4,%xmm0
  pop    %r14
  pop    %r15
  ret
L85:
  lea    D26(%rip),%rdi
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm1,(%rsp)
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  jmp    L211
L190:
  mov    0x13c(%rsp),%esi
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0xc8(%rsp)
  movsd  %xmm4,0xd8(%rsp)
  test   %esi,%esi
  jns    L210
L136:
  movsd  0xc8(%rsp),%xmm4
  movsd  %xmm4,(%rsp)
  jmp    L14
L89:
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0xc8(%rsp)
  movsd  %xmm4,(%rsp)
  jmp    L16
```

tool_calls: name: read_data
arguments: tag: D19
type: string
name: read_data
arguments: tag: D37
type: f32
name: read_data
arguments: tag: D17
type: f32
name: read_data
arguments: tag: D26
type: string

tool: D19: 

tool: D37: 0

tool: D17: 0

tool: D26: contr_grad_eri: error unrecognized direction flag


assistant: ```c
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;
}
```