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

```asm
<mergeSort>:
  endbr64
  cmp    %edx,%esi
  jl     L106
  ret
  nopl   0x0(%rax)
L106:
  lea    (%rsi,%rdx,1),%eax
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %eax,%r12d
  push   %rbp
  shr    $0x1f,%r12d
  mov    %esi,%ebp
  push   %rbx
  add    %eax,%r12d
  mov    %edx,%ebx
  sar    %r12d
  sub    $0x18,%rsp
  cmp    %r12d,%esi
  jl     L100
  lea    0x1(%r12),%r14d
  cmp    %ebx,%r14d
  jl     L30
L76:
  add    $0x18,%rsp
  mov    %ebx,%r8d
  mov    %r14d,%ecx
  mov    %r12d,%edx
  pop    %rbx
  mov    %ebp,%esi
  mov    %r13,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <mergeSortedArray@plt>
  nopl   (%rax)
L100:
  lea    (%rsi,%r12,1),%eax
  mov    %eax,%r14d
  shr    $0x1f,%r14d
  add    %eax,%r14d
  sar    %r14d
  cmp    %r14d,%esi
  jl     L75
L56:
  lea    0x1(%r14),%r15d
  cmp    %r15d,%r12d
  jg     L73
L70:
  mov    %r14d,%edx
  mov    %r12d,%r8d
  mov    %r15d,%ecx
  mov    %ebp,%esi
  mov    %r13,%rdi
  lea    0x1(%r12),%r14d
  call   <mergeSortedArray@plt>
  cmp    %ebx,%r14d
  jge    L76
L30:
  lea    (%r14,%rbx,1),%eax
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  sar    %r15d
  cmp    %r15d,%r14d
  jl     L40
L87:
  lea    0x1(%r15),%r9d
  cmp    %r9d,%ebx
  jg     L85
L58:
  mov    %ebx,%r8d
  mov    %r9d,%ecx
  mov    %r15d,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <mergeSortedArray@plt>
  jmp    L76
  nopl   0x0(%rax)
L75:
  lea    (%rsi,%r14,1),%eax
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  sar    %r15d
  mov    %r15d,%edx
  call   <mergeSort>
  lea    0x1(%r15),%ecx
  mov    %r14d,%edx
  mov    %r13,%rdi
  mov    %ecx,%esi
  mov    %ecx,0x4(%rsp)
  call   <mergeSort>
  mov    0x4(%rsp),%ecx
  mov    %r14d,%r8d
  mov    %r15d,%edx
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <mergeSortedArray@plt>
  jmp    L56
  nop
L85:
  lea    (%rbx,%r9,1),%eax
  mov    %r9d,%esi
  mov    %r13,%rdi
  mov    %r9d,0xc(%rsp)
  mov    %eax,%r10d
  shr    $0x1f,%r10d
  add    %eax,%r10d
  sar    %r10d
  mov    %r10d,%edx
  mov    %r10d,0x4(%rsp)
  call   <mergeSort>
  mov    0x4(%rsp),%r10d
  mov    %ebx,%edx
  mov    %r13,%rdi
  lea    0x1(%r10),%ecx
  mov    %r10d,0x8(%rsp)
  mov    %ecx,%esi
  mov    %ecx,0x4(%rsp)
  call   <mergeSort>
  mov    0xc(%rsp),%r9d
  mov    %ebx,%r8d
  mov    %r13,%rdi
  mov    0x4(%rsp),%ecx
  mov    0x8(%rsp),%edx
  mov    %r9d,%esi
  mov    %r9d,0x4(%rsp)
  call   <mergeSortedArray@plt>
  mov    0x4(%rsp),%r9d
  jmp    L58
  nopl   0x0(%rax)
L40:
  lea    (%r14,%r15,1),%eax
  mov    %r14d,%esi
  mov    %r13,%rdi
  mov    %eax,%r9d
  shr    $0x1f,%r9d
  add    %eax,%r9d
  sar    %r9d
  mov    %r9d,%edx
  mov    %r9d,0x4(%rsp)
  call   <mergeSort>
  mov    0x4(%rsp),%r9d
  mov    %r15d,%edx
  mov    %r13,%rdi
  lea    0x1(%r9),%ecx
  mov    %r9d,0x8(%rsp)
  mov    %ecx,%esi
  mov    %ecx,0x4(%rsp)
  call   <mergeSort>
  mov    0x4(%rsp),%ecx
  mov    0x8(%rsp),%edx
  mov    %r15d,%r8d
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <mergeSortedArray@plt>
  jmp    L87
  cs nopw 0x0(%rax,%rax,1)
L73:
  lea    (%r12,%r15,1),%eax
  mov    %r15d,%esi
  mov    %r13,%rdi
  mov    %eax,%r9d
  shr    $0x1f,%r9d
  add    %eax,%r9d
  sar    %r9d
  mov    %r9d,%edx
  mov    %r9d,0x4(%rsp)
  call   <mergeSort>
  mov    0x4(%rsp),%r9d
  mov    %r12d,%edx
  mov    %r13,%rdi
  lea    0x1(%r9),%ecx
  mov    %r9d,0x8(%rsp)
  mov    %ecx,%esi
  mov    %ecx,0x4(%rsp)
  call   <mergeSort>
  mov    0x4(%rsp),%ecx
  mov    0x8(%rsp),%edx
  mov    %r12d,%r8d
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <mergeSortedArray@plt>
  jmp    L70
```

assistant: ```c
void mergeSort(int *a, int beg, int end) {
  int mid;
  if (beg < end) {
    mid = (beg + end) / 2;
    mergeSort(a, beg, mid);
    mergeSort(a, mid + 1, end);
    mergeSortedArray(a, beg, mid, mid + 1, end);
  }
}
```