user: Translate the below assembly code into C programming language:

```asm
<heapSort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L7
L107:
  mov    -0x14(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L104:
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jge    L65
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    %rax,(%rdx)
L65:
  mov    -0x8(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L104
  addl   $0x1,-0x14(%rbp)
L7:
  mov    -0x14(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  jg     L107
  mov    -0x30(%rbp),%rax
  sub    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L33
L70:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %eax,-0x4(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    %rax,(%rdx)
  movl   $0x0,-0x8(%rbp)
L35:
  mov    -0x8(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jge    L18
  mov    -0x10(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xc(%rbp)
  jge    L18
  addl   $0x1,-0xc(%rbp)
L18:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jge    L50
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jge    L50
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    %rax,(%rdx)
L50:
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L35
  subl   $0x1,-0x10(%rbp)
L33:
  cmpl   $0x0,-0x10(%rbp)
  jns    L70
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void heapSort(long list[], long n) {
  int i, j, k, v, temp;
  for (i = 1; i < n; i++) {
    k = i;
    do {
      v = (k - 1) / 2;
      if (list[v] < list[k]) {
        temp = list[v];
        list[v] = list[k];
        list[k] = temp;
      }
      k = v;
    } while (k != 0);
  }
  for (j = n - 1; j >= 0; j--) {
    temp = list[0];
    list[0] = list[j];
    list[j] = temp;
    v = 0;
    do {
      k = 2 * v + 1;
      if (list[k] < list[k + 1] && k < j - 1)
        k++;
      if (list[v] < list[k] && k < j) {
        temp = list[v];
        list[v] = list[k];
        list[k] = temp;
      }
      v = k;
    } while (k < j);
  }
}
```