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

```asm
<main>:
  endbr64
  push   %r15
  lea    D27(%rip),%r15
  push   %r14
  lea    D86(%rip),%r14
  push   %r13
  lea    D102(%rip),%r13
  push   %r12
  lea    D41(%rip),%r12
  push   %rbp
  lea    D53(%rip),%rbp
  push   %rbx
  lea    D89(%rip),%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L26:
  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>
  lea    D121(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%rsi
  xor    %eax,%eax
  lea    D117(%rip),%rdi
  call   <scanf@plt>
  cmpl   $0x4,0x10(%rsp)
  ja     L10
  mov    0x10(%rsp),%eax
  movslq (%rbx,%rax,4),%rax
  add    %rbx,%rax
  notrack jmp *%rax
  xor    %edi,%edi
L48:
  call   <del@plt>
  mov    %eax,0x14(%rsp)
  mov    %eax,%esi
  cmp    $0xffffffff,%eax
  je     L47
  lea    D92(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L47:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x10(%rsp),%eax
  test   %eax,%eax
  jne    L26
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L89
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
  lea    0x14(%rsp),%rsi
  lea    D10(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x14(%rsp),%esi
  mov    $0x1,%edi
  call   <add@plt>
  jmp    L47
  nopl   0x0(%rax,%rax,1)
  lea    0x14(%rsp),%rsi
  lea    D10(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x14(%rsp),%esi
  xor    %edi,%edi
  call   <add@plt>
  jmp    L47
  nopl   0x0(%rax,%rax,1)
  lea    D19(%rip),%rdi
  call   <puts@plt>
  jmp    L47
  nopl   0x0(%rax)
  mov    $0x1,%edi
  jmp    L48
L10:
  lea    D49(%rip),%rdi
  call   <puts@plt>
  jmp    L47
L89:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D27
data_type: string
name: retrieve_data
arguments: tag: D86
data_type: string
name: retrieve_data
arguments: tag: D102
data_type: string
name: retrieve_data
arguments: tag: D41
data_type: string
name: retrieve_data
arguments: tag: D53
data_type: string
name: retrieve_data
arguments: tag: D121
data_type: string
name: retrieve_data
arguments: tag: D117
data_type: string
name: retrieve_data
arguments: tag: D92
data_type: string
name: retrieve_data
arguments: tag: D10
data_type: string
name: retrieve_data
arguments: tag: D19
data_type: string
name: retrieve_data
arguments: tag: D49
data_type: string

tool: D27: Choose an action 

tool: D86: 0: Exit

tool: D102: 1: Add to   FRONT

tool: D41: 2: Add to   REAR 

tool: D53: 3: Del from FRONT

tool: D121: 4: Del from REAR 

tool: D117:  %u%*c

tool: D92: %d


tool: D10:  %d%*c

tool: D19: Bye!

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