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

```asm
<filesort_heapsort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    $0x2,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  lea    -0x8(%rdi),%rbx
  sub    $0x28,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,(%rsp)
  cmp    $0x1,%rsi
  jbe    L20
  xchg   %ax,%ax
L121:
  mov    0x10(%rsp),%rax
  mov    %r13d,%ebp
  mov    -0x8(%rax,%r13,8),%rdi
  nopl   (%rax)
L71:
  movslq %ebp,%rax
  sar    %ebp
  movslq %ebp,%rdx
  lea    (%rbx,%rax,8),%r14
  lea    (%rbx,%rdx,8),%r15
  mov    (%r15),%rsi
  call   *%r12
  test   %eax,%eax
  jle    L26
  mov    (%r14),%rdi
  mov    (%r15),%rax
  mov    %rax,(%r14)
  mov    %rdi,(%r15)
  cmp    $0x1,%ebp
  jne    L71
L26:
  add    $0x1,%r13
  cmp    %r13,(%rsp)
  jae    L121
L20:
  mov    (%rsp),%rax
  cmp    $0x1,%eax
  jle    L97
  mov    %eax,%r14d
  sub    $0x1,%r14d
  movslq %r14d,%rax
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax)
L46:
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%rsi
  mov    (%rcx),%rax
  mov    (%rcx,%rsi,8),%rdx
  mov    %esi,0xc(%rsp)
  mov    %rdx,(%rcx)
  mov    %rax,(%rcx,%rsi,8)
  cmp    $0x2,%esi
  jle    L142
  movl   $0x1,(%rsp)
  mov    $0x2,%r14d
  jmp    L134
  nopl   0x0(%rax)
L72:
  mov    (%r15),%rax
  mov    0x0(%rbp),%rcx
  lea    0x0(%r13,%r13,1),%r14d
  mov    %rcx,(%r15)
  mov    %rax,0x0(%rbp)
  cmp    0xc(%rsp),%r14d
  jge    L31
  mov    %r13d,(%rsp)
L134:
  lea    0x1(%r14),%r13d
  movslq %r13d,%rax
  shl    $0x3,%rax
  lea    (%rbx,%rax,1),%rbp
  lea    -0x8(%rbx,%rax,1),%r15
  mov    0x0(%rbp),%rsi
  mov    (%r15),%rdi
  call   *%r12
  test   %eax,%eax
  cmovle %rbp,%r15
  movslq (%rsp),%rbp
  cmovg  %r14d,%r13d
  lea    (%rbx,%rbp,8),%rbp
  mov    (%r15),%rsi
  mov    0x0(%rbp),%rdi
  call   *%r12
  test   %eax,%eax
  js     L72
L55:
  subq   $0x1,0x18(%rsp)
  jmp    L46
  nopw   0x0(%rax,%rax,1)
L31:
  jne    L55
  movslq %r14d,%rbp
  shl    $0x3,%rbp
L119:
  add    %rbx,%rbp
  mov    (%r15),%rdi
  mov    0x0(%rbp),%rsi
  call   *%r12
  test   %eax,%eax
  jns    L55
  mov    0x0(%rbp),%rax
  mov    (%r15),%rcx
  subq   $0x1,0x18(%rsp)
  mov    %rcx,0x0(%rbp)
  mov    %rax,(%r15)
  jmp    L46
L97:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L142:
  jne    L97
  mov    %rcx,%r15
  mov    $0x10,%ebp
  jmp    L119
```

assistant: ```c
void filesort_heapsort(void **datap, size_t nitems, int (*compare)(const void *, const void *)) {
  void **datap1 = &datap[-1];
  int i;
  for (i = 2; i <= nitems; i++) {
    int index = i;
    while (index > 1) {
      int newindex;
      void *temp;
      newindex = index / 2;
      if (compare(datap1[index], datap1[newindex]) <= 0)
        break;
      temp = datap1[index];
      datap1[index] = datap1[newindex];
      datap1[newindex] = temp;
      index = newindex;
    }
  }
  for (i = nitems; i > 1; i--) {
    int index = 1;
    void *temp;
    temp = datap1[index];
    datap1[index] = datap1[i];
    datap1[i] = temp;
    while ((2 * index) < (i - 1)) {
      int newindex;
      void *temp;
      newindex = 2 * index;
      if (compare(datap1[newindex], datap1[newindex + 1]) <= 0)
        newindex = newindex + 1;
      if (compare(datap1[index], datap1[newindex]) >= 0)
        break;
      temp = datap1[newindex];
      datap1[newindex] = datap1[index];
      datap1[index] = temp;
      index = newindex;
    }
    if ((2 * index) == (i - 1)) {
      int newindex;
      void *temp;
      newindex = 2 * index;
      if (compare(datap1[index], datap1[newindex]) >= 0)
        ;
      else {
        temp = datap1[newindex];
        datap1[newindex] = datap1[index];
        datap1[index] = temp;
      }
    }
  }
}
```