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

```asm
<main>:
  endbr64
  push   %r15
  lea    D66(%rip),%r15
  push   %r14
  lea    D36(%rip),%r14
  push   %r13
  push   %r12
  lea    D47(%rip),%r12
  push   %rbp
  push   %rbx
  mov    $0x5,%ebx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%r13
  call   <initMap@plt>
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <banner@plt>
  movl   $0x0,0x4(%rsp)
  jmp    L159
  nopl   0x0(%rax,%rax,1)
L102:
  test   %ebx,%ebx
  je     L32
L159:
  mov    %r14,%rdi
  call   <printf@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  test   %rax,%rax
  jle    L120
  mov    0x4(%rsp),%esi
  mov    %rbp,%rdi
  call   <setMap@plt>
  test   %rax,%rax
  jne    L102
  mov    %rbp,%rdi
  call   <check@plt>
  test   %rax,%rax
  jne    L32
  mov    %rbp,%rdi
  call   <outMap@plt>
  mov    %r15,%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <setNPC@plt>
  mov    %rbp,%rdi
  call   <outMap@plt>
  mov    %rbp,%rdi
  call   <check@plt>
  test   %rax,%rax
  jne    L32
  sub    $0x1,%ebx
  test   %ebx,%ebx
  jne    L159
  nopw   0x0(%rax,%rax,1)
L32:
  lea    D32(%rip),%rdi
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <check@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  je     L64
  cmp    $0x1,%eax
  je     L11
  cmp    $0x2,%eax
  je     L110
L10:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r12d,%edi
  call   <writeRecord@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L84
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L120:
  lea    D4(%rip),%rdi
  call   <printf@plt>
  nopl   0x0(%rax)
L83:
  xor    %eax,%eax
  call   <getchar@plt>
  cmp    $0xa,%al
  jne    L83
  jmp    L102
L64:
  lea    D75(%rip),%rdi
  call   <printf@plt>
  jmp    L10
L110:
  lea    D55(%rip),%rdi
  call   <printf@plt>
  jmp    L10
L11:
  lea    D76(%rip),%rdi
  call   <printf@plt>
  jmp    L10
L84:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D66
datatype: string
name: retrieve_data
arguments: data_label: D36
datatype: string
name: retrieve_data
arguments: data_label: D47
datatype: string
name: retrieve_data
arguments: data_label: D32
datatype: string
name: retrieve_data
arguments: data_label: D4
datatype: string
name: retrieve_data
arguments: data_label: D75
datatype: string
name: retrieve_data
arguments: data_label: D55
datatype: string
name: retrieve_data
arguments: data_label: D76
datatype: string

tool: D66: Gegner ist am Zug:


tool: D36: Dein Zug: 

tool: D47: %d

tool: D32: Der Sieger ist...


tool: D4: 
Fehler bei der Eingabe!


tool: D75: Niemand


tool: D55: Der Computer


tool: D76: Der Spieler


assistant: ```c
int main(void) {
  char *map = initMap();
  banner(map);
  int input = 0;
  int turn;
  for (turn = 5; turn != 0; turn--) {
    printf("Dein Zug: ");
    if (scanf("%d", &input) <= 0) {
      printf("\nFehler bei der Eingabe!\n");
      while (getchar() != '\n')
        ;
      turn++;
      continue;
    }
    if (setMap(map, input) == 0) {
      if (check(map) != 0)
        break;
      outMap(map);
      printf("Gegner ist am Zug:\n");
      setNPC(map);
      outMap(map);
      if (check(map) != 0)
        break;
    } else {
      turn++;
    }
  }
  printf("Der Sieger ist...\n");
  int result = check(map);
  if (result == 0)
    printf("Niemand\n");
  else if (result == 1)
    printf("Der Spieler\n");
  else if (result == 2)
    printf("Der Computer\n");
  free(map);
  writeRecord(result);
  return 0;
}
```