user: What is the c source code of the assembly code below?

```asm
<merge_final>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %edx,-0x3c(%rbp)
  mov    %rcx,-0x48(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x3c(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x38(%rbp),%eax
  sub    -0x34(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x3c(%rbp)
  lea    0x1(%rax),%edx
  mov    -0x3c(%rbp),%eax
  add    $0x2,%eax
  imul   %edx,%eax
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x38(%rbp),%eax
  sub    -0x34(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x3c(%rbp)
  add    $0x1,%eax
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L76
L85:
  mov    -0x28(%rbp),%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,%eax
  test   %eax,%eax
  jne    L72
  cmpl   $0x0,-0x28(%rbp)
  je     L72
  mov    -0x20(%rbp),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  movl   $0x0,-0x24(%rbp)
L72:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x20(%rbp),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    (%rcx),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x24(%rbp)
  addl   $0x1,-0x28(%rbp)
L76:
  mov    -0x38(%rbp),%eax
  sub    -0x34(%rbp),%eax
  cmp    %eax,-0x28(%rbp)
  jle    L85
  mov    -0x20(%rbp),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  movl   $0x0,-0x28(%rbp)
  jmp    L18
L73:
  movl   $0x0,-0x24(%rbp)
  jmp    L59
L3:
  mov    -0x24(%rbp),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x1c(%rbp)
  jle    L45
  mov    -0x24(%rbp),%eax
  imul   -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x18(%rbp)
L45:
  addl   $0x1,-0x24(%rbp)
L59:
  mov    -0x24(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jle    L3
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  addl   $0x1,-0x28(%rbp)
L18:
  mov    -0x38(%rbp),%eax
  sub    -0x34(%rbp),%eax
  cmp    %eax,-0x28(%rbp)
  jle    L73
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void merge_final(int p, int r, int k, int *arr) {
  int i, j = 0, l = 0, *ptrs, buff = INT_MAX, buffI = 0;
  int *dList, n = k + 2;
  dList = calloc(((r - p + 1) / k + 1) * (k + 2), sizeof(int));
  ptrs = calloc((r - p + 1) / k + 1, sizeof(int));
  for (i = 0; i < (r - p + 1); i++) {
    if (i % k == 0 && (i != 0)) {
      dList[l * n + j] = INT_MAX;
      l++;
      ptrs[l] = 0;
      j = 0;
    }
    dList[l * n + j] = arr[i];
    j++;
  }
  dList[l * n + j] = INT_MAX;
  for (i = 0; i < (r - p + 1); i++) {
    for (j = 0; j <= l; j++) {
      if (dList[j * n + ptrs[j]] < buff) {
        buff = dList[j * n + ptrs[j]];
        buffI = j;
      }
    }
    arr[i] = buff;
    ptrs[buffI]++;
    buff = INT_MAX;
  }
  free(dList);
  free(ptrs);
}
```