user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<merge>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %ecx,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L49
L9:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jg     L74
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x20(%rbp)
  jmp    L90
L74:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x1c(%rbp)
L90:
  addl   $0x1,-0x18(%rbp)
L49:
  mov    -0x20(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jg     L114
  mov    -0x1c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jle    L9
L114:
  mov    -0x1c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jle    L117
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L87
L127:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x18(%rbp)
  addl   $0x1,-0x14(%rbp)
L87:
  mov    -0x14(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jle    L127
  jmp    L122
L117:
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L48
L41:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x18(%rbp)
  addl   $0x1,-0x10(%rbp)
L48:
  mov    -0x10(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jle    L41
L122:
  movl   $0x0,-0xc(%rbp)
  jmp    L32
L14:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x2c(%rbp),%ecx
  mov    -0xc(%rbp),%edx
  add    %ecx,%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0xc(%rbp)
L32:
  mov    -0xc(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L14
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void merge(int a[], int left, int mid, int right) {
  int *temp = (int *)malloc((right - left + 1) * sizeof(int));
  int i = left;
  int j = mid + 1;
  int index = 0;
  while (i <= mid && j <= right) {
    if (a[i] <= a[j]) {
      temp[index] = a[i];
      i++;
    } else {
      temp[index] = a[j];
      j++;
    }
    index++;
  }
  if (j > right) {
    for (int k = i; k <= mid; k++) {
      temp[index] = a[k];
      index++;
    }
  } else {
    for (int k = j; k <= right; k++) {
      temp[index] = a[k];
      index++;
    }
  }
  for (int k = 0; k < index; k++) {
    a[left + k] = temp[k];
  }
  free(temp);
  return;
}
```