user: What would the C source look like for the assembly code provided here?

```asm
<stable_grail_rec_merge>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %esi,%ebx
  mov    %edx,%r12d
  cmp    $0x2,%esi
  jle    L8
  cmp    $0x2,%edx
  jle    L8
  cmp    %edx,%esi
  jge    L19
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  add    %esi,%eax
L162:
  cltq
  lea    0x0(%r13,%rax,8),%r15
  mov    %r15,%rdx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <stable_grail_bin_search_left@plt>
  mov    %eax,%r14d
  cmp    %eax,%ebx
  jle    L54
  cltq
  lea    0x0(%r13,%rax,8),%rdi
  mov    (%rdi),%rdx
  mov    (%r15),%rax
  mov    (%rax),%eax
  cmp    %eax,(%rdx)
  je     L141
L54:
  movslq %ebx,%rax
  mov    %rax,0x8(%rsp)
  lea    0x0(%r13,%rax,8),%rdi
  mov    %r15,%rdx
  mov    %r12d,%esi
  call   <stable_grail_bin_search_left@plt>
  mov    %eax,%ebp
  cmp    %eax,%r12d
  jg     L10
  mov    %eax,%r15d
  mov    %r14d,0x4(%rsp)
L84:
  mov    %ebx,%esi
  sub    %r14d,%esi
  movslq %r14d,%rax
  lea    0x0(%r13,%rax,8),%rdi
  mov    %ebp,%edx
  call   <stable_grail_rotate@plt>
L187:
  mov    %r12d,%edx
  sub    %ebp,%edx
  mov    0x4(%rsp),%eax
  sub    %eax,%ebx
  mov    %ebx,%esi
  add    %eax,%ebp
  movslq %ebp,%rbp
  lea    0x0(%r13,%rbp,8),%rdi
  call   <stable_grail_rec_merge>
  mov    %r15d,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <stable_grail_rec_merge>
L116:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L8:
  mov    %r12d,%edx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <stable_grail_merge_without_buffer@plt>
  jmp    L116
L19:
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  jmp    L162
L141:
  mov    %ebx,%esi
  sub    %r14d,%esi
  mov    %r15,%rdx
  call   <stable_grail_bin_search_right@plt>
  add    %r14d,%eax
  mov    %eax,0x4(%rsp)
  movslq %ebx,%rax
  mov    %rax,0x8(%rsp)
  lea    0x0(%r13,%rax,8),%rdi
  mov    %r15,%rdx
  mov    %r12d,%esi
  call   <stable_grail_bin_search_left@plt>
  mov    %eax,%ebp
  cmp    %eax,%r12d
  jle    L159
  jmp    L179
L10:
  mov    %r14d,0x4(%rsp)
L179:
  movslq %ebp,%rax
  add    0x8(%rsp),%rax
  lea    0x0(%r13,%rax,8),%rdi
  mov    (%rdi),%rdx
  mov    (%r15),%rax
  mov    (%rax),%eax
  cmp    %eax,(%rdx)
  je     L173
L159:
  cmp    0x4(%rsp),%r14d
  je     L185
  mov    %ebx,%esi
  sub    %r14d,%esi
  movslq %r14d,%rax
  lea    0x0(%r13,%rax,8),%rdi
  mov    %ebp,%edx
  call   <stable_grail_rotate@plt>
  mov    %ebp,%r15d
  jmp    L187
L173:
  mov    %r12d,%esi
  sub    %ebp,%esi
  mov    %r15,%rdx
  call   <stable_grail_bin_search_right@plt>
  mov    %eax,%r15d
  lea    (%rax,%rbp,1),%eax
  mov    %eax,0x8(%rsp)
  cmp    0x4(%rsp),%r14d
  je     L106
  mov    %ebx,%esi
  sub    %r14d,%esi
  movslq %r14d,%rax
  lea    0x0(%r13,%rax,8),%rdi
  mov    %ebp,%edx
  call   <stable_grail_rotate@plt>
  cmp    %ebp,0x8(%rsp)
  je     L161
  mov    %ebx,%esi
  mov    0x4(%rsp),%ecx
  sub    %ecx,%esi
  lea    (%rcx,%rbp,1),%eax
  cltq
  lea    0x0(%r13,%rax,8),%rdi
  mov    %r15d,%edx
  call   <stable_grail_rotate@plt>
  mov    %ebp,%r15d
  mov    0x8(%rsp),%ebp
  jmp    L187
L106:
  mov    %ebp,%r15d
  mov    %eax,%ebp
  jmp    L84
L185:
  mov    %ebp,%r15d
  jmp    L84
L161:
  mov    %ebp,%r15d
  mov    0x8(%rsp),%ebp
  jmp    L187
```

assistant: ```c
void stable_grail_rec_merge(int **A, int L1, int L2) {
  int K, k1, k2, m1, m2;
  if (L1 < 3 || L2 < 3) {
    stable_grail_merge_without_buffer(A, L1, L2);
    return;
  }
  if (L1 < L2) {
    K = L1 + L2 / 2;
  } else {
    K = L1 / 2;
  }
  k1 = k2 = stable_grail_bin_search_left(A, L1, A + K);
  if (k2 < L1 && (*(*(A + k2)) - *(*(A + K))) == 0) {
    k2 = stable_grail_bin_search_right(A + k1, L1 - k1, A + K) + k1;
  }
  m1 = stable_grail_bin_search_left(A + L1, L2, A + K);
  m2 = m1;
  if (m2 < L2 && (*(*(A + L1 + m2)) - *(*(A + K))) == 0) {
    m2 = stable_grail_bin_search_right(A + L1 + m1, L2 - m1, A + K) + m1;
  }
  if (k1 == k2) {
    stable_grail_rotate(A + k2, L1 - k2, m2);
  } else {
    stable_grail_rotate(A + k1, L1 - k1, m1);
    if (m2 != m1) {
      stable_grail_rotate(A + (k2 + m1), L1 - k2, m2 - m1);
    }
  }
  stable_grail_rec_merge(A + (k2 + m2), L1 - k2, L2 - m2);
  stable_grail_rec_merge(A, k1, m1);
}
```