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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
L18:
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D82(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x10(%rbp),%eax
  cmp    $0x3,%eax
  je     L119
  cmp    $0x3,%eax
  jg     L120
  cmp    $0x2,%eax
  je     L105
  cmp    $0x2,%eax
  jg     L120
  test   %eax,%eax
  je     L81
  cmp    $0x1,%eax
  jne    L120
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0xc(%rbp),%rax
  mov    %rax,%rsi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <qinsert@plt>
  jmp    L110
L105:
  mov    $0x0,%eax
  call   <qdelete@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  cmp    $0xffffffff,%eax
  je     L36
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L36
L119:
  mov    $0x0,%eax
  call   <display@plt>
  jmp    L110
L120:
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L110
L81:
  nop
  jmp    L110
L36:
  nop
L110:
  mov    -0x10(%rbp),%eax
  test   %eax,%eax
  jne    L18
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L74
  call   <__stack_chk_fail@plt>
L74:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D37
type_guessed: string
name: parse_data
arguments: tag: D10
type_guessed: string
name: parse_data
arguments: tag: D23
type_guessed: string
name: parse_data
arguments: tag: D8
type_guessed: string
name: parse_data
arguments: tag: D82
type_guessed: string
name: parse_data
arguments: tag: D53
type_guessed: string
name: parse_data
arguments: tag: D20
type_guessed: string
name: parse_data
arguments: tag: D62
type_guessed: string
name: parse_data
arguments: tag: D12
type_guessed: string
name: parse_data
arguments: tag: D85
type_guessed: string

tool: D37: 
-------------------

tool: D10: 1. Insert

tool: D23: 2. Delete

tool: D8: 3. Display

tool: D82: 0. Exit

tool: D53: Enter choice: 

tool: D20: %d

tool: D62: Enter an item: 

tool: D12: Item removed: %d 


tool: D85: Invalid Choice!

assistant: ```c
int main() {
  int ch, item;
  do {
    printf("\n-------------------\n");
    printf("1. Insert\n");
    printf("2. Delete\n");
    printf("3. Display\n");
    printf("0. Exit\n");
    printf("Enter choice: ");
    scanf("%d", &ch);
    switch (ch) {
    case 1:
      printf("Enter an item: ");
      scanf("%d", &item);
      qinsert(item);
      break;
    case 2:
      item = qdelete();
      if (item != -1)
        printf("Item removed: %d \n", item);
      break;
    case 3:
      display();
      break;
    case 0:
      break;
    default:
      printf("Invalid Choice!\n");
    }
  } while (ch != 0);
  return 0;
}
```