user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  cmpl   $0x2,-0x24(%rbp)
  jg     L104
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L104:
  mov    -0x30(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  movsbl -0x15(%rbp),%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <Database_open@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  cmpl   $0x3,-0x24(%rbp)
  jle    L87
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x14(%rbp)
L87:
  cmpl   $0x63,-0x14(%rbp)
  jle    L94
  lea    D58(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L94:
  movsbl -0x15(%rbp),%eax
  sub    $0x63,%eax
  cmp    $0x10,%eax
  ja     L53
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D39(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D39(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <Database_create@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <Database_write@plt>
  jmp    L73
  cmpl   $0x4,-0x24(%rbp)
  je     L49
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L49:
  mov    -0x14(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <Database_get@plt>
  jmp    L73
  cmpl   $0x6,-0x24(%rbp)
  je     L117
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L117:
  mov    -0x30(%rbp),%rax
  add    $0x28,%rax
  mov    (%rax),%rcx
  mov    -0x30(%rbp),%rax
  add    $0x20,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%esi
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <Database_set@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <Database_write@plt>
  jmp    L73
  cmpl   $0x4,-0x24(%rbp)
  je     L107
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L107:
  mov    -0x14(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <Database_delete@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <Database_write@plt>
  jmp    L73
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <Database_list@plt>
  jmp    L73
L53:
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L73:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <Database_close@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D17
type_guessed: string
name: disassemble_data
arguments: label: D58
type_guessed: string
name: disassemble_data
arguments: label: D69
type_guessed: string
name: disassemble_data
arguments: label: D21
type_guessed: string
name: disassemble_data
arguments: label: D22
type_guessed: string
name: disassemble_data
arguments: label: D24
type_guessed: string

tool: D17: USAGE: cool 17 <dbfile> <action> [action params]

tool: D58: i don't have so many records./Theres not that many records.

tool: D69: Need an id to get

tool: D21: Need id, name, email to set a record

tool: D22: Need an id to delete

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

assistant: ```c
int main(int argc, char *argv[]) {
  if (argc < 3)
    die("USAGE: cool 17 <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("i don't have so many records./Theres 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 a record");
    Database_set(conn, id, argv[4], argv[5]);
    Database_write(conn);
    break;
  case 'd':
    if (argc != 4)
      die("Need an id to delete");
    Database_delete(conn, id);
    Database_write(conn);
    break;
  case 'l':
    Database_list(conn);
    break;
  default:
    die("Invalid action, only support: c=create, g=get, s=set, d=del, l=list");
  }
  Database_close(conn);
  return 0;
}
```