user: 下面的汇编指令对应的C源代码是什么:

```asm
<sorter_grail_common_sort>:
  endbr64
  push   %r15
  mov    $0x1,%r9d
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %ecx,0x10(%rsp)
  cmp    $0xf,%esi
  jle    L35
L179:
  add    %r9d,%r9d
  mov    %r9d,%eax
  imul   %r9d,%eax
  cmp    %r12d,%eax
  jl     L179
  lea    -0x1(%r12),%eax
  mov    %r12d,%esi
  mov    %rbp,%rdi
  mov    %r9d,0x4(%rsp)
  cltd
  idiv   %r9d
  lea    0x1(%rax),%r15d
  lea    (%r15,%r9,1),%ecx
  mov    %ecx,%edx
  mov    %ecx,%ebx
  mov    %ecx,0x1c(%rsp)
  call   <sorter_grail_find_keys@plt>
  mov    0x4(%rsp),%r9d
  cmp    %eax,%ebx
  mov    %eax,0x14(%rsp)
  jg     L144
  movslq %ebx,%rax
  mov    0x10(%rsp),%r8d
  mov    0x8(%rsp),%rcx
  sub    %ebx,%r12d
  mov    %r9d,%edx
  lea    0x0(%rbp,%rax,4),%rdi
  mov    %r12d,%esi
  call   <sorter_grail_build_blocks@plt>
  mov    0x4(%rsp),%r9d
  movl   $0x1,0x4(%rsp)
  mov    %r9d,%eax
L152:
  lea    (%r9,%r9,1),%r13d
  cmp    %r12d,%r13d
  jge    L33
  mov    %r15d,%edx
  mov    0x4(%rsp),%edi
  mov    %r15d,%ebx
  sar    $0x3,%edx
  sar    %ebx
  imul   %r15d,%edx
  test   %edi,%edi
  cmovne %eax,%ebx
  movslq 0x1c(%rsp),%rax
  lea    0x0(%rbp,%rax,4),%r14
  mov    %r15d,%eax
  mov    %edx,0x18(%rsp)
  mov    %r13d,%r15d
  mov    %eax,%r13d
  jmp    L78
  nopw   0x0(%rax,%rax,1)
L85:
  cmp    %r15d,0x18(%rsp)
  jl     L113
L147:
  xor    %edx,%edx
  cmp    0x10(%rsp),%ebx
  cmovle 0x8(%rsp),%rdx
  mov    %ebx,%r8d
  mov    $0x1,%r9d
L26:
  sub    $0x8,%rsp
  mov    %r15d,%ecx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  push   %rdx
  mov    %r12d,%edx
  call   <sorter_grail_combine_blocks@plt>
  lea    (%r15,%r15,1),%eax
  pop    %rdx
  mov    %r15d,%r9d
  pop    %rcx
  cmp    %r12d,%eax
  jge    L33
  mov    %eax,%r15d
L78:
  mov    0x4(%rsp),%esi
  test   %esi,%esi
  jne    L147
  cmp    $0x4,%r13d
  jg     L85
L113:
  movslq 0x14(%rsp),%rdx
  movslq %r15d,%rax
  mov    $0x1,%edi
  imul   %rdx,%rax
  mov    %rax,%rdx
  shr    $0x3f,%rdx
  add    %rax,%rdx
  sar    %rdx
  je     L23
  cmp    $0x1,%r13d
  jle    L23
  nopl   0x0(%rax,%rax,1)
L37:
  add    %edi,%edi
  lea    0x7(%rdx),%rax
  test   %rdx,%rdx
  cmovs  %rax,%rdx
  sar    $0x3,%rdx
  cmp    %r13d,%edi
  jge    L23
  test   %rdx,%rdx
  jne    L37
L23:
  lea    0x0(,%r9,4),%eax
  xor    %r9d,%r9d
  cltd
  idiv   %edi
  xor    %edx,%edx
  mov    %eax,%r8d
  jmp    L26
  nopl   0x0(%rax,%rax,1)
L144:
  mov    0x14(%rsp),%eax
  cmp    $0x3,%eax
  jle    L17
  cmp    %r9d,%eax
  jge    L93
  mov    0x14(%rsp),%eax
  xchg   %ax,%ax
L160:
  sar    %r9d
  cmp    %r9d,%eax
  jl     L160
L93:
  sub    %r9d,%r12d
  movslq %r9d,%rax
  mov    %r9d,%edx
  xor    %r8d,%r8d
  lea    0x0(%rbp,%rax,4),%rdi
  xor    %ecx,%ecx
  mov    %r12d,%esi
  mov    %r9d,0x4(%rsp)
  call   <sorter_grail_build_blocks@plt>
  mov    0x4(%rsp),%r9d
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  mov    %r9d,0x1c(%rsp)
  mov    %r9d,%r15d
  jmp    L152
  nopl   0x0(%rax)
L33:
  mov    0x1c(%rsp),%ebx
  mov    %rbp,%rdi
  mov    %ebx,%esi
  call   <sorter_binary_insertion_sort@plt>
  add    $0x28,%rsp
  mov    %r12d,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10c0 <sorter_grail_merge_without_buffer@plt>
  nopl   0x0(%rax)
L35:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10d0 <sorter_binary_insertion_sort@plt>
L17:
  add    $0x28,%rsp
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <sorter_grail_lazy_stable_sort@plt>
```

assistant: ```c
void sorter_grail_common_sort(int64_t *arr, int Len, int64_t *extbuf, int LExtBuf) {
  int lblock, nkeys, findkeys, ptr, cbuf, lb, nk;
  int havebuf, chavebuf;
  long long s;
  if (Len < 16) {
    sorter_binary_insertion_sort(arr, Len);
    return;
  }
  lblock = 1;
  while (lblock * lblock < Len) {
    lblock *= 2;
  }
  nkeys = (Len - 1) / lblock + 1;
  findkeys = sorter_grail_find_keys(arr, Len, nkeys + lblock);
  havebuf = 1;
  if (findkeys < nkeys + lblock) {
    if (findkeys < 4) {
      sorter_grail_lazy_stable_sort(arr, Len);
      return;
    }
    nkeys = lblock;
    while (nkeys > findkeys) {
      nkeys /= 2;
    }
    havebuf = 0;
    lblock = 0;
  }
  ptr = lblock + nkeys;
  cbuf = havebuf ? lblock : nkeys;
  if (havebuf) {
    sorter_grail_build_blocks(arr + ptr, Len - ptr, cbuf, extbuf, LExtBuf);
  } else {
    sorter_grail_build_blocks(arr + ptr, Len - ptr, cbuf, NULL, 0);
  }
  while (Len - ptr > (cbuf *= 2)) {
    lb = lblock;
    chavebuf = havebuf;
    if (!havebuf) {
      if (nkeys > 4 && nkeys / 8 * nkeys >= cbuf) {
        lb = nkeys / 2;
        chavebuf = 1;
      } else {
        nk = 1;
        s = (long long)cbuf * findkeys / 2;
        while (nk < nkeys && s != 0) {
          nk *= 2;
          s /= 8;
        }
        lb = (2 * cbuf) / nk;
      }
    }
    sorter_grail_combine_blocks(arr, arr + ptr, Len - ptr, cbuf, lb, chavebuf, chavebuf && lb <= LExtBuf ? extbuf : NULL);
  }
  sorter_binary_insertion_sort(arr, ptr);
  sorter_grail_merge_without_buffer(arr, ptr, Len - ptr);
}
```