user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<coocsc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edx
  lea    D17(%rip),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <Malloc@plt>
  mov    %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  lea    D17(%rip),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <Malloc@plt>
  mov    %rax,%rdx
  mov    0x10(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  lea    D17(%rip),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <Malloc@plt>
  mov    %rax,%rdx
  mov    0x18(%rbp),%rax
  mov    %rdx,(%rax)
  cmpl   $0x0,0x20(%rbp)
  jne    L24
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  lea    D17(%rip),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <Malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  lea    D17(%rip),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <Malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L39
L37:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  add    $0x1,%edx
  mov    %edx,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  add    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x14(%rbp)
L39:
  mov    -0x28(%rbp),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L37
  jmp    L31
L24:
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x8(%rbp)
L31:
  mov    0x18(%rbp),%rax
  mov    (%rax),%r8
  mov    0x10(%rbp),%rax
  mov    (%rax),%rdi
  mov    -0x48(%rbp),%rax
  mov    (%rax),%r9
  mov    -0x10(%rbp),%r10
  mov    -0x8(%rbp),%rcx
  mov    -0x30(%rbp),%rdx
  lea    -0x28(%rbp),%rsi
  lea    -0x24(%rbp),%rax
  push   %r8
  push   %rdi
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <coocsr_@plt>
  add    $0x10,%rsp
  cmpl   $0x0,0x20(%rbp)
  jne    L20
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L20:
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D17
datatype: string

tool: D17: coocsc

assistant: ```c
void coocsc(int n, int nnz, double *val, int *col, int *row, double **a, int **ja, int **ia, int job) {
  *a = (double *)Malloc(nnz * sizeof(double), "coocsc");
  *ja = (int *)Malloc(nnz * sizeof(int), "coocsc");
  *ia = (int *)Malloc((n + 1) * sizeof(int), "coocsc");
  int i, *ir, *jc;
  if (job == 0) {
    ir = (int *)Malloc(nnz * sizeof(int), "coocsc");
    jc = (int *)Malloc(nnz * sizeof(int), "coocsc");
    for (i = 0; i < nnz; i++) {
      ir[i] = row[i] + 1;
      jc[i] = col[i] + 1;
    }
  } else {
    ir = row;
    jc = col;
  }
  coocsr_(&n, &nnz, val, jc, ir, *a, *ja, *ia);
  if (job == 0) {
    free(ir);
    free(jc);
  }
}
```