user: Converte this assembly snippet into its equivalent C code:

```asm
<merge>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x9000(%rsp),%r11
L117:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L117
  sub    $0xc68,%rsp
  movslq %esi,%r8
  lea    0x1(%rdx),%r9d
  mov    %rdi,%r12
  mov    %ecx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x9c58(%rsp)
  xor    %eax,%eax
  mov    %r9d,%ebx
  mov    %r8d,%ebp
  cmp    %edx,%r8d
  jg     L149
  cmp    %ecx,%r9d
  jg     L149
  mov    $0x1,%eax
  movslq %r8d,%r10
  lea    0x10(%rsp),%r14
  movslq %r9d,%rdi
  xchg   %ax,%ax
L26:
  mov    (%r12,%r10,4),%esi
  mov    (%r12,%rdi,4),%ecx
  mov    %eax,%r15d
  cmp    %ecx,%esi
  jg     L43
L121:
  mov    %esi,-0x4(%r14,%rax,4)
  add    $0x1,%ebp
  add    $0x1,%rax
  cmp    %r13d,%ebx
  jg     L167
  cmp    %edx,%ebp
  jg     L167
  movslq %ebp,%r10
  mov    (%r12,%rdi,4),%ecx
  mov    %eax,%r15d
  mov    (%r12,%r10,4),%esi
  cmp    %ecx,%esi
  jle    L121
L43:
  add    $0x1,%ebx
  mov    %ecx,-0x4(%r14,%rax,4)
  add    $0x1,%rax
  cmp    %r13d,%ebx
  jg     L167
  cmp    %ebp,%edx
  jl     L98
  movslq %ebx,%rdi
  jmp    L26
  nopl   0x0(%rax)
L149:
  xor    %r15d,%r15d
  nopl   0x0(%rax,%rax,1)
L167:
  mov    %r9d,0xc(%rsp)
  cmp    %ebp,%edx
  jl     L98
  mov    %edx,%ecx
  movslq %r15d,%rax
  lea    0x10(%rsp),%r14
  mov    %r8d,0x8(%rsp)
  sub    %ebp,%ecx
  lea    (%r14,%rax,4),%rdi
  mov    %ecx,%eax
  mov    %ecx,0x4(%rsp)
  lea    0x4(,%rax,4),%rdx
  movslq %ebp,%rax
  lea    (%r12,%rax,4),%rsi
  call   <memcpy@plt>
  mov    0xc(%rsp),%r9d
  mov    0x4(%rsp),%ecx
  movslq 0x8(%rsp),%r8
  add    %r15d,%r9d
  lea    (%rcx,%r15,1),%edx
  sub    %ebp,%r9d
  cmp    %ebx,%r13d
  jl     L102
L42:
  mov    %r13d,%ebp
  movslq %r9d,%rax
  mov    %r8d,0x8(%rsp)
  sub    %ebx,%ebp
  lea    (%r14,%rax,4),%rdi
  cmp    %ebx,%r13d
  mov    %r9d,0x4(%rsp)
  mov    %ebp,%eax
  lea    0x4(,%rax,4),%rdx
  mov    $0x4,%eax
  cmovl  %rax,%rdx
  movslq %ebx,%rax
  lea    (%r12,%rax,4),%rsi
  call   <memcpy@plt>
  xor    %eax,%eax
  cmp    %ebx,%r13d
  mov    0x4(%rsp),%r9d
  cmovge %ebp,%eax
  movslq 0x8(%rsp),%r8
  mov    %eax,%edx
  add    %r9d,%edx
L102:
  movslq %edx,%rdx
  mov    %rdx,%rax
  add    %rdx,%r8
  neg    %rax
  shl    $0x2,%rax
  lea    (%rax,%r8,4),%rcx
  lea    (%rax,%rdx,4),%rax
  lea    0x4(,%rdx,4),%r8
  lea    (%r12,%rcx,1),%rdi
  lea    (%r14,%rax,1),%rsi
  mov    %r8,%rdx
  call   <memcpy@plt>
L116:
  mov    0x9c58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L132
  add    $0x9c68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L98:
  cmp    %ebx,%r13d
  jge    L9
  lea    -0x1(%r15),%edx
  test   %r15d,%r15d
  je     L116
  lea    0x10(%rsp),%r14
  jmp    L102
L9:
  mov    %r15d,%r9d
  lea    0x10(%rsp),%r14
  jmp    L42
L132:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge(int a[], int low, int mid, int high) {
  int b[10000];
  int i = low, j = mid + 1, k = 0;
  while (i <= mid && j <= high) {
    if (a[i] <= a[j])
      b[k++] = a[i++];
    else
      b[k++] = a[j++];
  }
  while (i <= mid)
    b[k++] = a[i++];
  while (j <= high)
    b[k++] = a[j++];
  k--;
  while (k >= 0) {
    a[low + k] = b[k];
    k--;
  }
}
```