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

```asm
<readHB_newmat_double>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    %r9,-0x50(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x14(%rbp),%r8
  lea    -0x10(%rbp),%rdi
  mov    -0x40(%rbp),%rcx
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <readHB_info@plt>
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L9
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <IOHBTerminate@plt>
L9:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x50(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L23
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <IOHBTerminate@plt>
L23:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x43,%al
  jne    L65
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x4,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L40
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <IOHBTerminate@plt>
  jmp    L40
L65:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x50,%al
  je     L40
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L40
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <IOHBTerminate@plt>
L40:
  mov    -0x58(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <readHB_mat_double@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L19
  call   <__stack_chk_fail@plt>
L19:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D24
data_type: string
name: read_data
arguments: label: D9
data_type: string
name: read_data
arguments: label: D28
data_type: string

tool: D24: Insufficient memory for colptr.


tool: D9: Insufficient memory for rowind.


tool: D28: Insufficient memory for val.


assistant: ```c
int readHB_newmat_double(const char *filename, int *M, int *N, int *nonzeros, int **colptr, int **rowind, double **val) {
  int Nrhs;
  char *Type;
  readHB_info(filename, M, N, nonzeros, &Type, &Nrhs);
  *colptr = (int *)malloc((*N + 1) * sizeof(int));
  if (*colptr == NULL)
    IOHBTerminate("Insufficient memory for colptr.\n");
  *rowind = (int *)malloc(*nonzeros * sizeof(int));
  if (*rowind == NULL)
    IOHBTerminate("Insufficient memory for rowind.\n");
  if (Type[0] == 'C') {
    *val = (double *)malloc(*nonzeros * sizeof(double) * 2);
    if (*val == NULL)
      IOHBTerminate("Insufficient memory for val.\n");
  } else {
    if (Type[0] != 'P') {
      *val = (double *)malloc(*nonzeros * sizeof(double));
      if (*val == NULL)
        IOHBTerminate("Insufficient memory for val.\n");
    }
  }
  return readHB_mat_double(filename, *colptr, *rowind, *val);
}
```