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

```asm
<MergeHalves>:
  endbr64
  lea    (%rsi,%rdx,1),%eax
  push   %r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %eax,%r13d
  push   %r12
  shr    $0x1f,%r13d
  mov    %edx,%r12d
  push   %rbp
  add    %eax,%r13d
  mov    %edx,%eax
  push   %rbx
  sub    %esi,%eax
  mov    %rdi,%rbx
  sar    %r13d
  lea    0x4(,%rax,4),%edi
  lea    0x1(%r13),%ebp
  sub    $0x18,%rsp
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %r14d,%eax
  cmp    %r13d,%r14d
  jg     L252
  cmp    %ebp,%r12d
  jl     L252
  mov    $0x1,%ecx
  movslq %r14d,%r10
  nop
L290:
  movslq %ebp,%r9
  mov    (%rbx,%r10,4),%r8d
  mov    %ecx,%edx
  mov    (%rbx,%r9,4),%esi
  cmp    %r8d,%esi
  jl     L247
L376:
  mov    %r8d,-0x4(%rdi,%rcx,4)
  add    $0x1,%eax
  add    $0x1,%rcx
  cmp    %ebp,%r12d
  jl     L250
  cmp    %eax,%r13d
  jl     L201
  movslq %eax,%r10
  mov    (%rbx,%r9,4),%esi
  mov    %ecx,%edx
  mov    (%rbx,%r10,4),%r8d
  cmp    %r8d,%esi
  jge    L376
L247:
  mov    %esi,-0x4(%rdi,%rcx,4)
  add    $0x1,%ebp
  add    $0x1,%rcx
  cmp    %eax,%r13d
  jl     L201
  cmp    %ebp,%r12d
  jge    L290
L250:
  cmp    %eax,%r13d
  jl     L201
  movslq %edx,%r9
  movslq %eax,%rsi
  mov    %r13d,%r10d
  lea    0x1(%rsi),%rcx
  shl    $0x2,%r9
  sub    %eax,%r10d
  lea    0x0(,%rcx,4),%r11
  lea    (%rdi,%r9,1),%r8
  mov    %rcx,0x8(%rsp)
  lea    (%rbx,%r11,1),%r15
  mov    %r8,%rcx
  sub    %r15,%rcx
  cmp    $0x8,%rcx
  jbe    L43
  cmp    $0x2,%r10d
  jbe    L43
  lea    0x1(%r10),%r9d
  lea    -0x4(%rbx,%r11,1),%r11
  xor    %ecx,%ecx
  mov    %r9d,%esi
  shr    $0x2,%esi
  shl    $0x4,%rsi
  nopl   0x0(%rax,%rax,1)
L302:
  movdqu (%r11,%rcx,1),%xmm0
  movups %xmm0,(%r8,%rcx,1)
  add    $0x10,%rcx
  cmp    %rsi,%rcx
  jne    L302
  mov    %r9d,%ecx
  and    $0xfffffffc,%ecx
  add    %ecx,%eax
  lea    (%rdx,%rcx,1),%esi
  cmp    %ecx,%r9d
  je     L154
  movslq %eax,%r9
  lea    0x1(%rsi),%r8d
  lea    0x1(%rax),%ecx
  movslq %esi,%rsi
  mov    (%rbx,%r9,4),%r9d
  mov    %r9d,(%rdi,%rsi,4)
  cmp    %ecx,%r13d
  jl     L154
  movslq %ecx,%rcx
  movslq %r8d,%rsi
  add    $0x2,%eax
  lea    0x0(,%rcx,4),%r9
  mov    (%rbx,%rcx,4),%ecx
  lea    0x0(,%rsi,4),%r8
  mov    %ecx,(%rdi,%rsi,4)
  cmp    %eax,%r13d
  jl     L154
  mov    0x4(%rbx,%r9,1),%eax
  mov    %eax,0x4(%rdi,%r8,1)
L154:
  lea    0x1(%rdx,%r10,1),%edx
L201:
  cmp    %ebp,%r12d
  jl     L78
  movslq %edx,%r9
  movslq %ebp,%rcx
  mov    %r12d,%r8d
  shl    $0x2,%r9
  lea    0x1(%rcx),%rax
  sub    %ebp,%r8d
  lea    (%rdi,%r9,1),%rsi
  lea    0x0(,%rax,4),%r10
  lea    (%rbx,%r10,1),%r13
  mov    %rsi,%r11
  sub    %r13,%r11
  cmp    $0x8,%r11
  jbe    L213
  cmp    $0x2,%r8d
  jbe    L213
  add    $0x1,%r8d
  lea    -0x4(%rbx,%r10,1),%r9
  xor    %eax,%eax
  mov    %r8d,%ecx
  shr    $0x2,%ecx
  shl    $0x4,%rcx
  nopl   (%rax)
L161:
  movdqu (%r9,%rax,1),%xmm1
  movups %xmm1,(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rcx
  jne    L161
  mov    %r8d,%eax
  and    $0xfffffffc,%eax
  add    %eax,%ebp
  add    %eax,%edx
  cmp    %eax,%r8d
  je     L78
  movslq %ebp,%rsi
  lea    0x1(%rdx),%ecx
  lea    0x1(%rbp),%eax
  movslq %edx,%rdx
  mov    (%rbx,%rsi,4),%esi
  mov    %esi,(%rdi,%rdx,4)
  cmp    %r12d,%eax
  jg     L78
  cltq
  movslq %ecx,%rdx
  add    $0x2,%ebp
  lea    0x0(,%rax,4),%rsi
  mov    (%rbx,%rax,4),%eax
  lea    0x0(,%rdx,4),%rcx
  mov    %eax,(%rdi,%rdx,4)
  cmp    %ebp,%r12d
  jl     L78
  mov    0x4(%rbx,%rsi,1),%eax
  mov    %eax,0x4(%rdi,%rcx,1)
L78:
  cmp    %r12d,%r14d
  jg     L54
  movslq %r14d,%rax
  lea    0x4(%rdi),%rdx
  mov    %r12d,%esi
  lea    (%rbx,%rax,4),%rcx
  sub    %r14d,%esi
  mov    %rcx,%rax
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L284
  cmp    $0x2,%esi
  jbe    L284
  add    $0x1,%esi
  xor    %eax,%eax
  mov    %esi,%edx
  shr    $0x2,%edx
  shl    $0x4,%rdx
  nopl   (%rax)
L238:
  movdqu (%rdi,%rax,1),%xmm2
  movups %xmm2,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L238
  mov    %esi,%edx
  and    $0xfffffffc,%edx
  lea    (%rdx,%r14,1),%eax
  cmp    %edx,%esi
  je     L54
  movslq %edx,%rdx
  mov    (%rdi,%rdx,4),%ecx
  movslq %eax,%rdx
  mov    %ecx,(%rbx,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %r12d,%edx
  jg     L54
  movslq %edx,%rcx
  sub    %r14d,%edx
  add    $0x2,%eax
  movslq %edx,%rdx
  lea    0x0(,%rcx,4),%rsi
  mov    (%rdi,%rdx,4),%edx
  mov    %edx,(%rbx,%rcx,4)
  cmp    %r12d,%eax
  jg     L54
  sub    %r14d,%eax
  cltq
  mov    (%rdi,%rax,4),%eax
  mov    %eax,0x4(%rbx,%rsi,1)
L54:
  call   <free@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L284:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L323:
  mov    (%rdi,%rax,4),%edx
  mov    %edx,(%rcx,%rax,4)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rdx,%rsi
  jne    L323
  jmp    L54
  nopl   0x0(%rax)
L43:
  mov    %rsi,%rax
  mov    0x8(%rsp),%rcx
  neg    %rax
  lea    (%r9,%rax,4),%r8
  add    %rdi,%r8
  jmp    L328
  nopl   0x0(%rax)
L308:
  add    $0x1,%rcx
L328:
  mov    (%rbx,%rsi,4),%eax
  mov    %eax,(%r8,%rsi,4)
  mov    %rcx,%rsi
  cmp    %ecx,%r13d
  jge    L308
  jmp    L154
L213:
  mov    %rcx,%rdx
  neg    %rdx
  lea    (%r9,%rdx,4),%rsi
  add    %rdi,%rsi
  jmp    L0
  nop
L77:
  add    $0x1,%rax
L0:
  mov    (%rbx,%rcx,4),%edx
  mov    %edx,(%rsi,%rcx,4)
  mov    %rax,%rcx
  cmp    %eax,%r12d
  jge    L77
  jmp    L78
  nopw   0x0(%rax,%rax,1)
L252:
  xor    %edx,%edx
  jmp    L250
```

assistant: ```c
int MergeHalves(int *Arr, int Low, int High) {
  int Mid = (Low + High) / 2;
  int i = Low, j = Mid + 1;
  int k = 0;
  int *Arr2 = malloc(sizeof(int) * (High - Low + 1));
  while ((i <= Mid) && (j <= High)) {
    if (Arr[i] <= Arr[j]) {
      Arr2[k++] = Arr[i++];
    } else {
      Arr2[k++] = Arr[j++];
    }
  }
  while (i <= Mid) {
    Arr2[k++] = Arr[i++];
  }
  while (j <= High) {
    Arr2[k++] = Arr[j++];
  }
  i = Low;
  while (i <= High) {
    Arr[i] = Arr2[i - Low];
    i++;
  }
  free(Arr2);
  return 0;
}
```