user: 请将以下的汇编代码转换成C语言代码：

```asm
<gint1_fns_basis>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %rdi,0x88(%rsp)
  mov    $0x50,%edi
  movslq 0x108(%rsp),%rbp
  mov    %rsi,0x50(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %rcx,0x40(%rsp)
  mov    %r8,0x90(%rsp)
  mov    %r9,0x60(%rsp)
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L206
  mov    0x100(%rsp),%eax
  movslq 0x100(%rsp),%rbx
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,0x58(%rsp)
  test   %rax,%rax
  je     L206
  test   %ebp,%ebp
  jle    L179
  mov    0x50(%rsp),%rcx
  lea    0x0(,%rbp,8),%rax
  mov    %rax,0x98(%rsp)
  add    %rax,%rcx
  mov    0x100(%rsp),%eax
  mov    %rcx,0x68(%rsp)
  mov    0x60(%rsp),%rcx
  sub    $0x1,%eax
  mov    %rax,0x80(%rsp)
  lea    0x8(,%rax,8),%rax
  mov    %rax,0x78(%rsp)
  mov    0x118(%rsp),%eax
  sub    $0x1,%eax
  lea    0x4(%rcx,%rax,4),%rax
  mov    %rax,0x48(%rsp)
  lea    0x0(,%rbx,8),%rax
  mov    %rax,0x70(%rsp)
  lea    0x8(%r14),%rax
  mov    %rax,0x30(%rsp)
L129:
  mov    0x100(%rsp),%eax
  test   %eax,%eax
  jle    L239
  mov    0x78(%rsp),%rdx
  mov    0x58(%rsp),%rdi
  xor    %esi,%esi
  call   <memset@plt>
L239:
  mov    0x118(%rsp),%esi
  test   %esi,%esi
  jle    L46
  mov    0x90(%rsp),%rax
  mov    0xf0(%rsp),%r12
  mov    %r14,%r13
  mov    0xe8(%rsp),%rbp
  mov    %rax,0x28(%rsp)
  mov    0xe0(%rsp),%rax
  mov    %r12,%r15
  mov    %rbp,%r14
  mov    %rax,(%rsp)
  mov    0x60(%rsp),%rax
  mov    %rax,0x20(%rsp)
  mov    0x58(%rsp),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L185:
  mov    0x20(%rsp),%rax
  mov    0x40(%rsp),%rdi
  mov    (%rax),%eax
  lea    (%rax,%rax,2),%eax
  cltq
  lea    (%rdi,%rax,8),%rbp
  mov    0x28(%rsp),%rax
  mov    (%rax),%r12d
  mov    %r12d,%eax
  neg    %eax
  cmovs  %r12d,%eax
  cmp    $0x3,%eax
  jg     L242
  cmp    $0xffffffff,%r12d
  jl     L165
  je     L107
  lea    0x1(%r12),%edx
  lea    0x2(%r12),%eax
  imul   %edx,%eax
  sar    %eax
  mov    %eax,0x14(%rsp)
  cltq
  shl    $0x3,%rax
  mov    %rax,0x38(%rsp)
L76:
  mov    (%rsp),%rax
  mov    (%rax),%edx
  test   %edx,%edx
  jle    L81
  xor    %ebx,%ebx
  mov    %rbp,%rdi
  mov    %r13,%rbp
  mov    %ebx,%eax
  mov    %rdi,%r13
  mov    %r15,%rbx
  mov    %r14,%r15
  mov    %eax,%r14d
  nopl   0x0(%rax)
L234:
  movsd  (%rbx),%xmm0
  mov    0x18(%rsp),%rdx
  mov    %rbp,%rcx
  mov    %r13,%rsi
  mov    %r12d,%edi
  add    $0x8,%rbx
  call   <gint1_fn_dispatch@plt>
  cmp    $0xffffffff,%r12d
  je     L69
  mov    0x8(%rsp),%rdx
  mov    0x14(%rsp),%esi
  mov    %rbp,%r10
L41:
  movslq %esi,%rsi
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L104:
  movsd  (%r10,%rax,8),%xmm0
  mulsd  (%r15),%xmm0
  addsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L104
L27:
  mov    (%rsp),%rax
  add    $0x8,%r15
  add    $0x1,%r14d
  cmp    %r14d,(%rax)
  jg     L234
  mov    %r15,%r14
  mov    %rbp,%r13
  mov    %rbx,%r15
L81:
  addq   $0x4,0x20(%rsp)
  mov    0x38(%rsp),%rdi
  addq   $0x4,0x28(%rsp)
  mov    0x20(%rsp),%rax
  add    %rdi,0x8(%rsp)
  addq   $0x4,(%rsp)
  cmp    %rax,0x48(%rsp)
  jne    L185
  mov    %r13,%r14
L46:
  mov    0xf8(%rsp),%ecx
  mov    0x50(%rsp),%r8
  xor    %edi,%edi
  mov    0x88(%rsp),%rsi
  test   %ecx,%ecx
  jle    L66
  mov    0x58(%rsp),%rcx
  mov    0x70(%rsp),%r10
  mov    0x80(%rsp),%r9
  mov    0xf8(%rsp),%r11d
  mov    0x100(%rsp),%ebx
  mov    0x98(%rsp),%rbp
L53:
  test   %ebx,%ebx
  jle    L125
  xor    %eax,%eax
  pxor   %xmm1,%xmm1
  nopw   0x0(%rax,%rax,1)
L202:
  movsd  (%rcx,%rax,8),%xmm0
  mulsd  (%rsi,%rax,8),%xmm0
  mov    %rax,%rdx
  add    $0x1,%rax
  addsd  %xmm0,%xmm1
  cmp    %r9,%rdx
  jne    L202
L132:
  add    $0x1,%edi
  movsd  %xmm1,(%r8)
  add    %r10,%rsi
  add    %rbp,%r8
  cmp    %edi,%r11d
  jne    L53
L66:
  addq   $0x8,0x50(%rsp)
  mov    0x50(%rsp),%rax
  addq   $0x18,0x18(%rsp)
  cmp    %rax,0x68(%rsp)
  jne    L129
L179:
  xor    %r12d,%r12d
  jmp    L68
  xchg   %ax,%ax
L69:
  mov    0x8(%rsp),%rax
  movsd  0x0(%rbp),%xmm0
  add    $0x8,%r15
  mulsd  -0x8(%r15),%xmm0
  mov    0x14(%rsp),%esi
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  sub    $0x1,%esi
  je     L27
  mov    0x30(%rsp),%r10
  lea    0x8(%rax),%rdx
  jmp    L41
L165:
  mov    %r12d,%eax
  neg    %eax
  lea    0x1(%rax,%rax,1),%eax
  mov    %eax,0x14(%rsp)
  cltq
  shl    $0x3,%rax
  mov    %rax,0x38(%rsp)
  jmp    L76
L107:
  movq   $0x20,0x38(%rsp)
  movl   $0x4,0x14(%rsp)
  jmp    L76
L242:
  mov    %r13,%r14
  mov    $0xfffffffe,%r12d
L68:
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x58(%rsp),%rdi
  call   <free@plt>
  add    $0xa8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L125:
  pxor   %xmm1,%xmm1
  jmp    L132
L206:
  mov    $0xffffffff,%r12d
  jmp    L68
```

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;
}
```