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

```asm
<mainmenu>:
  endbr64
  push   %rbp
  lea    D117(%rip),%rbp
  mov    %rbp,%rdi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    D8(%rip),%rdi
  call   <printf@plt>
  lea    D60(%rip),%rdi
  call   <printf@plt>
  lea    D91(%rip),%rdi
  call   <printf@plt>
  lea    D14(%rip),%rdi
  call   <printf@plt>
  lea    D67(%rip),%rdi
  call   <printf@plt>
  lea    D65(%rip),%rdi
  call   <printf@plt>
  lea    D54(%rip),%rdi
  call   <printf@plt>
  lea    D83(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <printf@plt>
  lea    D5(%rip),%rdi
  call   <printf@plt>
  lea    0x7(%rsp),%rsi
  lea    D16(%rip),%rdi
  call   <scanf@plt>
  cmpb   $0x6,0x7(%rsp)
  ja     L26
  movzbl 0x7(%rsp),%eax
  lea    D63(%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)
L26:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L67
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <query_menu@plt>
  jmp    L26
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <output_menu@plt>
  jmp    L26
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <file_menu@plt>
  jmp    L26
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <mod_menu@plt>
  jmp    L26
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <calc_menu@plt>
  jmp    L26
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <sort_menu@plt>
  jmp    L26
L67:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D117
type_infered: string
name: disassemble_data
arguments: tag: D8
type_infered: string
name: disassemble_data
arguments: tag: D60
type_infered: string
name: disassemble_data
arguments: tag: D91
type_infered: string
name: disassemble_data
arguments: tag: D14
type_infered: string
name: disassemble_data
arguments: tag: D67
type_infered: string
name: disassemble_data
arguments: tag: D65
type_infered: string
name: disassemble_data
arguments: tag: D54
type_infered: string
name: disassemble_data
arguments: tag: D83
type_infered: string
name: disassemble_data
arguments: tag: D5
type_infered: string
name: disassemble_data
arguments: tag: D16
type_infered: string

tool: D117: * * * * * * * * * * * * * * * * * * *


tool: D8: *           Main Menu               *


tool: D60: * 1. File                           *


tool: D91: * 2. Modify                         *


tool: D14: * 3. Calculate                      *


tool: D67: * 4. Sort                           *


tool: D65: * 5. Query                          *


tool: D54: * 6. Output                         *


tool: D83: * 0. Exit                           *


tool: D5: Please enter your choice:

tool: D16: %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;
  }
}
```