user: Please show me the C implementation that matches the assembly code listed below:

```asm
<merge>:
  endbr64
  push   %rbp
  mov    %rdi,%r8
  mov    %rsp,%rbp
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  push   %r13
  movslq %esi,%r13
  push   %r12
  push   %rbx
  movslq %edx,%rbx
  sub    %ebx,%r15d
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  mov    %ebx,%eax
  mov    %rsp,%rsi
  sub    %r13d,%eax
  lea    0x1(%rax),%ecx
  mov    %eax,-0x48(%rbp)
  movslq %ecx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rsi,%rsp
  je     L182
L144:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L144
L182:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L36
L2:
  movslq %r15d,%r12
  mov    %rsp,%rsi
  mov    %rsp,%r10
  lea    0xf(,%r12,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rsi,%rsp
  je     L99
L33:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L33
L99:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L13
L17:
  mov    %rsp,%r14
  test   %ecx,%ecx
  jle    L134
  mov    -0x48(%rbp),%eax
  mov    %r10,%rdi
  mov    %ecx,-0x58(%rbp)
  mov    %r8,-0x50(%rbp)
  lea    0x4(,%rax,4),%rdx
  movslq %r13d,%rax
  lea    (%r8,%rax,4),%rsi
  call   <memcpy@plt>
  test   %r15d,%r15d
  mov    -0x50(%rbp),%r8
  mov    -0x58(%rbp),%ecx
  mov    %rax,%r10
  jle    L174
  lea    0x4(%r8,%rbx,4),%rsi
  mov    %r14,%rdi
  add    $0x1,%r13d
  mov    %ecx,-0x5c(%rbp)
  lea    0x0(,%r12,4),%rdx
  mov    %r8,-0x50(%rbp)
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  mov    %rax,-0x58(%rbp)
  call   <memcpy@plt>
  mov    -0x50(%rbp),%r8
  mov    -0x58(%rbp),%r10
  movslq %r13d,%rax
  mov    -0x5c(%rbp),%ecx
  jmp    L37
  nopl   0x0(%rax,%rax,1)
L23:
  add    $0x1,%r12d
L147:
  mov    %edx,-0x4(%r8,%rax,4)
  movslq %eax,%r13
  add    $0x1,%rax
  cmp    %ecx,%r12d
  jge    L155
  cmp    %r15d,%ebx
  jge    L155
L37:
  movslq %r12d,%rdx
  movslq %ebx,%rsi
  mov    (%r10,%rdx,4),%edx
  mov    (%r14,%rsi,4),%esi
  cmp    %esi,%edx
  jle    L23
  add    $0x1,%ebx
  mov    %esi,%edx
  jmp    L147
  nopl   0x0(%rax,%rax,1)
L36:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L2
  nopl   0x0(%rax,%rax,1)
L174:
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  nopl   (%rax)
L155:
  cmp    %r12d,%ecx
  mov    %ecx,-0x50(%rbp)
  jle    L18
  movslq %r13d,%rax
  mov    %r8,-0x58(%rbp)
  lea    (%r8,%rax,4),%rdi
  mov    -0x48(%rbp),%eax
  sub    %r12d,%eax
  lea    0x4(,%rax,4),%rdx
  movslq %r12d,%rax
  lea    (%r10,%rax,4),%rsi
  call   <memcpy@plt>
  mov    -0x50(%rbp),%ecx
  mov    -0x58(%rbp),%r8
  add    %r13d,%ecx
  sub    %r12d,%ecx
  movslq %ecx,%r13
L18:
  cmp    %ebx,%r15d
  jle    L54
L148:
  sub    $0x1,%r15d
  lea    (%r8,%r13,4),%rdi
  sub    %ebx,%r15d
  movslq %ebx,%rbx
  lea    0x4(,%r15,4),%rdx
  lea    (%r14,%rbx,4),%rsi
  call   <memcpy@plt>
L54:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L133
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L134:
  test   %r15d,%r15d
  jle    L174
  lea    0x4(%r8,%rbx,4),%rsi
  mov    %r14,%rdi
  mov    %r8,-0x48(%rbp)
  xor    %ebx,%ebx
  lea    0x0(,%r12,4),%rdx
  call   <memcpy@plt>
  mov    -0x48(%rbp),%r8
  jmp    L148
L13:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L17
L133:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge(int array[], int p, int q, int r) {
  int i, j;
  int n1 = q - p + 1;
  int n2 = r - q;
  int b[n1], c[n2];
  for (i = 0; i < n1; ++i) {
    b[i] = array[i + p];
  }
  for (i = 0; i < n2; ++i) {
    c[i] = array[i + q + 1];
  }
  i = j = 0;
  int k = p;
  while ((i < n1) && (j < n2)) {
    if (b[i] <= c[j]) {
      array[k] = b[i];
      i++;
    } else {
      array[k] = c[j];
      j++;
    }
    k++;
  }
  while (i < n1) {
    array[k] = b[i];
    i++;
    k++;
  }
  while (j < n2) {
    array[k] = c[j];
    j++;
    k++;
  }
}
```