user: Converte this assembly snippet into its equivalent C code:

```asm
<contr_eri>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    0xf0(%rsp),%ebp
  movsd  %xmm0,0x78(%rsp)
  mov    0x118(%rsp),%r12d
  movsd  %xmm6,0x80(%rsp)
  movsd  %xmm7,0x88(%rsp)
  test   %edi,%edi
  jle    L58
  mov    %edi,%eax
  mov    %rdx,%r10
  mov    %rsi,0x68(%rsp)
  movapd %xmm3,%xmm0
  sub    $0x1,%eax
  mov    %rcx,0x70(%rsp)
  movapd %xmm5,%xmm8
  mov    %r8d,%r15d
  lea    0x8(%rdx,%rax,8),%rax
  pxor   %xmm3,%xmm3
  mov    %r9d,%ebx
  mov    %r10,%r13
  mov    %rax,0xa8(%rsp)
  mov    0xf8(%rsp),%eax
  movapd %xmm0,%xmm5
  movapd %xmm4,%xmm6
  mov    0x108(%rsp),%rdx
  movsd  %xmm3,(%rsp)
  movapd %xmm8,%xmm7
  sub    $0x1,%eax
  lea    0x8(%rdx,%rax,8),%rax
  mov    0x140(%rsp),%rdx
  mov    %rax,0xa0(%rsp)
  mov    0x130(%rsp),%eax
  sub    $0x1,%eax
  lea    0x8(%rdx,%rax,8),%rax
  mov    %rax,0x98(%rsp)
  movslq 0x170(%rsp),%rax
  mov    %rax,0x90(%rsp)
L49:
  mov    0xf8(%rsp),%eax
  test   %eax,%eax
  jle    L25
  mov    0x100(%rsp),%rax
  mov    %ebx,%r14d
  mov    %rax,0x60(%rsp)
  mov    0x110(%rsp),%rax
  mov    %rax,0x58(%rsp)
  mov    0x108(%rsp),%rax
  mov    %rax,0x50(%rsp)
  nopw   0x0(%rax,%rax,1)
L76:
  mov    0x130(%rsp),%edx
  test   %edx,%edx
  jle    L52
  mov    0x138(%rsp),%rax
  mov    %rax,0x48(%rsp)
  mov    0x148(%rsp),%rax
  mov    %rax,0x40(%rsp)
  mov    0x140(%rsp),%rax
  mov    %rax,0x38(%rsp)
  xchg   %ax,%ax
L38:
  mov    0x170(%rsp),%ecx
  xor    %ebx,%ebx
  test   %ecx,%ecx
  jle    L65
  mov    %ebp,%esi
  mov    %r12d,%eax
  mov    %r13,%rbp
  mov    %r15d,%r12d
  mov    %r14d,%r13d
  mov    %eax,%r15d
  mov    %esi,%r14d
  nopl   (%rax)
L20:
  mov    0x50(%rsp),%rax
  movsd  0x0(%rbp),%xmm0
  mov    %r15d,%ecx
  mov    %r14d,%edx
  mov    %r13d,%esi
  mov    %r12d,%edi
  mulsd  (%rax),%xmm0
  mov    0x38(%rsp),%rax
  mulsd  (%rax),%xmm0
  mov    0x180(%rsp),%rax
  mulsd  (%rax,%rbx,8),%xmm0
  mov    0x178(%rsp),%rax
  movsd  %xmm0,0x8(%rsp)
  push   (%rax,%rbx,8)
  mov    0x1c0(%rsp),%eax
  push   %rax
  mov    0x1c0(%rsp),%eax
  push   %rax
  mov    0x1c0(%rsp),%eax
  push   %rax
  mov    0x1a8(%rsp),%rax
  push   (%rax,%rbx,8)
  add    $0x1,%rbx
  push   0x1c8(%rsp)
  push   0x1c8(%rsp)
  push   0x1c8(%rsp)
  mov    0x88(%rsp),%rax
  push   (%rax)
  mov    0x1b0(%rsp),%eax
  push   %rax
  mov    0x1b0(%rsp),%eax
  push   %rax
  mov    0x1b0(%rsp),%eax
  push   %rax
  mov    0xa0(%rsp),%rax
  push   (%rax)
  push   0x1b8(%rsp)
  push   0xf8(%rsp)
  push   0xf8(%rsp)
  mov    0xe0(%rsp),%rax
  push   (%rax)
  mov    0xe0(%rsp),%rax
  push   (%rax)
  mov    0xf8(%rsp),%rax
  mov    0x1b8(%rsp),%r9d
  movsd  (%rax),%xmm4
  mov    0x100(%rsp),%rax
  mov    0x1b0(%rsp),%r8d
  movsd  0x108(%rsp),%xmm0
  movsd  %xmm7,0xc0(%rsp)
  movsd  %xmm6,0xb8(%rsp)
  movsd  (%rax),%xmm3
  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
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm2
  cmp    %rbx,0x90(%rsp)
  movsd  0x20(%rsp),%xmm5
  movsd  0x28(%rsp),%xmm6
  movsd  0x30(%rsp),%xmm7
  jne    L20
  mov    %r14d,%esi
  mov    %r15d,%eax
  mov    %r13d,%r14d
  mov    %r12d,%r15d
  mov    %rbp,%r13
  mov    %eax,%r12d
  mov    %esi,%ebp
L65:
  addq   $0x8,0x38(%rsp)
  mov    0x38(%rsp),%rax
  addq   $0x8,0x48(%rsp)
  addq   $0x8,0x40(%rsp)
  cmp    %rax,0x98(%rsp)
  jne    L38
L52:
  addq   $0x8,0x50(%rsp)
  mov    0x50(%rsp),%rax
  addq   $0x8,0x60(%rsp)
  addq   $0x8,0x58(%rsp)
  cmp    %rax,0xa0(%rsp)
  jne    L76
  mov    %r14d,%ebx
L25:
  addq   $0x8,0x68(%rsp)
  add    $0x8,%r13
  addq   $0x8,0x70(%rsp)
  cmp    0xa8(%rsp),%r13
  jne    L49
L43:
  movsd  (%rsp),%xmm0
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L58:
  pxor   %xmm4,%xmm4
  movsd  %xmm4,(%rsp)
  jmp    L43
```

assistant: ```c
double contr_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) {
  double val = 0.0;
  int i, j, k, l;
  double EE;
  for (i = 0; i < lena; i++) {
    for (j = 0; j < lenb; j++) {
      for (k = 0; k < lenc; k++) {
        for (l = 0; l < lend; l++) {
          EE = acoefs[i] * bcoefs[j] * ccoefs[k] * dcoefs[l] * eri(xa, ya, za, anorms[i], la, ma, na, aexps[i], xb, yb, zb, bnorms[j], lb, mb, nb, bexps[j], xc, yc, zc, cnorms[k], lc, mc, nc, cexps[k], xd, yd, zd, dnorms[l], ld, md, nd, dexps[l]);
          val += EE;
        }
      }
    }
  }
  return val;
}
```