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

```asm
<sort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %esi,0x4(%rsp)
  mov    %edx,%ebp
  mov    %ecx,%ebx
  test   %ecx,%ecx
  jle    L10
  mov    $0x0,%r13d
L123:
  mov    $0x9,%edi
  call   <putchar@plt>
  add    $0x1,%r13d
  cmp    %r13d,%ebx
  jne    L123
L10:
  mov    %ebp,%edx
  mov    0x4(%rsp),%r14d
  mov    %r14d,%esi
  lea    D3(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    %ebp,%r14d
  je     L140
  lea    (%r14,%rbp,1),%eax
  mov    %eax,%r13d
  shr    $0x1f,%r13d
  add    %eax,%r13d
  sar    %r13d
  lea    0x1(%rbx),%r15d
  mov    %r15d,%ecx
  mov    %r13d,%edx
  mov    %r14d,0x4(%rsp)
  mov    %r14d,%esi
  mov    %r12,%rdi
  call   <sort>
  lea    0x1(%r13),%r14d
  mov    %r15d,%ecx
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %r12,%rdi
  call   <sort>
  mov    %ebp,%r15d
  sub    0x4(%rsp),%r15d
  lea    0x4(,%r15,4),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  cmp    %r13d,0x4(%rsp)
  jle    L111
  cmp    %ebp,%r14d
  jg     L183
L111:
  mov    0x8(%rsp),%rcx
  mov    %r14d,%edx
  mov    0x4(%rsp),%eax
  lea    0x1(%rbp),%r8d
  jmp    L174
L118:
  movslq %edx,%rsi
  mov    (%r12,%rsi,4),%esi
  mov    %esi,(%rcx)
  add    $0x1,%edx
L79:
  add    $0x4,%rcx
  cmp    %r13d,%eax
  jle    L174
  cmp    %edx,%ebp
  jl     L183
L174:
  cmp    %eax,%r14d
  je     L118
  cmp    %edx,%r8d
  je     L77
  movslq %eax,%rsi
  mov    (%r12,%rsi,4),%edi
  movslq %edx,%rsi
  mov    (%r12,%rsi,4),%esi
  cmp    %esi,%edi
  jge    L69
  mov    %edi,(%rcx)
  add    $0x1,%eax
  jmp    L79
L77:
  movslq %eax,%rsi
  mov    (%r12,%rsi,4),%esi
  mov    %esi,(%rcx)
  add    $0x1,%eax
  jmp    L79
L69:
  mov    %esi,(%rcx)
  add    $0x1,%edx
  jmp    L79
L183:
  mov    0x4(%rsp),%ecx
  cmp    %ebp,%ecx
  jg     L107
  mov    0x8(%rsp),%rdi
  mov    %rdi,%rax
  sub    %ecx,%ebp
  lea    0x4(%rdi,%rbp,4),%rsi
  movslq %ecx,%rdx
  lea    (%r12,%rdx,4),%rcx
  sub    %rdi,%rcx
L4:
  mov    (%rax),%edx
  mov    %edx,(%rcx,%rax,1)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L4
L107:
  test   %ebx,%ebx
  jle    L178
  mov    $0x0,%ebp
L47:
  mov    $0x9,%edi
  call   <putchar@plt>
  add    $0x1,%ebp
  cmp    %ebp,%ebx
  jne    L47
L178:
  test   %r15d,%r15d
  js     L115
  mov    0x8(%rsp),%rbp
  mov    $0x0,%ebx
  lea    D15(%rip),%r12
L190:
  mov    0x0(%rbp),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%ebx
  add    $0x4,%rbp
  cmp    %ebx,%r15d
  jge    L190
L115:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
L140:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_label: D3
type_guessed: string
name: parse_data
arguments: data_label: D15
type_guessed: string

tool: D3: MergeSort ( %i , %i )


tool: D15: %i || 

assistant: ```c
void sort(int *vetor, int posicaoInicio, int posicaoFim, int tabulacao) {
  int i, j, k, metadeTamanho, *vetorTemp;
  for (i = 0; i < tabulacao; i++)
    printf("\t");
  printf("MergeSort ( %i , %i )\n", posicaoInicio, posicaoFim);
  if (posicaoInicio == posicaoFim)
    return;
  metadeTamanho = (posicaoInicio + posicaoFim) / 2;
  sort(vetor, posicaoInicio, metadeTamanho, tabulacao + 1);
  sort(vetor, metadeTamanho + 1, posicaoFim, tabulacao + 1);
  i = posicaoInicio;
  j = metadeTamanho + 1;
  k = 0;
  vetorTemp = (int *)malloc(sizeof(int) * (posicaoFim - posicaoInicio + 1));
  while (i < metadeTamanho + 1 || j < posicaoFim + 1) {
    if (i == metadeTamanho + 1) {
      vetorTemp[k] = vetor[j];
      j++;
      k++;
    } else {
      if (j == posicaoFim + 1) {
        vetorTemp[k] = vetor[i];
        i++;
        k++;
      } else {
        if (vetor[i] < vetor[j]) {
          vetorTemp[k] = vetor[i];
          i++;
          k++;
        } else {
          vetorTemp[k] = vetor[j];
          j++;
          k++;
        }
      }
    }
  }
  for (i = posicaoInicio; i <= posicaoFim; i++) {
    vetor[i] = vetorTemp[i - posicaoInicio];
  }
  for (i = 0; i < tabulacao; i++)
    printf("\t");
  for (i = 0; i <= (posicaoFim - posicaoInicio); i++)
    printf("%i || ", vetorTemp[i]);
  printf("\n");
  free(vetorTemp);
}
```