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

```asm
<mergeSort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rsi,0x28(%rsp)
  mov    %rcx,0x20(%rsp)
  cmp    $0x1,%rsi
  jbe    L89
  mov    %rsi,%r13
  mov    %rsi,%rbx
  mov    %rdx,%r14
  mov    %rdi,%r12
  shr    %r13
  mov    %rcx,%r15
  mov    %r13,%rsi
  call   <mergeSort>
  mov    %r13,%r10
  mov    %rbx,%rsi
  mov    %r15,%rcx
  imul   %r14,%r10
  sub    %r13,%rsi
  mov    %r14,%rdx
  mov    %rsi,0x18(%rsp)
  lea    (%r12,%r10,1),%rdi
  mov    %r10,0x8(%rsp)
  call   <mergeSort>
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <calloc@plt>
  mov    0x8(%rsp),%r10
  test   %rax,%rax
  mov    %rax,0x10(%rsp)
  je     L33
L21:
  cmpq   $0x0,0x18(%rsp)
  je     L120
  xor    %ebp,%ebp
  xor    %ebx,%ebx
  xor    %esi,%esi
  xor    %r8d,%r8d
  jmp    L6
  nopl   0x0(%rax,%rax,1)
L122:
  mov    0x8(%rsp),%rsi
  add    $0x1,%ebp
  call   <memcpy@plt>
  movslq %ebx,%r8
  cmp    %r8,%r13
  jbe    L8
L83:
  movslq %ebp,%rsi
  cmp    %rsi,0x18(%rsp)
  jbe    L79
L6:
  add    %r13,%rsi
  imul   %r14,%r8
  mov    0x20(%rsp),%rax
  imul   %r14,%rsi
  lea    (%r12,%r8,1),%r15
  add    %r12,%rsi
  mov    %r15,%rdi
  mov    %rsi,0x8(%rsp)
  call   *%rax
  lea    0x0(%rbp,%rbx,1),%edi
  mov    %r14,%rdx
  movslq %edi,%rdi
  imul   %r14,%rdi
  add    0x10(%rsp),%rdi
  test   %eax,%eax
  jg     L122
  mov    %r15,%rsi
  add    $0x1,%ebx
  call   <memcpy@plt>
  movslq %ebx,%r8
  cmp    %r8,%r13
  ja     L83
L8:
  add    %ebp,%ebx
  mov    0x10(%rsp),%rax
  movslq %ebx,%rbx
  imul   %r14,%rbx
  lea    (%rax,%rbx,1),%rdi
  cmp    %r8,%r13
  jne    L30
  mov    0x18(%rsp),%rdx
  movslq %ebp,%rbp
  lea    (%r12,%rbx,1),%rsi
  sub    %rbp,%rdx
  imul   %r14,%rdx
  call   <memcpy@plt>
  jmp    L90
  nop
L79:
  mov    %r13,%r10
  lea    0x0(%rbp,%rbx,1),%edi
  sub    %r8,%r10
  imul   %r14,%r8
  movslq %edi,%rdi
  imul   %r14,%r10
  imul   %r14,%rdi
  add    0x10(%rsp),%rdi
  lea    (%r12,%r8,1),%rsi
L43:
  mov    %r10,%rdx
  call   <memcpy@plt>
L90:
  mov    0x28(%rsp),%rdx
  mov    0x10(%rsp),%rbx
  mov    %r12,%rdi
  imul   %r14,%rdx
  mov    %rbx,%rsi
  call   <memcpy@plt>
  mov    %rbx,%rdi
  call   <free@plt>
L89:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L30:
  sub    %r8,%r13
  imul   %r14,%r8
  mov    %r13,%r10
  imul   %r14,%r10
  lea    (%r12,%r8,1),%rsi
  jmp    L43
L120:
  mov    0x10(%rsp),%rdi
  mov    %r12,%rsi
  jmp    L43
L33:
  mov    D1(%rip),%rax
  mov    (%rax),%edi
  call   <exit@plt>
  mov    0x8(%rsp),%r10
  jmp    L21
```

assistant: ```c
void *mergeSort(void *base, size_t nmeb, size_t size, int (*compar)(const void *, const void *)) {
  if (nmeb < 2)
    return;
  mergeSort(base, nmeb / 2, size, compar);
  mergeSort(base + (nmeb / 2) * size, nmeb - nmeb / 2, size, compar);
  int i, j;
  void *hold;
  hold = calloc(nmeb, size);
  if (hold == NULL) {
    exit(EXIT_FAILURE);
  }
  i = j = 0;
  while (i < nmeb / 2 && j < nmeb - nmeb / 2) {
    if (compar(base + i * size, base + (nmeb / 2 + j) * size) > 0) {
      memcpy(hold + (i + j) * size, base + (nmeb / 2 + j) * size, size);
      ++j;
    } else {
      memcpy(hold + (i + j) * size, base + i * size, size);
      ++i;
    }
  }
  if (i == nmeb / 2) {
    memcpy(hold + (i + j) * size, base + (nmeb / 2 + j) * size, (nmeb - nmeb / 2 - j) * size);
  } else {
    memcpy(hold + (i + j) * size, base + i * size, (nmeb / 2 - i) * size);
  }
  memcpy(base, hold, nmeb * size);
  free(hold);
}
```