user: Please show me the C implementation that matches the assembly code listed below:

```asm
<quicksort_rec>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edx,0x20(%rsp)
  cmp    %esi,%edx
  jle    L169
  mov    %rcx,%rbx
  mov    %esi,%r15d
  mov    %rdi,%r14
  mov    %r8,%rbp
L177:
  mov    0x20(%rsp),%edx
  mov    %rbp,%r9
  mov    %rbx,%rcx
  mov    %r15d,%esi
  mov    %r14,%rdi
  lea    (%rdx,%r15,1),%eax
  mov    %eax,%r8d
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  call   <partition@plt>
  mov    %eax,0x24(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x14(%rsp)
  cmp    %r15d,%eax
  jle    L171
  mov    %rbp,%r12
  mov    %r14,%rbp
L23:
  mov    0x14(%rsp),%edx
  mov    %r12,%r9
  mov    %rbx,%rcx
  mov    %r15d,%esi
  mov    %rbp,%rdi
  lea    (%rdx,%r15,1),%eax
  mov    %eax,%r8d
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  call   <partition@plt>
  mov    %eax,0x28(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x18(%rsp)
  cmp    %r15d,%eax
  jle    L170
  mov    %r12,%rax
  mov    %rbp,%r12
  mov    %rax,%rbp
L59:
  mov    0x18(%rsp),%edx
  mov    %rbp,%r9
  mov    %rbx,%rcx
  mov    %r15d,%esi
  mov    %r12,%rdi
  lea    (%rdx,%r15,1),%eax
  mov    %eax,%r8d
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  call   <partition@plt>
  mov    %eax,0x2c(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x1c(%rsp)
  cmp    %r15d,%eax
  jle    L17
  mov    %rbp,%rax
  mov    %r15d,%r14d
  mov    %rbx,%rbp
  mov    %r12,%r15
  mov    %rax,%rbx
L35:
  mov    0x1c(%rsp),%edx
  mov    %rbx,%r9
  mov    %rbp,%rcx
  mov    %r14d,%esi
  mov    %r15,%rdi
  lea    (%rdx,%r14,1),%eax
  mov    %eax,%r8d
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  call   <partition@plt>
  lea    -0x1(%rax),%r12d
  mov    %eax,0x30(%rsp)
  cmp    %r14d,%r12d
  jle    L168
  mov    %r14d,%r13d
  mov    %r12d,%r14d
L101:
  lea    (%r14,%r13,1),%eax
  mov    %rbx,%r9
  mov    %rbp,%rcx
  mov    %r14d,%edx
  mov    %eax,%r8d
  mov    %r13d,%esi
  mov    %r15,%rdi
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  call   <partition@plt>
  lea    -0x1(%rax),%r12d
  mov    %eax,(%rsp)
  cmp    %r13d,%r12d
  jle    L42
  mov    %r14d,0x8(%rsp)
  mov    %r12d,0x4(%rsp)
L102:
  mov    0x4(%rsp),%edx
  mov    %rbx,%r9
  mov    %rbp,%rcx
  mov    %r13d,%esi
  mov    %r15,%rdi
  lea    (%rdx,%r13,1),%eax
  mov    %eax,%r8d
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  call   <partition@plt>
  mov    %eax,0xc(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x10(%rsp)
  cmp    %r13d,%eax
  jle    L123
L86:
  mov    0x10(%rsp),%edx
  mov    %rbx,%r9
  mov    %rbp,%rcx
  mov    %r13d,%esi
  mov    %r15,%rdi
  lea    (%rdx,%r13,1),%eax
  mov    %eax,%r8d
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  call   <partition@plt>
  lea    -0x1(%rax),%r14d
  mov    %eax,0x34(%rsp)
  cmp    %r13d,%r14d
  jle    L88
L55:
  lea    (%r14,%r13,1),%eax
  mov    %rbx,%r9
  mov    %rbp,%rcx
  mov    %r14d,%edx
  mov    %eax,%r8d
  mov    %r13d,%esi
  mov    %r15,%rdi
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  call   <partition@plt>
  lea    -0x1(%rax),%r10d
  mov    %eax,%r12d
  cmp    %r13d,%r10d
  jle    L112
L6:
  lea    (%r10,%r13,1),%eax
  mov    %r10d,%edx
  mov    %r13d,%esi
  mov    %rbx,%r9
  mov    %eax,%r8d
  mov    %rbp,%rcx
  mov    %r15,%rdi
  mov    %r10d,0x3c(%rsp)
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  call   <partition@plt>
  mov    %r13d,%esi
  mov    %rbx,%r8
  mov    %rbp,%rcx
  lea    -0x1(%rax),%edx
  mov    %r15,%rdi
  mov    %eax,0x38(%rsp)
  call   <quicksort_rec>
  mov    0x38(%rsp),%eax
  mov    0x3c(%rsp),%r10d
  lea    0x1(%rax),%r13d
  cmp    %r13d,%r10d
  jg     L6
L112:
  lea    0x1(%r12),%r13d
  cmp    %r13d,%r14d
  jg     L55
L88:
  mov    0x34(%rsp),%r13d
  add    $0x1,%r13d
  cmp    %r13d,0x10(%rsp)
  jg     L86
L123:
  mov    0xc(%rsp),%r13d
  add    $0x1,%r13d
  cmp    %r13d,0x4(%rsp)
  jg     L102
  mov    0x8(%rsp),%r14d
L42:
  mov    (%rsp),%r13d
  add    $0x1,%r13d
  cmp    %r13d,%r14d
  jg     L101
L168:
  mov    0x30(%rsp),%r14d
  add    $0x1,%r14d
  cmp    %r14d,0x1c(%rsp)
  jg     L35
  mov    %rbx,%rax
  mov    %r15,%r12
  mov    %rbp,%rbx
  mov    %rax,%rbp
L17:
  mov    0x2c(%rsp),%r15d
  add    $0x1,%r15d
  cmp    %r15d,0x18(%rsp)
  jg     L59
  mov    %rbp,%rax
  mov    %r12,%rbp
  mov    %rax,%r12
L170:
  mov    0x28(%rsp),%r15d
  add    $0x1,%r15d
  cmp    %r15d,0x14(%rsp)
  jg     L23
  mov    %rbp,%r14
  mov    %r12,%rbp
L171:
  mov    0x24(%rsp),%r15d
  add    $0x1,%r15d
  cmp    0x20(%rsp),%r15d
  jl     L177
L169:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void quicksort_rec(void *base, int begin, int end, size_t size, int (*compare)(const void *, const void *)) {
  int pivot, pivotIndex;
  if (begin < end) {
    pivotIndex = (begin + end) / 2;
    pivot = partition(base, begin, end, size, pivotIndex, compare);
    quicksort_rec(base, begin, pivot - 1, size, compare);
    quicksort_rec(base, pivot + 1, end, size, compare);
  }
}
```