user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
L21:
  lea    D93(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D113(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D94(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D125(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x10(%rbp),%eax
  cmp    $0x4,%eax
  ja     L36
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D79(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D79(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L15
  lea    -0xc(%rbp),%rax
  mov    %rax,%rsi
  lea    D121(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  mov    $0x0,%edi
  call   <add@plt>
  jmp    L15
  lea    -0xc(%rbp),%rax
  mov    %rax,%rsi
  lea    D121(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <add@plt>
  jmp    L15
  mov    $0x0,%edi
  call   <del@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    $0xffffffff,%eax
  je     L109
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L109
  mov    $0x1,%edi
  call   <del@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    $0xffffffff,%eax
  je     L18
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L18
L36:
  lea    D129(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L15
L109:
  nop
  jmp    L15
L18:
  nop
L15:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x10(%rbp),%eax
  test   %eax,%eax
  jne    L21
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D93
type: string
name: unpack_data
arguments: data_label: D113
type: string
name: unpack_data
arguments: data_label: D21
type: string
name: unpack_data
arguments: data_label: D94
type: string
name: unpack_data
arguments: data_label: D125
type: string
name: unpack_data
arguments: data_label: D24
type: string
name: unpack_data
arguments: data_label: D34
type: string
name: unpack_data
arguments: data_label: D15
type: string
name: unpack_data
arguments: data_label: D121
type: string
name: unpack_data
arguments: data_label: D25
type: string
name: unpack_data
arguments: data_label: D129
type: string

tool: D93: Choose an action 

tool: D113: 0: Exit

tool: D21: 1: Add to   FRONT

tool: D94: 2: Add to   REAR 

tool: D125: 3: Del from FRONT

tool: D24: 4: Del from REAR 

tool: D34:  %u%*c

tool: D15: Bye!

tool: D121:  %d%*c

tool: D25: %d


tool: D129: Invalid Input!

assistant: ```c
int main() {
  unsigned ch;
  int p;
  do {
    puts("Choose an action ");
    puts("0: Exit");
    puts("1: Add to   FRONT");
    puts("2: Add to   REAR ");
    puts("3: Del from FRONT");
    puts("4: Del from REAR ");
    scanf(" %u%*c", &ch);
    switch (ch) {
    case 0:
      puts("Bye!");
      break;
    case 1:
      scanf(" %d%*c", &p);
      add(0, p);
      break;
    case 2:
      scanf(" %d%*c", &p);
      add(1, p);
      break;
    case 3:
      if ((p = del(0)) != -1)
        printf("%d\n", p);
      break;
    case 4:
      if ((p = del(1)) != -1)
        printf("%d\n", p);
      break;
    default:
      printf("Invalid Input!\n");
      break;
    }
    putchar('\n');
  } while (ch);
  return 0;
}
```