user: Demonstrate the C code that generates the assembly output below:

```asm
<svd_sort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %esi,%r12d
  mov    %edx,%r13d
  mov    %rcx,%rbp
  mov    %r8,%r14
  movslq %edx,%r15
  movslq %esi,%rdi
  imul   %r15,%rdi
  shl    $0x2,%rdi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  mov    %r15,%rdi
  imul   %r15,%rdi
  shl    $0x2,%rdi
  call   <malloc@plt>
  mov    %rax,(%rsp)
  lea    0x0(,%r15,4),%rax
  mov    %rax,0x18(%rsp)
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%r15
  mov    0x18(%rsp),%rdi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %r13d,%r13d
  jle    L69
  mov    %r13d,%edx
  mov    $0x0,%eax
L144:
  movss  (%r14,%rax,4),%xmm0
  movss  %xmm0,(%r15,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L144
  mov    %r13d,%edx
  imul   %r12d,%edx
  test   %edx,%edx
  jle    L124
L59:
  mov    $0x0,%eax
  mov    0x10(%rsp),%rcx
L151:
  movss  (%rbx,%rax,4),%xmm0
  movss  %xmm0,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%edx
  jg     L151
  mov    %r13d,%edx
  imul   %r13d,%edx
  test   %edx,%edx
  jle    L154
L128:
  mov    $0x0,%eax
  mov    (%rsp),%rcx
L141:
  movss  0x0(%rbp,%rax,4),%xmm0
  movss  %xmm0,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%edx
  jg     L141
L154:
  mov    0x8(%rsp),%rdx
  mov    %r13d,%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <sort1d@plt>
  test   %r13d,%r13d
  jle    L56
  mov    0x8(%rsp),%rcx
  mov    $0x0,%esi
  mov    0x18(%rsp),%rdi
  mov    0x10(%rsp),%r9
  jmp    L133
L69:
  mov    %r13d,%edx
  imul   %r12d,%edx
  test   %edx,%edx
  jg     L59
  mov    %r13d,%edx
  imul   %r13d,%edx
  test   %edx,%edx
  jg     L128
  mov    0x8(%rsp),%rdx
  mov    %r13d,%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <sort1d@plt>
  jmp    L56
L58:
  mov    %eax,%esi
L133:
  movslq (%rcx),%rax
  lea    0x0(,%rax,4),%r8
  movss  (%r15,%rax,4),%xmm0
  movss  %xmm0,(%r14)
  test   %r12d,%r12d
  jle    L16
  lea    (%r9,%r8,1),%r10
  mov    $0x0,%eax
  mov    $0x0,%edx
L88:
  movss  (%r10,%rax,1),%xmm0
  movss  %xmm0,(%rbx,%rax,1)
  add    $0x1,%edx
  add    %rdi,%rax
  cmp    %edx,%r12d
  jne    L88
L16:
  add    (%rsp),%r8
  mov    $0x0,%edx
  mov    $0x0,%eax
L104:
  movss  (%r8,%rdx,1),%xmm0
  movss  %xmm0,0x0(%rbp,%rdx,1)
  mov    %eax,%r10d
  add    $0x1,%eax
  add    %rdi,%rdx
  cmp    %eax,%r13d
  jne    L104
  lea    0x1(%rsi),%eax
  add    $0x4,%rcx
  add    $0x4,%r14
  add    $0x4,%rbp
  add    $0x4,%rbx
  cmp    %r10d,%esi
  jne    L58
L56:
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L124:
  mov    %r13d,%edx
  imul   %r13d,%edx
  jmp    L128
```

assistant: ```c
void svd_sort(float *U, int M, int N, float *V, float *q) {
  int i, j;
  float *UT, *VT, *qq;
  int *pos;
  UT = (float *)malloc(sizeof(float) * N * M);
  VT = (float *)malloc(sizeof(float) * N * N);
  qq = (float *)malloc(sizeof(float) * N);
  pos = (int *)malloc(sizeof(int) * N);
  for (i = 0; i < N; ++i) {
    qq[i] = q[i];
  }
  for (i = 0; i < M * N; ++i) {
    UT[i] = U[i];
  }
  for (i = 0; i < N * N; ++i) {
    VT[i] = V[i];
  }
  sort1d(q, N, pos);
  for (i = 0; i < N; ++i) {
    q[i] = qq[pos[i]];
    for (j = 0; j < M; ++j) {
      U[j * N + i] = UT[j * N + pos[i]];
    }
    for (j = 0; j < N; ++j) {
      V[j * N + i] = VT[j * N + pos[i]];
    }
  }
  free(UT);
  free(VT);
  free(qq);
  free(pos);
}
```