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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %rsi,%rbx
  cmp    $0x2,%edi
  jle    L127
  mov    0x10(%rsi),%rax
  movzbl (%rax),%r13d
  movsbl %r13b,%esi
  mov    0x8(%rbx),%rdi
  call   <Database_open@plt>
  mov    %rax,%rbp
  mov    $0x0,%r14d
  cmp    $0x3,%r12d
  jg     L121
L26:
  sub    $0x63,%r13d
  cmp    $0x10,%r13b
  ja     L167
  movzbl %r13b,%r13d
  lea    D30(%rip),%rdx
  movslq (%rdx,%r13,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L127:
  lea    D31(%rip),%rdi
  call   <die@plt>
  mov    0x10(%rbx),%rax
  movzbl (%rax),%r13d
  movsbl %r13b,%esi
  mov    0x8(%rbx),%rdi
  call   <Database_open@plt>
  mov    %rax,%rbp
  sub    $0x63,%r13d
  cmp    $0x10,%r13b
  ja     L167
  movzbl %r13b,%r13d
  lea    D35(%rip),%rdx
  movslq (%rdx,%r13,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L121:
  mov    0x18(%rbx),%rdi
  call   <atoi@plt>
  mov    %eax,%r14d
  cmp    $0x63,%eax
  jle    L26
  lea    D1(%rip),%rdi
  call   <die@plt>
  jmp    L26
  mov    %rbp,%rdi
  call   <Database_create@plt>
  mov    %rbp,%rdi
  call   <Database_write@plt>
L39:
  mov    %rbp,%rdi
  call   <Database_close@plt>
  mov    $0x0,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  mov    $0x0,%r14d
  cmp    $0x4,%r12d
  jne    L47
L29:
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <Database_get@plt>
  jmp    L39
L47:
  lea    D26(%rip),%rdi
  call   <die@plt>
  jmp    L29
  mov    $0x0,%r14d
  cmp    $0x6,%r12d
  jne    L114
L128:
  mov    0x28(%rbx),%rcx
  mov    0x20(%rbx),%rdx
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <Database_set@plt>
  mov    %rbp,%rdi
  call   <Database_write@plt>
  jmp    L39
L114:
  lea    D70(%rip),%rdi
  call   <die@plt>
  jmp    L128
  cmp    $0x4,%r12d
  jne    L48
L166:
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <Database_delete@plt>
  mov    %rbp,%rdi
  call   <Database_write@plt>
  jmp    L39
  mov    $0x0,%r14d
L48:
  lea    D4(%rip),%rdi
  call   <die@plt>
  jmp    L166
  mov    %rbp,%rdi
  call   <Database_list@plt>
  jmp    L39
L167:
  lea    D74(%rip),%rdi
  call   <die@plt>
  jmp    L39
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D31
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D1
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D26
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D70
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D4
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D74
type_guessed: string

tool: D31: USAGE: ex17 <dbfile> <action> [action params]

tool: D1: There's not that many records.

tool: D26: Need an id to get

tool: D70: Need id, name, email to set

tool: D4: Need id to delete

tool: D74: Invalid action, only: c=create, g=get, s=set, d=del, l=list

assistant: ```c
int main(int argc, char *argv[]) {
  if (argc < 3)
    die("USAGE: ex17 <dbfile> <action> [action params]");
  char *filename = argv[1];
  char action = argv[2][0];
  struct Connection *conn = Database_open(filename, action);
  int id = 0;
  if (argc > 3)
    id = atoi(argv[3]);
  if (id >= 100)
    die("There's not that many records.");
  switch (action) {
  case 'c':
    Database_create(conn);
    Database_write(conn);
    break;
  case 'g':
    if (argc != 4)
      die("Need an id to get");
    Database_get(conn, id);
    break;
  case 's':
    if (argc != 6)
      die("Need id, name, email to set");
    Database_set(conn, id, argv[4], argv[5]);
    Database_write(conn);
    break;
  case 'd':
    if (argc != 4)
      die("Need id to delete");
    Database_delete(conn, id);
    Database_write(conn);
    break;
  case 'l':
    Database_list(conn);
    break;
  default:
    die("Invalid action, only: c=create, g=get, s=set, d=del, l=list");
  }
  Database_close(conn);
  return 0;
}
```