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

```asm
<merge_sort>:
  endbr64
  cmp    %esi,%edi
  jl     L24
  ret
  nopl   0x0(%rax)
L24:
  lea    (%rdi,%rsi,1),%eax
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %eax,%r13d
  push   %r12
  shr    $0x1f,%r13d
  mov    %esi,%r12d
  push   %rbp
  add    %eax,%r13d
  mov    %edi,%ebp
  push   %rbx
  sar    %r13d
  sub    $0x18,%rsp
  cmp    %r13d,%edi
  jl     L55
  lea    0x1(%r13),%r15d
  cmp    %r12d,%r15d
  jl     L1
L75:
  add    $0x18,%rsp
  mov    %r14,%rcx
  mov    %r12d,%edx
  mov    %r13d,%esi
  pop    %rbx
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <merge@plt>
  nopw   0x0(%rax,%rax,1)
L55:
  lea    (%rdi,%r13,1),%eax
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  sar    %r15d
  cmp    %r15d,%edi
  jl     L52
L40:
  lea    0x1(%r15),%ebx
  cmp    %ebx,%r13d
  jg     L95
L103:
  mov    %r15d,%esi
  mov    %r14,%rcx
  mov    %r13d,%edx
  mov    %ebp,%edi
  call   <merge@plt>
  lea    0x1(%r13),%r15d
  cmp    %r12d,%r15d
  jge    L75
L1:
  lea    (%r15,%r12,1),%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  cmp    %ebx,%r15d
  jl     L29
L20:
  lea    0x1(%rbx),%r8d
  cmp    %r8d,%r12d
  jg     L123
L47:
  mov    %r14,%rcx
  mov    %r12d,%edx
  mov    %ebx,%esi
  mov    %r15d,%edi
  call   <merge@plt>
  jmp    L75
  nopl   0x0(%rax,%rax,1)
L52:
  lea    (%rdi,%r15,1),%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  sar    %ebx
  mov    %ebx,%esi
  call   <merge_sort>
  lea    0x1(%rbx),%edi
  mov    %r14,%rdx
  mov    %r15d,%esi
  call   <merge_sort>
  mov    %r14,%rcx
  mov    %r15d,%edx
  mov    %ebx,%esi
  mov    %ebp,%edi
  call   <merge@plt>
  jmp    L40
  cs nopw 0x0(%rax,%rax,1)
L123:
  lea    (%r12,%r8,1),%eax
  mov    %r8d,%edi
  mov    %r14,%rdx
  mov    %r8d,0xc(%rsp)
  mov    %eax,%r9d
  shr    $0x1f,%r9d
  add    %eax,%r9d
  sar    %r9d
  mov    %r9d,%esi
  mov    %r9d,0x8(%rsp)
  call   <merge_sort>
  mov    0x8(%rsp),%r9d
  mov    %r14,%rdx
  mov    %r12d,%esi
  lea    0x1(%r9),%edi
  call   <merge_sort>
  mov    0x8(%rsp),%esi
  mov    0xc(%rsp),%edi
  mov    %r14,%rcx
  mov    %r12d,%edx
  call   <merge@plt>
  jmp    L47
  nopl   (%rax)
L29:
  lea    (%r15,%rbx,1),%eax
  mov    %r14,%rdx
  mov    %r15d,%edi
  mov    %eax,%r8d
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  mov    %r8d,%esi
  mov    %r8d,0x8(%rsp)
  call   <merge_sort>
  mov    0x8(%rsp),%r8d
  mov    %r14,%rdx
  mov    %ebx,%esi
  lea    0x1(%r8),%edi
  call   <merge_sort>
  mov    0x8(%rsp),%esi
  mov    %r14,%rcx
  mov    %ebx,%edx
  mov    %r15d,%edi
  call   <merge@plt>
  jmp    L20
  nopl   (%rax)
L95:
  lea    0x0(%r13,%rbx,1),%eax
  mov    %r14,%rdx
  mov    %ebx,%edi
  mov    %eax,%r8d
  shr    $0x1f,%r8d
  add    %eax,%r8d
  sar    %r8d
  mov    %r8d,%esi
  mov    %r8d,0x8(%rsp)
  call   <merge_sort>
  mov    0x8(%rsp),%r8d
  mov    %r14,%rdx
  mov    %r13d,%esi
  lea    0x1(%r8),%edi
  call   <merge_sort>
  mov    0x8(%rsp),%esi
  mov    %r14,%rcx
  mov    %r13d,%edx
  mov    %ebx,%edi
  call   <merge@plt>
  jmp    L103
```

assistant: ```c
void merge_sort(int p, int r, int *arr) {
  if (p < r) {
    int q = (p + r) / 2;
    merge_sort(p, q, arr);
    merge_sort(q + 1, r, arr);
    merge(p, q, r, arr);
  }
}
```