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

```asm
<main>:
  endbr64
  push   %r13
  lea    D28(%rip),%rdi
  push   %r12
  lea    D90(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x10(%rsp)
  call   <printf@plt>
  lea    0xc(%rsp),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%eax
  lea    0x0(,%rax,4),%edi
  call   <malloc@plt>
  lea    D65(%rip),%rdi
  mov    %rax,%r13
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L7
  mov    %r13,%rbp
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L14:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  add    $0x4,%rbp
  call   <scanf@plt>
  cmp    %ebx,0xc(%rsp)
  jg     L14
L7:
  lea    D59(%rip),%rdi
  lea    0x10(%rsp),%rbp
  call   <printf@plt>
  mov    0xc(%rsp),%esi
  mov    %r13,%rdi
  call   <printIntArray@plt>
  mov    0xc(%rsp),%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <cloneIntArray@plt>
  lea    D85(%rip),%rdi
  call   <printf@plt>
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%rdi
  call   <printIntArray@plt>
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%rdi
  call   <IntArraySelSort@plt>
  lea    D41(%rip),%rdi
  call   <printf@plt>
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%rdi
  call   <printIntArray@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0xc(%rsp),%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <cloneIntArray@plt>
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%rdi
  call   <IntArrayInsSort@plt>
  lea    D19(%rip),%rdi
  call   <printf@plt>
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%rdi
  call   <printIntArray@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0xc(%rsp),%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <cloneIntArray@plt>
  mov    0xc(%rsp),%eax
  mov    0x10(%rsp),%rdi
  xor    %esi,%esi
  lea    -0x1(%rax),%edx
  call   <intArrayMergeSort@plt>
  lea    D67(%rip),%rdi
  call   <printf@plt>
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%rdi
  call   <printIntArray@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0xc(%rsp),%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <cloneIntArray@plt>
  xor    %edi,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    0xc(%rsp),%eax
  mov    0x10(%rsp),%rdi
  xor    %esi,%esi
  lea    -0x1(%rax),%edx
  call   <intArrayQuickSort@plt>
  lea    D99(%rip),%rdi
  call   <printf@plt>
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%rdi
  call   <printIntArray@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0xc(%rsp),%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <cloneIntArray@plt>
  mov    0xc(%rsp),%esi
  mov    %rbp,%rdi
  call   <intArrayHeapSort@plt>
  lea    D64(%rip),%rdi
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  mov    0xc(%rsp),%esi
  call   <printIntArrayReverse@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L27
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L27:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D28
data_type: string
name: read_data
arguments: tag: D90
data_type: string
name: read_data
arguments: tag: D65
data_type: string
name: read_data
arguments: tag: D59
data_type: string
name: read_data
arguments: tag: D85
data_type: string
name: read_data
arguments: tag: D41
data_type: string
name: read_data
arguments: tag: D19
data_type: string
name: read_data
arguments: tag: D67
data_type: string
name: read_data
arguments: tag: D99
data_type: string
name: read_data
arguments: tag: D64
data_type: string

tool: D28: How many elements do you want store in the array? 

tool: D90: %d

tool: D65: Insert elements:


tool: D59: This is your array:


tool: D85: This is the temporary array that we're going to order:


tool: D41: This is the array ordered with selection sort:


tool: D19: This is the array ordered with insertion sort:


tool: D67: This is the array ordered with mergesort:


tool: D99: This is the array ordered with quicksort:


tool: D64: This is the array ordered with heapsort:


assistant: ```c
int main() {
  int *a = NULL, *temp = NULL, n, i;
  printf("How many elements do you want store in the array? ");
  scanf("%d", &n);
  a = (int *)malloc(sizeof(int) * n);
  printf("Insert elements:\n");
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  printf("This is your array:\n");
  printIntArray(a, n);
  cloneIntArray(&temp, a, n);
  printf("This is the temporary array that we're going to order:\n");
  printIntArray(temp, n);
  IntArraySelSort(temp, n);
  printf("This is the array ordered with selection sort:\n");
  printIntArray(temp, n);
  free(temp);
  cloneIntArray(&temp, a, n);
  IntArrayInsSort(temp, n);
  printf("This is the array ordered with insertion sort:\n");
  printIntArray(temp, n);
  free(temp);
  cloneIntArray(&temp, a, n);
  intArrayMergeSort(temp, 0, n - 1);
  printf("This is the array ordered with mergesort:\n");
  printIntArray(temp, n);
  free(temp);
  cloneIntArray(&temp, a, n);
  srand(time(NULL));
  intArrayQuickSort(temp, 0, n - 1);
  printf("This is the array ordered with quicksort:\n");
  printIntArray(temp, n);
  free(temp);
  cloneIntArray(&temp, a, n);
  intArrayHeapSort(&temp, n);
  printf("This is the array ordered with heapsort:\n");
  printIntArrayReverse(temp, n);
  free(temp);
  return 0;
}
```