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

```asm
<qsort>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  mov    %esi,%eax
  push   %r14
  push   %r13
  mov    %rdi,%r13
  movslq %edx,%rdi
  push   %r12
  mov    %rdi,%rcx
  push   %rbp
  and    $0x7,%ecx
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x10(%rsp)
  neg    %rdi
  mov    %edx,0x20(%rsp)
  mov    %rdi,%r12
  mov    %ecx,0x28(%rsp)
  movl   $0x2,(%rsp)
  test   $0x7,%r13b
  jne    L232
L310:
  mov    0x28(%rsp),%edi
  test   %edi,%edi
  jne    L232
  xor    %ecx,%ecx
  cmpl   $0x8,0x20(%rsp)
  setne  %cl
  mov    %ecx,(%rsp)
L232:
  cmp    $0x6,%eax
  jbe    L185
L362:
  mov    0x20(%rsp),%ecx
  mov    %eax,%ebx
  lea    -0x1(%rax),%edx
  shr    %ebx
  imul   %ecx,%edx
  imul   %ecx,%ebx
  mov    %edx,%ebp
  mov    %edx,0x24(%rsp)
  lea    0x0(%r13,%rbx,1),%r14
  add    %r13,%rbp
  cmp    $0x7,%eax
  je     L55
  mov    %rbp,%rdx
  mov    %r13,%rbx
  cmp    $0x28,%eax
  ja     L251
L279:
  mov    %r14,%rsi
  mov    %r15,%rcx
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <med3@plt>
  movslq %eax,%r14
L55:
  mov    (%rsp),%esi
  test   %esi,%esi
  jne    L248
  mov    0x0(%r13),%rax
  mov    (%r14),%rdx
  mov    %rdx,0x0(%r13)
  mov    %rax,(%r14)
L117:
  mov    0x10(%rsp),%rax
  add    %r13,%rax
  mov    %rax,0x18(%rsp)
  cmp    %rbp,%rax
  jbe    L114
  mov    %rax,0x8(%rsp)
  xor    %r8d,%r8d
  xor    %r9d,%r9d
  xor    %ebx,%ebx
  xor    %eax,%eax
  nopl   (%rax)
L272:
  mov    0x18(%rsp),%rdx
  sub    %r13,%rdx
  cmp    %rax,%rdx
  cmovle %rdx,%rax
  mov    %eax,%edx
  test   %eax,%eax
  jg     L278
L5:
  mov    0x20(%rsp),%eax
  mov    0x24(%rsp),%ecx
  lea    (%rax,%rcx,1),%r10d
  add    %r13,%r10
  mov    %r10,%rax
  sub    %rbp,%rax
  sub    0x10(%rsp),%rax
  cmp    %rbx,%rax
  cmovg  %rbx,%rax
  mov    %eax,%edx
  test   %eax,%eax
  jle    L155
  mov    %r10,%rsi
  cltq
  mov    (%rsp),%ecx
  mov    0x8(%rsp),%rdi
  sub    %rax,%rsi
  xor    %eax,%eax
  mov    %r8d,0x2c(%rsp)
  mov    %r9d,0x24(%rsp)
  mov    %r10,0x18(%rsp)
  call   <swapfunc@plt>
  movslq 0x2c(%rsp),%r8
  mov    0x24(%rsp),%r9d
  mov    0x18(%rsp),%r10
L155:
  cmp    %r9d,0x20(%rsp)
  jl     L395
L33:
  mov    0x20(%rsp),%ecx
  cmp    %r8d,%ecx
  jge    L252
  mov    %r8d,%eax
  sub    %r8,%r10
  movl   $0x2,(%rsp)
  cltd
  mov    %r10,%r13
  idiv   %ecx
  test   $0x7,%r13b
  je     L310
  cmp    $0x6,%eax
  ja     L362
L185:
  imul   0x20(%rsp),%eax
  mov    0x10(%rsp),%rcx
  lea    0x0(%r13,%rcx,1),%rbp
  neg    %rcx
  add    %r13,%rax
  mov    %rcx,%rbx
  mov    %rax,0x18(%rsp)
  cmp    %rax,%rbp
  jae    L252
  mov    (%rsp),%r12d
  mov    0x10(%rsp),%r14
  mov    %rbp,0x8(%rsp)
  mov    %r13,(%rsp)
  nopl   0x0(%rax,%rax,1)
L71:
  mov    0x8(%rsp),%rax
  cmp    %rax,(%rsp)
  jae    L164
  mov    %rax,%rbp
  jmp    L240
  nopl   0x0(%rax,%rax,1)
L24:
  mov    0x0(%r13),%rax
  mov    0x0(%r13,%rbx,1),%rdx
  mov    %rdx,0x0(%r13)
  mov    %rax,0x0(%r13,%rbx,1)
  cmp    %rbp,(%rsp)
  jae    L164
L240:
  mov    %rbp,%r13
  sub    %r14,%rbp
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   *%r15
  test   %eax,%eax
  jle    L164
  test   %r12d,%r12d
  je     L24
  mov    0x20(%rsp),%edx
  xor    %eax,%eax
  mov    %r12d,%ecx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <swapfunc@plt>
  cmp    %rbp,(%rsp)
  jb     L240
  nopw   0x0(%rax,%rax,1)
L164:
  add    %r14,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    0x18(%rsp),%rax
  jb     L71
L252:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L114:
  mov    0x18(%rsp),%rbx
  mov    %rbp,%r14
  nopl   0x0(%rax,%rax,1)
L196:
  mov    %rbx,0x8(%rsp)
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   *%r15
  test   %eax,%eax
  jle    L32
  cmp    0x8(%rsp),%r14
  jae    L365
  jmp    L225
  nopw   0x0(%rax,%rax,1)
L209:
  mov    (%r14),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,(%r14)
  mov    %rax,0x0(%rbp)
L329:
  add    %r12,%rbp
L92:
  add    %r12,%r14
  cmp    %rbx,%r14
  jb     L243
L365:
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   *%r15
  test   %eax,%eax
  js     L256
  jne    L92
  mov    (%rsp),%edx
  test   %edx,%edx
  je     L209
  mov    (%rsp),%ecx
  mov    0x20(%rsp),%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <swapfunc@plt>
  jmp    L329
  nopl   0x0(%rax)
L256:
  mov    (%rsp),%eax
  test   %eax,%eax
  jne    L372
  mov    (%rbx),%rax
  mov    (%r14),%rdx
  mov    %rdx,(%rbx)
  mov    %rax,(%r14)
L48:
  mov    0x10(%rsp),%rax
  add    %r12,%r14
  add    %rbx,%rax
  mov    %rax,0x8(%rsp)
L286:
  mov    %rax,%rbx
  cmp    %rax,%r14
  jae    L196
L427:
  mov    %rbp,%rbx
  sub    0x18(%rsp),%rax
  sub    %r14,%rbx
  mov    %eax,%r9d
  movslq %ebx,%r8
  jmp    L272
  nopl   (%rax)
L372:
  mov    (%rsp),%ecx
  mov    0x20(%rsp),%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  call   <swapfunc@plt>
  jmp    L48
  cs nopw 0x0(%rax,%rax,1)
L32:
  jne    L224
  mov    (%rsp),%ecx
  test   %ecx,%ecx
  jne    L98
  mov    0x18(%rsp),%rcx
  mov    (%rbx),%rdx
  mov    (%rcx),%rax
  mov    %rdx,(%rcx)
  mov    %rax,(%rbx)
L148:
  mov    0x10(%rsp),%rcx
  add    %rcx,0x18(%rsp)
L224:
  mov    0x10(%rsp),%rax
  add    %rbx,%rax
  mov    %rax,0x8(%rsp)
  jmp    L286
  nopl   0x0(%rax,%rax,1)
L278:
  mov    0x8(%rsp),%rsi
  cltq
  mov    (%rsp),%ecx
  mov    %r13,%rdi
  mov    %r8d,0x2c(%rsp)
  sub    %rax,%rsi
  xor    %eax,%eax
  mov    %r9d,0x18(%rsp)
  call   <swapfunc@plt>
  movslq 0x2c(%rsp),%r8
  mov    0x18(%rsp),%r9d
  jmp    L5
L98:
  mov    (%rsp),%ecx
  mov    0x20(%rsp),%edx
  mov    %rbx,%rsi
  xor    %eax,%eax
  mov    0x18(%rsp),%rdi
  call   <swapfunc@plt>
  jmp    L148
L248:
  mov    (%rsp),%ecx
  mov    0x20(%rsp),%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  call   <swapfunc@plt>
  jmp    L117
L251:
  shr    $0x3,%eax
  mov    %r13,%rdi
  imul   %ecx,%eax
  mov    %r15,%rcx
  lea    (%rax,%rax,1),%edx
  movslq %eax,%r8
  xor    %eax,%eax
  movslq %edx,%rdx
  lea    0x0(%r13,%r8,1),%rsi
  mov    %r8,0x8(%rsp)
  add    %r13,%rdx
  call   <med3@plt>
  mov    0x8(%rsp),%r8
  mov    %r14,%rdi
  mov    %r14,%rsi
  mov    %r15,%rcx
  movslq %eax,%rbx
  xor    %eax,%eax
  mov    %r8,%r10
  lea    (%r14,%r8,1),%rdx
  sub    %r8,%rdi
  neg    %r10
  mov    %r10,0x8(%rsp)
  call   <med3@plt>
  mov    0x8(%rsp),%r10
  mov    %rbp,%rdx
  mov    %r15,%rcx
  movslq %eax,%r14
  xor    %eax,%eax
  lea    0x0(%rbp,%r10,1),%rsi
  lea    (%rsi,%r10,1),%rdi
  call   <med3@plt>
  movslq %eax,%rdx
  jmp    L279
L395:
  mov    0x20(%rsp),%edi
  mov    %r9d,%eax
  mov    %r15,%rcx
  mov    %r8d,0x8(%rsp)
  cltd
  mov    %r10,(%rsp)
  idiv   %edi
  mov    %edi,%edx
  mov    %r13,%rdi
  mov    %eax,%esi
  call   <qsort>
  movslq 0x8(%rsp),%r8
  mov    (%rsp),%r10
  jmp    L33
L243:
  mov    %rbx,%rax
  jmp    L427
L225:
  mov    0x8(%rsp),%rax
  jmp    L427
```

assistant: ```c
void qsort(void *base, unsigned n, int es, int (*cmp)(const void *, const void *)) {
  char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
  int d, r, swaptype;
  char *a = (char *)base;
  swaptype = (a - (char *)0) % sizeof(long) || es % sizeof(long) ? 2 : es == sizeof(long) ? 0 : 1;
  ;
  if (n < 7) {
    for (pm = a + es; pm < a + n * es; pm += es)
      for (pl = pm; pl > a && cmp(pl - es, pl) > 0; pl -= es)
        if (swaptype == 0) {
          long t = *(long *)(pl);
          *(long *)(pl) = *(long *)(pl - es);
          *(long *)(pl - es) = t;
        } else
          swapfunc(pl, pl - es, es, swaptype);
    return;
  }
  pm = a + (n / 2) * es;
  if (n > 7) {
    pl = a;
    pn = a + (n - 1) * es;
    if (n > 40) {
      d = (n / 8) * es;
      pl = med3(pl, pl + d, pl + 2 * d, cmp);
      pm = med3(pm - d, pm, pm + d, cmp);
      pn = med3(pn - 2 * d, pn - d, pn, cmp);
    }
    pm = med3(pl, pm, pn, cmp);
  }
  if (swaptype == 0) {
    long t = *(long *)(a);
    *(long *)(a) = *(long *)(pm);
    *(long *)(pm) = t;
  } else
    swapfunc(a, pm, es, swaptype);
  pa = pb = a + es;
  pc = pd = a + (n - 1) * es;
  for (;;) {
    while (pb <= pc && (r = cmp(pb, a)) <= 0) {
      if (r == 0) {
        if (swaptype == 0) {
          long t = *(long *)(pa);
          *(long *)(pa) = *(long *)(pb);
          *(long *)(pb) = t;
        } else
          swapfunc(pa, pb, es, swaptype);
        pa += es;
      }
      pb += es;
    }
    while (pb <= pc && (r = cmp(pc, a)) >= 0) {
      if (r == 0) {
        if (swaptype == 0) {
          long t = *(long *)(pc);
          *(long *)(pc) = *(long *)(pd);
          *(long *)(pd) = t;
        } else
          swapfunc(pc, pd, es, swaptype);
        pd -= es;
      }
      pc -= es;
    }
    if (pb > pc)
      break;
    if (swaptype == 0) {
      long t = *(long *)(pb);
      *(long *)(pb) = *(long *)(pc);
      *(long *)(pc) = t;
    } else
      swapfunc(pb, pc, es, swaptype);
    pb += es;
    pc -= es;
  }
  pn = a + n * es;
  r = ((pa - a) <= (pb - pa) ? (pa - a) : (pb - pa));
  if (r > 0)
    swapfunc(a, pb - r, r, swaptype);
  r = ((pd - pc) <= (pn - pd - es) ? (pd - pc) : (pn - pd - es));
  if (r > 0)
    swapfunc(pb, pn - r, r, swaptype);
  if ((r = pb - pa) > es)
    qsort(a, r / es, es, cmp);
  if ((r = pd - pc) > es)
    qsort(pn - r, r / es, es, cmp);
}
```