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

```asm
<mergesort>:
  endbr64
  cmp    %rdx,%rsi
  jb     L328
  ret
  nopw   0x0(%rax,%rax,1)
L328:
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  lea    (%rsi,%rdx,1),%rbx
  shr    %rbx
  movslq %ebx,%r14
  add    $0x1,%ebx
  mov    %r14,%rdx
  movslq %ebx,%rbx
  call   <mergesort>
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <mergesort>
  mov    %r12d,%eax
  sub    %r13d,%eax
  lea    0x4(,%rax,4),%edi
  call   <xmalloc@plt>
  mov    %rax,%r8
  cmp    %r13,%r14
  jb     L166
  cmp    %r12,%rbx
  ja     L166
  mov    %rax,%rdx
  xor    %ecx,%ecx
  mov    %r13,%rax
  cs nopw 0x0(%rax,%rax,1)
L94:
  mov    0x0(%rbp,%rax,4),%edi
  mov    0x0(%rbp,%rbx,4),%esi
  cmp    %edi,%esi
  jl     L110
  add    $0x1,%rax
  mov    %edi,(%rdx)
  add    $0x1,%rcx
  add    $0x4,%rdx
  cmp    %rax,%r14
  jb     L78
  cmp    %rbx,%r12
  jae    L94
L18:
  mov    %rcx,%rsi
  jmp    L312
  nopl   0x0(%rax)
L110:
  add    $0x1,%rbx
  mov    %esi,(%rdx)
  add    $0x1,%rcx
  add    $0x4,%rdx
  cmp    %rbx,%r12
  jb     L18
  cmp    %rax,%r14
  jae    L94
L78:
  cmp    %rbx,%r12
  jb     L18
  mov    %r12,%rsi
  lea    (%r8,%rcx,4),%rdi
  lea    0x4(,%rbx,4),%r9
  sub    %rbx,%rsi
  mov    %rdi,%rdx
  cmp    $0x3,%rsi
  seta   %r11b
  cmp    $0xffffffffffffffff,%r12
  setne  %r10b
  test   %r10b,%r11b
  je     L329
  lea    0x0(%rbp,%r9,1),%r11
  mov    %rdi,%r10
  sub    %r11,%r10
  cmp    $0x8,%r10
  jbe    L329
  lea    0x1(%rsi),%rdi
  mov    %rbp,%r11
  lea    0x1(%rcx),%rsi
  movdqa D5(%rip),%xmm3
  movq   %rsi,%xmm7
  mov    %rdi,%r10
  movq   %rcx,%xmm1
  sub    %rdx,%r11
  shr    $0x2,%r10
  punpcklqdq %xmm7,%xmm1
  lea    -0x4(%r11,%r9,1),%r9
  xor    %esi,%esi
  movdqa D14(%rip),%xmm2
  nopw   0x0(%rax,%rax,1)
L34:
  movdqu (%rdx,%r9,1),%xmm5
  movdqa %xmm1,%xmm0
  add    $0x1,%rsi
  paddq  %xmm3,%xmm1
  paddq  %xmm2,%xmm0
  add    $0x10,%rdx
  movups %xmm5,-0x10(%rdx)
  cmp    %r10,%rsi
  jb     L34
  mov    %rdi,%rdx
  movhlps %xmm0,%xmm7
  and    $0xfffffffffffffffc,%rdx
  movq   %xmm7,%rsi
  add    %rdx,%rbx
  add    %rdx,%rcx
  cmp    %rdx,%rdi
  je     L312
  mov    0x0(%rbp,%rbx,4),%esi
  lea    0x1(%rbx),%r9
  lea    0x0(,%rbx,4),%rdi
  lea    0x0(,%rcx,4),%rdx
  mov    %esi,(%r8,%rcx,4)
  lea    0x1(%rcx),%rsi
  cmp    %r12,%r9
  ja     L312
  mov    0x4(%rbp,%rdi,1),%esi
  add    $0x2,%rbx
  mov    %esi,0x4(%r8,%rdx,1)
  lea    0x2(%rcx),%rsi
  cmp    %rbx,%r12
  jb     L312
  mov    0x8(%rbp,%rdi,1),%esi
  mov    %esi,0x8(%r8,%rdx,1)
  lea    0x3(%rcx),%rsi
L312:
  cmp    %rax,%r14
  jb     L345
  mov    %r14,%r9
  lea    (%r8,%rsi,4),%rdi
  lea    0x1(%rax),%rcx
  sub    %rax,%r9
  mov    %rdi,%rdx
  lea    0x0(,%rcx,4),%r11
  cmp    $0x2,%r9
  seta   %bl
  cmp    $0xffffffffffffffff,%r14
  setne  %r10b
  test   %r10b,%bl
  je     L315
  lea    0x0(%rbp,%r11,1),%rbx
  mov    %rdi,%r10
  sub    %rbx,%r10
  cmp    $0x8,%r10
  jbe    L315
  lea    0x1(%r9),%rdi
  mov    %rbp,%r9
  xor    %ecx,%ecx
  mov    %rdi,%r10
  sub    %rdx,%r9
  shr    $0x2,%r10
  lea    -0x4(%r9,%r11,1),%r9
  nopl   0x0(%rax)
L122:
  movdqu (%rdx,%r9,1),%xmm6
  add    $0x1,%rcx
  add    $0x10,%rdx
  movups %xmm6,-0x10(%rdx)
  cmp    %r10,%rcx
  jb     L122
  mov    %rdi,%rdx
  and    $0xfffffffffffffffc,%rdx
  add    %rdx,%rax
  add    %rdx,%rsi
  cmp    %rdx,%rdi
  je     L345
  mov    0x0(%rbp,%rax,4),%edi
  lea    0x0(,%rsi,4),%rdx
  lea    0x0(,%rax,4),%rcx
  mov    %edi,(%r8,%rsi,4)
  lea    0x1(%rax),%rsi
  cmp    %rsi,%r14
  jb     L345
  mov    0x4(%rbp,%rcx,1),%esi
  add    $0x2,%rax
  mov    %esi,0x4(%r8,%rdx,1)
  cmp    %rax,%r14
  jb     L345
  mov    0x8(%rbp,%rcx,1),%eax
  mov    %eax,0x8(%r8,%rdx,1)
L345:
  lea    0x0(%rbp,%r13,4),%rcx
  lea    0x4(%r8),%rdi
  mov    %r12,%rsi
  mov    %r8,%rax
  mov    %rcx,%rdx
  sub    %r13,%rsi
  sub    %rdi,%rdx
  cmp    $0x8,%rdx
  jbe    L39
  cmp    $0xffffffffffffffff,%r12
  setne  %dil
  cmp    $0x2,%rsi
  seta   %dl
  test   %dl,%dil
  je     L39
  add    $0x1,%rsi
  xor    %edx,%edx
  sub    %r8,%rcx
  mov    %rsi,%rdi
  shr    $0x2,%rdi
  nop
L7:
  movdqu (%rax),%xmm4
  add    $0x1,%rdx
  movups %xmm4,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rdi
  ja     L7
  mov    %rsi,%rdx
  and    $0xfffffffffffffffc,%rdx
  lea    0x0(%r13,%rdx,1),%rax
  cmp    %rdx,%rsi
  je     L3
  mov    (%r8,%rdx,4),%edx
  lea    0x0(,%rax,4),%rcx
  mov    %edx,0x0(%rbp,%rax,4)
  lea    0x1(%rax),%rdx
  cmp    %rdx,%r12
  jb     L3
  sub    %r13,%rdx
  add    $0x2,%rax
  mov    (%r8,%rdx,4),%edx
  mov    %edx,0x4(%rbp,%rcx,1)
  cmp    %rax,%r12
  jb     L3
  sub    %r13,%rax
  mov    (%r8,%rax,4),%eax
  mov    %eax,0x8(%rbp,%rcx,1)
L3:
  pop    %rbx
  mov    %r8,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1060 <free@plt>
  xchg   %ax,%ax
L30:
  add    $0x1,%rcx
L315:
  mov    0x0(%rbp,%rax,4),%eax
  add    $0x4,%rdi
  mov    %eax,-0x4(%rdi)
  mov    %rcx,%rax
  cmp    %rcx,%r14
  jae    L30
  jmp    L345
  nopl   0x0(%rax)
L39:
  mov    (%rax),%edx
  add    $0x4,%rax
  mov    %edx,0x0(%rbp,%r13,4)
  add    $0x1,%r13
  cmp    %r12,%r13
  jbe    L39
  jmp    L3
  cs nopw 0x0(%rax,%rax,1)
L329:
  add    $0x1,%rcx
  sub    %rbx,%rcx
  nopw   0x0(%rax,%rax,1)
L182:
  mov    0x0(%rbp,%rbx,4),%edx
  lea    (%rcx,%rbx,1),%rsi
  add    $0x1,%rbx
  add    $0x4,%rdi
  mov    %edx,-0x4(%rdi)
  cmp    %rbx,%r12
  jae    L182
  jmp    L312
  nopl   (%rax)
L166:
  mov    %r13,%rax
  xor    %ecx,%ecx
  jmp    L78
```

tool_calls: name: read_data
arguments: data_tag: D5
type_guessed: byte[16]
name: read_data
arguments: data_tag: D14
type_guessed: byte[16]

tool: {"D5": [0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D14": [0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
void mergesort(int *array, size_t first, size_t last) {
  int middle;
  if (first >= last)
    return;
  middle = (first + last) / 2;
  mergesort(array, first, middle);
  mergesort(array, middle + 1, last);
  int *temp;
  size_t i = first, j = middle + 1, tp = 0;
  temp = (int *)xmalloc(sizeof(int) * (last - first + 1));
  while (i <= middle && j <= last) {
    if (array[i] <= array[j]) {
      temp[tp] = array[i];
      ++i;
    } else {
      temp[tp] = array[j];
      ++j;
    }
    ++tp;
  }
  while (j <= last) {
    temp[tp] = array[j];
    ++tp;
    j++;
  }
  while (i <= middle) {
    temp[tp] = array[i];
    ++tp;
    i++;
  }
  i = first;
  while (i <= last) {
    array[i] = temp[i - first];
    i++;
  }
  free(temp);
}
```