user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rsi,%rbx
  cmp    $0x2,%edi
  jle    L70
  mov    0x10(%rsi),%rax
  mov    0x8(%rbx),%rdi
  xor    %r13d,%r13d
  movsbl (%rax),%esi
  mov    %esi,%r12d
  call   <Database_open@plt>
  mov    %rax,%r14
  cmp    $0x3,%ebp
  jne    L111
L8:
  sub    $0x63,%r12d
  cmp    $0x10,%r12b
  ja     L149
  lea    D75(%rip),%rdx
  movzbl %r12b,%r12d
  movslq (%rdx,%r12,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L111:
  mov    0x18(%rbx),%rdi
  call   <atoi@plt>
  mov    %eax,%r13d
  cmp    $0x63,%eax
  jle    L8
  lea    D33(%rip),%rdi
  call   <die@plt>
  jmp    L8
L70:
  lea    D52(%rip),%rdi
  call   <die@plt>
  mov    0x10(%rbx),%rax
  mov    0x8(%rbx),%rdi
  movsbl (%rax),%esi
  mov    %esi,%r12d
  call   <Database_open@plt>
  sub    $0x63,%r12d
  mov    %rax,%r14
  cmp    $0x10,%r12b
  ja     L149
  lea    D36(%rip),%rdx
  movzbl %r12b,%r12d
  movslq (%rdx,%r12,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L149:
  lea    D58(%rip),%rdi
  call   <die@plt>
L38:
  mov    %r14,%rdi
  call   <Database_close@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  xor    %r13d,%r13d
  cmp    $0x6,%ebp
  je     L121
  lea    D0(%rip),%rdi
  call   <die@plt>
L121:
  mov    0x28(%rbx),%rcx
  mov    0x20(%rbx),%rdx
  mov    %r14,%rdi
  mov    %r13d,%esi
  call   <Database_set@plt>
  mov    %r14,%rdi
  call   <Database_write@plt>
  jmp    L38
  mov    %r14,%rdi
  call   <Database_list@plt>
  jmp    L38
  xor    %r13d,%r13d
  cmp    $0x4,%ebp
  je     L55
  lea    D29(%rip),%rdi
  call   <die@plt>
L55:
  mov    %r13d,%esi
  mov    %r14,%rdi
  call   <Database_get@plt>
  jmp    L38
  mov    %r14,%rdi
  call   <Database_create@plt>
  mov    %r14,%rdi
  call   <Database_write@plt>
  jmp    L38
  cmp    $0x4,%ebp
  jne    L107
L84:
  mov    %r14,%rdi
  mov    %r13d,%esi
  call   <Database_delete@plt>
  mov    %r14,%rdi
  call   <Database_write@plt>
  jmp    L38
  xor    %r13d,%r13d
L107:
  lea    D5(%rip),%rdi
  call   <die@plt>
  jmp    L84
```

tool_calls: name: retrieve_data
arguments: label: D33
data_type: string
name: retrieve_data
arguments: label: D52
data_type: string
name: retrieve_data
arguments: label: D58
data_type: string
name: retrieve_data
arguments: label: D0
data_type: string
name: retrieve_data
arguments: label: D29
data_type: string
name: retrieve_data
arguments: label: D5
data_type: string

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

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

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

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

tool: D29: Need an id to get

tool: D5: Need an id to delete

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;
}
```