user: Converte this assembly snippet into its equivalent C code:

```asm
<BNCMode>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D80(%rip),%rdi
  call   <printf@plt>
  lea    D111(%rip),%rdi
  call   <printf@plt>
  lea    D114(%rip),%rdi
  call   <printf@plt>
  lea    D9(%rip),%rdi
  call   <printf@plt>
  lea    D27(%rip),%rdi
  call   <printf@plt>
  lea    D65(%rip),%rdi
  call   <printf@plt>
  lea    D13(%rip),%rdi
  call   <printf@plt>
  lea    D32(%rip),%rdi
  call   <printf@plt>
  lea    D115(%rip),%rdi
  call   <printf@plt>
  lea    D38(%rip),%rdi
  call   <printf@plt>
  lea    D122(%rip),%rdi
  call   <printf@plt>
  mov    %rsp,%rsi
  lea    D56(%rip),%rdi
  call   <scanf@plt>
  mov    $0x14,%edi
  call   <BNCIO@plt>
  cmpq   $0x9,(%rsp)
  ja     L99
  lea    D31(%rip),%rdx
  mov    (%rsp),%rax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x0,%eax
  call   <BNC_0@plt>
L79:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  mov    $0x63,%eax
  add    $0x18,%rsp
  ret
  mov    $0x0,%eax
  call   <BNC_1@plt>
  jmp    L79
  mov    $0x0,%eax
  call   <BNC_2@plt>
  jmp    L79
  mov    $0x0,%eax
  call   <BNC_3@plt>
  jmp    L79
  mov    $0x0,%eax
  call   <BNC_4@plt>
  jmp    L79
  mov    $0x0,%eax
  call   <BNC_5@plt>
  jmp    L79
  mov    $0x0,%eax
  call   <BNC_6@plt>
  jmp    L79
  mov    $0x0,%eax
  call   <BNC_7@plt>
  jmp    L79
  mov    $0x0,%eax
  call   <BNC_8@plt>
  jmp    L79
  mov    $0x0,%eax
  call   <BNC_9@plt>
  jmp    L79
L99:
  mov    $0x0,%eax
  call   <BNC_0@plt>
  jmp    L79
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D80
type: string
name: read_data
arguments: data_label: D111
type: string
name: read_data
arguments: data_label: D114
type: string
name: read_data
arguments: data_label: D9
type: string
name: read_data
arguments: data_label: D27
type: string
name: read_data
arguments: data_label: D65
type: string
name: read_data
arguments: data_label: D13
type: string
name: read_data
arguments: data_label: D32
type: string
name: read_data
arguments: data_label: D115
type: string
name: read_data
arguments: data_label: D38
type: string
name: read_data
arguments: data_label: D122
type: string
name: read_data
arguments: data_label: D56
type: string

tool: D80: Function (0-9) ? 


tool: D111: 0 - Power measure 


tool: D114: 1 - Am 


tool: D9: 2 - FM 


tool: D27: 3 - Phase modulated 


tool: D65: 4 - Sweep 


tool: D13: 5 - FSK 


tool: D32: 6 - Burst 


tool: D115: 7 - SSb 


tool: D38: 8 - DTMF generator 


tool: D122: 9 - DTMF detection 


tool: D56: %i

assistant: ```c
long int BNCMode() {
  long int ii, stat = 99;
  printf("Function (0-9) ? \n");
  printf("0 - Power measure \n");
  printf("1 - Am \n");
  printf("2 - FM \n");
  printf("3 - Phase modulated \n");
  printf("4 - Sweep \n");
  printf("5 - FSK \n");
  printf("6 - Burst \n");
  printf("7 - SSb \n");
  printf("8 - DTMF generator \n");
  printf("9 - DTMF detection \n");
  scanf("%i", &ii);
  BNCIO(20);
  switch (ii) {
  case 0:
    BNC_0();
    break;
  case 1:
    BNC_1();
    break;
  case 2:
    BNC_2();
    break;
  case 3:
    BNC_3();
    break;
  case 4:
    BNC_4();
    break;
  case 5:
    BNC_5();
    break;
  case 6:
    BNC_6();
    break;
  case 7:
    BNC_7();
    break;
  case 8:
    BNC_8();
    break;
  case 9:
    BNC_9();
    break;
  default:
    BNC_0();
    break;
  }
  return (stat);
}
```