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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
L105:
  lea    D65(%rip),%rax
  mov    %rax,%rdi
  call   <system@plt>
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0xd8(%rbp),%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0xd8(%rbp),%eax
  cmp    $0x3,%eax
  jg     L122
  mov    -0xd8(%rbp),%eax
  test   %eax,%eax
  jle    L122
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0xdc(%rbp),%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0x0,-0xd4(%rbp)
  jmp    L101
L63:
  lea    -0xd0(%rbp),%rdx
  mov    -0xd4(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0xd4(%rbp)
L101:
  mov    -0xdc(%rbp),%eax
  cmp    %eax,-0xd4(%rbp)
  jl     L63
L122:
  mov    -0xd8(%rbp),%eax
  cmp    $0x4,%eax
  je     L64
  cmp    $0x4,%eax
  jg     L161
  cmp    $0x3,%eax
  je     L130
  cmp    $0x3,%eax
  jg     L161
  cmp    $0x1,%eax
  je     L93
  cmp    $0x2,%eax
  je     L60
  jmp    L161
L93:
  mov    -0xdc(%rbp),%eax
  lea    -0x1(%rax),%edx
  lea    -0xd0(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <mergeSort@plt>
  lea    D113(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0xdc(%rbp),%edx
  lea    -0xd0(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <printArray@plt>
  jmp    L15
L60:
  mov    -0xdc(%rbp),%eax
  lea    -0x1(%rax),%edx
  lea    -0xd0(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <quickSort@plt>
  lea    D113(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0xdc(%rbp),%edx
  lea    -0xd0(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <printArray@plt>
  jmp    L15
L130:
  mov    -0xdc(%rbp),%eax
  lea    -0x1(%rax),%edx
  lea    -0xd0(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <heapSort@plt>
  lea    D113(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0xdc(%rbp),%edx
  lea    -0xd0(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <printArray@plt>
  jmp    L15
L64:
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L15
L161:
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
L15:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    -0xd8(%rbp),%eax
  cmp    $0x4,%eax
  jne    L105
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L118
  call   <__stack_chk_fail@plt>
L118:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D65
type_guessed: string
name: read_data
arguments: label: D47
type_guessed: string
name: read_data
arguments: label: D25
type_guessed: string
name: read_data
arguments: label: D85
type_guessed: string
name: read_data
arguments: label: D49
type_guessed: string
name: read_data
arguments: label: D113
type_guessed: string
name: read_data
arguments: label: D23
type_guessed: string
name: read_data
arguments: label: D37
type_guessed: string

tool: D65: cls

tool: D47: ===To implement various Sorting Algorithms===
1. MergeSort
2. QuickSort
3. HeapSort
4. Exit
Enter your choice: 

tool: D25: %d

tool: D85: Enter Size of array: 

tool: D49: Enter Array elements: 

tool: D113: Sorted array is: 

tool: D23: Thank you for using


tool: D37: Invalid Choice please try again


assistant: ```c
int main() {
  int arr[50];
  int n, i;
  int choice;
  do {
    system("cls");
    printf("===To implement various Sorting Algorithms===\n"
           "1. MergeSort\n"
           "2. QuickSort\n"
           "3. HeapSort\n"
           "4. Exit\n"
           "Enter your choice: ");
    scanf("%d", &choice);
    if (choice < 4 && choice > 0) {
      printf("Enter Size of array: ");
      scanf("%d", &n);
      printf("Enter Array elements: ");
      for (i = 0; i < n; i++)
        scanf("%d", &arr[i]);
    }
    switch (choice) {
    case 1:
      mergeSort(arr, 0, n - 1);
      printf("Sorted array is: ");
      printArray(arr, n);
      break;
    case 2:
      quickSort(arr, 0, n - 1);
      printf("Sorted array is: ");
      printArray(arr, n);
      break;
    case 3:
      heapSort(arr, n - 1);
      printf("Sorted array is: ");
      printArray(arr, n);
      break;
    case 4:
      printf("Thank you for using\n");
      break;
    default:
      printf("Invalid Choice please try again\n");
      break;
    }
    getch();
  } while (choice != 4);
  return 0;
}
```