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

```asm
<int_sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  cmp    $0x1,%esi
  je     L2
  mov    %rdi,%rbx
  mov    %esi,%r12d
  cmp    $0x2,%esi
  je     L219
  cmp    $0x3,%esi
  jne    L66
  mov    0x4(%rdi),%eax
  cmp    %eax,(%rdi)
  jg     L198
  cmp    0x8(%rdi),%eax
  jle    L2
L178:
  lea    0x8(%rbx),%rsi
  lea    0x4(%rbx),%rdi
  call   <swap@plt>
L211:
  mov    0x4(%rbx),%eax
  cmp    %eax,(%rbx)
  jle    L2
  lea    0x4(%rbx),%rsi
  mov    %rbx,%rdi
  call   <swap@plt>
  jmp    L2
L219:
  mov    (%rdi),%eax
  cmp    %eax,0x4(%rdi)
  jge    L2
  lea    0x4(%rdi),%rsi
  call   <swap@plt>
  jmp    L2
L198:
  lea    0x4(%rdi),%rsi
  call   <swap@plt>
  mov    0x8(%rbx),%eax
  cmp    %eax,0x4(%rbx)
  jle    L211
  jmp    L178
L66:
  mov    %rsp,%r14
  movslq %esi,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L122:
  cmp    %rdx,%rsp
  je     L46
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L122
L46:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L56
  orq    $0x0,-0x8(%rsp,%rax,1)
L56:
  mov    %rsp,%r13
  mov    %r12d,%r15d
  shr    $0x1f,%r15d
  add    %r12d,%r15d
  sar    %r15d
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <int_sort>
  mov    %r12d,%esi
  sub    %r15d,%esi
  movslq %r15d,%rax
  lea    (%rbx,%rax,4),%rdi
  call   <int_sort>
  test   %r12d,%r12d
  jle    L218
  mov    %r13,%rax
  mov    %r12d,%edx
  lea    0x0(%r13,%rdx,4),%rdi
  mov    %r15d,%edx
  mov    $0x0,%ecx
  jmp    L192
L197:
  movslq %ecx,%rsi
  mov    (%rbx,%rsi,4),%esi
  add    $0x1,%ecx
L124:
  mov    %esi,(%rax)
  add    $0x4,%rax
  cmp    %rdi,%rax
  je     L90
L192:
  cmp    %edx,%r12d
  je     L197
  cmp    %ecx,%r15d
  jle    L73
  movslq %ecx,%rsi
  movslq %edx,%r8
  mov    (%rbx,%r8,4),%r9d
  cmp    %r9d,(%rbx,%rsi,4)
  jl     L197
L73:
  movslq %edx,%rsi
  mov    (%rbx,%rsi,4),%esi
  add    $0x1,%edx
  jmp    L124
L90:
  mov    %r12d,%r12d
  mov    $0x0,%eax
L74:
  mov    0x0(%r13,%rax,4),%edx
  mov    %edx,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L74
L218:
  mov    %r14,%rsp
L2:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L77
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L77:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void int_sort(int *arr, int n) {
  if (n == 1) {
    return;
  } else if (n == 2) {
    if (arr[1] < arr[0]) {
      swap(&arr[0], &arr[1]);
    }
  } else if (n == 3) {
    if (arr[0] > arr[1])
      swap(&arr[0], &arr[1]);
    if (arr[1] > arr[2])
      swap(&arr[1], &arr[2]);
    if (arr[0] > arr[1])
      swap(&arr[0], &arr[1]);
  } else {
    int res[n];
    int_sort(arr, n / 2);
    int_sort(&arr[n / 2], n - n / 2);
    int i;
    int a = 0;
    int b = n / 2;
    for (i = 0; i < n; i++) {
      if (b == n || (a < n / 2 && arr[a] < arr[b])) {
        res[i] = arr[a];
        a++;
      } else {
        res[i] = arr[b];
        b++;
      }
    }
    for (i = 0; i < n; i++) {
      arr[i] = res[i];
    }
  }
}
```