user: 请将以下的汇编代码转换成C语言代码:

```asm
<mainmenu>:
  endbr64
  push   %rbp
  lea    D63(%rip),%rbp
  mov    %rbp,%rdi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    D118(%rip),%rdi
  call   <printf@plt>
  lea    D28(%rip),%rdi
  call   <printf@plt>
  lea    D54(%rip),%rdi
  call   <printf@plt>
  lea    D100(%rip),%rdi
  call   <printf@plt>
  lea    D73(%rip),%rdi
  call   <printf@plt>
  lea    D103(%rip),%rdi
  call   <printf@plt>
  lea    D38(%rip),%rdi
  call   <printf@plt>
  lea    D116(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <printf@plt>
  lea    D3(%rip),%rdi
  call   <printf@plt>
  lea    0x7(%rsp),%rsi
  lea    D32(%rip),%rdi
  call   <scanf@plt>
  cmpb   $0x6,0x7(%rsp)
  ja     L5
  movzbl 0x7(%rsp),%eax
  lea    D105(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopw   0x0(%rax,%rax,1)
  xor    %edi,%edi
  call   <exit@plt>
  nopw   0x0(%rax,%rax,1)
L5:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L44
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <query_menu@plt>
  jmp    L5
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <output_menu@plt>
  jmp    L5
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <file_menu@plt>
  jmp    L5
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <mod_menu@plt>
  jmp    L5
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <calc_menu@plt>
  jmp    L5
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <sort_menu@plt>
  jmp    L5
L44:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D63
data_type: string
name: unpack_data
arguments: data_label: D118
data_type: string
name: unpack_data
arguments: data_label: D28
data_type: string
name: unpack_data
arguments: data_label: D54
data_type: string
name: unpack_data
arguments: data_label: D100
data_type: string
name: unpack_data
arguments: data_label: D73
data_type: string
name: unpack_data
arguments: data_label: D103
data_type: string
name: unpack_data
arguments: data_label: D38
data_type: string
name: unpack_data
arguments: data_label: D116
data_type: string
name: unpack_data
arguments: data_label: D3
data_type: string
name: unpack_data
arguments: data_label: D32
data_type: string

tool: D63: * * * * * * * * * * * * * * * * * * *


tool: D118: *           Main Menu               *


tool: D28: * 1. File                           *


tool: D54: * 2. Modify                         *


tool: D100: * 3. Calculate                      *


tool: D73: * 4. Sort                           *


tool: D103: * 5. Query                          *


tool: D38: * 6. Output                         *


tool: D116: * 0. Exit                           *


tool: D3: Please enter your choice:

tool: D32: %d

assistant: ```c
int mainmenu() {
  char sel;
  printf("* * * * * * * * * * * * * * * * * * *\n");
  printf("*           Main Menu               *\n");
  printf("* 1. File                           *\n");
  printf("* 2. Modify                         *\n");
  printf("* 3. Calculate                      *\n");
  printf("* 4. Sort                           *\n");
  printf("* 5. Query                          *\n");
  printf("* 6. Output                         *\n");
  printf("* 0. Exit                           *\n");
  printf("* * * * * * * * * * * * * * * * * * *\n");
  printf("Please enter your choice:");
  scanf("%d", &sel);
  switch (sel) {
  case 1:
    file_menu();
    break;
  case 2:
    mod_menu();
    break;
  case 3:
    calc_menu();
    break;
  case 4:
    sort_menu();
    break;
  case 5:
    query_menu();
    break;
  case 6:
    output_menu();
    break;
  case 0:
    exit(0);
    break;
  }
}
```