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

```asm
<quick_sort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edx,0x24(%rsp)
  cmp    %esi,%edx
  jle    L171
  mov    %rdi,%r15
  mov    %esi,%r13d
L120:
  mov    0x24(%rsp),%edx
  mov    %r13d,%esi
  mov    %r15,%rdi
  call   <partition@plt>
  mov    %eax,0x28(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x18(%rsp)
  cmp    %r13d,%eax
  jle    L71
  mov    %r13d,%r14d
  mov    %r15,%r13
L108:
  mov    0x18(%rsp),%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <partition@plt>
  mov    %eax,0x2c(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x1c(%rsp)
  cmp    %r14d,%eax
  jle    L125
  mov    %r14d,%eax
  mov    %r13,%r14
  mov    %eax,%r13d
L11:
  mov    0x1c(%rsp),%edx
  mov    %r13d,%esi
  mov    %r14,%rdi
  call   <partition@plt>
  mov    %eax,0x30(%rsp)
  sub    $0x1,%eax
  mov    %eax,0x20(%rsp)
  cmp    %r13d,%eax
  jle    L48
L6:
  mov    0x20(%rsp),%edx
  mov    %r13d,%esi
  mov    %r14,%rdi
  call   <partition@plt>
  lea    -0x1(%rax),%r12d
  mov    %eax,0x34(%rsp)
  cmp    %r13d,%r12d
  jle    L22
L104:
  mov    %r12d,%edx
  mov    %r13d,%esi
  mov    %r14,%rdi
  call   <partition@plt>
  lea    -0x1(%rax),%ebx
  mov    %eax,%ebp
  cmp    %r13d,%ebx
  jle    L66
  mov    %r12d,0x8(%rsp)
  mov    %r13d,%r15d
  mov    %ebx,%ebp
  mov    %r14,%r13
  mov    %eax,%r14d
L87:
  mov    %ebp,%edx
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <partition@plt>
  lea    -0x1(%rax),%ebx
  mov    %eax,0x10(%rsp)
  cmp    %r15d,%ebx
  jle    L42
  mov    %ebp,0xc(%rsp)
  mov    %ebx,%ebp
  mov    %r13,%rbx
L70:
  mov    %ebp,%edx
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <partition@plt>
  lea    -0x1(%rax),%r13d
  mov    %eax,0x38(%rsp)
  cmp    %r15d,%r13d
  jle    L95
  mov    %ebp,0x14(%rsp)
  mov    %rbx,%rbp
  mov    %r13d,%ebx
L153:
  mov    %ebx,%edx
  mov    %r15d,%esi
  mov    %rbp,%rdi
  call   <partition@plt>
  lea    -0x1(%rax),%r13d
  mov    %eax,%r12d
  cmp    %r15d,%r13d
  jle    L29
  mov    %ebx,%r12d
  mov    %eax,%ecx
  mov    %r13d,%ebx
L106:
  mov    %r15d,%esi
  mov    %ebx,%edx
  mov    %rbp,%rdi
  mov    %ecx,0x3c(%rsp)
  call   <partition@plt>
  mov    %r15d,%esi
  mov    %rbp,%rdi
  mov    %eax,%r13d
  lea    -0x1(%rax),%edx
  call   <quick_sort>
  lea    0x1(%r13),%r15d
  mov    0x3c(%rsp),%ecx
  cmp    %r15d,%ebx
  jg     L106
  mov    %r12d,%ebx
  mov    %ecx,%r12d
L29:
  lea    0x1(%r12),%r15d
  cmp    %r15d,%ebx
  jg     L153
  mov    %rbp,%rbx
  mov    0x14(%rsp),%ebp
L95:
  mov    0x38(%rsp),%r15d
  add    $0x1,%r15d
  cmp    %r15d,%ebp
  jg     L70
  mov    0xc(%rsp),%ebp
  mov    %rbx,%r13
L42:
  mov    0x10(%rsp),%r15d
  add    $0x1,%r15d
  cmp    %r15d,%ebp
  jg     L87
  mov    0x8(%rsp),%r12d
  mov    %r14d,%ebp
  mov    %r13,%r14
L66:
  lea    0x1(%rbp),%r13d
  cmp    %r13d,%r12d
  jg     L104
L22:
  mov    0x34(%rsp),%r13d
  add    $0x1,%r13d
  cmp    %r13d,0x20(%rsp)
  jg     L6
L48:
  mov    0x30(%rsp),%r13d
  add    $0x1,%r13d
  cmp    %r13d,0x1c(%rsp)
  jg     L11
  mov    %r14,%r13
L125:
  mov    0x2c(%rsp),%r14d
  add    $0x1,%r14d
  cmp    %r14d,0x18(%rsp)
  jg     L108
  mov    %r13,%r15
L71:
  mov    0x28(%rsp),%r13d
  add    $0x1,%r13d
  cmp    0x24(%rsp),%r13d
  jl     L120
L171:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void quick_sort(int *A, int p, int r) {
  if (p < r) {
    int q = partition(A, p, r);
    quick_sort(A, p, q - 1);
    quick_sort(A, q + 1, r);
  }
}
```