user: What is the c source code of the assembly code below:

```asm
<transpose>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r14
  mov    %rdi,(%rsp)
  mov    %esi,%r15d
  lea    (%rsi,%rsi,1),%edi
  mov    $0x0,%eax
  call   <mallocate@plt>
  mov    %eax,0x20(%rsp)
  movslq %eax,%rbx
  test   %r15d,%r15d
  jle    L203
  mov    %r14,%rcx
  lea    -0x1(%r15),%eax
  lea    0x8(%r14,%rax,8),%rsi
  jmp    L100
L69:
  add    $0x8,%rcx
  cmp    %rsi,%rcx
  je     L211
L100:
  mov    (%rcx),%rdx
  test   %rdx,%rdx
  je     L69
  movzwl (%rdx),%eax
  test   %ax,%ax
  js     L69
L26:
  add    $0x2,%rdx
  movswq %ax,%rax
  addw   $0x1,(%rbx,%rax,2)
  movzwl (%rdx),%eax
  test   %ax,%ax
  jns    L26
  jmp    L69
L87:
  add    $0x2,%rbp
  add    $0x8,%r14
  cmp    0x8(%rsp),%rbp
  je     L60
L148:
  movzwl 0x0(%rbp),%r13d
  movswl %r13w,%eax
  test   %eax,%eax
  jle    L87
  lea    0x2(%rax,%rax,1),%edi
  mov    $0x0,%eax
  call   <mallocate@plt>
  cltq
  mov    %rax,(%r14)
  mov    0x18(%rsp),%rdx
  sub    0x10(%rsp),%rdx
  mov    %rax,(%rdx,%r14,1)
  movswq %r13w,%r13
  movw   $0xffff,(%rax,%r13,2)
  jmp    L87
L104:
  add    $0x1,%rsi
  cmp    %esi,%r15d
  jle    L40
L225:
  mov    (%rsp),%rax
  mov    (%rax,%rsi,8),%rdx
  test   %rdx,%rdx
  je     L104
  movzwl (%rdx),%eax
  test   %ax,%ax
  js     L104
L54:
  add    $0x2,%rdx
  movswq %ax,%rax
  lea    (%r12,%rax,8),%rcx
  mov    (%rcx),%rax
  lea    0x2(%rax),%rdi
  mov    %rdi,(%rcx)
  mov    %si,(%rax)
  movzwl (%rdx),%eax
  test   %ax,%ax
  jns    L54
  jmp    L104
L191:
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L160
L60:
  cmpl   $0x0,0x20(%rsp)
  jne    L105
L58:
  mov    $0x0,%esi
  jmp    L225
L211:
  lea    0x0(,%r15,8),%ebp
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <mallocate@plt>
  movslq %eax,%r14
  mov    %r14,0x28(%rsp)
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   <mallocate@plt>
  mov    %eax,0x24(%rsp)
  movslq %eax,%r12
  movslq 0x20(%rsp),%rbp
  mov    %r14,0x10(%rsp)
  mov    %r15d,%eax
  lea    0x0(%rbp,%rax,2),%rax
  mov    %rax,0x8(%rsp)
  mov    %r12,0x18(%rsp)
  jmp    L148
L203:
  shl    $0x3,%r15d
  mov    %r15d,%edi
  mov    $0x0,%eax
  call   <mallocate@plt>
  cltq
  mov    %rax,0x28(%rsp)
  mov    %r15d,%edi
  mov    $0x0,%eax
  call   <mallocate@plt>
  mov    %eax,0x24(%rsp)
  movslq %eax,%r12
  cmpl   $0x0,0x20(%rsp)
  jne    L133
L40:
  cmpl   $0x0,0x24(%rsp)
  jne    L191
L160:
  mov    0x28(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L133:
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L40
L105:
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L58
```

assistant: ```c
short **transpose(short **R, int n) {
  register short **new_R;
  register short **temp_R;
  register short *nedges;
  register short *sp;
  register int i;
  register int k;
  nedges = ((short *)mallocate((unsigned)((n) * sizeof(short))));
  for (i = 0; i < n; i++) {
    sp = R[i];
    if (sp) {
      while (*sp >= 0)
        nedges[*sp++]++;
    }
  }
  new_R = ((short **)mallocate((unsigned)((n) * sizeof(short *))));
  temp_R = ((short **)mallocate((unsigned)((n) * sizeof(short *))));
  for (i = 0; i < n; i++) {
    k = nedges[i];
    if (k > 0) {
      sp = ((short *)mallocate((unsigned)((k + 1) * sizeof(short))));
      new_R[i] = sp;
      temp_R[i] = sp;
      sp[k] = -1;
    }
  }
  {
    if (nedges)
      free(nedges);
  };
  for (i = 0; i < n; i++) {
    sp = R[i];
    if (sp) {
      while (*sp >= 0)
        *temp_R[*sp++]++ = i;
    }
  }
  {
    if (temp_R)
      free(temp_R);
  };
  return (new_R);
}
```