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

```asm
<qsort_int>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x228,%rsp
  mov    %rdi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x10(%rsp)
  lea    -0x1(%rsi),%eax
  mov    %eax,0x14(%rsp)
  movl   $0x1,0x8(%rsp)
  jmp    L30
L9:
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  idiv   %r12d
  lea    (%rdx,%r13,1),%eax
  cltq
  mov    0x0(%rbp,%rax,4),%esi
  jmp    L99
L50:
  mov    %ecx,(%r12)
  mov    %r11d,(%rdi)
  mov    %r10d,%ebx
  sub    $0x1,%edx
  cmp    %edx,%r10d
  jg     L104
L62:
  add    $0x4,%r8
  add    $0x1,%r10d
  add    $0x1,%r9d
L117:
  mov    %r9d,%ebx
  mov    %r8,%r12
  mov    (%r8),%r11d
  cmp    %esi,%r11d
  jl     L62
  movslq %edx,%rax
  lea    0x0(%rbp,%rax,4),%rdi
  mov    (%rdi),%ecx
  cmp    %ecx,%esi
  jge    L92
  lea    -0x4(%rbp,%rax,4),%rax
L22:
  sub    $0x1,%edx
  mov    %rax,%rdi
  sub    $0x4,%rax
  mov    0x4(%rax),%ecx
  cmp    %esi,%ecx
  jg     L22
L92:
  cmp    %edx,%ebx
  jle    L50
L104:
  cmp    %edx,%r13d
  jge    L1
  movslq %r14d,%r14
  mov    %edx,0x14(%rsp,%r14,8)
  mov    0x8(%rsp),%r14d
L1:
  mov    %r14d,0x8(%rsp)
  cmp    %ebx,%r15d
  jle    L10
  movslq %r14d,%rax
  mov    %ebx,0x10(%rsp,%rax,8)
  mov    %r15d,0x14(%rsp,%rax,8)
  lea    0x1(%r14),%eax
  mov    %eax,0x8(%rsp)
  jmp    L10
L116:
  mov    %r14d,0x8(%rsp)
L10:
  cmpl   $0x0,0x8(%rsp)
  jle    L130
L30:
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%r14d
  movslq %r14d,%rax
  mov    0x10(%rsp,%rax,8),%r13d
  mov    0x14(%rsp,%rax,8),%r15d
  mov    %r15d,%r12d
  sub    %r13d,%r12d
  add    $0x1,%r12d
  cmp    $0x1,%r12d
  jle    L116
  cmp    $0xf,%r12d
  jle    L9
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  idiv   %r12d
  lea    (%rdx,%r13,1),%eax
  cltq
  mov    0x0(%rbp,%rax,4),%ebx
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  idiv   %r12d
  lea    (%rdx,%r13,1),%eax
  cltq
  mov    0x0(%rbp,%rax,4),%eax
  mov    %eax,0xc(%rsp)
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  idiv   %r12d
  lea    (%rdx,%r13,1),%eax
  cltq
  mov    0xc(%rsp),%edi
  cmp    %edi,%ebx
  mov    %edi,%esi
  cmovge %ebx,%esi
  mov    0x0(%rbp,%rax,4),%eax
  cmp    %eax,%esi
  cmovg  %eax,%esi
L99:
  movslq %r13d,%rax
  lea    0x0(%rbp,%rax,4),%r8
  mov    %r13d,%r9d
  lea    0x1(%r13),%r10d
  mov    %r15d,%edx
  jmp    L117
L130:
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  add    $0x228,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L36:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void qsort_int(int v[], const size_t n) {
  int stack[64][2];
  int l, r, i, j, p;
  stack[0][0] = 0;
  stack[0][1] = n - 1;
  int depth = 1;
  int selements[3];
PARTITION:
  --depth;
  l = stack[depth][0];
  r = stack[depth][1];
  int psize = r - l + 1;
  if (psize < 2)
    goto NEXT_PARTITION;
  if (psize >= 16) {
    selements[0] = v[l + rand() % psize];
    selements[1] = v[l + rand() % psize];
    selements[2] = v[l + rand() % psize];
    if (selements[0] > selements[1]) {
      int t = selements[0];
      selements[0] = selements[1];
      selements[1] = t;
    };
    if (selements[1] > selements[2]) {
      int t = selements[1];
      selements[1] = selements[2];
      selements[2] = t;
    };
    if (selements[0] > selements[2]) {
      int t = selements[0];
      selements[0] = selements[2];
      selements[2] = t;
    };
    p = selements[1];
  } else
    p = v[l + rand() % psize];
  i = l;
  j = r;
  do {
    while (v[i] < p)
      ++i;
    while (v[j] > p)
      --j;
    if (i <= j) {
      {
        int t = v[i];
        v[i] = v[j];
        v[j] = t;
      };
      ++i;
      --j;
    }
  } while (i <= j);
  if (l < j) {
    stack[depth][0] = l;
    stack[depth][1] = j;
    depth++;
  }
  if (i < r) {
    stack[depth][0] = i;
    stack[depth][1] = r;
    depth++;
  }
NEXT_PARTITION:
  if (depth > 0)
    goto PARTITION;
}
```