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

```asm
<heap_sort_test>:
  endbr64
  push   %rbp
  mov    $0xb,%edi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <get_rand_int_limit@plt>
  mov    %rsp,%rcx
  mov    %eax,-0x44(%rbp)
  add    $0x1,%eax
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L49
L104:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L104
L49:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L71
L119:
  mov    -0x44(%rbp),%ebx
  xor    %eax,%eax
  lea    D76(%rip),%rdi
  mov    %rsp,%r13
  mov    %ebx,%esi
  call   <printf@plt>
  test   %ebx,%ebx
  jle    L23
  mov    $0x1,%r15d
  xor    %r12d,%r12d
  lea    D36(%rip),%rbx
  nopl   0x0(%rax,%rax,1)
L118:
  mov    $0x15,%edi
  call   <get_rand_int_limit@plt>
  mov    %rbx,%rdi
  lea    -0xa(%rax),%esi
  xor    %eax,%eax
  mov    %esi,0x0(%r13,%r15,4)
  call   <printf@plt>
  movslq 0x0(%r13,%r15,4),%rax
  add    $0x1,%r15
  add    %rax,%r12
  cmp    %r15d,-0x44(%rbp)
  jge    L118
  lea    D61(%rip),%rax
  mov    $0x1,%r14d
  xor    %r15d,%r15d
  mov    %rax,%rdi
  mov    %rax,-0x50(%rbp)
  call   <puts@plt>
  mov    -0x44(%rbp),%esi
  mov    %r13,%rdi
  call   <heap_sort@plt>
  lea    D25(%rip),%rdi
  call   <puts@plt>
  nopl   0x0(%rax)
L101:
  mov    %r15d,-0x48(%rbp)
  mov    0x0(%r13,%r14,4),%r15d
  xor    %eax,%eax
  mov    %rbx,%rdi
  mov    %r15d,%esi
  call   <printf@plt>
  cmp    $0x1,%r14d
  jle    L38
  mov    -0x48(%rbp),%r8d
  cmp    %r8d,%r15d
  jge    L38
  mov    %r15d,%edx
  mov    %r8d,%esi
  lea    D55(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <block_api@plt>
L38:
  movslq %r15d,%rax
  add    $0x1,%r14
  sub    %rax,%r12
  cmp    %r14d,-0x44(%rbp)
  jge    L101
  test   %r12,%r12
  je     L105
  mov    %r12,%rsi
  lea    D78(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <block_api@plt>
L105:
  mov    -0x50(%rbp),%rdi
  call   <puts@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L58
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax)
L71:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L119
L23:
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  mov    %rax,-0x50(%rbp)
  call   <puts@plt>
  mov    -0x44(%rbp),%esi
  mov    %r13,%rdi
  call   <heap_sort@plt>
  lea    D25(%rip),%rdi
  call   <puts@plt>
  jmp    L105
L58:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D76
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D36
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D61
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D25
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D55
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D78
type_guessed: string

tool: D76: Creating %d random numbers:


tool: D36: %d, 

tool: D61: 
--------------------------------------------

tool: D25: Validating Heap_sort output

tool: D55: 
Error: Sort invariant broken - %d found before %d


tool: D78: 
Error: sum(%lu) nonzero, heap gobbled something?


assistant: ```c
void heap_sort_test() {
  int i, n = get_rand_int_limit(10 + 1);
  int arr[n + 1];
  int old_val = 0;
  unsigned long sum = 0;
  printf("Creating %d random numbers:\n", n);
  for (i = 1; i <= n; i++) {
    arr[i] = get_rand_int_limit(10 * 2 + 1) + (-10);
    printf("%d, ", arr[i]);
    sum += arr[i];
  }
  printf("\n--------------------------------------------\n");
  heap_sort(arr, n);
  printf("Validating Heap_sort output\n");
  for (i = 1; i <= n; i++) {
    int val = arr[i];
    printf("%d, ", val);
    if (i > 1 && (((val)) < ((old_val)))) {
      printf("\nError: Sort invariant broken - %d found before %d\n", old_val, val);
      block_api();
    }
    sum -= val;
    old_val = val;
  }
  if (sum != 0) {
    printf("\nError: sum(%lu) nonzero, heap gobbled something?\n", sum);
    block_api();
  }
  printf("\n--------------------------------------------\n");
}
```