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

```asm
<matrix_transposition>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    0x18(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x18(%rbp)
  jmp    L3
L57:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x18(%rbp)
L3:
  mov    -0x18(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L57
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <exclusive_scan@plt>
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    0x18(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L35
L20:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L16
L2:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    0x20(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x10(%rbp)
L16:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x10(%rbp)
  jl     L2
  addl   $0x1,-0x14(%rbp)
L35:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L20
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void matrix_transposition(const int m, const int n, const int nnz, const int *csrRowPtr, const int *csrColIdx, const double *csrVal, int *cscRowIdx, int *cscColPtr, double *cscVal) {
  memset(cscColPtr, 0, sizeof(int) * (n + 1));
  for (int i = 0; i < nnz; i++) {
    cscColPtr[csrColIdx[i]]++;
  }
  exclusive_scan(cscColPtr, n + 1);
  int *cscColIncr = (int *)malloc(sizeof(int) * (n + 1));
  memcpy(cscColIncr, cscColPtr, sizeof(int) * (n + 1));
  for (int row = 0; row < m; row++) {
    for (int j = csrRowPtr[row]; j < csrRowPtr[row + 1]; j++) {
      int col = csrColIdx[j];
      cscRowIdx[cscColIncr[col]] = row;
      cscVal[cscColIncr[col]] = csrVal[j];
      cscColIncr[col]++;
    }
  }
  free(cscColIncr);
}
```