user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<_pqsort>:
  endbr64
  push   %r15
  xor    %eax,%eax
  mov    %rcx,%r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x48,%rsp
  test   %rdx,%rdx
  cmovle %rdx,%rax
  mov    %rdx,(%rsp)
  mov    %r8,0x28(%rsp)
  mov    %r9,0x30(%rsp)
  mov    %rax,0x38(%rsp)
L333:
  mov    (%rsp),%rax
  movl   $0x2,0xc(%rsp)
  or     %r13,%rax
  test   $0x7,%al
  je     L57
  cmp    $0x6,%rbx
  jbe    L5
L174:
  mov    (%rsp),%rax
  mov    %rbx,%rbp
  lea    -0x1(%rbx),%r8
  shr    %rbp
  imul   %rax,%rbp
  imul   %rax,%r8
  add    %r13,%rbp
  lea    0x0(%r13,%r8,1),%r14
  cmp    $0x7,%rbx
  je     L42
  mov    %r14,%rdx
  mov    %r13,%r12
  cmp    $0x28,%rbx
  ja     L21
L301:
  mov    %rbp,%rsi
  mov    %r15,%rcx
  mov    %r12,%rdi
  call   <med3@plt>
  mov    %rax,%rbp
L42:
  mov    0xc(%rsp),%ecx
  test   %ecx,%ecx
  jne    L168
  mov    0x0(%r13),%rax
  mov    0x0(%rbp),%rdx
  mov    %rdx,0x0(%r13)
  mov    %rax,0x0(%rbp)
L426:
  mov    (%rsp),%rcx
  imul   %rcx,%rbx
  lea    0x0(%r13,%rcx,1),%rax
  mov    %rax,0x18(%rsp)
  lea    0x0(%r13,%rbx,1),%rcx
  mov    %rcx,0x20(%rsp)
  cmp    %r14,%rax
  ja     L494
  mov    (%rsp),%r12
  mov    %rax,%rbx
  mov    %r14,%rbp
  neg    %r12
  nopl   0x0(%rax,%rax,1)
L70:
  mov    %rbx,0x10(%rsp)
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   *%r15
  test   %eax,%eax
  jle    L320
  cmp    0x10(%rsp),%r14
  jb     L166
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L96
  jmp    L395
  xchg   %ax,%ax
L257:
  jne    L515
  mov    0x0(%rbp),%rdx
  mov    (%r14),%rax
  mov    %rdx,(%r14)
  mov    %rax,0x0(%rbp)
  add    %r12,%rbp
L515:
  add    %r12,%r14
  cmp    %rbx,%r14
  jb     L72
L96:
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   *%r15
  test   %eax,%eax
  jns    L257
  mov    (%rbx),%rax
  mov    (%r14),%rdx
  mov    %rdx,(%rbx)
  mov    %rax,(%r14)
L392:
  mov    (%rsp),%rax
  add    %r12,%r14
  add    %rbx,%rax
  mov    %rax,0x10(%rsp)
L178:
  mov    %rax,%rbx
  cmp    %rax,%r14
  jae    L70
  mov    0x20(%rsp),%rdx
  mov    %rbp,%r12
  sub    0x18(%rsp),%rax
  sub    %r14,%r12
  sub    %rbp,%rdx
  sub    (%rsp),%rdx
  mov    %rax,%rbp
  cmp    %r12,%rdx
  cmova  %r12,%rdx
  mov    %rdx,%rbx
L122:
  mov    0x18(%rsp),%rdx
  sub    %r13,%rdx
  cmp    %rax,%rdx
  cmovg  %rax,%rdx
  test   %rdx,%rdx
  jne    L188
L211:
  test   %rbx,%rbx
  je     L467
  mov    0x20(%rsp),%rsi
  mov    0xc(%rsp),%ecx
  mov    %rbx,%rdx
  mov    0x10(%rsp),%rdi
  sub    %rbx,%rsi
  call   <swapfunc@plt>
L467:
  cmp    %rbp,(%rsp)
  jae    L402
  cmp    0x28(%rsp),%r13
  jbe    L145
  cmp    0x30(%rsp),%r13
  jbe    L145
L402:
  mov    (%rsp),%rdi
  cmp    %r12,%rdi
  jae    L270
  mov    %r12,%rax
  xor    %edx,%edx
  mov    0x20(%rsp),%rcx
  div    %rdi
  mov    %rcx,%r13
  sub    %r12,%r13
  mov    %rax,%rbx
  mov    %rcx,%rax
  sub    $0x1,%rax
  cmp    %r13,0x28(%rsp)
  jae    L118
  cmp    %r13,0x30(%rsp)
  jb     L270
L118:
  cmp    %rax,0x28(%rsp)
  jbe    L333
  cmp    %rax,0x30(%rsp)
  jbe    L333
L270:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L104:
  jne    L120
  mov    0xc(%rsp),%ecx
  mov    (%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  add    %r12,%rbp
  call   <swapfunc@plt>
L120:
  add    %r12,%r14
  cmp    %rbx,%r14
  jb     L72
L395:
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   *%r15
  test   %eax,%eax
  jns    L104
  mov    0xc(%rsp),%ecx
  mov    (%rsp),%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <swapfunc@plt>
  jmp    L392
  nopl   0x0(%rax)
L320:
  jne    L309
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  jne    L407
  mov    0x18(%rsp),%rcx
  mov    (%rbx),%rdx
  mov    (%rcx),%rax
  mov    %rdx,(%rcx)
  mov    %rax,(%rbx)
L59:
  mov    (%rsp),%rcx
  add    %rcx,0x18(%rsp)
L309:
  mov    (%rsp),%rax
  add    %rbx,%rax
  mov    %rax,0x10(%rsp)
  jmp    L178
L494:
  cmpq   $0x0,0x38(%rsp)
  je     L270
  mov    %rax,0x10(%rsp)
  mov    0x38(%rsp),%rdx
  xor    %ebp,%ebp
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  nopw   0x0(%rax,%rax,1)
L188:
  mov    0x10(%rsp),%rsi
  mov    0xc(%rsp),%ecx
  mov    %r13,%rdi
  sub    %rdx,%rsi
  call   <swapfunc@plt>
  jmp    L211
L407:
  mov    0xc(%rsp),%ecx
  mov    (%rsp),%rdx
  mov    %rbx,%rsi
  mov    0x18(%rsp),%rdi
  call   <swapfunc@plt>
  jmp    L59
L168:
  mov    0xc(%rsp),%ecx
  mov    (%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <swapfunc@plt>
  jmp    L426
L57:
  xor    %eax,%eax
  cmpq   $0x8,(%rsp)
  setne  %al
  mov    %eax,0xc(%rsp)
  cmp    $0x6,%rbx
  ja     L174
L5:
  mov    (%rsp),%rax
  imul   %rax,%rbx
  lea    0x0(%r13,%rax,1),%rbp
  neg    %rax
  lea    0x0(%r13,%rbx,1),%rcx
  mov    %rax,%rbx
  mov    %rcx,0x18(%rsp)
  cmp    %rbp,%rcx
  jbe    L270
  mov    %rbp,0x10(%rsp)
  mov    (%rsp),%r12
L58:
  mov    0x10(%rsp),%rbp
  cmp    %rbp,%r13
  jae    L495
  mov    0xc(%rsp),%esi
  test   %esi,%esi
  je     L477
  jmp    L278
  xchg   %ax,%ax
L508:
  mov    (%r14),%rax
  mov    (%r14,%rbx,1),%rsi
  mov    %rsi,(%r14)
  mov    %rax,(%r14,%rbx,1)
  cmp    %rbp,%r13
  jae    L495
L477:
  mov    %rbp,%r14
  sub    %r12,%rbp
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   *%r15
  test   %eax,%eax
  jg     L508
L495:
  add    %r12,0x10(%rsp)
  mov    0x10(%rsp),%rax
  cmp    %rax,0x18(%rsp)
  ja     L58
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L145:
  lea    -0x1(%r13,%rbp,1),%rax
  cmp    0x28(%rsp),%rax
  jae    L54
  cmp    0x30(%rsp),%rax
  jb     L402
L54:
  mov    (%rsp),%rdi
  mov    %rbp,%rax
  xor    %edx,%edx
  mov    0x30(%rsp),%r9
  mov    0x28(%rsp),%r8
  mov    %r15,%rcx
  div    %rdi
  mov    %rdi,%rdx
  mov    %r13,%rdi
  mov    %rax,%rsi
  call   <_pqsort>
  jmp    L402
L21:
  mov    %rbx,%r9
  mov    %r15,%rcx
  mov    %r13,%rdi
  shr    $0x3,%r9
  imul   %rax,%r9
  lea    0x0(%r13,%r9,2),%rdx
  lea    0x0(%r13,%r9,1),%rsi
  mov    %r9,0x10(%rsp)
  call   <med3@plt>
  mov    0x10(%rsp),%r9
  mov    %rbp,%rdi
  mov    %rbp,%rsi
  mov    %r15,%rcx
  mov    %rax,%r12
  mov    %r9,%r10
  lea    0x0(%rbp,%r9,1),%rdx
  sub    %r9,%rdi
  neg    %r10
  mov    %r10,0x10(%rsp)
  call   <med3@plt>
  mov    0x10(%rsp),%r10
  mov    %r14,%rdx
  mov    %r15,%rcx
  mov    %rax,%rbp
  lea    (%r14,%r10,1),%rsi
  lea    (%rsi,%r10,1),%rdi
  call   <med3@plt>
  mov    %rax,%rdx
  jmp    L301
  nopw   0x0(%rax,%rax,1)
L341:
  mov    0xc(%rsp),%ecx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <swapfunc@plt>
  cmp    %rbp,%r13
  jae    L495
L278:
  mov    %rbp,%r14
  add    %rbx,%rbp
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   *%r15
  test   %eax,%eax
  jg     L341
  jmp    L495
L72:
  mov    %rbx,%rax
L478:
  mov    0x20(%rsp),%rdx
  mov    %rbp,%r12
  sub    0x18(%rsp),%rax
  sub    %r14,%r12
  sub    %rbp,%rdx
  sub    (%rsp),%rdx
  mov    %rax,%rbp
  cmp    %r12,%rdx
  mov    %rdx,%rbx
  cmova  %r12,%rbx
  jmp    L122
L166:
  mov    0x10(%rsp),%rax
  jmp    L478
```

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, cmp_result;
loop:
  swaptype = ((char *)a - (char *)0) % sizeof(long) || es % sizeof(long) ? 2 : es == sizeof(long) ? 0 : 1;
  ;
  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) {
        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) {
        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);
    pb += es;
    pc -= es;
  }
  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;
  }
}
```