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

```asm
<fim>:
  endbr64
  push   %r15
  mov    %r9,%r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  cmpl   $0x1,(%rdi)
  mov    0x60(%rsp),%rdx
  mov    0x68(%rsp),%rcx
  mov    0x70(%rsp),%rsi
  mov    0x78(%rsp),%r8
  je     L161
L560:
  cmpl   $0x1,0x0(%r13)
  je     L687
L820:
  cmpl   $0x1,(%rdx)
  je     L627
L543:
  cmpl   $0x1,(%rbx)
  je     L677
L590:
  cmpl   $0x1,0x0(%rbp)
  je     L134
L10:
  cmpl   $0x1,(%r12)
  je     L365
  mov    (%rbx),%eax
  cmp    $0x1,%eax
  je     L52
L367:
  cmp    $0xffffffff,%eax
  je     L712
L752:
  cmpl   $0xffffffff,0x0(%r13)
  je     L290
L579:
  cmpl   $0xffffffff,(%rdx)
  je     L394
L592:
  cmpl   $0xffffffff,(%rbx)
  je     L51
L87:
  cmpl   $0xffffffff,0x0(%rbp)
  je     L359
L268:
  cmpl   $0xffffffff,(%r12)
  je     L18
  mov    (%rbx),%eax
  cmp    $0xffffffff,%eax
  je     L46
L689:
  test   %eax,%eax
  jne    L125
L362:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L46:
  cmpl   $0xffffffff,(%r14)
  je     L850
L125:
  mov    0x0(%rbp),%ebp
  test   %ebp,%ebp
  je     L362
  mov    (%r12),%ebx
  test   %ebx,%ebx
  je     L362
  mov    0x0(%r13),%r11d
  test   %r11d,%r11d
  je     L362
  mov    (%r14),%r10d
  test   %r10d,%r10d
  je     L362
  mov    (%r15),%r9d
  test   %r9d,%r9d
  je     L362
  mov    (%rdx),%edi
  test   %edi,%edi
  je     L362
  mov    (%rcx),%ecx
  test   %ecx,%ecx
  je     L362
  mov    (%rsi),%edx
  test   %edx,%edx
  je     L362
  mov    (%r8),%eax
  test   %eax,%eax
  jne    L362
  add    $0x28,%rsp
  lea    D106(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1050 <printf@plt>
  nopl   (%rax)
L712:
  cmpl   $0xffffffff,0x0(%rbp)
  jne    L752
  cmpl   $0xffffffff,(%r12)
  jne    L752
  movl   $0xffffffff,(%r8)
  lea    D113(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L752
  nopl   0x0(%rax,%rax,1)
L52:
  cmpl   $0x1,(%r14)
  jne    L752
  cmpl   $0x1,(%rsi)
  je     L735
  cmpl   $0x1,(%r12)
  jne    L752
L172:
  cmpl   $0x1,(%rdx)
  je     L801
  mov    (%rbx),%eax
L847:
  cmp    $0xffffffff,%eax
  jne    L752
  jmp    L712
  nop
L18:
  cmpl   $0xffffffff,(%r15)
  je     L124
L132:
  cmpl   $0xffffffff,(%rbx)
  mov    (%r14),%eax
  je     L106
L187:
  cmp    $0xffffffff,%eax
  je     L528
L484:
  mov    (%rbx),%eax
L426:
  test   %eax,%eax
  je     L362
  jmp    L125
  xchg   %ax,%ax
L161:
  cmpl   $0x1,0x0(%rbp)
  jne    L560
  cmpl   $0x1,(%r12)
  jne    L560
  movl   $0x1,(%r8)
  lea    D25(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L560
  nopl   0x0(%rax,%rax,1)
L365:
  cmpl   $0x1,(%r15)
  je     L195
L762:
  cmpl   $0x1,(%rbx)
  je     L52
L523:
  cmpl   $0x1,(%r14)
  je     L172
  mov    (%rbx),%eax
  jmp    L847
  nopl   0x0(%rax)
L134:
  cmpl   $0x1,(%r14)
  jne    L10
  cmpl   $0x1,(%rcx)
  jne    L10
  movl   $0x1,(%r8)
  lea    D25(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L10
  nopl   0x0(%rax)
L677:
  cmpl   $0x1,0x0(%r13)
  jne    L590
  cmpl   $0x1,(%rdx)
  jne    L590
  movl   $0x1,(%r8)
  lea    D25(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L590
  nopw   0x0(%rax,%rax,1)
L627:
  cmpl   $0x1,(%rcx)
  jne    L543
  cmpl   $0x1,(%rsi)
  jne    L543
  movl   $0x1,(%r8)
  lea    D25(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L543
L687:
  cmpl   $0x1,(%r14)
  jne    L820
  cmpl   $0x1,(%r15)
  jne    L820
  movl   $0x1,(%r8)
  lea    D25(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L820
  nopw   0x0(%rax,%rax,1)
L359:
  cmpl   $0xffffffff,(%r14)
  jne    L268
  cmpl   $0xffffffff,(%rcx)
  jne    L268
  movl   $0xffffffff,(%r8)
  lea    D113(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L268
  nopl   0x0(%rax)
L51:
  cmpl   $0xffffffff,0x0(%r13)
  jne    L87
  cmpl   $0xffffffff,(%rdx)
  jne    L87
  movl   $0xffffffff,(%r8)
  lea    D113(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L87
  nopw   0x0(%rax,%rax,1)
L394:
  cmpl   $0xffffffff,(%rcx)
  jne    L592
  cmpl   $0xffffffff,(%rsi)
  jne    L592
  movl   $0xffffffff,(%r8)
  lea    D113(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L592
  nopl   0x0(%rax,%rax,1)
L290:
  cmpl   $0xffffffff,(%r14)
  jne    L579
  cmpl   $0xffffffff,(%r15)
  jne    L579
  movl   $0xffffffff,(%r8)
  lea    D113(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L579
  nopw   0x0(%rax,%rax,1)
L850:
  cmpl   $0xffffffff,(%rsi)
  je     L465
  cmpl   $0xffffffff,(%r12)
  jne    L125
L528:
  cmpl   $0xffffffff,(%rdx)
  jne    L484
  movl   $0xffffffff,(%r8)
  lea    D113(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    (%rbx),%eax
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L689
  nopl   (%rax)
L195:
  cmpl   $0x1,(%rsi)
  jne    L762
  movl   $0x1,(%r8)
  lea    D25(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  cmpl   $0x1,(%rbx)
  mov    (%rsp),%r8
  mov    0x8(%rsp),%rdx
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%rsi
  je     L52
L542:
  cmpl   $0x1,(%r12)
  je     L523
  mov    (%rbx),%eax
  jmp    L847
  nopl   (%rax)
L106:
  cmpl   $0xffffffff,(%r14)
  je     L850
  cmpl   $0xffffffff,(%r12)
  jne    L125
  mov    (%rbx),%eax
  jmp    L426
  nopl   0x0(%rax)
L124:
  cmpl   $0xffffffff,(%rsi)
  jne    L132
  movl   $0xffffffff,(%r8)
  lea    D113(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  cmpl   $0xffffffff,(%rbx)
  mov    (%rsp),%r8
  mov    0x8(%rsp),%rdx
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%rsi
  je     L106
L740:
  cmpl   $0xffffffff,(%r12)
  jne    L484
  mov    (%r14),%eax
  jmp    L187
  nopw   0x0(%rax,%rax,1)
L801:
  movl   $0x1,(%r8)
  lea    D25(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    (%rbx),%eax
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L367
  nopl   0x0(%rax,%rax,1)
L465:
  movl   $0xffffffff,(%r8)
  lea    D113(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L740
  xchg   %ax,%ax
L735:
  movl   $0x1,(%r8)
  lea    D25(%rip),%rdi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %r8,(%rsp)
  call   <printf@plt>
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%r8
  jmp    L542
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D106
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D113
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D25
type_guessed: string

tool: D106: 
Deu Velha! ! ! Jogo empatou


tool: D113: 
O ganhou ! ! ! 


tool: D25: 
X ganhou ! ! ! 


assistant: ```c
void fim(int *tabuleiro0, int *tabuleiro1, int *tabuleiro2, int *tabuleiro3, int *tabuleiro4, int *tabuleiro5, int *tabuleiro6, int *tabuleiro7, int *tabuleiro8, int *vencedor) {
  if (*tabuleiro0 == 1 && *tabuleiro1 == 1 && *tabuleiro2 == 1) {
    *vencedor = 1;
    printf("\nX ganhou ! ! ! \n");
  }
  if (*tabuleiro3 == 1 && *tabuleiro4 == 1 && *tabuleiro5 == 1) {
    *vencedor = 1;
    printf("\nX ganhou ! ! ! \n");
  }
  if (*tabuleiro6 == 1 && *tabuleiro7 == 1 && *tabuleiro8 == 1) {
    *vencedor = 1;
    printf("\nX ganhou ! ! ! \n");
  }
  if (*tabuleiro0 == 1 && *tabuleiro3 == 1 && *tabuleiro6 == 1) {
    *vencedor = 1;
    printf("\nX ganhou ! ! ! \n");
  }
  if (*tabuleiro1 == 1 && *tabuleiro4 == 1 && *tabuleiro7 == 1) {
    *vencedor = 1;
    printf("\nX ganhou ! ! ! \n");
  }
  if (*tabuleiro2 == 1 && *tabuleiro5 == 1 && *tabuleiro8 == 1) {
    *vencedor = 1;
    printf("\nX ganhou ! ! ! \n");
  }
  if (*tabuleiro0 == 1 && *tabuleiro4 == 1 && *tabuleiro8 == 1) {
    *vencedor = 1;
    printf("\nX ganhou ! ! ! \n");
  }
  if (*tabuleiro2 == 1 && *tabuleiro4 == 1 && *tabuleiro6 == 1) {
    *vencedor = 1;
    printf("\nX ganhou ! ! ! \n");
  }
  if (*tabuleiro0 == -1 && *tabuleiro1 == -1 && *tabuleiro2 == -1) {
    *vencedor = -1;
    printf("\nO ganhou ! ! ! \n");
  }
  if (*tabuleiro3 == -1 && *tabuleiro4 == -1 && *tabuleiro5 == -1) {
    *vencedor = -1;
    printf("\nO ganhou ! ! ! \n");
  }
  if (*tabuleiro6 == -1 && *tabuleiro7 == -1 && *tabuleiro8 == -1) {
    *vencedor = -1;
    printf("\nO ganhou ! ! ! \n");
  }
  if (*tabuleiro0 == -1 && *tabuleiro3 == -1 && *tabuleiro6 == -1) {
    *vencedor = -1;
    printf("\nO ganhou ! ! ! \n");
  }
  if (*tabuleiro1 == -1 && *tabuleiro4 == -1 && *tabuleiro7 == -1) {
    *vencedor = -1;
    printf("\nO ganhou ! ! ! \n");
  }
  if (*tabuleiro2 == -1 && *tabuleiro5 == -1 && *tabuleiro8 == -1) {
    *vencedor = -1;
    printf("\nO ganhou ! ! ! \n");
  }
  if (*tabuleiro0 == -1 && *tabuleiro4 == -1 && *tabuleiro8 == -1) {
    *vencedor = -1;
    printf("\nO ganhou ! ! ! \n");
  }
  if (*tabuleiro2 == -1 && *tabuleiro4 == -1 && *tabuleiro6 == -1) {
    *vencedor = -1;
    printf("\nO ganhou ! ! ! \n");
  }
  if (*tabuleiro0 != 0 && *tabuleiro1 != 0 && *tabuleiro2 != 0 && *tabuleiro3 != 0 && *tabuleiro4 != 0 && *tabuleiro5 != 0 && *tabuleiro6 != 0 && *tabuleiro7 != 0 && *tabuleiro8 != 0 && *vencedor == 0)
    printf("\nDeu Velha! ! ! Jogo empatou\n");
}
```