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

```asm
<pregame>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  movl   $0x1,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <itoa@plt>
  mov    %rax,%rsi
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <cat@plt>
  mov    %rax,%rdx
  lea    D24(%rip),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <cat@plt>
  mov    %rax,%rdi
  call   <map_setmessage@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <data_isai@plt>
  test   %rax,%rax
  je     L180
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <ai_pregame@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <data_refresh@plt>
  mov    $0x0,%edi
  call   <io_printmap@plt>
  mov    $0x0,%eax
  call   <data_sleep@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L180
L29:
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <data_refresh@plt>
  mov    $0x0,%edi
  call   <io_printmap@plt>
  mov    $0x0,%eax
  call   <io_getkey@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x75,-0x4(%rbp)
  jg     L168
  cmpl   $0x61,-0x4(%rbp)
  jge    L26
  cmpl   $0x3,-0x4(%rbp)
  jg     L143
  cmpl   $0x0,-0x4(%rbp)
  jns    L120
  jmp    L168
L26:
  mov    -0x4(%rbp),%eax
  sub    $0x61,%eax
  cmp    $0x14,%eax
  ja     L168
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D35(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D35(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L143:
  cmpl   $0x4,-0x4(%rbp)
  je     L176
  jmp    L168
L120:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <marker_move@plt>
  jmp    L180
L176:
  mov    $0x0,%eax
  call   <marker_show@plt>
  mov    -0x14(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <build_routine@plt>
  test   %eax,%eax
  jne    L82
  jmp    L180
L82:
  mov    -0x14(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <road_routine@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L180
  mov    $0x0,%eax
  call   <io_printhelp@plt>
  mov    $0x0,%eax
  call   <io_getkey@plt>
  jmp    L180
  mov    $0x0,%edi
  call   <quit@plt>
  jmp    L180
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <ai_pregame@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L180
  mov    $0x1,%edi
  call   <pass_between_humans@plt>
  jmp    L180
L168:
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  call   <map_setmessage@plt>
  nop
L180:
  cmpl   $0x0,-0x8(%rbp)
  jne    L29
  cmpl   $0x0,-0x18(%rbp)
  je     L25
  mov    $0x0,%eax
  call   <marker_getposition@plt>
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <data_pregameres@plt>
L25:
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D21
type: string
name: extract_symbolic_data
arguments: data_label: D24
type: string
name: extract_symbolic_data
arguments: data_label: D46
type: string

tool: D21: Player 

tool: D24:  pregame, please build a settlement.

tool: D46: Press 'b' to build

assistant: ```c
void pregame(int player, int res) {
  int c;
  int go = 1;
  map_setmessage(cat(cat("Player ", itoa(player + 1)), " pregame, please build a settlement."));
  if (data_isai(player)) {
    ai_pregame(player);
    data_refresh(player);
    io_printmap(0);
    data_sleep();
    go = 0;
  }
  while (go) {
    data_refresh(player);
    io_printmap(0);
    switch (c = io_getkey()) {
    case 0:
    case 1:
    case 2:
    case 3:
      marker_move(c);
      break;
    case 4:
    case 'b':
      marker_show();
      if (!build_routine(player, 1))
        break;
      road_routine(player, 1);
      go = 0;
      break;
    case 'h':
      io_printhelp();
      io_getkey();
      break;
    case 'q':
      quit(0);
      break;
    case 'a':
      ai_pregame(player);
      go = 0;
      break;
    case 'u':
      pass_between_humans(1);
      break;
    default:
      map_setmessage("Press 'b' to build");
      break;
    }
  }
  if (res)
    data_pregameres(player, marker_getposition());
}
```