user: Demonstrate the C code that generates the assembly output below:

```asm
<int_sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  cmp    $0x1,%esi
  je     L53
  mov    %rdi,%r12
  mov    %esi,%ebx
  cmp    $0x2,%esi
  je     L48
  cmp    $0x3,%esi
  jne    L222
  mov    0x4(%rdi),%eax
  cmp    %eax,(%rdi)
  jg     L79
  lea    0x4(%rdi),%r13
  cmp    0x8(%rdi),%eax
  jle    L53
L162:
  lea    0x8(%r12),%rsi
  mov    %r13,%rdi
  call   <swap@plt>
  mov    0x4(%r12),%eax
L217:
  cmp    %eax,(%r12)
  jle    L53
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <swap@plt>
  nopl   0x0(%rax,%rax,1)
L53:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L187
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L222:
  movslq %esi,%rax
  mov    %rsp,%rcx
  mov    %rsp,%r15
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  and    $0xfffffffffffffff0,%rdx
  sub    %rax,%rcx
L32:
  cmp    %rcx,%rsp
  je     L55
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L32
  nopl   0x0(%rax,%rax,1)
L48:
  mov    (%rdi),%eax
  cmp    %eax,0x4(%rdi)
  jge    L53
  lea    0x4(%rdi),%rsi
  call   <swap@plt>
  jmp    L53
  nopw   0x0(%rax,%rax,1)
L79:
  lea    0x4(%rdi),%r13
  mov    %r13,%rsi
  call   <swap@plt>
  mov    0x4(%r12),%eax
  cmp    0x8(%r12),%eax
  jle    L217
  jmp    L162
  nopl   0x0(%rax)
L55:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L87
L2:
  mov    %ebx,%r8d
  mov    %r12,%rdi
  mov    %rsp,%r14
  shr    $0x1f,%r8d
  add    %ebx,%r8d
  sar    %r8d
  mov    %r8d,%esi
  mov    %r8d,-0x44(%rbp)
  call   <int_sort>
  movslq -0x44(%rbp),%rax
  mov    %ebx,%esi
  sub    %eax,%esi
  lea    (%r12,%rax,4),%rdi
  call   <int_sort>
  test   %ebx,%ebx
  mov    -0x44(%rbp),%r8d
  jle    L196
  lea    -0x1(%rbx),%r9d
  mov    %ebx,%r13d
  mov    %r8d,%edx
  mov    $0x1,%eax
  xor    %ecx,%ecx
  nopl   0x0(%rax,%rax,1)
L151:
  cmp    %edx,%ebx
  jne    L200
  movslq %ecx,%rsi
  mov    (%r12,%rsi,4),%esi
L221:
  mov    %esi,-0x4(%r14,%rax,4)
  add    $0x1,%ecx
  mov    %eax,%esi
  cmp    %rax,%r13
  je     L106
  add    $0x1,%rax
  cmp    %edx,%ebx
  je     10a0 <int_sort.cold>
L200:
  movslq %edx,%rsi
  mov    (%r12,%rsi,4),%edi
  cmp    %ecx,%r8d
  jle    L27
  movslq %ecx,%rsi
  mov    (%r12,%rsi,4),%esi
  cmp    %edi,%esi
  jl     L221
L27:
  mov    %edi,-0x4(%r14,%rax,4)
  add    $0x1,%edx
  cmp    %rax,%r13
  je     L106
  add    $0x1,%rax
  jmp    L151
L106:
  lea    0x0(,%r13,4),%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
L196:
  mov    %r15,%rsp
  jmp    L53
  nopl   0x0(%rax,%rax,1)
L87:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L2
L187:
  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];
    }
  }
}
```