user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<qsortx>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x218,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%esi
  jbe    L258
  mov    %edx,%r15d
  test   %edx,%edx
  je     L258
  sub    $0x1,%esi
  movl   $0x0,0x1c(%rsp)
  mov    %rdi,%r14
  mov    %rcx,%rbx
  imul   %edx,%esi
  lea    (%rdi,%rsi,1),%rax
  mov    %rax,0x8(%rsp)
  mov    %edx,%eax
  mov    %rax,0x10(%rsp)
  mov    %rax,%rbp
  neg    %rbp
  xchg   %ax,%ax
L207:
  mov    0x8(%rsp),%rsi
  mov    %rsi,%rax
  sub    %r14,%rax
  cqto
  idivq  0x10(%rsp)
  add    $0x1,%eax
  cmp    $0x8,%eax
  ja     L219
  mov    %rbx,%rcx
  mov    %r15d,%edx
  mov    %r14,%rdi
  call   <shortsort@plt>
L3:
  subl   $0x1,0x1c(%rsp)
  movslq 0x1c(%rsp),%rax
  cmp    $0xffffffff,%eax
  je     L258
  mov    0x20(%rsp,%rax,8),%r14
  mov    0x110(%rsp,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  jmp    L207
L258:
  mov    0x208(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L186
  add    $0x218,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L219:
  shr    %eax
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %r14,%r12
  imul   %r15d,%eax
  lea    (%r14,%rax,1),%rdi
  call   <swap@plt>
  mov    0x8(%rsp),%r13
  add    0x10(%rsp),%r13
  nopw   0x0(%rax,%rax,1)
L46:
  add    0x10(%rsp),%r12
  cmp    %r12,0x8(%rsp)
  jb     L143
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   *%rbx
  test   %eax,%eax
  jg     L143
  jmp    L46
  nopw   0x0(%rax,%rax,1)
L214:
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   *%rbx
  test   %eax,%eax
  js     L156
L143:
  add    %rbp,%r13
  cmp    %r13,%r14
  jb     L214
L156:
  cmp    %r13,%r12
  ja     L58
  mov    %r15d,%edx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <swap@plt>
  jmp    L46
  nopl   0x0(%rax)
L58:
  mov    %r15d,%edx
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <swap@plt>
  mov    0x10(%rsp),%rax
  mov    0x8(%rsp),%rdi
  lea    (%r14,%rax,1),%rsi
  mov    %rdi,%rdx
  lea    -0x1(%r13),%rax
  sub    %r14,%rax
  sub    %r12,%rdx
  cmp    %rdx,%rax
  jl     L234
  cmp    %rsi,%r13
  jbe    L91
  movslq 0x1c(%rsp),%rax
  lea    0x0(%r13,%rbp,1),%rcx
  mov    %r14,0x20(%rsp,%rax,8)
  mov    %rcx,0x110(%rsp,%rax,8)
  cmp    %r12,%rdi
  ja     L224
  mov    %rcx,0x8(%rsp)
  jmp    L207
L234:
  mov    0x8(%rsp),%rcx
  cmp    %r12,%rcx
  jbe    L177
  movslq 0x1c(%rsp),%rax
  mov    %r12,0x20(%rsp,%rax,8)
  mov    %rcx,0x110(%rsp,%rax,8)
  cmp    %rsi,%r13
  ja     L142
L225:
  mov    %r12,%r14
  jmp    L207
L177:
  cmp    %rsi,%r13
  jbe    L3
  lea    0x0(%r13,%rbp,1),%rax
  mov    %rax,0x8(%rsp)
  jmp    L207
L91:
  cmp    %r12,0x8(%rsp)
  jbe    L3
  jmp    L225
L142:
  lea    0x0(%r13,%rbp,1),%rax
  addl   $0x1,0x1c(%rsp)
  mov    %rax,0x8(%rsp)
  jmp    L207
L224:
  addl   $0x1,0x1c(%rsp)
  mov    %r12,%r14
  jmp    L207
L186:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void qsortx(void *base, unsigned num, unsigned width, int (*comp)(const void *, const void *)) {
  char *lo, *hi;
  char *mid;
  char *loguy, *higuy;
  unsigned size;
  char *lostk[30], *histk[30];
  int stkptr;
  if (num < 2 || width == 0)
    return;
  stkptr = 0;
  lo = base;
  hi = (char *)base + width * (num - 1);
recurse:
  size = (hi - lo) / width + 1;
  if (size <= 8) {
    shortsort(lo, hi, width, comp);
  } else {
    mid = lo + (size / 2) * width;
    swap(mid, lo, width);
    loguy = lo;
    higuy = hi + width;
    for (;;) {
      do {
        loguy += width;
      } while (loguy <= hi && comp(loguy, lo) <= 0);
      do {
        higuy -= width;
      } while (higuy > lo && comp(higuy, lo) >= 0);
      if (higuy < loguy)
        break;
      swap(loguy, higuy, width);
    }
    swap(lo, higuy, width);
    if (higuy - 1 - lo >= hi - loguy) {
      if (lo + width < higuy) {
        lostk[stkptr] = lo;
        histk[stkptr] = higuy - width;
        ++stkptr;
      }
      if (loguy < hi) {
        lo = loguy;
        goto recurse;
      }
    } else {
      if (loguy < hi) {
        lostk[stkptr] = loguy;
        histk[stkptr] = hi;
        ++stkptr;
      }
      if (lo + width < higuy) {
        hi = higuy - width;
        goto recurse;
      }
    }
  }
  --stkptr;
  if (stkptr >= 0) {
    lo = lostk[stkptr];
    hi = histk[stkptr];
    goto recurse;
  } else
    return;
}
```