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

```asm
<sorter_grail_merge_without_buffer>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jge    L81
  jmp    L68
L93:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%eax
  mov    %eax,%esi
  mov    %rcx,%rdi
  call   <sorter_grail_bin_search_left@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L140
  mov    -0x4(%rbp),%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <sorter_grail_rotate@plt>
  mov    -0x4(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x18(%rbp)
  mov    -0x4(%rbp),%eax
  sub    %eax,-0x20(%rbp)
L140:
  cmpl   $0x0,-0x20(%rbp)
  je     L134
L5:
  addq   $0x8,-0x18(%rbp)
  subl   $0x1,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L68
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rdx
  sub    %rdx,%rax
  test   %rax,%rax
  jle    L5
L68:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L93
  jmp    L111
L85:
  mov    -0x1c(%rbp),%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <sorter_grail_bin_search_right@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  je     L67
  mov    -0x1c(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rdx,%rcx
  mov    -0x20(%rbp),%edx
  mov    %eax,%esi
  mov    %rcx,%rdi
  call   <sorter_grail_rotate@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L67:
  cmpl   $0x0,-0x1c(%rbp)
  je     L0
L119:
  subl   $0x1,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  je     L81
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x20(%rbp),%edx
  movslq %edx,%rdx
  add    %rcx,%rdx
  shl    $0x3,%rdx
  lea    -0x8(%rdx),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rdx
  sub    %rdx,%rax
  test   %rax,%rax
  jle    L119
L81:
  cmpl   $0x0,-0x20(%rbp)
  jne    L85
  jmp    L111
L134:
  nop
  jmp    L111
L0:
  nop
L111:
  nop
  leave
  ret
```

assistant: ```c
void sorter_grail_merge_without_buffer(int64_t *arr, int len1, int len2) {
  int h;
  if (len1 < len2) {
    while (len1) {
      h = sorter_grail_bin_search_left(arr + len1, len2, arr);
      if (h != 0) {
        sorter_grail_rotate(arr, len1, h);
        arr += h;
        len2 -= h;
      }
      if (len2 == 0) {
        break;
      }
      do {
        arr++;
        len1--;
      } while (len1 && ((*(arr)) - (*(arr + len1))) <= 0);
    }
  } else {
    while (len2) {
      h = sorter_grail_bin_search_right(arr, len1, arr + (len1 + len2 - 1));
      if (h != len1) {
        sorter_grail_rotate(arr + h, len1 - h, len2);
        len1 = h;
      }
      if (len1 == 0) {
        break;
      }
      do {
        len2--;
      } while (len2 && ((*(arr + len1 - 1)) - (*(arr + len1 + len2 - 1))) <= 0);
    }
  }
}
```