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

```asm
<merge>:
  endbr64
  push   %rbp
  movslq %edx,%r11
  mov    %ecx,%r8d
  mov    %r11d,%edx
  sub    %r11d,%r8d
  sub    %esi,%edx
  mov    %rsp,%rbp
  push   %r15
  mov    %esi,%r15d
  push   %r14
  lea    0x1(%rdx),%r14d
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq %r14d,%rax
  mov    %rsp,%rsi
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rcx
  cmp    %rsi,%rsp
  je     L27
L39:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L39
L27:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  jne    L31
L169:
  movslq %r8d,%rax
  mov    %rsp,%rsi
  mov    %rsp,%r9
  mov    %rax,-0x58(%rbp)
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rsi
  and    $0xfffffffffffffff0,%rcx
  cmp    %rsi,%rsp
  je     L112
L29:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rsi,%rsp
  jne    L29
L112:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  jne    L66
L130:
  mov    %rsp,%r13
  test   %r14d,%r14d
  jle    L6
  movslq %r15d,%rax
  mov    %r9,%rdi
  lea    0x4(,%rdx,4),%rdx
  mov    %r11d,-0x50(%rbp)
  lea    (%r12,%rax,4),%rsi
  mov    %r8d,-0x44(%rbp)
  call   <memcpy@plt>
  mov    -0x44(%rbp),%r8d
  movslq -0x50(%rbp),%r11
  mov    %rax,%r9
L6:
  test   %r8d,%r8d
  jle    L8
  mov    -0x58(%rbp),%rdx
  lea    0x4(%r12,%r11,4),%rsi
  mov    %r13,%rdi
  mov    %r9,-0x50(%rbp)
  mov    %r8d,-0x44(%rbp)
  shl    $0x2,%rdx
  call   <memcpy@plt>
  mov    -0x44(%rbp),%r8d
  mov    -0x50(%rbp),%r9
L8:
  cmp    %ebx,%r15d
  jg     L42
  lea    0x1(%r15),%eax
  xor    %ecx,%ecx
  xor    %edx,%edx
  cltq
  cmp    %ecx,%r14d
  jle    L53
  nopl   (%rax)
L75:
  movslq %ecx,%rsi
  mov    (%r9,%rsi,4),%esi
  cmp    %edx,%r8d
  je     L63
  movslq %edx,%rdi
  mov    0x0(%r13,%rdi,4),%edi
  cmp    %esi,%edi
  jg     L63
  mov    %edi,-0x4(%r12,%rax,4)
  add    $0x1,%edx
  cmp    %eax,%ebx
  jl     L42
L59:
  add    $0x1,%rax
  cmp    %ecx,%r14d
  jg     L75
L53:
  movslq %edx,%rcx
  add    $0x1,%edx
  mov    0x0(%r13,%rcx,4),%ecx
  mov    %ecx,-0x4(%r12,%rax,4)
  cmp    %eax,%ebx
  jl     L42
  movslq %eax,%rcx
  movslq %edx,%rdx
  lea    (%r12,%rcx,4),%rdi
  mov    %ebx,%ecx
  lea    0x0(%r13,%rdx,4),%rsi
  sub    %eax,%ecx
  cmp    %eax,%ebx
  mov    $0x4,%eax
  lea    0x4(,%rcx,4),%r8
  cmovl  %rax,%r8
  mov    %r8,%rdx
  call   <memcpy@plt>
L42:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L162
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   (%rax)
L31:
  orq    $0x0,-0x8(%rsp,%rcx,1)
  jmp    L169
  nopl   0x0(%rax,%rax,1)
L63:
  mov    %esi,-0x4(%r12,%rax,4)
  add    $0x1,%ecx
  cmp    %eax,%ebx
  jge    L59
  jmp    L42
L66:
  orq    $0x0,-0x8(%rsp,%rcx,1)
  jmp    L130
L162:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void merge(int *a, int p, int q, int r) {
  int l1, l2, i, j, k;
  l1 = q - p + 1;
  l2 = r - q;
  int left[l1];
  int right[l2];
  for (i = 0; i < l1; i++) {
    left[i] = a[p + i];
  }
  for (i = 0; i < l2; i++) {
    right[i] = a[q + i + 1];
  }
  i = 0;
  j = 0;
  for (k = p; k <= r; k++) {
    if (i < l1 && ((j == l2) || left[i] < right[j])) {
      a[k] = left[i];
      i++;
    } else {
      a[k] = right[j];
      j++;
    }
  }
}
```