user: What would the C source look like for the assembly code provided here?

```asm
<_pqsort>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rsi,0x28(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %r8,0x40(%rsp)
  mov    %r9,0x48(%rsp)
L323:
  mov    0x10(%rsp),%rax
  movl   $0x2,0x1c(%rsp)
  or     %r14,%rax
  test   $0x7,%al
  je     L473
  cmpq   $0x6,0x28(%rsp)
  jbe    L361
L399:
  mov    0x28(%rsp),%rax
  mov    0x10(%rsp),%rdx
  mov    %rax,%rbp
  lea    -0x1(%rax),%r8
  shr    %rbp
  imul   %rdx,%r8
  imul   %rdx,%rbp
  lea    (%r14,%r8,1),%r13
  add    %r14,%rbp
  cmp    $0x7,%rax
  je     L154
  mov    %r13,%rdx
  mov    %r14,%r12
  cmp    $0x28,%rax
  ja     L320
L441:
  mov    %rbp,%rsi
  mov    %r15,%rcx
  mov    %r12,%rdi
  call   <med3@plt>
  mov    %rax,%rbp
L154:
  mov    0x1c(%rsp),%edi
  test   %edi,%edi
  jne    L63
  mov    (%r14),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,(%r14)
  mov    %rax,0x0(%rbp)
L247:
  mov    0x10(%rsp),%rdx
  lea    (%r14,%rdx,1),%rax
  mov    %rax,0x38(%rsp)
  cmp    %rax,%r13
  jb     L210
  mov    %rax,0x30(%rsp)
  neg    %rdx
  mov    %rax,%rbx
  mov    %r13,%rbp
  movl   $0x0,0x8(%rsp)
  mov    %rdx,%r12
  nopl   0x0(%rax)
L5:
  mov    %rbx,0x20(%rsp)
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   *%r15
  test   %eax,%eax
  jle    L79
  cmp    %rbx,%r13
  jb     L508
  mov    0x1c(%rsp),%edx
  test   %edx,%edx
  je     L201
  jmp    L37
L267:
  jne    L462
  mov    0x0(%rbp),%rcx
  mov    0x0(%r13),%rax
  movl   $0x1,0x8(%rsp)
  mov    %rcx,0x0(%r13)
  mov    %rax,0x0(%rbp)
  add    %r12,%rbp
L462:
  add    %r12,%r13
  cmp    %rbx,%r13
  jb     L508
L201:
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   *%r15
  test   %eax,%eax
  jns    L267
  mov    (%rbx),%rax
  mov    0x0(%r13),%rdx
  mov    %rdx,(%rbx)
  mov    %rax,0x0(%r13)
L577:
  add    0x10(%rsp),%rbx
  movl   $0x1,0x8(%rsp)
  add    %r12,%r13
  mov    %rbx,0x20(%rsp)
L101:
  cmp    %rbx,%r13
  jae    L5
L508:
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  je     L210
  mov    0x30(%rsp),%rax
  mov    0x20(%rsp),%r8
  sub    %rax,%r8
  sub    %r14,%rax
  cmp    %r8,%rax
  cmovg  %r8,%rax
  mov    %rax,%rdx
  test   %rax,%rax
  jne    L194
L133:
  mov    0x10(%rsp),%rdx
  mov    0x28(%rsp),%rbx
  mov    %rbp,%r12
  sub    %r13,%r12
  imul   %rdx,%rbx
  add    %r14,%rbx
  mov    %rbx,%rax
  sub    %rbp,%rax
  sub    %rdx,%rax
  cmp    %r12,%rax
  cmova  %r12,%rax
  mov    %rax,%rdx
  test   %rax,%rax
  jne    L402
L324:
  cmp    %r8,0x10(%rsp)
  jae    L274
  cmp    0x40(%rsp),%r14
  jbe    L601
  cmp    0x48(%rsp),%r14
  jbe    L601
L274:
  mov    0x10(%rsp),%rdx
  cmp    %rdx,%r12
  jbe    L559
  mov    %rdx,%rcx
  mov    %r12,%rax
  xor    %edx,%edx
  mov    %rbx,%r14
  div    %rcx
  sub    %r12,%r14
  sub    $0x1,%rbx
  mov    %rax,0x28(%rsp)
  cmp    %r14,0x40(%rsp)
  jae    L222
  cmp    %r14,0x48(%rsp)
  jb     L559
L222:
  cmp    %rbx,0x40(%rsp)
  jbe    L323
  cmp    %rbx,0x48(%rsp)
  jbe    L323
L559:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L350:
  jne    L161
  mov    0x1c(%rsp),%ecx
  mov    0x10(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  add    %r12,%rbp
  call   <swapfunc@plt>
  movl   $0x1,0x8(%rsp)
L161:
  add    %r12,%r13
  cmp    %rbx,%r13
  jb     L508
L37:
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   *%r15
  test   %eax,%eax
  jns    L350
  mov    0x1c(%rsp),%ecx
  mov    0x10(%rsp),%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <swapfunc@plt>
  jmp    L577
  nopl   0x0(%rax,%rax,1)
L79:
  jne    L491
  mov    0x1c(%rsp),%esi
  test   %esi,%esi
  jne    L166
  mov    0x30(%rsp),%rcx
  mov    (%rbx),%rdx
  mov    (%rcx),%rax
  mov    %rdx,(%rcx)
  mov    %rax,(%rbx)
L242:
  mov    0x10(%rsp),%rdx
  add    %rdx,0x30(%rsp)
  movl   $0x1,0x8(%rsp)
L491:
  add    0x10(%rsp),%rbx
  mov    %rbx,0x20(%rsp)
  jmp    L101
L210:
  mov    0x10(%rsp),%rax
  mov    0x28(%rsp),%rbp
  imul   %rax,%rbp
  neg    %rax
  mov    %rax,%rbx
  add    %r14,%rbp
  cmp    0x38(%rsp),%rbp
  jbe    L559
  mov    %rbp,0x8(%rsp)
  mov    0x10(%rsp),%r12
L561:
  mov    0x38(%rsp),%rbp
  cmp    %rbp,%r14
  jae    L233
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  je     L332
  jmp    L220
L348:
  mov    0x0(%r13),%rax
  mov    0x0(%r13,%rbx,1),%rsi
  mov    %rsi,0x0(%r13)
  mov    %rax,0x0(%r13,%rbx,1)
  cmp    %rbp,%r14
  jae    L233
L332:
  mov    %rbp,%r13
  sub    %r12,%rbp
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   *%r15
  test   %eax,%eax
  jg     L348
L233:
  add    %r12,0x38(%rsp)
  mov    0x38(%rsp),%rax
  cmp    %rax,0x8(%rsp)
  ja     L561
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L50:
  mov    0x1c(%rsp),%ecx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <swapfunc@plt>
  cmp    %r14,%rbp
  jbe    L233
L220:
  mov    %rbp,%r13
  add    %rbx,%rbp
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   *%r15
  test   %eax,%eax
  jg     L50
  jmp    L233
L166:
  mov    0x1c(%rsp),%ecx
  mov    0x10(%rsp),%rdx
  mov    %rbx,%rsi
  mov    0x30(%rsp),%rdi
  call   <swapfunc@plt>
  jmp    L242
L63:
  mov    0x1c(%rsp),%ecx
  mov    0x10(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <swapfunc@plt>
  jmp    L247
L402:
  mov    0x1c(%rsp),%ecx
  mov    0x20(%rsp),%rdi
  mov    %rbx,%rsi
  mov    %r8,0x8(%rsp)
  sub    %rax,%rsi
  call   <swapfunc@plt>
  mov    0x8(%rsp),%r8
  jmp    L324
L194:
  mov    0x20(%rsp),%rsi
  mov    0x1c(%rsp),%ecx
  mov    %r14,%rdi
  mov    %r8,0x8(%rsp)
  sub    %rax,%rsi
  call   <swapfunc@plt>
  mov    0x8(%rsp),%r8
  jmp    L133
L473:
  xor    %eax,%eax
  cmpq   $0x8,0x10(%rsp)
  setne  %al
  cmpq   $0x6,0x28(%rsp)
  mov    %eax,0x1c(%rsp)
  ja     L399
L361:
  mov    0x10(%rsp),%rdx
  mov    0x28(%rsp),%rax
  imul   %rdx,%rax
  lea    (%r14,%rdx,1),%rbp
  neg    %rdx
  mov    %rdx,%rbx
  add    %r14,%rax
  mov    %rax,0x20(%rsp)
  cmp    %rbp,%rax
  jbe    L559
  mov    %rbp,0x8(%rsp)
  mov    0x10(%rsp),%r12
L279:
  mov    0x8(%rsp),%rbp
  cmp    %r14,%rbp
  jbe    L121
  mov    0x1c(%rsp),%r8d
  test   %r8d,%r8d
  je     L553
  jmp    L362
  nopl   (%rax)
L232:
  mov    0x0(%r13),%rax
  mov    0x0(%r13,%rbx,1),%rsi
  mov    %rsi,0x0(%r13)
  mov    %rax,0x0(%r13,%rbx,1)
  cmp    %rbp,%r14
  jae    L121
L553:
  mov    %rbp,%r13
  sub    %r12,%rbp
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   *%r15
  test   %eax,%eax
  jg     L232
L121:
  add    %r12,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    %rax,0x20(%rsp)
  ja     L279
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L601:
  lea    -0x1(%r14,%r8,1),%rax
  cmp    0x40(%rsp),%rax
  jae    L289
  cmp    0x48(%rsp),%rax
  jb     L274
L289:
  mov    0x10(%rsp),%rdi
  mov    %r8,%rax
  xor    %edx,%edx
  mov    0x48(%rsp),%r9
  mov    0x40(%rsp),%r8
  mov    %r15,%rcx
  div    %rdi
  mov    %rdi,%rdx
  mov    %r14,%rdi
  mov    %rax,%rsi
  call   <_pqsort>
  jmp    L274
L320:
  mov    %rax,%rbx
  mov    %r15,%rcx
  mov    %r14,%rdi
  shr    $0x3,%rbx
  imul   0x10(%rsp),%rbx
  lea    (%r14,%rbx,2),%rdx
  lea    (%r14,%rbx,1),%rsi
  call   <med3@plt>
  mov    %rbp,%rdi
  mov    %rbx,%r8
  lea    0x0(%rbp,%rbx,1),%rdx
  neg    %r8
  mov    %rbp,%rsi
  sub    %rbx,%rdi
  mov    %r15,%rcx
  mov    %r8,0x8(%rsp)
  mov    %rax,%r12
  call   <med3@plt>
  mov    0x8(%rsp),%r8
  mov    %r13,%rdx
  mov    %r15,%rcx
  mov    %rax,%rbp
  lea    0x0(%r13,%r8,1),%rsi
  lea    (%rsi,%r8,1),%rdi
  call   <med3@plt>
  mov    %rax,%rdx
  jmp    L441
  cs nopw 0x0(%rax,%rax,1)
L445:
  mov    0x1c(%rsp),%ecx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <swapfunc@plt>
  cmp    %r14,%rbp
  jbe    L121
L362:
  mov    %rbp,%r13
  add    %rbx,%rbp
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   *%r15
  test   %eax,%eax
  jg     L445
  jmp    L121
```

assistant: ```c
void _pqsort(void *a, size_t n, size_t es, int (*cmp)(const void *, const void *), void *lrange, void *rrange) {
  char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
  size_t d, r;
  int swaptype, swap_cnt, cmp_result;
loop:
  swaptype = ((char *)a - (char *)0) % sizeof(long) || es % sizeof(long) ? 2 : es == sizeof(long) ? 0 : 1;
  ;
  swap_cnt = 0;
  if (n < 7) {
    for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
      for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0; pl -= es)
        if (swaptype == 0) {
          long t = *(long *)(void *)(pl);
          *(long *)(void *)(pl) = *(long *)(void *)(pl - es);
          *(long *)(void *)(pl - es) = t;
        } else
          swapfunc(pl, pl - es, es, swaptype);
    return;
  }
  pm = (char *)a + (n / 2) * es;
  if (n > 7) {
    pl = (char *)a;
    pn = (char *)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 *)(void *)(a);
    *(long *)(void *)(a) = *(long *)(void *)(pm);
    *(long *)(void *)(pm) = t;
  } else
    swapfunc(a, pm, es, swaptype);
  pa = pb = (char *)a + es;
  pc = pd = (char *)a + (n - 1) * es;
  for (;;) {
    while (pb <= pc && (cmp_result = cmp(pb, a)) <= 0) {
      if (cmp_result == 0) {
        swap_cnt = 1;
        if (swaptype == 0) {
          long t = *(long *)(void *)(pa);
          *(long *)(void *)(pa) = *(long *)(void *)(pb);
          *(long *)(void *)(pb) = t;
        } else
          swapfunc(pa, pb, es, swaptype);
        pa += es;
      }
      pb += es;
    }
    while (pb <= pc && (cmp_result = cmp(pc, a)) >= 0) {
      if (cmp_result == 0) {
        swap_cnt = 1;
        if (swaptype == 0) {
          long t = *(long *)(void *)(pc);
          *(long *)(void *)(pc) = *(long *)(void *)(pd);
          *(long *)(void *)(pd) = t;
        } else
          swapfunc(pc, pd, es, swaptype);
        pd -= es;
      }
      pc -= es;
    }
    if (pb > pc)
      break;
    if (swaptype == 0) {
      long t = *(long *)(void *)(pb);
      *(long *)(void *)(pb) = *(long *)(void *)(pc);
      *(long *)(void *)(pc) = t;
    } else
      swapfunc(pb, pc, es, swaptype);
    swap_cnt = 1;
    pb += es;
    pc -= es;
  }
  if (swap_cnt == 0) {
    for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
      for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0; pl -= es)
        if (swaptype == 0) {
          long t = *(long *)(void *)(pl);
          *(long *)(void *)(pl) = *(long *)(void *)(pl - es);
          *(long *)(void *)(pl - es) = t;
        } else
          swapfunc(pl, pl - es, es, swaptype);
    return;
  }
  pn = (char *)a + n * es;
  r = (pa - (char *)a) < (pb - pa) ? pa - (char *)a : pb - pa;
  if ((r) > 0)
    swapfunc((a), (pb - r), (size_t)(r), swaptype);
  r = ((size_t)(pd - pc)) < (pn - pd - es) ? (size_t)(pd - pc) : pn - pd - es;
  if ((r) > 0)
    swapfunc((pb), (pn - r), (size_t)(r), swaptype);
  if ((r = pb - pa) > es) {
    void *_l = a, *_r = ((unsigned char *)a) + r - 1;
    if (!((lrange < _l && rrange < _l) || (lrange > _r && rrange > _r)))
      _pqsort(a, r / es, es, cmp, lrange, rrange);
  }
  if ((r = pd - pc) > es) {
    void *_l, *_r;
    a = pn - r;
    n = r / es;
    _l = a;
    _r = ((unsigned char *)a) + r - 1;
    if (!((lrange < _l && rrange < _l) || (lrange > _r && rrange > _r)))
      goto loop;
  }
}
```