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

```asm
<mergeSort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r14
  mov    %esi,%ebp
  mov    %edx,%r15d
  mov    %ecx,%ebx
  mov    %ecx,0xc(%rsp)
  lea    D18(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r15d,%r13d
  mov    %ebp,0x8(%rsp)
  sub    %ebp,%r13d
  sub    %r15d,%ebx
  mov    %ebx,%edx
  mov    %r13d,%esi
  lea    D16(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x0(,%r13,4),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  lea    0x0(,%rbx,4),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %r13d,%r13d
  jle    L84
  mov    %r12,%rax
  mov    %r13d,%edx
  lea    (%r12,%rdx,4),%rsi
  movslq 0x8(%rsp),%rdx
  lea    (%r14,%rdx,4),%rcx
  sub    %r12,%rcx
L19:
  mov    (%rcx,%rax,1),%edx
  mov    %edx,(%rax)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L19
L84:
  test   %ebx,%ebx
  jle    L16
  mov    %rbp,%rax
  mov    %ebx,%edx
  lea    0x0(%rbp,%rdx,4),%rsi
  movslq %r15d,%r15
  lea    (%r14,%r15,4),%rcx
  sub    %rbp,%rcx
L91:
  mov    (%rcx,%rax,1),%edx
  mov    %edx,(%rax)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L91
  mov    %r13d,%esi
  mov    %r12,%rdi
  call   <printArray@plt>
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <printArray@plt>
  mov    0xc(%rsp),%r15d
  sub    0x8(%rsp),%r15d
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <printArray@plt>
  test   %r13d,%r13d
  jle    L40
  mov    %r14,%rsi
  mov    $0x1,%eax
  mov    $0x0,%ecx
  mov    $0x0,%edx
  jmp    L50
L127:
  add    $0x1,%ecx
  mov    %eax,%r9d
  mov    %edi,(%rsi)
L139:
  add    $0x1,%eax
  add    $0x4,%rsi
  cmp    %r13d,%edx
  jge    L100
  cmp    %ebx,%ecx
  jge    L100
L50:
  movslq %edx,%rdi
  mov    (%r12,%rdi,4),%r8d
  movslq %ecx,%rdi
  mov    0x0(%rbp,%rdi,4),%edi
  cmp    %edi,%r8d
  jge    L127
  add    $0x1,%edx
  mov    %eax,%r9d
  mov    %r8d,(%rsi)
  jmp    L139
L40:
  mov    $0x0,%ecx
  mov    $0x0,%r9d
  jmp    L24
L16:
  mov    %r13d,%esi
  mov    %r12,%rdi
  call   <printArray@plt>
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <printArray@plt>
  mov    0xc(%rsp),%r15d
  sub    0x8(%rsp),%r15d
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <printArray@plt>
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%r9d
L100:
  cmp    %edx,%r13d
  jle    L24
  movslq %edx,%r10
  lea    (%r12,%r10,4),%rax
  mov    %edx,%r8d
  lea    -0x1(%r13),%esi
  sub    %edx,%esi
  lea    (%rsi,%r10,1),%rdx
  lea    0x4(%r12,%rdx,4),%rdi
  movslq %r9d,%rdx
  sub    %r10,%rdx
  lea    (%r14,%rdx,4),%rsi
  sub    %r12,%rsi
L79:
  mov    (%rax),%edx
  mov    %edx,(%rsi,%rax,1)
  add    $0x4,%rax
  cmp    %rdi,%rax
  jne    L79
  add    %r13d,%r9d
  sub    %r8d,%r9d
L24:
  cmp    %ecx,%ebx
  jle    L36
  movslq %ecx,%rdx
  lea    0x0(%rbp,%rdx,4),%rax
  sub    $0x1,%ebx
  sub    %ecx,%ebx
  add    %rdx,%rbx
  lea    0x4(%rbp,%rbx,4),%rsi
  neg    %rdx
  shl    $0x2,%rdx
  sub    %rbp,%rdx
  movslq %r9d,%r9
  lea    (%rdx,%r9,4),%rcx
  add    %r14,%rcx
L124:
  mov    (%rax),%edx
  mov    %edx,(%rcx,%rax,1)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L124
L36:
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <printArray@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: tag: D18
datatype: string
name: parse_data
arguments: tag: D16
datatype: string

tool: D18: low = %d mid=%d high=%d 


tool: D16: n1 = %d n2=%d


assistant: ```c
int mergeSort(int *arr, int low, int mid, int high) {
  printf("low = %d mid=%d high=%d \n", low, mid, high);
  int n1 = mid - low;
  int n2 = high - mid;
  printf("n1 = %d n2=%d\n", n1, n2);
  int *a = (int *)malloc(n1 * sizeof(int));
  int *b = (int *)malloc(n2 * sizeof(int));
  int i, j, k, temp;
  j = low;
  for (i = 0; i < n1; i++) {
    a[i] = arr[j++];
  }
  j = mid;
  for (i = 0; i < n2; i++) {
    b[i] = arr[mid + i];
  }
  printArray(a, n1);
  printArray(b, n2);
  printArray(arr, n1 + n2);
  i = 0, j = 0, k = 0;
  while (j < n1 && k < n2) {
    if (a[j] < b[k]) {
      arr[i++] = a[j++];
    } else {
      arr[i++] = b[k++];
    }
  }
  while (j < n1) {
    arr[i++] = a[j++];
  }
  while (k < n2) {
    arr[i++] = b[k++];
  }
  printArray(arr, n1 + n2);
  free(a);
  free(b);
}
```