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

```asm
<svd_sort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  movslq %edx,%r12
  push   %rbp
  mov    %r12,%r15
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x38,%rsp
  mov    %rdi,0x20(%rsp)
  movslq %esi,%rdi
  mov    %edi,0x10(%rsp)
  imul   %r12,%rdi
  mov    %r8,0x18(%rsp)
  shl    $0x2,%rdi
  call   <malloc@plt>
  mov    %r12,%rdi
  imul   %r12,%rdi
  mov    %rax,%r13
  shl    $0x2,%rdi
  call   <malloc@plt>
  lea    0x0(,%r12,4),%rcx
  mov    %rcx,%rdi
  mov    %rcx,0x8(%rsp)
  mov    %rax,%rbp
  call   <malloc@plt>
  mov    0x8(%rsp),%rdi
  mov    %rax,%r12
  call   <malloc@plt>
  mov    0x10(%rsp),%r9d
  mov    %r15d,%r11d
  mov    0x8(%rsp),%rcx
  mov    0x18(%rsp),%r8
  mov    0x20(%rsp),%r10
  mov    %rax,%r14
  imul   %r9d,%r11d
  test   %r15d,%r15d
  jle    L117
  mov    %rcx,%rdx
  mov    %r8,%rsi
  mov    %r12,%rdi
  mov    %r9d,0x28(%rsp)
  mov    %r11d,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %r8,0x8(%rsp)
  call   <memcpy@plt>
  mov    0x18(%rsp),%r11d
  mov    0x8(%rsp),%r8
  mov    0x10(%rsp),%rcx
  mov    0x20(%rsp),%r10
  test   %r11d,%r11d
  mov    0x28(%rsp),%r9d
  jle    L51
  movslq %r11d,%rdx
  mov    %r10,%rsi
  mov    %r13,%rdi
  mov    %r8,0x28(%rsp)
  shl    $0x2,%rdx
  mov    %r9d,0x20(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %r11d,0x10(%rsp)
  mov    %r10,0x8(%rsp)
  call   <memcpy@plt>
  mov    %r15d,%eax
  mov    0x8(%rsp),%r10
  mov    0x10(%rsp),%r11d
  imul   %r15d,%eax
  mov    0x18(%rsp),%rcx
  mov    0x20(%rsp),%r9d
  mov    0x28(%rsp),%r8
  test   %eax,%eax
  je     L148
L122:
  movslq %eax,%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    %r8,0x8(%rsp)
  shl    $0x2,%rdx
  test   %eax,%eax
  mov    $0x4,%eax
  mov    %r9d,0x28(%rsp)
  cmovle %rax,%rdx
  mov    %r10,0x20(%rsp)
  mov    %r11d,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  call   <memcpy@plt>
  mov    0x8(%rsp),%rdi
  xor    %eax,%eax
  mov    %r14,%rdx
  mov    %r15d,%esi
  call   <sort1d@plt>
  test   %r15d,%r15d
  mov    0x8(%rsp),%r8
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%r11d
  mov    0x20(%rsp),%r10
  mov    0x28(%rsp),%r9d
  jle    L59
L173:
  cmp    $0x1,%r15d
  jne    L125
  movslq (%r14),%r15
  movss  (%r12,%r15,4),%xmm0
  lea    0x0(,%r15,4),%rsi
  movss  %xmm0,(%r8)
  test   %r11d,%r11d
  jle    L14
  movslq %r11d,%rdx
  add    %r13,%rsi
  mov    %r10,%rdi
  shl    $0x2,%rdx
  call   <memcpy@plt>
L14:
  movss  0x0(%rbp,%r15,4),%xmm0
  movss  %xmm0,(%rbx)
L59:
  mov    %r13,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x38,%rsp
  mov    %r14,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free@plt>
L125:
  mov    %r14,0x8(%rsp)
  mov    %r14,%rsi
  xor    %edi,%edi
  nopl   0x0(%rax,%rax,1)
L96:
  movslq (%rsi),%rax
  xor    %edx,%edx
  movss  (%r12,%rax,4),%xmm0
  lea    0x0(,%rax,4),%r11
  xor    %eax,%eax
  lea    0x0(%r13,%r11,1),%r14
  movss  %xmm0,(%r8)
  test   %r9d,%r9d
  jle    L34
  nopl   0x0(%rax)
L13:
  movss  (%r14,%rax,1),%xmm0
  add    $0x1,%edx
  movss  %xmm0,(%r10,%rax,1)
  add    %rcx,%rax
  cmp    %edx,%r9d
  jne    L13
L34:
  add    %rbp,%r11
  xor    %edx,%edx
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L45:
  movss  (%r11,%rdx,1),%xmm0
  mov    %eax,%r14d
  add    $0x1,%eax
  movss  %xmm0,(%rbx,%rdx,1)
  add    %rcx,%rdx
  cmp    %eax,%r15d
  jne    L45
  lea    0x1(%rdi),%eax
  add    $0x4,%rsi
  add    $0x4,%r8
  add    $0x4,%rbx
  add    $0x4,%r10
  cmp    %r14d,%edi
  je     L19
  mov    %eax,%edi
  jmp    L96
L19:
  mov    0x8(%rsp),%r14
  jmp    L59
L117:
  test   %r11d,%r11d
  jle    L21
  movslq %r11d,%rdx
  mov    %r10,%rsi
  mov    %r13,%rdi
  mov    %r8,0x28(%rsp)
  shl    $0x2,%rdx
  mov    %r9d,0x20(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %r11d,0x10(%rsp)
  mov    %r10,0x8(%rsp)
  call   <memcpy@plt>
  mov    %r15d,%eax
  mov    0x8(%rsp),%r10
  mov    0x10(%rsp),%r11d
  imul   %r15d,%eax
  mov    0x18(%rsp),%rcx
  mov    0x20(%rsp),%r9d
  mov    0x28(%rsp),%r8
  test   %eax,%eax
  jne    L122
  jmp    L64
L148:
  mov    %r8,%rdi
  mov    %r14,%rdx
  mov    %r15d,%esi
  xor    %eax,%eax
  mov    %r9d,0x28(%rsp)
  mov    %r10,0x20(%rsp)
  mov    %r11d,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %r8,0x8(%rsp)
  call   <sort1d@plt>
  mov    0x8(%rsp),%r8
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%r11d
  mov    0x20(%rsp),%r10
  mov    0x28(%rsp),%r9d
  jmp    L173
L51:
  mov    %r15d,%eax
  imul   %r15d,%eax
  jmp    L122
L21:
  mov    %r15d,%eax
  imul   %r15d,%eax
  test   %eax,%eax
  jne    L122
L64:
  mov    %r14,%rdx
  mov    %r15d,%esi
  mov    %r8,%rdi
  xor    %eax,%eax
  call   <sort1d@plt>
  jmp    L59
```

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