user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<gint1_fn_dmat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %rcx,-0xa0(%rbp)
  mov    %r8,-0xa8(%rbp)
  mov    %r9,-0xb0(%rbp)
  movl   $0x0,-0x6c(%rbp)
  mov    $0x50,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L229
  movl   $0xffffffff,-0x6c(%rbp)
  jmp    L211
L229:
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x28(%rbp),%xmm1
  movsd  D13(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  D5(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  movsd  D5(%rip),%xmm0
  movq   %rax,%xmm1
  subsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x64(%rbp)
  mov    -0x64(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x40(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  jne    L172
  movl   $0xffffffff,-0x6c(%rbp)
  jmp    L211
L172:
  movl   $0x0,-0x68(%rbp)
  jmp    L47
L12:
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  movl   $0x0,-0x74(%rbp)
  jmp    L109
L92:
  mov    -0x30(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x8,-0x30(%rbp)
  addl   $0x1,-0x74(%rbp)
L109:
  mov    -0x74(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L92
  mov    0x18(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  movl   $0x0,-0x7c(%rbp)
  jmp    L86
L178:
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xb0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0xa0(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0xa8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x60(%rbp)
  mov    -0x60(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  cmp    $0x3,%eax
  jle    L9
  movl   $0xfffffffe,-0x6c(%rbp)
  jmp    L211
L9:
  cmpl   $0xffffffff,-0x60(%rbp)
  jge    L58
  mov    -0x60(%rbp),%edx
  mov    $0x0,%eax
  sub    %edx,%eax
  add    %eax,%eax
  add    $0x1,%eax
  jmp    L107
L58:
  cmpl   $0xffffffff,-0x60(%rbp)
  je     L77
  mov    -0x60(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x60(%rbp),%eax
  add    $0x2,%eax
  imul   %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  jmp    L107
L77:
  mov    $0x4,%eax
L107:
  mov    %eax,-0x5c(%rbp)
  movl   $0x0,-0x78(%rbp)
  jmp    L234
L248:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdi
  mov    -0x10(%rbp),%rcx
  mov    -0x98(%rbp),%rdx
  mov    -0x8(%rbp),%rsi
  mov    -0x60(%rbp),%eax
  movq   %rdi,%xmm0
  mov    %eax,%edi
  call   <gint1_fn_dispatch@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  addq   $0x8,-0x48(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  cmpl   $0xffffffff,-0x60(%rbp)
  jne    L35
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x58(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%rax
  movsd  %xmm0,(%rax)
  addq   $0x8,-0x30(%rbp)
  addq   $0x8,-0x58(%rbp)
  addq   $0x8,-0x50(%rbp)
L35:
  cmpl   $0xffffffff,-0x60(%rbp)
  sete   %al
  movzbl %al,%edx
  mov    -0x5c(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x74(%rbp)
  jmp    L194
L44:
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x58(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x30(%rbp),%rax
  movsd  %xmm0,(%rax)
  addq   $0x8,-0x30(%rbp)
  addq   $0x8,-0x58(%rbp)
  subl   $0x1,-0x74(%rbp)
L194:
  cmpl   $0x0,-0x74(%rbp)
  jg     L44
  addq   $0x8,-0x50(%rbp)
  addl   $0x1,-0x78(%rbp)
L234:
  mov    -0x7c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x78(%rbp)
  jl     L248
  mov    -0x5c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x38(%rbp)
  addl   $0x1,-0x7c(%rbp)
L86:
  mov    -0x7c(%rbp),%eax
  cmp    0x40(%rbp),%eax
  jl     L178
  mov    -0x90(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x88(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  movl   $0x0,-0x74(%rbp)
  jmp    L14
L180:
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x70(%rbp)
  jmp    L24
L123:
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  addq   $0x8,-0x20(%rbp)
  addq   $0x8,-0x28(%rbp)
  addl   $0x1,-0x70(%rbp)
L24:
  mov    -0x70(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jl     L123
  movsd  -0x18(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  addq   $0x8,-0x20(%rbp)
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x30(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x90(%rbp),%rax
  movsd  %xmm0,(%rax)
  addq   $0x8,-0x30(%rbp)
  addl   $0x1,-0x74(%rbp)
L14:
  mov    -0x74(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L180
  addq   $0x8,-0x90(%rbp)
  addq   $0x18,-0x98(%rbp)
  addl   $0x1,-0x68(%rbp)
L47:
  mov    -0x68(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L12
  nop
L211:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x6c(%rbp),%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D13
data_type: f64
name: read_data
arguments: data_label: D5
data_type: f64

tool: D13: 8

tool: D5: 1

assistant: ```c
int gint1_fn_dmat(double *dmat, double *density, double *points, double *centers, int *shell_types, int *shell_map, int *num_primitives, double *ccoeffs, double *exponents, int num_dmat, int num_points, int num_centers, int num_shells, int num_ccoeffs, int num_exponents) {
  int shell, shell_type, primitive, dof1, dof2, num_dof, num_shell_dof, result, i_point;
  double *work, *out, *center, *ccoeff, *exponent, *basis_fns, *shell_fns, *fn1, *fn2, *dmat_element;
  double tmp;
  result = 0;
  work = malloc(10 * sizeof(double));
  if (work == NULL) {
    result = -1;
    goto EXIT;
  };
  num_dof = ((int)(sqrt(1.0 + 8.0 * num_dmat) - 1.0)) / 2;
  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++) {
    fn1 = basis_fns;
    for (dof1 = 0; dof1 < num_dof; dof1++) {
      *fn1 = 0.0;
      fn1++;
    }
    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++;
        fn1 = shell_fns;
        if (shell_type == -1) {
          *fn1 += (*out) * (*ccoeff);
          fn1++;
          out++;
          ccoeff++;
        }
        for (dof1 = num_shell_dof - (shell_type == -1); dof1 > 0; dof1--) {
          *fn1 += (*out) * (*ccoeff);
          fn1++;
          out++;
        }
        ccoeff++;
      }
      shell_fns += num_shell_dof;
    }
    *density = 0.0;
    dmat_element = dmat;
    fn1 = basis_fns;
    for (dof1 = 0; dof1 < num_dof; dof1++) {
      fn2 = basis_fns;
      tmp = 0.0;
      for (dof2 = 0; dof2 < dof1; dof2++) {
        tmp += (*fn2) * (*dmat_element);
        dmat_element++;
        fn2++;
      }
      tmp *= 2;
      tmp += (*fn1) * (*dmat_element);
      dmat_element++;
      *density += tmp * (*fn1);
      fn1++;
    }
    density++;
    points += 3;
  }
EXIT:
  free(work);
  free(basis_fns);
  return result;
}
```