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

```asm
<heapSort>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %esi,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    $0x2,%esi
  mov    $0x3b,%edi
  call   <__CrestCall@plt>
  lea    0x4(%rsp),%rbx
  mov    %rbx,%rsi
  mov    $0x3a,%edi
  call   <__CrestStore@plt>
  lea    0x8(%rsp),%rdi
  call   <__CrestInt@plt>
  mov    %rbx,%rdi
  call   <__CrestInt@plt>
  movslq 0x4(%rsp),%rdx
  mov    %rbx,%rsi
  mov    $0x3c,%edi
  call   <__CrestLoad@plt>
  mov    0x4(%rsp),%esi
  mov    0x8(%rsp),%rdi
  call   <heapify@plt>
  mov    $0x3d,%edi
  call   <__CrestClearStack@plt>
  movslq 0x4(%rsp),%rdx
  mov    %rbx,%rsi
  mov    $0x40,%edi
  call   <__CrestLoad@plt>
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    $0x3f,%edi
  call   <__CrestLoad@plt>
  mov    0x4(%rsp),%eax
  lea    -0x1(%rax),%edx
  movslq %edx,%rdx
  mov    $0x1,%esi
  mov    $0x3e,%edi
  call   <__CrestApply2@plt>
  lea    0x10(%rsp),%rbx
  mov    %rbx,%rsi
  mov    $0x41,%edi
  call   <__CrestStore@plt>
  mov    0x4(%rsp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x10(%rsp)
  movslq %edx,%rdx
  mov    %rbx,%rsi
  mov    $0x44,%edi
  call   <__CrestLoad@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x43,%edi
  call   <__CrestLoad@plt>
  cmpl   $0x0,0x10(%rsp)
  setg   %dl
  movzbl %dl,%edx
  mov    $0xe,%esi
  mov    $0x42,%edi
  call   <__CrestApply2@plt>
  cmpl   $0x0,0x10(%rsp)
  jle    L35
  mov    $0x1,%edx
  mov    $0x17,%esi
  mov    $0x45,%edi
  call   <__CrestBranch@plt>
  mov    0x8(%rsp),%rbp
  movslq 0x0(%rbp),%rdx
  mov    %rbp,%rsi
  mov    $0x47,%edi
  call   <__CrestLoad@plt>
  lea    0x14(%rsp),%r13
  mov    %r13,%rsi
  mov    $0x48,%edi
  call   <__CrestStore@plt>
  mov    0x0(%rbp),%eax
  mov    %eax,0x14(%rsp)
  mov    0x8(%rsp),%rbp
  movslq 0x10(%rsp),%rax
  lea    0x0(%rbp,%rax,4),%r12
  movslq (%r12),%rdx
  mov    %r12,%rsi
  mov    $0x49,%edi
  call   <__CrestLoad@plt>
  mov    %rbp,%rsi
  mov    $0x4a,%edi
  call   <__CrestStore@plt>
  mov    (%r12),%eax
  mov    %eax,0x0(%rbp)
  movslq 0x10(%rsp),%rdx
  mov    0x8(%rsp),%rax
  lea    (%rax,%rdx,4),%rbp
  movslq 0x14(%rsp),%rdx
  mov    %r13,%rsi
  mov    $0x4b,%edi
  call   <__CrestLoad@plt>
  mov    %rbp,%rsi
  mov    $0x4c,%edi
  call   <__CrestStore@plt>
  mov    0x14(%rsp),%eax
  mov    %eax,0x0(%rbp)
  movslq 0x10(%rsp),%rdx
  mov    %rbx,%rsi
  mov    $0x4d,%edi
  call   <__CrestLoad@plt>
  mov    0x10(%rsp),%esi
  mov    0x8(%rsp),%rdi
  call   <adjust@plt>
  mov    $0x4e,%edi
  call   <__CrestClearStack@plt>
  movslq 0x10(%rsp),%rdx
  mov    %rbx,%rsi
  mov    $0x51,%edi
  call   <__CrestLoad@plt>
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    $0x50,%edi
  call   <__CrestLoad@plt>
  mov    0x10(%rsp),%eax
  lea    -0x1(%rax),%edx
  movslq %edx,%rdx
  mov    $0x1,%esi
  mov    $0x4f,%edi
  call   <__CrestApply2@plt>
  mov    %rbx,%rsi
  mov    $0x52,%edi
  call   <__CrestStore@plt>
  subl   $0x1,0x10(%rsp)
L18:
  movslq 0x10(%rsp),%rdx
  mov    %rbx,%rsi
  mov    $0x55,%edi
  call   <__CrestLoad@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x54,%edi
  call   <__CrestLoad@plt>
  cmpl   $0x0,0x10(%rsp)
  setg   %dl
  movzbl %dl,%edx
  mov    $0xe,%esi
  mov    $0x53,%edi
  call   <__CrestApply2@plt>
  cmpl   $0x0,0x10(%rsp)
  jle    L38
  mov    $0x1,%edx
  mov    $0x1a,%esi
  mov    $0x56,%edi
  call   <__CrestBranch@plt>
  mov    0x8(%rsp),%rbp
  movslq 0x0(%rbp),%rdx
  mov    %rbp,%rsi
  mov    $0x58,%edi
  call   <__CrestLoad@plt>
  lea    0x14(%rsp),%r13
  mov    %r13,%rsi
  mov    $0x59,%edi
  call   <__CrestStore@plt>
  mov    0x0(%rbp),%eax
  mov    %eax,0x14(%rsp)
  mov    0x8(%rsp),%rbp
  movslq 0x10(%rsp),%rax
  lea    0x0(%rbp,%rax,4),%r12
  movslq (%r12),%rdx
  mov    %r12,%rsi
  mov    $0x5a,%edi
  call   <__CrestLoad@plt>
  mov    %rbp,%rsi
  mov    $0x5b,%edi
  call   <__CrestStore@plt>
  mov    (%r12),%eax
  mov    %eax,0x0(%rbp)
  movslq 0x10(%rsp),%rdx
  mov    0x8(%rsp),%rax
  lea    (%rax,%rdx,4),%rbp
  movslq 0x14(%rsp),%rdx
  mov    %r13,%rsi
  mov    $0x5c,%edi
  call   <__CrestLoad@plt>
  mov    %rbp,%rsi
  mov    $0x5d,%edi
  call   <__CrestStore@plt>
  mov    0x14(%rsp),%eax
  mov    %eax,0x0(%rbp)
  movslq 0x10(%rsp),%rdx
  mov    %rbx,%rsi
  mov    $0x5e,%edi
  call   <__CrestLoad@plt>
  mov    0x10(%rsp),%esi
  mov    0x8(%rsp),%rdi
  call   <adjust@plt>
  mov    $0x5f,%edi
  call   <__CrestClearStack@plt>
  movslq 0x10(%rsp),%rdx
  mov    %rbx,%rsi
  mov    $0x62,%edi
  call   <__CrestLoad@plt>
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    $0x61,%edi
  call   <__CrestLoad@plt>
  mov    0x10(%rsp),%eax
  lea    -0x1(%rax),%edx
  movslq %edx,%rdx
  mov    $0x1,%esi
  mov    $0x60,%edi
  call   <__CrestApply2@plt>
  mov    %rbx,%rsi
  mov    $0x63,%edi
  call   <__CrestStore@plt>
  subl   $0x1,0x10(%rsp)
L46:
  mov    $0x64,%edi
  call   <__CrestReturn@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L35:
  mov    $0x0,%edx
  mov    $0x18,%esi
  mov    $0x46,%edi
  call   <__CrestBranch@plt>
  jmp    L18
L38:
  mov    $0x0,%edx
  mov    $0x1b,%esi
  mov    $0x57,%edi
  call   <__CrestBranch@plt>
  jmp    L46
L21:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void heapSort(int *a, int n) {
  int i;
  int t;
  int *mem_5;
  int *mem_6;
  int *mem_7;
  int *mem_8;
  int *mem_9;
  int *mem_10;
  int *mem_11;
  int *mem_12;
  {
    __CrestCall(59, 2);
    __CrestStore(58, (unsigned long)(&n));
    __CrestInt((int *)(&a));
    __CrestInt(&n);
    __CrestLoad(60, (unsigned long)(&n), (long long)n);
    heapify(a, n);
    __CrestClearStack(61);
    __CrestLoad(64, (unsigned long)(&n), (long long)n);
    __CrestLoad(63, (unsigned long)0, (long long)1);
    __CrestApply2(62, 1, (long long)(n - 1));
    __CrestStore(65, (unsigned long)(&i));
    i = n - 1;
    {{__CrestLoad(68, (unsigned long)(&i), (long long)i);
    __CrestLoad(67, (unsigned long)0, (long long)0);
    __CrestApply2(66, 14, (long long)(i > 0));
    if (i > 0) {
      __CrestBranch(69, 23, 1);
      mem_5 = a + 0;
      __CrestLoad(71, (unsigned long)mem_5, (long long)*mem_5);
      __CrestStore(72, (unsigned long)(&t));
      t = *mem_5;
      mem_6 = a + 0;
      mem_7 = a + i;
      __CrestLoad(73, (unsigned long)mem_7, (long long)*mem_7);
      __CrestStore(74, (unsigned long)mem_6);
      *mem_6 = *mem_7;
      mem_8 = a + i;
      __CrestLoad(75, (unsigned long)(&t), (long long)t);
      __CrestStore(76, (unsigned long)mem_8);
      *mem_8 = t;
      __CrestLoad(77, (unsigned long)(&i), (long long)i);
      adjust(a, i);
      __CrestClearStack(78);
      __CrestLoad(81, (unsigned long)(&i), (long long)i);
      __CrestLoad(80, (unsigned long)0, (long long)1);
      __CrestApply2(79, 1, (long long)(i - 1));
      __CrestStore(82, (unsigned long)(&i));
      i--;
    } else {
      __CrestBranch(70, 24, 0);
    }
  }
  {
    __CrestLoad(85, (unsigned long)(&i), (long long)i);
    __CrestLoad(84, (unsigned long)0, (long long)0);
    __CrestApply2(83, 14, (long long)(i > 0));
    if (i > 0) {
      __CrestBranch(86, 26, 1);
      mem_9 = a + 0;
      __CrestLoad(88, (unsigned long)mem_9, (long long)*mem_9);
      __CrestStore(89, (unsigned long)(&t));
      t = *mem_9;
      mem_10 = a + 0;
      mem_11 = a + i;
      __CrestLoad(90, (unsigned long)mem_11, (long long)*mem_11);
      __CrestStore(91, (unsigned long)mem_10);
      *mem_10 = *mem_11;
      mem_12 = a + i;
      __CrestLoad(92, (unsigned long)(&t), (long long)t);
      __CrestStore(93, (unsigned long)mem_12);
      *mem_12 = t;
      __CrestLoad(94, (unsigned long)(&i), (long long)i);
      adjust(a, i);
      __CrestClearStack(95);
      __CrestLoad(98, (unsigned long)(&i), (long long)i);
      __CrestLoad(97, (unsigned long)0, (long long)1);
      __CrestApply2(96, 1, (long long)(i - 1));
      __CrestStore(99, (unsigned long)(&i));
      i--;
    } else {
      __CrestBranch(87, 27, 0);
    }
  }
}
{
  __CrestReturn(100);
  return;
}
}
}
```