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

```asm
<__merge>:
  endbr64
  push   %rbp
  movslq %esi,%r9
  mov    %rsp,%rbp
  push   %r15
  mov    %edx,%r15d
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    (%r9,%rdx,1),%eax
  mov    %rsp,%rcx
  mov    %eax,%r14d
  shr    $0x1f,%r14d
  add    %eax,%r14d
  mov    %edx,%eax
  sub    %r9d,%eax
  sar    %r14d
  add    $0x1,%eax
  lea    0x1(%r14),%ebx
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L97
L64:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L64
L97:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L124
L45:
  mov    %rsp,%r8
  mov    %r9d,%r12d
  cmp    %r14d,%r9d
  jg     L133
  cmp    %ebx,%r15d
  jl     L133
  mov    $0x1,%eax
  jmp    L41
  nopw   0x0(%rax,%rax,1)
L153:
  add    $0x1,%r12d
  mov    %edx,-0x4(%r8,%rax,4)
  mov    %eax,%ecx
  add    $0x1,%rax
  cmp    %r14d,%r12d
  jg     L53
L84:
  cmp    %r15d,%ebx
  jg     L99
L41:
  movslq %r12d,%rdx
  movslq %ebx,%rcx
  mov    0x0(%r13,%rdx,4),%edx
  mov    0x0(%r13,%rcx,4),%ecx
  cmp    %ecx,%edx
  jle    L153
  mov    %ecx,%edx
  add    $0x1,%ebx
  mov    %eax,%ecx
  mov    %edx,-0x4(%r8,%rax,4)
  add    $0x1,%rax
  cmp    %r14d,%r12d
  jle    L84
  xchg   %ax,%ax
L53:
  cmp    %r15d,%ebx
  jg     L18
L104:
  mov    %r15d,%r12d
  movslq %ecx,%rax
  mov    %r9d,-0x54(%rbp)
  sub    %ebx,%r12d
  lea    (%r8,%rax,4),%rdi
  cmp    %r15d,%ebx
  mov    %ecx,-0x50(%rbp)
  mov    %r12d,%eax
  mov    %r8,-0x48(%rbp)
  lea    0x4(,%rax,4),%rdx
  mov    $0x4,%eax
  cmovg  %rax,%rdx
  movslq %ebx,%rax
  lea    0x0(%r13,%rax,4),%rsi
  call   <memcpy@plt>
  xor    %eax,%eax
  cmp    %r15d,%ebx
  mov    -0x50(%rbp),%ecx
  cmovg  %eax,%r12d
  movslq -0x54(%rbp),%r9
  mov    -0x48(%rbp),%r8
  lea    0x1(%rcx,%r12,1),%ecx
L18:
  movslq %ecx,%rdx
  lea    0x0(%r13,%r9,4),%rdi
  mov    %r8,%rsi
  shl    $0x2,%rdx
  call   <memcpy@plt>
L20:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L42
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L99:
  cmp    %r14d,%r12d
  jg     L53
L163:
  mov    %r14d,%r10d
  movslq %ecx,%rax
  mov    %r9d,-0x58(%rbp)
  sub    %r12d,%r10d
  lea    (%r8,%rax,4),%rdi
  cmp    %r14d,%r12d
  mov    %ecx,-0x54(%rbp)
  mov    %r10d,%eax
  mov    %r8,-0x50(%rbp)
  lea    0x4(,%rax,4),%rdx
  mov    $0x4,%eax
  mov    %r10d,-0x48(%rbp)
  cmovg  %rax,%rdx
  movslq %r12d,%rax
  lea    0x0(%r13,%rax,4),%rsi
  call   <memcpy@plt>
  mov    -0x48(%rbp),%r10d
  xor    %eax,%eax
  cmp    %r14d,%r12d
  mov    -0x54(%rbp),%ecx
  movslq -0x58(%rbp),%r9
  cmovg  %eax,%r10d
  mov    -0x50(%rbp),%r8
  lea    0x1(%rcx,%r10,1),%ecx
  jmp    L53
  nopl   0x0(%rax,%rax,1)
L124:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L45
L133:
  xor    %ecx,%ecx
  cmp    %r14d,%r9d
  jle    L163
  cmp    %ebx,%r15d
  jge    L104
  jmp    L20
L42:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void __merge(int *a, int l, int r) {
  int m = (l + r) / 2;
  int i = l;
  int j = m + 1;
  int k = 0;
  int t[r - l + 1];
  while (i <= m && j <= r) {
    t[k++] = (a[i] <= a[j]) ? a[i++] : a[j++];
  }
  while (i <= m) {
    t[k++] = a[i++];
  }
  while (j <= r) {
    t[k++] = a[j++];
  }
  i = l;
  j = 0;
  while (j < k) {
    a[i++] = t[j++];
  }
}
```