user: What would the C source look like for the assembly code provided here:

```asm
<convert_ij2slap_w>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %rdx,%r15
  mov    %r8,%rbx
  mov    %r9,%r14
  mov    %ecx,0x10(%rsp)
  mov    %ecx,%esi
  call   <find_max@plt>
  mov    %eax,%ebp
  mov    0x10(%rsp),%esi
  mov    %r13,%rdi
  call   <find_max@plt>
  add    $0x1,%ebp
  add    $0x1,%eax
  cmp    %eax,%ebp
  cmovae %ebp,%eax
  mov    %eax,0xc(%rsp)
  lea    0x1(%rax),%edi
  mov    %edi,0x14(%rsp)
  shl    $0x2,%edi
  mov    %edi,%ebp
  call   <malloc@plt>
  mov    %rax,(%rbx)
  mov    %ebp,0x18(%rsp)
  lea    -0x4(%rbp),%r10d
  mov    %r10d,0x1c(%rsp)
  mov    %r10d,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    0x10(%rsp),%ecx
  lea    0x0(,%rcx,4),%edi
  call   <malloc@plt>
  mov    %rax,(%r14)
  mov    0x10(%rsp),%ecx
  lea    0x0(,%rcx,8),%edi
  call   <malloc@plt>
  mov    0x60(%rsp),%rsi
  mov    %rax,(%rsi)
  mov    0x18(%rsp),%edx
  mov    $0x0,%esi
  mov    (%rbx),%rdi
  call   <memset@plt>
  cmpl   $0x0,0x14(%rsp)
  je     L5
  mov    0xc(%rsp),%eax
  lea    0x4(,%rax,4),%rcx
  mov    $0x0,%eax
L60:
  mov    (%rbx),%rdx
  movl   $0x0,(%rdx,%rax,1)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L60
  mov    0x1c(%rsp),%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    (%rbx),%rax
  movl   $0x0,(%rax)
  cmpl   $0x0,0x10(%rsp)
  je     L95
L7:
  mov    %r12,%rax
  mov    0x10(%rsp),%edi
  lea    -0x1(%rdi),%edx
  lea    0x4(%r12,%rdx,4),%rsi
L24:
  mov    (%rax),%edx
  lea    0x1(%rdx),%ecx
  mov    (%rbx),%rdx
  addl   $0x1,(%rdx,%rcx,4)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L24
L95:
  cmpl   $0x0,0xc(%rsp)
  je     L9
L0:
  mov    $0x1,%eax
L44:
  mov    (%rbx),%rdx
  mov    %eax,%ecx
  lea    -0x1(%rax),%esi
  mov    (%rdx,%rsi,4),%esi
  add    %esi,(%rdx,%rcx,4)
  add    $0x1,%eax
  cmp    %eax,0xc(%rsp)
  jae    L44
L9:
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  je     L28
  mov    %eax,%edi
  mov    $0x0,%eax
L16:
  mov    (%r12,%rax,4),%ecx
  mov    (%rbx),%rsi
  mov    0x0(%rbp,%rcx,4),%edx
  add    (%rsi,%rcx,4),%edx
  mov    0x0(%r13,%rax,4),%esi
  mov    (%r14),%rcx
  mov    %esi,(%rcx,%rdx,4)
  movsd  (%r15,%rax,8),%xmm0
  mov    0x60(%rsp),%rsi
  mov    (%rsi),%rcx
  movsd  %xmm0,(%rcx,%rdx,8)
  mov    (%r12,%rax,4),%edx
  addl   $0x1,0x0(%rbp,%rdx,4)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L16
L28:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0xc(%rsp),%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L5:
  mov    0x1c(%rsp),%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    (%rbx),%rax
  movl   $0x0,(%rax)
  cmpl   $0x0,0x10(%rsp)
  jne    L7
  jmp    L0
```

assistant: ```c
int convert_ij2slap_w(unsigned int *I, unsigned int *J, double *W, unsigned int K, unsigned int **r_slap, unsigned int **J_slap, double **w_slap) {
  unsigned int tmp, max;
  unsigned int N;
  unsigned int i, pos;
  unsigned int *p;
  max = find_max(I, K) + 1;
  tmp = find_max(J, K) + 1;
  if (tmp > max) {
    max = tmp;
  }
  *r_slap = malloc((max + 1) * sizeof(unsigned int));
  p = malloc(max * sizeof(unsigned int));
  *J_slap = malloc(K * sizeof(unsigned int));
  *w_slap = malloc(K * sizeof(double));
  memset(*r_slap, 0, (max + 1) * sizeof(unsigned int));
  for (i = 0; i < max + 1; i++)
    (*r_slap)[i] = 0;
  memset(p, 0, max * sizeof(unsigned int));
  (*r_slap)[0] = 0;
  for (i = 0; i < K; i++) {
    (*r_slap)[I[i] + 1] += 1;
  }
  for (i = 1; i <= max; i++) {
    (*r_slap)[i] += (*r_slap)[i - 1];
  }
  for (i = 0; i < K; i++) {
    pos = (*r_slap)[I[i]] + p[I[i]];
    (*J_slap)[pos] = J[i];
    (*w_slap)[pos] = W[i];
    p[I[i]] += 1;
  }
  free(p);
  return max;
}
```