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

```asm
<qksort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %esi,0x4(%rsp)
  cmp    %r8d,%ecx
  jl     L52
L119:
  xor    %eax,%eax
L54:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L52:
  mov    %edx,%r15d
  mov    %ecx,%r12d
  mov    %r8d,%ebx
  mov    %r9,%r8
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %r15d,%esi
  mov    %rdi,%r13
  mov    %r9,%rbp
  call   <partition@plt>
  mov    %eax,%r14d
  test   %eax,%eax
  js     L70
  cmp    %eax,%r12d
  jl     L75
L246:
  add    $0x1,%r14d
  cmp    %ebx,%r14d
  jge    L119
  mov    %rbp,%r8
  mov    %ebx,%ecx
  mov    %r14d,%edx
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <partition@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L70
  cmp    %eax,%r14d
  jl     L120
L223:
  add    $0x1,%r12d
  cmp    %r12d,%ebx
  jle    L119
  mov    %rbp,%r8
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <partition@plt>
  mov    %eax,%r14d
  test   %eax,%eax
  js     L70
  mov    %r12d,%ecx
  mov    0x4(%rsp),%r12d
  mov    %rbp,%r9
  mov    %eax,%r8d
  mov    %r15d,%edx
  mov    %r13,%rdi
  mov    %r12d,%esi
  call   <qksort>
  test   %eax,%eax
  js     L70
  lea    0x1(%r14),%ecx
  mov    %rbp,%r9
  mov    %ebx,%r8d
  mov    %r15d,%edx
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <qksort>
  sar    $0x1f,%eax
  jmp    L54
  nopw   0x0(%rax,%rax,1)
L75:
  mov    %rbp,%r8
  mov    %eax,%ecx
  mov    %r12d,%edx
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <partition@plt>
  mov    %eax,%r10d
  test   %eax,%eax
  js     L70
  cmp    %eax,%r12d
  jl     L72
L176:
  lea    0x1(%r10),%r12d
  cmp    %r12d,%r14d
  jle    L246
  mov    %rbp,%r8
  mov    %r14d,%ecx
  mov    %r12d,%edx
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <partition@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  js     L70
  mov    %r12d,%ecx
  mov    0x4(%rsp),%r12d
  mov    %rbp,%r9
  mov    %r15d,%edx
  mov    %r13,%rdi
  mov    %eax,0x8(%rsp)
  mov    %r12d,%esi
  call   <qksort>
  test   %eax,%eax
  js     L70
  mov    0x8(%rsp),%r8d
  mov    %rbp,%r9
  mov    %r15d,%edx
  mov    %r12d,%esi
  mov    %r13,%rdi
  lea    0x1(%r8),%ecx
  mov    %r14d,%r8d
  call   <qksort>
  test   %eax,%eax
  jns    L246
  nopl   0x0(%rax)
L70:
  mov    $0xffffffff,%eax
  jmp    L54
  nopw   0x0(%rax,%rax,1)
L72:
  mov    %rbp,%r8
  mov    %eax,%ecx
  mov    %r12d,%edx
  mov    %r15d,%esi
  mov    %r13,%rdi
  mov    %eax,0xc(%rsp)
  call   <partition@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  js     L70
  mov    %r12d,%ecx
  mov    0x4(%rsp),%r12d
  mov    %rbp,%r9
  mov    %r15d,%edx
  mov    %r13,%rdi
  mov    %eax,0x8(%rsp)
  mov    %r12d,%esi
  call   <qksort>
  test   %eax,%eax
  js     L70
  mov    0x8(%rsp),%r8d
  mov    0xc(%rsp),%r10d
  mov    %rbp,%r9
  mov    %r15d,%edx
  mov    %r12d,%esi
  mov    %r13,%rdi
  lea    0x1(%r8),%ecx
  mov    %r10d,%r8d
  mov    %r10d,0x8(%rsp)
  call   <qksort>
  mov    0x8(%rsp),%r10d
  test   %eax,%eax
  jns    L176
  jmp    L70
  nopl   0x0(%rax,%rax,1)
L120:
  mov    %rbp,%r8
  mov    %eax,%ecx
  mov    %r14d,%edx
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <partition@plt>
  mov    %eax,%r8d
  test   %eax,%eax
  js     L70
  mov    %r14d,%ecx
  mov    0x4(%rsp),%r14d
  mov    %rbp,%r9
  mov    %r15d,%edx
  mov    %r13,%rdi
  mov    %eax,0x8(%rsp)
  mov    %r14d,%esi
  call   <qksort>
  test   %eax,%eax
  js     L70
  mov    0x8(%rsp),%r8d
  mov    %rbp,%r9
  mov    %r15d,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  lea    0x1(%r8),%ecx
  mov    %r12d,%r8d
  call   <qksort>
  test   %eax,%eax
  jns    L223
  jmp    L70
```

assistant: ```c
int qksort(void *data, int size, int esize, int i, int k, int (*compare)(const void *key1, const void *key2)) {
  int j;
  if (i < k) {
    if ((j = partition(data, esize, i, k, compare)) < 0)
      return -1;
    if (qksort(data, size, esize, i, j, compare) < 0)
      return -1;
    if (qksort(data, size, esize, j + 1, k, compare) < 0)
      return -1;
  }
  return 0;
}
```