user: 请从给定的汇编指令推导出C源代码:

```asm
<heap_sortv_ui>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  movl   $0x1,-0x20(%rbp)
  jmp    L99
L111:
  mov    -0x20(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  shr    %eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jbe    L17
L22:
  mov    -0x18(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x1c(%rbp),%edx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  shr    %eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L71
  mov    -0x18(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  ja     L22
L71:
  mov    -0x1c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L95
L17:
  nop
L95:
  addl   $0x1,-0x20(%rbp)
L99:
  mov    -0x20(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jb     L111
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L125
L86:
  mov    -0x20(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x20(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,(%rdx)
L1:
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jae    L12
  mov    -0x10(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jae    L12
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x10(%rbp)
L12:
  mov    -0x10(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jae    L120
  mov    -0x10(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jae    L120
  mov    -0x10(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L1
L120:
  mov    -0x14(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  subl   $0x1,-0x20(%rbp)
L125:
  cmpl   $0x0,-0x20(%rbp)
  jne    L86
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void heap_sortv_ui(unsigned int *const restrict A, unsigned n) {
  unsigned i;
  for (i = 1; i < n; ++i) {
    unsigned int item = A[i];
    unsigned h = i, p = (h - 1) >> 1;
    if (A[p] >= item)
      continue;
    do
      A[h] = A[p], h = p, p = (p - 1) >> 1;
    while (h && A[p] < item);
    A[h] = item;
  }
  for (i = n - 1; i; --i) {
    unsigned int item = A[i];
    unsigned h = 0;
    A[i] = A[0];
    for (;;) {
      unsigned ch = 1 + (h << 1), r = ch + 1;
      if (r < i && A[ch] < A[r])
        ch = r;
      if (ch >= i || item >= A[ch])
        break;
      A[h] = A[ch], h = ch;
    }
    A[h] = item;
  }
}
```