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,0x18(%rsp)
  mov    %r8,0x40(%rsp)
  mov    %r9,0x48(%rsp)
L484:
  mov    0x18(%rsp),%rax
  movl   $0x2,0x8(%rsp)
  or     %r14,%rax
  test   $0x7,%al
  je     L308
  cmpq   $0x6,0x28(%rsp)
  jbe    L130
L74:
  mov    0x28(%rsp),%rax
  mov    0x18(%rsp),%rcx
  mov    %rax,%rbp
  lea    -0x1(%rax),%r8
  shr    %rbp
  imul   %rcx,%r8
  imul   %rcx,%rbp
  lea    (%r14,%r8,1),%r13
  add    %r14,%rbp
  cmp    $0x7,%rax
  je     L513
  mov    %r13,%rdx
  mov    %r14,%r12
  cmp    $0x28,%rax
  ja     L280
L181:
  mov    %rbp,%rsi
  mov    %r15,%rcx
  mov    %r12,%rdi
  call   <med3@plt>
  mov    %rax,%rbp
L513:
  mov    0x8(%rsp),%edi
  test   %edi,%edi
  jne    L355
  mov    (%r14),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,(%r14)
  mov    %rax,0x0(%rbp)
L369:
  mov    0x18(%rsp),%rcx
  lea    (%r14,%rcx,1),%rax
  mov    %rax,0x38(%rsp)
  cmp    %rax,%r13
  jb     L465
  mov    %rax,0x30(%rsp)
  neg    %rcx
  mov    %rax,%rbx
  mov    %r13,%rbp
  movl   $0x0,0x10(%rsp)
  mov    %rcx,%r12
  nopl   0x0(%rax)
L380:
  mov    %rbx,0x20(%rsp)
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   *%r15
  test   %eax,%eax
  jg     L68
  jmp    L75
  nop
L144:
  mov    0x0(%r13),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,0x0(%r13)
  mov    %rax,0x0(%rbp)
L419:
  movl   $0x1,0x10(%rsp)
  add    %r12,%rbp
L128:
  add    %r12,%r13
L68:
  cmp    %rbx,%r13
  jb     L407
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   *%r15
  test   %eax,%eax
  js     L478
  jne    L128
  mov    0x8(%rsp),%ecx
  test   %ecx,%ecx
  je     L144
  mov    0x8(%rsp),%ecx
  mov    0x18(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <swapfunc@plt>
  jmp    L419
L478:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jne    L490
  mov    (%rbx),%rax
  mov    0x0(%r13),%rdx
  mov    %rdx,(%rbx)
  mov    %rax,0x0(%r13)
L80:
  add    0x18(%rsp),%rbx
  movl   $0x1,0x10(%rsp)
  add    %r12,%r13
  mov    %rbx,0x20(%rsp)
L164:
  cmp    %rbx,%r13
  jae    L380
L407:
  mov    0x10(%rsp),%edx
  test   %edx,%edx
  je     L465
  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    L30
L453:
  mov    0x18(%rsp),%rcx
  mov    0x28(%rsp),%rbx
  mov    %rbp,%r12
  sub    %r13,%r12
  imul   %rcx,%rbx
  add    %r14,%rbx
  mov    %rbx,%rax
  sub    %rbp,%rax
  sub    %rcx,%rax
  cmp    %r12,%rax
  cmova  %r12,%rax
  mov    %rax,%rdx
  test   %rax,%rax
  jne    L519
L542:
  cmp    %r8,0x18(%rsp)
  jae    L237
  cmp    0x40(%rsp),%r14
  jbe    L521
  cmp    0x48(%rsp),%r14
  jbe    L521
L237:
  mov    0x18(%rsp),%rcx
  cmp    %rcx,%r12
  jbe    L98
  mov    %r12,%rax
  xor    %edx,%edx
  mov    %rbx,%r14
  sub    $0x1,%rbx
  div    %rcx
  sub    %r12,%r14
  mov    %rax,0x28(%rsp)
  cmp    %r14,0x40(%rsp)
  jae    L344
  cmp    %r14,0x48(%rsp)
  jb     L98
L344:
  cmp    %rbx,0x40(%rsp)
  jbe    L484
  cmp    %rbx,0x48(%rsp)
  jbe    L484
L98:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L490:
  mov    0x8(%rsp),%ecx
  mov    0x18(%rsp),%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <swapfunc@plt>
  jmp    L80
  nopl   0x0(%rax)
L75:
  jne    L69
  mov    0x8(%rsp),%esi
  test   %esi,%esi
  jne    L93
  mov    0x30(%rsp),%rcx
  mov    (%rbx),%rdx
  mov    (%rcx),%rax
  mov    %rdx,(%rcx)
  mov    %rax,(%rbx)
L381:
  mov    0x18(%rsp),%rcx
  add    %rcx,0x30(%rsp)
  movl   $0x1,0x10(%rsp)
L69:
  add    0x18(%rsp),%rbx
  mov    %rbx,0x20(%rsp)
  jmp    L164
L465:
  mov    0x18(%rsp),%rax
  mov    0x28(%rsp),%rbp
  imul   %rax,%rbp
  neg    %rax
  mov    %rax,%rbx
  add    %r14,%rbp
  cmp    0x38(%rsp),%rbp
  jbe    L98
  mov    0x8(%rsp),%r13d
  mov    0x18(%rsp),%r12
  mov    %rbp,0x10(%rsp)
  mov    %r14,0x8(%rsp)
L487:
  mov    0x38(%rsp),%rax
  cmp    %rax,0x8(%rsp)
  jae    L216
  mov    %rax,%rbp
  jmp    L202
  nopw   0x0(%rax,%rax,1)
L527:
  mov    (%r14),%rax
  mov    (%r14,%rbx,1),%rdx
  mov    %rdx,(%r14)
  mov    %rax,(%r14,%rbx,1)
  cmp    %rbp,0x8(%rsp)
  jae    L216
L202:
  mov    %rbp,%r14
  sub    %r12,%rbp
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   *%r15
  test   %eax,%eax
  jle    L216
  test   %r13d,%r13d
  je     L527
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <swapfunc@plt>
  cmp    %rbp,0x8(%rsp)
  jb     L202
L216:
  add    %r12,0x38(%rsp)
  mov    0x38(%rsp),%rax
  cmp    %rax,0x10(%rsp)
  ja     L487
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L93:
  mov    0x8(%rsp),%ecx
  mov    0x18(%rsp),%rdx
  mov    %rbx,%rsi
  mov    0x30(%rsp),%rdi
  call   <swapfunc@plt>
  jmp    L381
L355:
  mov    0x8(%rsp),%ecx
  mov    0x18(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <swapfunc@plt>
  jmp    L369
L519:
  mov    0x8(%rsp),%ecx
  mov    0x20(%rsp),%rdi
  mov    %rbx,%rsi
  mov    %r8,0x10(%rsp)
  sub    %rax,%rsi
  call   <swapfunc@plt>
  mov    0x10(%rsp),%r8
  jmp    L542
L30:
  mov    0x20(%rsp),%rsi
  mov    0x8(%rsp),%ecx
  mov    %r14,%rdi
  mov    %r8,0x10(%rsp)
  sub    %rax,%rsi
  call   <swapfunc@plt>
  mov    0x10(%rsp),%r8
  jmp    L453
L308:
  xor    %eax,%eax
  cmpq   $0x8,0x18(%rsp)
  setne  %al
  cmpq   $0x6,0x28(%rsp)
  mov    %eax,0x8(%rsp)
  ja     L74
L130:
  mov    0x18(%rsp),%rcx
  mov    0x28(%rsp),%rax
  imul   %rcx,%rax
  lea    (%r14,%rcx,1),%rbp
  neg    %rcx
  mov    %rcx,%rbx
  add    %r14,%rax
  mov    %rax,0x20(%rsp)
  cmp    %rbp,%rax
  jbe    L98
  mov    0x8(%rsp),%r13d
  mov    0x18(%rsp),%r12
  mov    %rbp,0x10(%rsp)
  mov    %r14,0x8(%rsp)
L496:
  mov    0x10(%rsp),%rax
  mov    0x8(%rsp),%rcx
  cmp    %rcx,%rax
  jbe    L208
  mov    %rax,%rbp
  jmp    L81
  nopl   0x0(%rax,%rax,1)
L511:
  mov    (%r14),%rax
  mov    (%r14,%rbx,1),%rdx
  mov    %rdx,(%r14)
  mov    %rax,(%r14,%rbx,1)
  cmp    %rbp,0x8(%rsp)
  jae    L208
L81:
  mov    %rbp,%r14
  sub    %r12,%rbp
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   *%r15
  test   %eax,%eax
  jle    L208
  test   %r13d,%r13d
  je     L511
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <swapfunc@plt>
  cmp    %rbp,0x8(%rsp)
  jb     L81
L208:
  add    %r12,0x10(%rsp)
  mov    0x10(%rsp),%rax
  cmp    %rax,0x20(%rsp)
  ja     L496
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L521:
  lea    -0x1(%r14,%r8,1),%rax
  cmp    0x40(%rsp),%rax
  jae    L222
  cmp    0x48(%rsp),%rax
  jb     L237
L222:
  mov    0x18(%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    L237
L280:
  mov    %rax,%rbx
  mov    %r14,%rdi
  shr    $0x3,%rbx
  imul   %rcx,%rbx
  mov    %r15,%rcx
  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,0x10(%rsp)
  mov    %rax,%r12
  call   <med3@plt>
  mov    0x10(%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    L181
```

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