user: Converte this assembly snippet into its equivalent C code:

```asm
<qsortUpInts>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,0xc(%rsp)
  mov    %rsi,%r12
  mov    %rdx,%r14
  lea    -0x1(%rdi),%r13d
  mov    $0x2,%ebp
  movl   $0x0,0x8(%rsp)
  jmp    L57
L36:
  sar    %eax
  mov    0x8(%rsp),%ebx
  add    %ebx,%eax
  movslq %ebx,%rdx
  lea    (%r12,%rdx,4),%r8
  mov    (%r8),%edx
  movslq %r13d,%rcx
  lea    (%r12,%rcx,4),%r15
  mov    (%r15),%ecx
  cmp    %ecx,%edx
  jle    L91
  mov    %ecx,(%r8)
  mov    %edx,(%r15)
L91:
  mov    (%r8),%edx
  cltq
  lea    (%r12,%rax,4),%rax
  mov    (%rax),%ecx
  cmp    %ecx,%edx
  jle    L53
  mov    %ecx,(%r8)
  mov    %edx,(%rax)
L53:
  mov    (%r15),%ecx
  mov    (%rax),%edx
  cmp    %edx,%ecx
  jle    L74
  mov    %ecx,(%rax)
  mov    %edx,(%r15)
L74:
  mov    (%r15),%esi
  mov    0x8(%rsp),%eax
  lea    -0x1(%rax),%r11d
  mov    %r13d,%edx
  jmp    L68
L107:
  add    $0x4,%r8
  mov    %r9d,%r11d
L68:
  lea    0x1(%r11),%r9d
  mov    %r8,%rbx
  mov    (%r8),%r10d
  cmp    %esi,%r10d
  jl     L107
  movslq %edx,%rax
  lea    -0x4(%r12,%rax,4),%rax
L24:
  sub    $0x1,%edx
  mov    %rax,%rdi
  sub    $0x4,%rax
  mov    0x4(%rax),%ecx
  cmp    %esi,%ecx
  jg     L24
  cmp    %edx,%r9d
  jge    L52
  mov    %ecx,(%rbx)
  mov    %r10d,(%rdi)
  jmp    L107
L52:
  mov    (%r15),%eax
  mov    %eax,(%rbx)
  mov    %r10d,(%r15)
  mov    %r9d,%edx
  mov    0x8(%rsp),%ebx
  sub    %ebx,%edx
  mov    %r13d,%eax
  sub    %r9d,%eax
  cmp    %eax,%edx
  jle    L95
  movslq %ebp,%rax
  mov    %ebx,(%r14,%rax,4)
  add    $0x2,%ebp
  mov    %r11d,0x4(%r14,%rax,4)
  lea    0x2(%r11),%eax
  mov    %eax,0x8(%rsp)
L6:
  test   %ebp,%ebp
  jle    L121
L57:
  mov    %r13d,%eax
  sub    0x8(%rsp),%eax
  cmp    $0xa,%eax
  jg     L36
  lea    -0x1(%rbp),%eax
  cltq
  mov    (%r14,%rax,4),%r13d
  sub    $0x2,%ebp
  mov    -0x4(%r14,%rax,4),%eax
  mov    %eax,0x8(%rsp)
  jmp    L6
L95:
  movslq %ebp,%rax
  lea    0x2(%r11),%edx
  mov    %edx,(%r14,%rax,4)
  add    $0x2,%ebp
  mov    %r13d,0x4(%r14,%rax,4)
  mov    %r11d,%r13d
  jmp    L6
L121:
  mov    %r12,%rsi
  mov    0xc(%rsp),%edi
  call   <insertUpInts@plt>
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void qsortUpInts(int n, int *array, int *stack) {
  register int i, j;
  int t, l, m, r, p;
  l = 0;
  r = n - 1;
  p = 2;
  while (p > 0)
    if ((r - l) > 10) {
      m = l + ((r - l) >> 1);
      if (array[l] > array[r]) {
        (t) = (array[l]);
        (array[l]) = (array[r]);
        (array[r]) = (t);
      };
      if (array[l] > array[m]) {
        (t) = (array[l]);
        (array[l]) = (array[m]);
        (array[m]) = (t);
      };
      if (array[r] > array[m]) {
        (t) = (array[m]);
        (array[m]) = (array[r]);
        (array[r]) = (t);
      };
      m = array[r];
      i = l - 1;
      j = r;
      for (;;) {
        while (array[++i] < m)
          ;
        while (array[--j] > m)
          ;
        if (i >= j)
          break;
        {
          (t) = (array[i]);
          (array[i]) = (array[j]);
          (array[j]) = (t);
        };
      }
      {
        (t) = (array[i]);
        (array[i]) = (array[r]);
        (array[r]) = (t);
      };
      if ((i - l) > (r - i)) {
        stack[p++] = l;
        stack[p++] = i - 1;
        l = i + 1;
      } else {
        stack[p++] = i + 1;
        stack[p++] = r;
        r = i - 1;
      }
    } else {
      r = stack[--p];
      l = stack[--p];
    }
  if (10 > 0)
    insertUpInts(n, array);
}
```