user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D30(%rip),%r13
  lea    D133(%rip),%r12
  lea    D119(%rip),%rbp
  lea    D32(%rip),%rbx
  jmp    L45
  lea    D117(%rip),%rdi
  call   <puts@plt>
L68:
  mov    $0xa,%edi
  call   <putchar@plt>
  cmpl   $0x0,(%rsp)
  je     L99
L45:
  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    D72(%rip),%rdi
  call   <puts@plt>
  lea    D127(%rip),%rdi
  call   <puts@plt>
  mov    %rsp,%rsi
  lea    D58(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmpl   $0x4,(%rsp)
  ja     L56
  mov    (%rsp),%eax
  lea    D79(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    0x4(%rsp),%rsi
  lea    D49(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x4(%rsp),%esi
  mov    $0x0,%edi
  call   <add@plt>
  jmp    L68
  lea    0x4(%rsp),%rsi
  lea    D49(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x4(%rsp),%esi
  mov    $0x1,%edi
  call   <add@plt>
  jmp    L68
  mov    $0x0,%edi
  call   <del@plt>
  mov    %eax,0x4(%rsp)
  cmp    $0xffffffff,%eax
  je     L68
  mov    %eax,%esi
  lea    D74(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L68
  mov    $0x1,%edi
  call   <del@plt>
  mov    %eax,0x4(%rsp)
  cmp    $0xffffffff,%eax
  je     L68
  mov    %eax,%esi
  lea    D74(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L68
L56:
  lea    D22(%rip),%rdi
  call   <puts@plt>
  jmp    L68
L99:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L84
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L84:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D30
datatype: string
name: read_data
arguments: data_label: D133
datatype: string
name: read_data
arguments: data_label: D119
datatype: string
name: read_data
arguments: data_label: D32
datatype: string
name: read_data
arguments: data_label: D117
datatype: string
name: read_data
arguments: data_label: D72
datatype: string
name: read_data
arguments: data_label: D127
datatype: string
name: read_data
arguments: data_label: D58
datatype: string
name: read_data
arguments: data_label: D49
datatype: string
name: read_data
arguments: data_label: D74
datatype: string
name: read_data
arguments: data_label: D22
datatype: string

tool: D30: Choose an action 

tool: D133: 0: Exit

tool: D119: 1: Add to   FRONT

tool: D32: 2: Add to   REAR 

tool: D117: Bye!

tool: D72: 3: Del from FRONT

tool: D127: 4: Del from REAR 

tool: D58:  %u%*c

tool: D49:  %d%*c

tool: D74: %d


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