user: 请将以下的汇编代码转换成C语言代码:

```asm
<quicksort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    -0x34(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x34(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  imul   -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x38(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jle    L33
  mov    $0x0,%eax
  call   <rand@plt>
  mov    -0x38(%rbp),%edx
  mov    %edx,%ecx
  sub    -0x34(%rbp),%ecx
  cltd
  idiv   %ecx
  mov    -0x34(%rbp),%eax
  lea    (%rdx,%rax,1),%edi
  mov    -0x38(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <exch@plt>
L146:
  nop
L19:
  addl   $0x1,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  je     L13
  mov    -0x1c(%rbp),%eax
  cltq
  imul   -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rax
  mov    -0x40(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   *%rdx
  test   %eax,%eax
  js     L19
  jmp    L13
L117:
  mov    -0x18(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  je     L22
L13:
  subl   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  imul   -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rax
  mov    -0x40(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%rdx
  test   %eax,%eax
  js     L117
  jmp    L83
L22:
  nop
L83:
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jge    L80
  mov    -0x18(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <exch@plt>
  mov    -0x1c(%rbp),%eax
  cltq
  imul   -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rax
  mov    -0x40(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   *%rdx
  test   %eax,%eax
  jne    L60
  addl   $0x1,-0x14(%rbp)
  mov    -0x1c(%rbp),%ecx
  mov    -0x14(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <exch@plt>
L60:
  mov    -0x18(%rbp),%eax
  cltq
  imul   -0x30(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rax
  mov    -0x40(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%rdx
  test   %eax,%eax
  jne    L146
  subl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%ecx
  mov    -0x18(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <exch@plt>
  jmp    L146
L80:
  nop
  mov    -0x38(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <exch@plt>
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  addl   $0x1,-0x1c(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L144
L118:
  mov    -0x18(%rbp),%ecx
  mov    -0xc(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <exch@plt>
  addl   $0x1,-0xc(%rbp)
  subl   $0x1,-0x18(%rbp)
L144:
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L118
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L30
L150:
  mov    -0xc(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <exch@plt>
  subl   $0x1,-0xc(%rbp)
  addl   $0x1,-0x1c(%rbp)
L30:
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jg     L150
  mov    -0x40(%rbp),%rdi
  mov    -0x18(%rbp),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <quicksort>
  mov    -0x40(%rbp),%rdi
  mov    -0x38(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <quicksort>
  jmp    L35
L33:
  nop
L35:
  leave
  ret
```

assistant: ```c
void quicksort(char *base, size_t size, ssize_t l, ssize_t r, int (*compar)(const void *, const void *)) {
  ssize_t i = l - 1, j = r, p = l - 1, q = r, k;
  char *v = base + r * size;
  if (r <= l)
    return;
  exch(base, size, l + (rand() % (r - l)), r);
  for (;;) {
    while (++i != r && compar(base + i * size, v) < 0)
      ;
    while (compar(v, base + (--j) * size) < 0)
      if (j == l)
        break;
    if (i >= j)
      break;
    exch(base, size, i, j);
    if (compar(base + i * size, v) == 0)
      exch(base, size, ++p, i);
    if (compar(v, base + j * size) == 0)
      exch(base, size, j, --q);
  }
  exch(base, size, i, r);
  j = i - 1;
  ++i;
  for (k = l; k < p; k++, j--)
    exch(base, size, k, j);
  for (k = r - 1; k > q; k--, i++)
    exch(base, size, i, k);
  quicksort(base, size, l, j, compar);
  quicksort(base, size, i, r, compar);
}
```