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

```asm
<MainMenu>:
  endbr64
  push   %r15
  lea    D22(%rip),%r15
  push   %r14
  lea    D45(%rip),%r14
  push   %r13
  lea    D24(%rip),%r13
  push   %r12
  lea    D72(%rip),%r12
  push   %rbp
  lea    D8(%rip),%rbp
  push   %rbx
  lea    D5(%rip),%rbx
  sub    $0x128,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L62:
  mov    %r15,%rdi
  call   <puts@plt>
  mov    %r14,%rdi
  call   <puts@plt>
  mov    %r13,%rdi
  call   <puts@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <puts@plt>
  lea    D63(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  call   <LeddarGetKey@plt>
  mov    %eax,%edi
  call   <toupper@plt>
  sub    $0x1b,%eax
  cmp    $0x36,%eax
  ja     L62
  lea    D105(%rip),%rcx
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x128,%rsp
  lea    D44(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10d0 <puts@plt>
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <ConfigureRecordingMenu@plt>
  jmp    L62
  nopl   0x0(%rax)
  xor    %eax,%eax
  call   <ReplayMenu@plt>
  jmp    L62
  nopl   0x0(%rax)
  mov    0x8(%rsp),%rsi
  mov    $0xff,%edx
  lea    D89(%rip),%rdi
  call   <ListSensors@plt>
  mov    0x8(%rsp),%rsi
  mov    $0xff,%edx
  lea    D49(%rip),%rdi
  call   <ListSensors@plt>
  jmp    L62
  nopl   0x0(%rax)
  mov    $0x1,%edi
  call   <ConnectMenu@plt>
  jmp    L62
  nopw   0x0(%rax,%rax,1)
  xor    %edi,%edi
  call   <ConnectMenu@plt>
  jmp    L62
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D22
type_guessed: string
name: unpack_data
arguments: data_label: D45
type_guessed: string
name: unpack_data
arguments: data_label: D24
type_guessed: string
name: unpack_data
arguments: data_label: D72
type_guessed: string
name: unpack_data
arguments: data_label: D8
type_guessed: string
name: unpack_data
arguments: data_label: D5
type_guessed: string
name: unpack_data
arguments: data_label: D63
type_guessed: string
name: unpack_data
arguments: data_label: D44
type_guessed: string
name: unpack_data
arguments: data_label: D89
type_guessed: string
name: unpack_data
arguments: data_label: D49
type_guessed: string

tool: D22: 

Main Menu

tool: D45:   1. Connect

tool: D24:   2. Connect to single USB sensor

tool: D72:   3. List Sensors

tool: D8:   4. Replay Record

tool: D5:   5. Configure Recording

tool: D63:   6. Quit

tool: D44: 
*** Goodbye! ***

tool: D89: USB

tool: D49: SERIAL

assistant: ```c
void MainMenu(void) {
  for (;;) {
    int lChoice;
    puts("\n\nMain Menu");
    puts("  1. Connect");
    puts("  2. Connect to single USB sensor");
    puts("  3. List Sensors");
    puts("  4. Replay Record");
    puts("  5. Configure Recording");
    puts("  6. Quit");
    lChoice = toupper(LeddarGetKey());
    switch (lChoice) {
    case '1':
      ConnectMenu(0);
      break;
    case '2':
      ConnectMenu(1);
      break;
    case '3': {
      char lAddresses[256];
      ListSensors("USB", lAddresses, 255);
      ListSensors("SERIAL", lAddresses, 255);
      break;
    }
    case '4':
      ReplayMenu();
      break;
    case '5':
      ConfigureRecordingMenu();
      break;
    case '6':
    case 'Q':
    case 27:
      puts("\n*** Goodbye! ***");
      return;
    }
  }
}
```