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

```asm
<svd_sort>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  movslq %esi,%rdi
  push   %rbp
  mov    %rdi,%r13
  mov    %rcx,%rbp
  push   %rbx
  movslq %edx,%rbx
  imul   %rbx,%rdi
  mov    %rbx,%r14
  sub    $0x28,%rsp
  shl    $0x2,%rdi
  call   <malloc@plt>
  mov    %rbx,%rdi
  imul   %rbx,%rdi
  shl    $0x2,%rbx
  mov    %rax,0x18(%rsp)
  shl    $0x2,%rdi
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    %rax,0x10(%rsp)
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    %rax,0x8(%rsp)
  call   <malloc@plt>
  mov    %r14d,%ecx
  mov    0x8(%rsp),%r9
  mov    0x10(%rsp),%r8
  imul   %r13d,%ecx
  test   %r14d,%r14d
  mov    %rax,(%rsp)
  mov    0x18(%rsp),%r10
  jle    L53
  mov    %r9,%rdi
  mov    %rbx,%rdx
  mov    %r15,%rsi
  mov    %ecx,0x18(%rsp)
  mov    %r10,0x8(%rsp)
  call   <memcpy@plt>
  mov    0x18(%rsp),%ecx
  mov    0x8(%rsp),%r10
  mov    0x10(%rsp),%r8
  mov    %rax,%r9
  test   %ecx,%ecx
  jle    L11
  movslq %ecx,%rdx
  mov    %r10,%rdi
  mov    %r12,%rsi
  mov    %r8,0x8(%rsp)
  shl    $0x2,%rdx
  mov    %rax,0x10(%rsp)
  call   <memcpy@plt>
  mov    0x8(%rsp),%r8
  mov    0x10(%rsp),%r9
  mov    %rax,%r10
  mov    %r14d,%eax
  imul   %r14d,%eax
  test   %eax,%eax
  je     L135
L114:
  movslq %eax,%rdx
  mov    %r8,%rdi
  mov    %rbp,%rsi
  mov    %r9,0x18(%rsp)
  shl    $0x2,%rdx
  test   %eax,%eax
  mov    $0x4,%eax
  mov    %r10,0x10(%rsp)
  cmovle %rax,%rdx
  mov    %r8,0x8(%rsp)
  call   <memcpy@plt>
  mov    (%rsp),%rdx
  xor    %eax,%eax
  mov    %r14d,%esi
  mov    %r15,%rdi
  call   <sort1d@plt>
  test   %r14d,%r14d
  mov    0x8(%rsp),%r8
  mov    0x10(%rsp),%r10
  mov    0x18(%rsp),%r9
  jle    L43
L149:
  mov    (%rsp),%rcx
  xor    %esi,%esi
  nopl   (%rax)
L27:
  movslq (%rcx),%rax
  xor    %edx,%edx
  movss  (%r9,%rax,4),%xmm0
  lea    0x0(,%rax,4),%r11
  xor    %eax,%eax
  lea    (%r10,%r11,1),%rdi
  movss  %xmm0,(%r15)
  test   %r13d,%r13d
  jle    L102
  nopl   0x0(%rax,%rax,1)
L78:
  movss  (%rdi,%rax,1),%xmm0
  add    $0x1,%edx
  movss  %xmm0,(%r12,%rax,1)
  add    %rbx,%rax
  cmp    %edx,%r13d
  jne    L78
L102:
  add    %r8,%r11
  xor    %edx,%edx
  xor    %eax,%eax
  nopl   (%rax)
L39:
  movss  (%r11,%rdx,1),%xmm0
  mov    %eax,%edi
  add    $0x1,%eax
  movss  %xmm0,0x0(%rbp,%rdx,1)
  add    %rbx,%rdx
  cmp    %eax,%r14d
  jne    L39
  lea    0x1(%rsi),%eax
  add    $0x4,%rcx
  add    $0x4,%r15
  add    $0x4,%rbp
  add    $0x4,%r12
  cmp    %edi,%esi
  je     L43
  mov    %eax,%esi
  jmp    L27
L53:
  test   %ecx,%ecx
  jle    L81
  movslq %ecx,%rdx
  mov    %r10,%rdi
  mov    %r12,%rsi
  mov    %r9,0x10(%rsp)
  shl    $0x2,%rdx
  mov    %r8,0x8(%rsp)
  call   <memcpy@plt>
  mov    0x8(%rsp),%r8
  mov    0x10(%rsp),%r9
  mov    %rax,%r10
  mov    %r14d,%eax
  imul   %r14d,%eax
  test   %eax,%eax
  jne    L114
L30:
  mov    (%rsp),%rdx
  mov    %r14d,%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  mov    %r9,0x18(%rsp)
  mov    %r8,0x10(%rsp)
  mov    %r10,0x8(%rsp)
  call   <sort1d@plt>
  mov    0x8(%rsp),%r10
  mov    0x10(%rsp),%r8
  mov    0x18(%rsp),%r9
L43:
  mov    %r10,%rdi
  mov    %r9,0x10(%rsp)
  mov    %r8,0x8(%rsp)
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free@plt>
L11:
  mov    %r14d,%eax
  imul   %r14d,%eax
  jmp    L114
L135:
  mov    (%rsp),%rdx
  mov    %r14d,%esi
  mov    %r15,%rdi
  xor    %eax,%eax
  mov    %r9,0x18(%rsp)
  mov    %r8,0x10(%rsp)
  mov    %r10,0x8(%rsp)
  call   <sort1d@plt>
  mov    0x8(%rsp),%r10
  mov    0x10(%rsp),%r8
  mov    0x18(%rsp),%r9
  jmp    L149
L81:
  mov    %r14d,%eax
  imul   %r14d,%eax
  test   %eax,%eax
  jne    L114
  jmp    L30
```

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);
}
```