user: Converte this assembly snippet into its equivalent C code:

```asm
<slaSvdsol>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edi,%ebp
  mov    %esi,%ebx
  mov    %edx,%r12d
  mov    %ecx,%r13d
  mov    %r8,%r14
  mov    %r9,0x30(%rsp)
  mov    0xb0(%rsp),%r15
  mov    0xb8(%rsp),%rax
  mov    %rax,0x38(%rsp)
  mov    0xc0(%rsp),%rax
  mov    %rax,0x40(%rsp)
  mov    0xc8(%rsp),%rax
  mov    %rax,0x48(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0x0(,%rdi,8),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  mov    %r12d,0x28(%rsp)
  mov    %r12d,%edi
  imul   %r13d,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  lea    0x0(,%rbx,8),%r12d
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  mov    %r13d,%edi
  mov    %r13d,0x4(%rsp)
  imul   %r13d,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L37
  mov    %ebp,0x58(%rsp)
  mov    %ebx,0x5c(%rsp)
  mov    0x28(%rsp),%esi
  mov    %esi,0x60(%rsp)
  mov    0x4(%rsp),%edi
  mov    %edi,0x64(%rsp)
  test   %ebp,%ebp
  jle    L102
  mov    0x10(%rsp),%r9
  mov    %ebp,%ebp
  movslq %esi,%rcx
  shl    $0x3,%rcx
  mov    $0x0,%r8d
  mov    $0x0,%edi
  lea    -0x1(%rbx),%r11d
  mov    0x30(%rsp),%rsi
  lea    0x8(%rsi),%r10
  mov    %r13,0x28(%rsp)
  mov    %rax,0x30(%rsp)
  mov    %rsi,%r13
  mov    %r11,%r12
  mov    0x8(%rsp),%r11
L33:
  movsd  (%r14,%rdi,8),%xmm0
  movsd  %xmm0,(%r11,%rdi,8)
  test   %ebx,%ebx
  jle    L21
  movslq %r8d,%rdx
  lea    0x0(%r13,%rdx,8),%rax
  add    %r12,%rdx
  lea    (%r10,%rdx,8),%rsi
  mov    %r9,%rdx
L100:
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x8,%rax
  add    %rcx,%rdx
  cmp    %rsi,%rax
  jne    L100
L21:
  add    $0x1,%rdi
  add    $0x8,%r9
  add    0x4(%rsp),%r8d
  cmp    %rbp,%rdi
  jne    L33
  mov    0x28(%rsp),%r13
  mov    0x30(%rsp),%r12
L102:
  test   %ebx,%ebx
  jle    L59
  movslq 0x4(%rsp),%rcx
  shl    $0x3,%rcx
  lea    -0x1(%rbx),%eax
  mov    0x38(%rsp),%rdi
  lea    0x8(%rdi,%rax,8),%rsi
  mov    %ebx,%ebp
  mov    $0x0,%edi
  mov    %ebx,%ebx
  neg    %rbx
  lea    0x0(,%rbx,8),%r8
  mov    0x18(%rsp),%r9
  mov    0x20(%rsp),%r10
L92:
  movsd  (%r15,%rdi,8),%xmm0
  movsd  %xmm0,(%r9,%rdi,8)
  lea    (%r8,%rsi,1),%rax
  lea    (%r10,%rdi,8),%rdx
L61:
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x8,%rax
  add    %rcx,%rdx
  cmp    %rsi,%rax
  jne    L61
  add    $0x1,%rdi
  add    %rcx,%rsi
  cmp    %rbp,%rdi
  jne    L92
  lea    0x64(%rsp),%rcx
  lea    0x60(%rsp),%rdx
  lea    0x5c(%rsp),%rsi
  lea    0x58(%rsp),%rdi
  push   %r12
  push   %r13
  push   0x30(%rsp)
  push   0x30(%rsp)
  mov    0x30(%rsp),%r9
  mov    0x28(%rsp),%r8
  call   <sla_svdsol_@plt>
  add    $0x20,%rsp
  mov    $0x0,%eax
  mov    0x40(%rsp),%rdx
  mov    0x48(%rsp),%rcx
L38:
  movsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  movsd  0x0(%r13,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rbp,%rax
  jne    L38
L37:
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L59:
  lea    0x64(%rsp),%rcx
  lea    0x60(%rsp),%rdx
  lea    0x5c(%rsp),%rsi
  lea    0x58(%rsp),%rdi
  push   %r12
  push   %r13
  push   0x30(%rsp)
  push   0x30(%rsp)
  mov    0x30(%rsp),%r9
  mov    0x28(%rsp),%r8
  call   <sla_svdsol_@plt>
  add    $0x20,%rsp
  jmp    L37
L10:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void slaSvdsol(int m, int n, int mp, int np, double *b, double *u, double *w, double *v, double *work, double *x) {
  int M;
  int N;
  int MP;
  int NP;
  double *B;
  double *U;
  double *W;
  double *V;
  double *WORK;
  double *X;
  int i;
  int j;
  B = malloc(sizeof(double) * (size_t)(m));
  U = malloc(sizeof(double) * (size_t)(mp * np));
  W = malloc(sizeof(double) * (size_t)n);
  V = malloc(sizeof(double) * (size_t)(np * np));
  WORK = malloc(sizeof(double) * (size_t)n);
  X = malloc(sizeof(double) * (size_t)n);
  if (X) {
    M = m;
    N = n;
    MP = mp;
    NP = np;
    for (i = 0; i < m; i++) {
      B[i] = b[i];
      for (j = 0; j < n; j++)
        U[i + mp * j] = u[np * i + j];
    }
    for (i = 0; i < n; i++) {
      W[i] = w[i];
      for (j = 0; j < n; j++)
        V[i + np * j] = v[np * i + j];
    }
    sla_svdsol_(&M, &N, &MP, &NP, (double *)B, (double *)U, (double *)W, (double *)V, (double *)WORK, (double *)X);
    for (i = 0; i < n; i++) {
      x[i] = X[i];
      work[i] = WORK[i];
    }
  }
  free(B);
  free(U);
  free(W);
  free(V);
  free(WORK);
  free(X);
}
```