user: Translate the below assembly code into C programming language:

```asm
<gint1_fns_basis>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %rdi,0x98(%rsp)
  mov    $0x50,%edi
  movslq 0x118(%rsp),%rbx
  mov    %rsi,0x50(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %rcx,0x38(%rsp)
  mov    %r8,0xa0(%rsp)
  mov    %r9,0x58(%rsp)
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L243
  mov    0x110(%rsp),%eax
  movslq 0x110(%rsp),%rbp
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,0x48(%rsp)
  test   %rax,%rax
  je     L243
  test   %ebx,%ebx
  jle    L291
  mov    0x50(%rsp),%rdi
  lea    0x0(,%rbx,8),%rax
  mov    %r12,%r13
  mov    %rax,0xa8(%rsp)
  add    %rax,%rdi
  mov    0x110(%rsp),%eax
  mov    %rdi,0x90(%rsp)
  mov    0x58(%rsp),%rdi
  sub    $0x1,%eax
  lea    0x8(,%rax,8),%rax
  mov    %rax,0x88(%rsp)
  mov    0x128(%rsp),%eax
  sub    $0x1,%eax
  lea    0x4(%rdi,%rax,4),%rax
  mov    0x48(%rsp),%rdi
  mov    %rax,0x40(%rsp)
  lea    0x0(,%rbp,8),%rax
  mov    %rax,0x68(%rsp)
  mov    0x110(%rsp),%eax
  shr    %eax
  sub    $0x1,%eax
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,0x60(%rsp)
  mov    0x110(%rsp),%eax
  and    $0xfffffffe,%eax
  mov    %eax,0x84(%rsp)
  shl    $0x3,%rax
  add    %rax,%rdi
  mov    %rax,0x78(%rsp)
  mov    %rdi,0x70(%rsp)
L187:
  mov    0x110(%rsp),%eax
  test   %eax,%eax
  jle    L271
  mov    0x88(%rsp),%rdx
  mov    0x48(%rsp),%rdi
  xor    %esi,%esi
  call   <memset@plt>
L271:
  mov    0x128(%rsp),%esi
  test   %esi,%esi
  jle    L227
  mov    0xa0(%rsp),%rax
  mov    0x100(%rsp),%rbx
  mov    %r13,%rbp
  mov    0xf8(%rsp),%r14
  mov    %rax,0x28(%rsp)
  mov    0xf0(%rsp),%rax
  mov    %rbx,%r13
  mov    %rax,(%rsp)
  mov    0x58(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    0x48(%rsp),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L311:
  mov    0x20(%rsp),%rax
  mov    0x38(%rsp),%rdi
  mov    (%rax),%eax
  lea    (%rax,%rax,2),%eax
  cltq
  lea    (%rdi,%rax,8),%r12
  mov    0x28(%rsp),%rax
  mov    (%rax),%r15d
  mov    %r15d,%eax
  neg    %eax
  cmovs  %r15d,%eax
  cmp    $0x3,%eax
  jg     L44
  cmp    $0xffffffff,%r15d
  jl     L193
  je     L11
  lea    0x1(%r15),%eax
  lea    0x2(%r15),%edx
  imul   %edx,%eax
  sar    %eax
  mov    %eax,0x1c(%rsp)
  cltq
  shl    $0x3,%rax
  mov    %rax,0x30(%rsp)
L21:
  mov    (%rsp),%rax
  mov    (%rax),%edx
  test   %edx,%edx
  jle    L217
  xor    %eax,%eax
  mov    0x1c(%rsp),%edi
  cmp    $0xffffffff,%r15d
  mov    %rbp,%rbx
  sete   %al
  sub    %eax,%edi
  xor    %eax,%eax
  mov    %edi,0x80(%rsp)
  mov    %eax,%ebp
  cs nopw 0x0(%rax,%rax,1)
L308:
  movsd  0x0(%r13),%xmm0
  mov    %rbx,%rcx
  mov    %r12,%rsi
  mov    %r15d,%edi
  mov    0x10(%rsp),%rdx
  add    $0x8,%r13
  call   <gint1_fn_dispatch@plt>
  cmp    $0xffffffff,%r15d
  je     L95
  mov    0x8(%rsp),%rax
  mov    0x1c(%rsp),%ecx
  mov    %rbx,%rdx
L107:
  movslq %ecx,%rsi
  lea    (%rax,%rsi,8),%r9
  cmp    %r9,%r14
  lea    0x8(%r14),%r9
  setae  %r11b
  cmp    %r9,%rax
  setae  %r10b
  or     %r11b,%r10b
  je     L241
  lea    0x8(%rdx),%r10
  cmp    %r10,%rax
  setne  %r11b
  cmp    $0x1,%ecx
  setne  %r10b
  test   %r10b,%r11b
  je     L241
  movsd  (%r14),%xmm1
  mov    %ecx,%r10d
  xor    %esi,%esi
  shr    %r10d
  unpcklpd %xmm1,%xmm1
  shl    $0x4,%r10
  nopl   (%rax)
L48:
  movupd (%rdx,%rsi,1),%xmm0
  movupd (%rax,%rsi,1),%xmm3
  mulpd  %xmm1,%xmm0
  addpd  %xmm3,%xmm0
  movups %xmm0,(%rax,%rsi,1)
  add    $0x10,%rsi
  cmp    %rsi,%r10
  jne    L48
  mov    %ecx,%r10d
  and    $0xfffffffe,%r10d
  mov    %r10d,%esi
  shl    $0x3,%rsi
  add    %rsi,%rdx
  add    %rax,%rsi
  cmp    %r10d,%ecx
  je     L96
  movsd  (%r14),%xmm0
  mulsd  (%rdx),%xmm0
  addsd  (%rsi),%xmm0
  movsd  %xmm0,(%rsi)
L96:
  mov    (%rsp),%rax
  mov    %r9,%r14
  add    $0x1,%ebp
  cmp    %ebp,(%rax)
  jg     L308
  mov    %rbx,%rbp
L217:
  addq   $0x4,0x20(%rsp)
  mov    0x30(%rsp),%rdi
  addq   $0x4,0x28(%rsp)
  mov    0x20(%rsp),%rax
  add    %rdi,0x8(%rsp)
  addq   $0x4,(%rsp)
  cmp    0x40(%rsp),%rax
  jne    L311
  mov    %rbp,%r13
L227:
  mov    0x108(%rsp),%ecx
  mov    0x50(%rsp),%rdi
  xor    %esi,%esi
  mov    0x98(%rsp),%rdx
  test   %ecx,%ecx
  jle    L108
  mov    0x60(%rsp),%r8
  mov    0x48(%rsp),%rcx
  mov    0x68(%rsp),%r10
  mov    0x70(%rsp),%r14
  mov    0x78(%rsp),%rbp
  mov    0x84(%rsp),%r12d
  mov    0x108(%rsp),%r11d
  mov    0x110(%rsp),%r9d
  mov    0xa8(%rsp),%rbx
L318:
  mov    %rdx,%rax
  test   %r9d,%r9d
  jle    L179
  cmp    $0x1,%r9d
  je     L154
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  nopw   0x0(%rax,%rax,1)
L36:
  movupd (%rdx,%rax,1),%xmm2
  movupd (%rcx,%rax,1),%xmm4
  add    $0x10,%rax
  mulpd  %xmm4,%xmm2
  addsd  %xmm2,%xmm0
  unpckhpd %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  cmp    %rax,%r8
  jne    L36
  lea    (%rdx,%rbp,1),%rax
  mov    %r14,%r15
  cmp    %r9d,%r12d
  je     L119
L322:
  movsd  (%r15),%xmm1
  mulsd  (%rax),%xmm1
  addsd  %xmm1,%xmm0
L119:
  add    $0x1,%esi
  movsd  %xmm0,(%rdi)
  add    %r10,%rdx
  add    %rbx,%rdi
  cmp    %esi,%r11d
  jne    L318
L108:
  addq   $0x8,0x50(%rsp)
  mov    0x50(%rsp),%rax
  addq   $0x18,0x10(%rsp)
  cmp    0x90(%rsp),%rax
  jne    L187
  mov    %r13,%r12
L291:
  xor    %r13d,%r13d
  jmp    L292
  nopl   0x0(%rax,%rax,1)
L95:
  mov    0x8(%rsp),%rax
  movsd  (%rbx),%xmm0
  lea    0x8(%r14),%rcx
  lea    0x10(%r14),%r9
  mulsd  (%r14),%xmm0
  mov    0x80(%rsp),%edi
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  test   %edi,%edi
  je     L96
  mov    %rcx,%r14
  add    $0x8,%rax
  lea    0x8(%rbx),%rdx
  mov    %edi,%ecx
  jmp    L107
  nop
L241:
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L252:
  movsd  (%r14),%xmm0
  mulsd  (%rdx,%rcx,8),%xmm0
  addsd  (%rax,%rcx,8),%xmm0
  movsd  %xmm0,(%rax,%rcx,8)
  add    $0x1,%rcx
  cmp    %rcx,%rsi
  jne    L252
  jmp    L96
L193:
  mov    %r15d,%eax
  neg    %eax
  lea    0x1(%rax,%rax,1),%eax
  mov    %eax,0x1c(%rsp)
  cltq
  shl    $0x3,%rax
  mov    %rax,0x30(%rsp)
  jmp    L21
L11:
  movq   $0x20,0x30(%rsp)
  movl   $0x4,0x1c(%rsp)
  jmp    L21
L44:
  mov    %rbp,%r12
  mov    $0xfffffffe,%r13d
L292:
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  add    $0xb8,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L179:
  pxor   %xmm0,%xmm0
  jmp    L119
L154:
  mov    %rcx,%r15
  pxor   %xmm0,%xmm0
  jmp    L322
L243:
  mov    $0xffffffff,%r13d
  jmp    L292
```

assistant: ```c
int gint1_fns_basis(double *weights, double *orbs, double *points, double *centers, int *shell_types, int *shell_map, int *num_primitives, double *ccoeffs, double *exponents, int num_orbs, int num_dof, int num_points, int num_centers, int num_shells, int num_ccoeffs, int num_exponents) {
  int shell, shell_type, primitive, dof, num_shell_dof, result, i_point, i_orb;
  double *work, *out, *center, *ccoeff, *exponent, *weight, *shell_fns, *basis_fns, *fn;
  double tmp;
  result = 0;
  work = malloc(10 * sizeof(double));
  if (work == NULL) {
    result = -1;
    goto EXIT;
  };
  basis_fns = malloc(num_dof * sizeof(double));
  if (basis_fns == NULL) {
    result = -1;
    goto EXIT;
  };
  for (i_point = 0; i_point < num_points; i_point++) {
    fn = basis_fns;
    for (dof = 0; dof < num_dof; dof++) {
      *fn = 0.0;
      fn++;
    }
    ccoeff = ccoeffs;
    exponent = exponents;
    shell_fns = basis_fns;
    for (shell = 0; shell < num_shells; shell++) {
      center = centers + (3 * shell_map[shell]);
      shell_type = shell_types[shell];
      if (abs(shell_type) > 3) {
        result = -2;
        goto EXIT;
      };
      num_shell_dof = ((shell_type < -1) ? (-2 * shell_type + 1) : ((shell_type == -1) ? (4) : (((shell_type + 1) * (shell_type + 2)) / 2)));
      for (primitive = 0; primitive < num_primitives[shell]; primitive++) {
        gint1_fn_dispatch(shell_type, center, *exponent, points, work);
        out = work;
        exponent++;
        fn = shell_fns;
        if (shell_type == -1) {
          *fn += (*out) * (*ccoeff);
          fn++;
          out++;
          ccoeff++;
        }
        for (dof = num_shell_dof - (shell_type == -1); dof > 0; dof--) {
          *fn += (*out) * (*ccoeff);
          fn++;
          out++;
        }
        ccoeff++;
      }
      shell_fns += num_shell_dof;
    }
    for (i_orb = 0; i_orb < num_orbs; i_orb++) {
      tmp = 0.0;
      fn = basis_fns;
      weight = weights + i_orb * num_dof;
      for (dof = 0; dof < num_dof; dof++) {
        tmp += (*fn) * (*weight);
        fn++;
        weight++;
      }
      *(orbs + i_orb * num_points) = tmp;
    }
    points += 3;
    orbs++;
  }
EXIT:
  free(work);
  free(basis_fns);
  return result;
}
```