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

```asm
<merge>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r8
  mov    %esi,%edi
  mov    %edx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %edx,%r11d
  sub    %esi,%r11d
  lea    0x1(%r11),%ebx
  sub    %edx,%ecx
  mov    %ecx,%r9d
  movslq %ebx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L183:
  cmp    %rdx,%rsp
  je     L168
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L183
L168:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L50
  orq    $0x0,-0x8(%rsp,%rax,1)
L50:
  mov    %rsp,%r10
  movslq %r9d,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L199:
  cmp    %rdx,%rsp
  je     L152
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L199
L152:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L47
  orq    $0x0,-0x8(%rsp,%rax,1)
L47:
  mov    %rsp,%rsi
  test   %ebx,%ebx
  jle    L139
  mov    %r11d,%eax
  lea    0x4(,%rax,4),%r12
  movslq %edi,%rax
  lea    (%r8,%rax,4),%rcx
  mov    $0x0,%eax
L175:
  mov    (%rcx,%rax,1),%edx
  mov    %edx,(%r10,%rax,1)
  add    $0x4,%rax
  cmp    %r12,%rax
  jne    L175
L139:
  test   %r9d,%r9d
  jle    L65
  lea    0x1(%r9),%r12d
  movslq %r13d,%r13
  lea    (%r8,%r13,4),%rcx
  mov    $0x1,%eax
L29:
  mov    (%rcx,%rax,4),%edx
  mov    %edx,-0x4(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %r12,%rax
  jne    L29
  test   %ebx,%ebx
  jle    L208
  lea    0x1(%rdi),%edx
  movslq %edx,%rdx
  mov    $0x0,%eax
  mov    $0x0,%ecx
  jmp    L102
L87:
  mov    %edi,-0x4(%r8,%rdx,4)
  add    $0x1,%eax
L60:
  mov    %edx,%edi
  add    $0x1,%rdx
  cmp    %ebx,%ecx
  jge    L177
  cmp    %r9d,%eax
  jge    L177
L102:
  movslq %ecx,%rdi
  mov    (%r10,%rdi,4),%r12d
  movslq %eax,%rdi
  mov    (%rsi,%rdi,4),%edi
  cmp    %edi,%r12d
  jg     L87
  mov    %r12d,-0x4(%r8,%rdx,4)
  add    $0x1,%ecx
  jmp    L60
L177:
  cmp    %ebx,%ecx
  jge    L221
L90:
  mov    %ecx,%r12d
  mov    %r11d,%ebx
  sub    %ecx,%ebx
  movslq %ecx,%rcx
  lea    (%r10,%rcx,4),%r13
  movslq %edi,%rdx
  lea    (%r8,%rdx,4),%r10
  mov    $0x0,%edx
L234:
  mov    0x0(%r13,%rdx,4),%ecx
  mov    %ecx,(%r10,%rdx,4)
  mov    %rdx,%rcx
  add    $0x1,%rdx
  cmp    %rbx,%rcx
  jne    L234
  lea    0x1(%r11,%rdi,1),%edi
  sub    %r12d,%edi
L221:
  cmp    %r9d,%eax
  jge    L34
  cltq
  movslq %edi,%rdi
  sub    %rax,%rdi
  lea    (%r8,%rdi,4),%rcx
L111:
  mov    (%rsi,%rax,4),%edx
  mov    %edx,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%r9d
  jg     L111
L34:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L128
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L208:
  mov    $0x0,%eax
  jmp    L221
L65:
  mov    $0x0,%eax
  mov    $0x0,%ecx
  test   %ebx,%ebx
  jg     L90
  jmp    L34
L128:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge(int *a, int left, int mid, int right) {
  int i, j, k;
  int n1, n2;
  n1 = mid - left + 1;
  n2 = right - mid;
  int left_arr[n1], right_arr[n2];
  i = 0;
  j = 0;
  for (i = 0; i < n1; i++) {
    left_arr[i] = a[left + i];
  }
  for (j = 0; j < n2; j++) {
    right_arr[j] = a[mid + 1 + j];
  }
  i = 0;
  j = 0;
  k = left;
  while (i < n1 && j < n2) {
    if (left_arr[i] <= right_arr[j]) {
      a[k] = left_arr[i];
      i++;
    } else {
      a[k] = right_arr[j];
      j++;
    }
    k++;
  }
  while (i < n1) {
    a[k] = left_arr[i];
    k++;
    i++;
  }
  while (j < n2) {
    a[k] = right_arr[j];
    k++;
    j++;
  }
  return;
}
```