user: Please show me the C implementation that matches the assembly code listed below:

```asm
<merge>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r14
  mov    %rsi,%rbx
  mov    %rdx,0x18(%rsp)
  mov    %rdx,%r13
  sub    %rsi,%r13
  add    $0x1,%r13
  sub    %rdx,%rcx
  mov    %rcx,%r15
  lea    0x0(,%r13,8),%rax
  mov    %rax,0x8(%rsp)
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%rbp
  lea    0x0(,%r15,8),%rcx
  mov    %rcx,0x10(%rsp)
  mov    %rcx,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %r13,%r13
  je     L10
  mov    %rbp,%rax
  mov    0x8(%rsp),%rdi
  lea    (%rdi,%rbp,1),%rsi
  lea    (%r14,%rbx,8),%rcx
  sub    %rbp,%rcx
L103:
  mov    (%rcx,%rax,1),%rdx
  mov    %rdx,(%rax)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L103
  mov    %r15,%rdx
  mov    %r15,%rcx
  test   %r15,%r15
  je     L159
L66:
  mov    %r12,%rax
  mov    0x10(%rsp),%rdi
  lea    (%rdi,%r12,1),%rsi
  mov    0x18(%rsp),%rdi
  lea    (%r14,%rdi,8),%rcx
  sub    %r12,%rcx
L36:
  mov    0x8(%rcx,%rax,1),%rdx
  mov    %rdx,(%rax)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L36
  test   %r13,%r13
  je     L162
  mov    $0x0,%edx
  mov    $0x0,%ecx
  jmp    L134
L97:
  mov    %rax,(%r14,%rbx,8)
  add    $0x1,%rdx
L152:
  add    $0x1,%rbx
  cmp    %r13,%rcx
  jae    L64
  cmp    %r15,%rdx
  jae    L64
L134:
  mov    0x0(%rbp,%rcx,8),%rsi
  mov    (%r12,%rdx,8),%rax
  cmp    %rax,%rsi
  ja     L97
  mov    %rsi,(%r14,%rbx,8)
  add    $0x1,%rcx
  jmp    L152
L64:
  cmp    %r13,%rcx
  jae    L32
L159:
  lea    0x0(%rbp,%rcx,8),%rax
  mov    0x8(%rsp),%r8
  add    %rbp,%r8
  mov    %rbx,%rsi
  sub    %rcx,%rsi
  lea    (%r14,%rsi,8),%rdi
  sub    %rbp,%rdi
L11:
  mov    (%rax),%rsi
  mov    %rsi,(%rdi,%rax,1)
  add    $0x8,%rax
  cmp    %r8,%rax
  jne    L11
  add    %r13,%rbx
  sub    %rcx,%rbx
L32:
  cmp    %r15,%rdx
  jae    L128
  lea    (%r12,%rdx,8),%rax
  mov    0x10(%rsp),%rsi
  add    %r12,%rsi
  neg    %rdx
  shl    $0x3,%rdx
  sub    %r12,%rdx
  lea    (%rdx,%rbx,8),%rcx
  add    %r14,%rcx
L136:
  mov    (%rax),%rdx
  mov    %rdx,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rsi
  jne    L136
L128:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L162:
  mov    %r13,%rdx
  jmp    L32
L10:
  mov    %r15,%rdx
  test   %r15,%r15
  jne    L66
  jmp    L32
```

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);
}
```