user: What is the c source code of the assembly code below?

```asm
<player_build>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%r12d
  mov    %esi,%ebp
  mov    %edx,%ebx
  mov    %ecx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  mov    %edx,%edi
  call   <data_gethand@plt>
  movslq %ebp,%rax
  mov    (%rsp,%rax,4),%r14d
  mov    $0x0,%eax
  call   <data_getera@plt>
  mov    %eax,%esi
  mov    %r14d,%edx
  mov    %ebx,%edi
  call   <data_canafford@plt>
  mov    %eax,%r15d
  mov    $0x0,%eax
  call   <data_numplayers@plt>
  mov    $0x0,%r14d
  cmp    %r12d,%eax
  je     L104
L63:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L37
  mov    %r14d,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L104:
  movslq %ebp,%rax
  cmpl   $0xffffffff,(%rsp,%rax,4)
  je     L63
  mov    %r13d,%esi
  mov    $0x3d,%edi
  call   <postoptions@plt>
  mov    %eax,%r14d
  test   %eax,%eax
  je     L109
  cmp    $0x1,%eax
  je     L189
  cmp    $0x2,%eax
  je     L64
  mov    $0x0,%r14d
  jmp    L63
L109:
  movslq %ebp,%rax
  mov    (%rsp,%rax,4),%r12d
  mov    $0x0,%eax
  call   <data_getera@plt>
  mov    %eax,%esi
  mov    %r12d,%edx
  mov    %ebx,%edi
  call   <data_hasbuiltname@plt>
  test   %rax,%rax
  jne    L8
  cmp    $0x1,%r15d
  je     L187
  cmp    $0x2,%r15d
  je     L205
L116:
  lea    D0(%rip),%rdi
  call   <postmessage@plt>
  jmp    L63
L8:
  lea    D23(%rip),%rdi
  call   <postmessage@plt>
  jmp    L63
L205:
  lea    D27(%rip),%rdx
  mov    %r13d,%esi
  mov    $0x3d,%edi
  call   <postyn@plt>
  test   %rax,%rax
  je     L116
  movslq %ebp,%rbp
  mov    (%rsp,%rbp,4),%esi
  mov    %ebx,%edi
  call   <data_build@plt>
  mov    $0x0,%eax
  call   <data_spendfreebuild@plt>
  mov    $0x1,%r14d
  jmp    L63
L189:
  movslq %ebp,%rbp
  mov    (%rsp,%rbp,4),%esi
  mov    %ebx,%edi
  call   <data_discard@plt>
  mov    %ebx,%esi
  mov    $0x3,%edi
  call   <data_addgold@plt>
  jmp    L63
L64:
  mov    %ebx,%edi
  call   <data_getnextwonderstage@plt>
  cmp    $0xffffffff,%eax
  je     L167
  mov    %ebx,%edi
  call   <data_getnextwonderstage@plt>
  mov    %eax,%r12d
  mov    %ebx,%edi
  call   <data_getwonder@plt>
  mov    %eax,%esi
  mov    %r12d,%edx
  mov    %ebx,%edi
  call   <data_canafford@plt>
  mov    %eax,%r14d
  test   %eax,%eax
  jne    L87
  lea    D0(%rip),%rdi
  call   <postmessage@plt>
  jmp    L63
L167:
  lea    D38(%rip),%rdi
  call   <postmessage@plt>
  mov    $0x0,%r14d
  jmp    L63
L87:
  movslq %ebp,%rbp
  mov    (%rsp,%rbp,4),%esi
  mov    %ebx,%edi
  call   <data_buildwonder@plt>
  mov    $0x1,%r14d
  jmp    L63
L187:
  movslq %ebp,%rbp
  mov    (%rsp,%rbp,4),%esi
  mov    %ebx,%edi
  call   <data_build@plt>
  mov    %r15d,%r14d
  jmp    L63
L37:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D0
type_guessed: string
name: read_data
arguments: tag: D23
type_guessed: string
name: read_data
arguments: tag: D27
type_guessed: string
name: read_data
arguments: tag: D38
type_guessed: string

tool: D0: Can't afford this!

tool: D23: Cannot have two of the same card!

tool: D27: Spend free build?

tool: D38: Wonder already complete.

assistant: ```c
int player_build(int focus, int cursor, int player, int y) {
  int hand[7];
  data_gethand(player, hand);
  int afford = data_canafford(player, data_getera(), hand[cursor]);
  if (focus == data_numplayers()) {
    if (hand[cursor] == -1)
      return 0;
    int choice = postoptions(61, y);
    if (choice == 0) {
      if (data_hasbuiltname(player, data_getera(), hand[cursor])) {
        postmessage("Cannot have two of the same card!");
        return 0;
      }
      if (afford == 1 || (afford == 2 && postyn(61, y, "Spend free build?"))) {
        data_build(player, hand[cursor]);
        if (afford == 2)
          data_spendfreebuild();
        return 1;
      } else
        postmessage("Can't afford this!");
    } else if (choice == 1) {
      data_discard(player, hand[cursor]);
      data_addgold(3, player);
      return 1;
    } else if (choice == 2) {
      if (data_getnextwonderstage(player) == -1) {
        postmessage("Wonder already complete.");
      } else if (data_canafford(player, data_getwonder(player), data_getnextwonderstage(player))) {
        data_buildwonder(player, hand[cursor]);
        return 1;
      } else
        postmessage("Can't afford this!");
    }
  }
  return 0;
}
```