user: Please show me the C implementation that matches the assembly code listed below:

```asm
<svd_topk>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rcx,0x20(%rsp)
  mov    %r8,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    (%rcx,%rcx,1),%r14
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x40(%rsp)
  cmp    %rsi,%rdx
  mov    %rsi,%rax
  cmovbe %rdx,%rax
  cmp    %r14,%rax
  ja     L37
  mov    $0x0,%r15d
  movq   $0x0,0x8(%rsp)
  mov    $0x0,%r13d
L6:
  mov    %r15,%rdi
  call   <mem_free@plt>
  mov    $0x0,%r15d
L47:
  mov    0x18(%rsp),%rax
  mov    %r15,(%rax)
  mov    0x38(%rsp),%rdi
  call   <mem_free@plt>
  mov    0x30(%rsp),%rdi
  call   <mem_free@plt>
  mov    0x40(%rsp),%rdi
  call   <mem_free@plt>
  mov    %r13,%rdi
  call   <mem_free@plt>
  mov    0x8(%rsp),%rdi
  call   <mem_free@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L37:
  mov    %rsi,%rbp
  mov    %rdx,%rbx
  mov    %r14,%rax
  imul   %rdx,%rax
  mov    $0x4,%esi
  mov    %rax,0x28(%rsp)
  mov    %rax,%rdi
  call   <mem_alloc@plt>
  mov    %rax,%r13
  cmp    %rbp,%rbx
  mov    %rbp,%r12
  cmovae %rbx,%r12
  imul   %r14,%r12
  mov    $0x4,%esi
  mov    %r12,%rdi
  call   <mem_alloc@plt>
  mov    %rax,0x8(%rsp)
  mov    $0x4,%esi
  mov    %r12,%rdi
  call   <mem_alloc@plt>
  mov    %rax,%r15
  test   %r13,%r13
  sete   %al
  cmpq   $0x0,0x8(%rsp)
  sete   %dl
  or     %dl,%al
  jne    L6
  test   %r15,%r15
  je     L6
  mov    0x28(%rsp),%rax
  test   %rax,%rax
  je     L23
  mov    $0x0,%r12d
  mov    %r15,0x28(%rsp)
  mov    %rax,%r15
L7:
  mov    $0x0,%eax
  call   <rnorm@plt>
  movss  %xmm0,0x0(%r13,%r12,4)
  add    $0x1,%r12
  cmp    %r12,%r15
  jne    L7
  mov    0x28(%rsp),%r15
L23:
  mov    %r15,%r9
  mov    %r14,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    0x10(%rsp),%rdi
  call   <dotnn@plt>
  mov    0x8(%rsp),%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <qr@plt>
  mov    $0x2,%r12d
  mov    %r13,0x28(%rsp)
  mov    0x8(%rsp),%r13
L0:
  mov    %r15,%r9
  mov    %r14,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    0x10(%rsp),%rdi
  call   <dottn@plt>
  mov    %r13,%rcx
  mov    %r14,%rdx
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <qr@plt>
  mov    %r15,%r9
  mov    %r14,%r8
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    0x10(%rsp),%rdi
  call   <dotnn@plt>
  mov    %r13,%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <qr@plt>
  sub    $0x1,%r12
  jne    L0
  mov    0x28(%rsp),%r13
  mov    %r13,%r9
  mov    %rbx,%r8
  mov    %r14,%rcx
  mov    %rbp,%rdx
  mov    0x10(%rsp),%rsi
  mov    0x8(%rsp),%r12
  mov    %r12,%rdi
  call   <dottn@plt>
  mov    %rbx,%rdx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <transpose@plt>
  lea    0x38(%rsp),%rcx
  lea    0x40(%rsp),%r9
  lea    0x30(%rsp),%r8
  mov    %r14,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <svd_full@plt>
  mov    %r13,%r9
  mov    0x20(%rsp),%rbx
  mov    %rbx,%r8
  mov    %r14,%rcx
  mov    %r14,%rdx
  mov    0x30(%rsp),%rsi
  mov    0x40(%rsp),%rdi
  call   <trim@plt>
  mov    %r15,%r9
  mov    %rbx,%r8
  mov    %r14,%rcx
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <dotnn@plt>
  jmp    L47
L17:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void svd_topk(const float *a, size_t m, size_t n, size_t k, float **ou) {
  const size_t l = 2 * k;
  const size_t p = 2;
  size_t i;
  float *b = NULL;
  float *q = NULL;
  float *s = NULL;
  float *u = NULL;
  float *v = NULL;
  float *y = NULL;
  if (l >= (((m) < (n)) ? (m) : (n)))
    goto error;
  b = mem_alloc(l * n, sizeof(float));
  q = mem_alloc(l * (((m) > (n)) ? (m) : (n)), sizeof(float));
  y = mem_alloc(l * (((m) > (n)) ? (m) : (n)), sizeof(float));
  if (b == NULL || q == NULL || y == NULL)
    goto error;
  for (i = 0; i < n * l; i++)
    b[i] = rnorm();
  dotnn(a, b, m, n, l, y);
  qr(y, m, l, q);
  for (i = 0; i < p; i++) {
    dottn(a, q, m, n, l, y);
    qr(y, n, l, q);
    dotnn(a, q, m, n, l, y);
    qr(y, m, l, q);
  }
  dottn(q, a, m, l, n, b);
  transpose(b, l, n);
  svd_full(b, n, l, &u, &s, &v);
  trim(v, s, l, l, k, b);
  dotnn(q, b, m, l, k, y);
  goto done;
error:
  do {
    mem_free(y);
    y = NULL;
  } while (0);
done:
  *ou = y;
  mem_free(u);
  mem_free(s);
  mem_free(v);
  mem_free(b);
  mem_free(q);
}
```