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

```asm
<merge>:
  endbr64
  push   %r15
  sub    %rdx,%rcx
  push   %r14
  mov    %rdx,%r14
  mov    %rcx,%r15
  push   %r13
  sub    %rsi,%r14
  push   %r12
  add    $0x1,%r14
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  lea    0x0(,%r14,8),%rsi
  mov    %rsi,%rdi
  sub    $0x28,%rsp
  mov    %rdx,0x18(%rsp)
  mov    %rsi,0x10(%rsp)
  call   <malloc@plt>
  lea    0x0(,%r15,8),%rdi
  mov    %rdi,0x8(%rsp)
  mov    %rax,%r13
  call   <malloc@plt>
  test   %r14,%r14
  mov    0x8(%rsp),%rdi
  mov    0x10(%rsp),%rsi
  mov    0x18(%rsp),%rdx
  mov    %rax,%r12
  je     L15
  lea    0x0(%rbp,%rbx,8),%r8
  mov    %r13,%rax
  lea    (%rsi,%r13,1),%r9
  sub    %r13,%r8
  nopl   (%rax)
L127:
  mov    (%r8,%rax,1),%rcx
  add    $0x8,%rax
  mov    %rcx,-0x8(%rax)
  cmp    %r9,%rax
  jne    L127
L15:
  test   %r15,%r15
  je     L35
  lea    0x0(%rbp,%rdx,8),%r8
  mov    %r12,%rax
  lea    (%rdi,%r12,1),%rcx
  sub    %r12,%r8
  nopl   0x0(%rax)
L25:
  mov    0x8(%r8,%rax,1),%rdx
  add    $0x8,%rax
  mov    %rdx,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L25
  xor    %edx,%edx
  test   %r14,%r14
  je     L57
  xor    %ecx,%ecx
  jmp    L42
  nopl   0x0(%rax)
L141:
  add    $0x1,%rcx
  mov    %rax,0x0(%rbp,%rbx,8)
  add    $0x1,%rbx
  cmp    %r14,%rcx
  jae    L89
L59:
  cmp    %r15,%rdx
  jae    L89
L42:
  mov    0x0(%r13,%rcx,8),%rax
  mov    (%r12,%rdx,8),%r8
  cmp    %r8,%rax
  jbe    L141
  mov    %r8,%rax
  add    $0x1,%rdx
  mov    %rax,0x0(%rbp,%rbx,8)
  add    $0x1,%rbx
  cmp    %r14,%rcx
  jb     L59
L89:
  cmp    %rcx,%r14
  jbe    L124
  lea    0x0(,%rcx,8),%r8
  lea    0x0(,%rbx,8),%r9
  add    %r13,%rsi
  sub    %r8,%r9
  lea    0x0(%r13,%r8,1),%rax
  sub    %r13,%r9
  add    %rbp,%r9
  nopl   0x0(%rax,%rax,1)
L23:
  mov    (%rax),%r8
  mov    %r8,(%r9,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rsi
  jne    L23
  add    %rbx,%r14
  mov    %r14,%rbx
  sub    %rcx,%rbx
L124:
  lea    (%rdi,%r12,1),%rcx
  cmp    %rdx,%r15
  jbe    L11
L57:
  shl    $0x3,%rdx
  lea    (%r12,%rdx,1),%rax
  neg    %rdx
  sub    %r12,%rdx
  lea    (%rdx,%rbx,8),%rdx
  add    %rdx,%rbp
  nopw   0x0(%rax,%rax,1)
L36:
  mov    (%rax),%rdx
  mov    %rdx,0x0(%rbp,%rax,1)
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L36
L11:
  mov    %r13,%rdi
  call   <free@plt>
  add    $0x28,%rsp
  mov    %r12,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <free@plt>
  nop
L35:
  xor    %edx,%edx
  xor    %ecx,%ecx
  jmp    L89
```

assistant: ```c
void merge(long long unsigned *arr, long long unsigned l, long long unsigned m, long long unsigned r) {
  long long unsigned i, j, k;
  long long unsigned n1 = m - l + 1;
  long long unsigned n2 = r - m;
  long long unsigned *L = (long long unsigned *)malloc(n1 * sizeof(long long unsigned));
  long long unsigned *R = (long long unsigned *)malloc(n2 * sizeof(long long unsigned));
  for (i = 0; i < n1; i++)
    L[i] = arr[l + i];
  for (j = 0; j < n2; j++)
    R[j] = arr[m + 1 + j];
  i = 0;
  j = 0;
  k = l;
  while (i < n1 && j < n2) {
    if (L[i] <= R[j]) {
      arr[k] = L[i];
      i++;
    } else {
      arr[k] = R[j];
      j++;
    }
    k++;
  }
  while (i < n1) {
    arr[k] = L[i];
    i++;
    k++;
  }
  while (j < n2) {
    arr[k] = R[j];
    j++;
    k++;
  }
  free(L);
  free(R);
}
```