user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<pop_heap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  lea    -0x1(%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
L1:
  mov    -0x1c(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x20(%rbp)
  jge    L57
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jge    L40
  mov    -0x20(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x10(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L40
  addl   $0x1,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
L40:
  movsd  -0x10(%rbp),%xmm0
  comisd -0x8(%rbp),%xmm0
  ja     L55
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L1
L57:
  nop
  jmp    L30
L55:
  nop
L30:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%eax
  leave
  ret
```

assistant: ```c
int pop_heap(int *heap, const double *alpha, int *heap_size) {
  int child, parent, ret;
  int moving;
  double alpha_moving, alpha_child;
  assert(*heap_size > 0);
  ret = heap[0];
  moving = heap[--(*heap_size)];
  alpha_moving = alpha[moving];
  parent = 0;
  for (;;) {
    child = 2 * parent + 1;
    if (child >= *heap_size)
      break;
    alpha_child = alpha[heap[child]];
    if (child + 1 < *heap_size) {
      if (alpha[heap[child + 1]] < alpha_child) {
        alpha_child = alpha[heap[++child]];
      }
    }
    if (alpha_moving < alpha_child)
      break;
    heap[parent] = heap[child];
    parent = child;
  }
  heap[parent] = moving;
  return ret;
}
```