user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  lea    D50(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D103(%rip),%rbp
  push   %rbx
  sub    $0x128,%rsp
  movdqa D130(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  movl   $0x6,0x78(%rsp)
  movabs $0x6373615600000000,%rax
  mov    %rax,0xa0(%rsp)
  xor    %eax,%eax
  mov    %ax,0xac(%rsp)
  mov    D35(%rip),%rax
  movaps %xmm0,0x90(%rsp)
  movl   $0x6f61,0xa8(%rsp)
  mov    %rax,0x70(%rsp)
  movq   $0x0,0xb0(%rsp)
  movq   $0x0,0xc8(%rsp)
  movq   $0x0,0xe0(%rsp)
  call   <puts@plt>
  lea    0x90(%rsp),%rax
  xor    %esi,%esi
  mov    %rbp,%rdi
  mov    %rax,%rdx
  mov    %rax,0x30(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x9a(%rsp),%rax
  mov    $0x1,%esi
  mov    %rbp,%rdi
  mov    %rax,%rdx
  mov    %rax,0x50(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0xa4(%rsp),%rax
  mov    $0x2,%esi
  mov    %rbp,%rdi
  mov    %rax,%rdx
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    D104(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x64(%rsp),%rsi
  lea    D78(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x64(%rsp),%esi
  lea    D160(%rip),%rdi
  xor    %eax,%eax
  movq   $0x0,0x80(%rsp)
  movl   $0x0,0x88(%rsp)
  call   <printf@plt>
  mov    0x64(%rsp),%edx
  test   %edx,%edx
  jle    L211
  lea    0x6c(%rsp),%rax
  movl   $0x0,0x14(%rsp)
  lea    0x10e(%rsp),%r13
  mov    %rax,0x40(%rsp)
  lea    0x68(%rsp),%rax
  lea    0x104(%rsp),%r12
  mov    %rax,0x38(%rsp)
  lea    0x70(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0xb0(%rsp),%rax
  mov    %rax,0x48(%rsp)
  nopl   (%rax)
L143:
  mov    0x40(%rsp),%rcx
  mov    0x38(%rsp),%rdx
  mov    %r13,%r8
  mov    %r12,%rsi
  xor    %eax,%eax
  xor    %r14d,%r14d
  mov    $0xffffffff,%ebp
  mov    $0xffffffff,%ebx
  lea    D99(%rip),%rdi
  call   <scanf@plt>
  mov    0x30(%rsp),%r15
L91:
  mov    0x18(%rsp),%rax
  mov    %r15,%rsi
  mov    %r12,%rdi
  mov    (%rax,%r14,4),%edx
  xor    %eax,%eax
  mov    %edx,0x8(%rsp)
  call   <strAreEquals@plt>
  mov    0x8(%rsp),%edx
  mov    %r15,%rsi
  mov    %r13,%rdi
  test   %eax,%eax
  jne    L100
  call   <strAreEquals@plt>
  cmp    $0xffffffff,%ebx
  mov    %eax,%r8d
  setne  %al
  test   %r8d,%r8d
  je     L174
  mov    %r14d,%ebp
L177:
  test   %al,%al
  jne    L15
L148:
  add    $0x1,%r14
  add    $0xa,%r15
  cmp    $0x3,%r14
  jne    L91
L15:
  lea    D128(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%eax
  and    %ebx,%eax
  cmp    $0xffffffff,%eax
  je     L149
L44:
  lea    D153(%rip),%rdi
  xor    %eax,%eax
  movslq %ebp,%r14
  call   <printf@plt>
  movslq %ebx,%rdx
  mov    0x68(%rsp),%edi
  mov    0x6c(%rsp),%esi
  lea    (%rdx,%rdx,2),%rbx
  mov    0x48(%rsp),%r15
  mov    %rdx,0x28(%rsp)
  lea    (%r14,%r14,2),%rbp
  shl    $0x3,%rbx
  movd   %esi,%xmm6
  movd   %edi,%xmm0
  shl    $0x3,%rbp
  lea    (%r15,%rbx,1),%rax
  punpckldq %xmm6,%xmm0
  movq   (%rax),%xmm1
  cvtdq2ps %xmm0,%xmm0
  addps  %xmm1,%xmm0
  movlps %xmm0,(%rax)
  xor    %eax,%eax
  movlps %xmm0,0x8(%rsp)
  call   <points@plt>
  pxor   %xmm1,%xmm1
  movq   0x8(%rsp),%xmm0
  cvtsi2ss %eax,%xmm1
  mov    $0x2,%eax
  addss  0xbc(%rsp,%rbx,1),%xmm1
  movaps %xmm0,%xmm4
  cvtss2sd %xmm0,%xmm0
  shufps $0xe5,%xmm4,%xmm4
  movss  %xmm1,0xbc(%rsp,%rbx,1)
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm4,%xmm1
  call   <average@plt>
  mov    0x6c(%rsp),%edi
  mov    0x68(%rsp),%esi
  lea    (%r15,%rbp,1),%rax
  movq   (%rax),%xmm1
  movd   %edi,%xmm0
  movd   %esi,%xmm7
  punpckldq %xmm7,%xmm0
  cvtdq2ps %xmm0,%xmm0
  addps  %xmm1,%xmm0
  movlps %xmm0,(%rax)
  xor    %eax,%eax
  movlps %xmm0,0x20(%rsp)
  call   <points@plt>
  pxor   %xmm2,%xmm2
  movq   0x20(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm2
  mov    $0x2,%eax
  addss  0xbc(%rsp,%rbp,1),%xmm2
  movaps %xmm0,%xmm5
  cvtss2sd %xmm0,%xmm0
  shufps $0xe5,%xmm5,%xmm5
  cvtss2sd %xmm5,%xmm1
  movss  %xmm2,0xbc(%rsp,%rbp,1)
  movss  %xmm2,0x8(%rsp)
  call   <average@plt>
  mov    0x28(%rsp),%rdx
  movss  0xbc(%rsp,%rbx,1),%xmm0
  lea    D11(%rip),%rdi
  movss  0x8(%rsp),%xmm2
  movss  %xmm0,0x80(%rsp,%rdx,4)
  movss  %xmm2,0x80(%rsp,%r14,4)
  call   <puts@plt>
  addl   $0x1,0x14(%rsp)
  mov    0x14(%rsp),%eax
  cmp    %eax,0x64(%rsp)
  jg     L143
L211:
  lea    D122(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edx,%edx
  xor    %eax,%eax
  xor    %ecx,%ecx
  movss  0x80(%rsp),%xmm1
  movss  0x84(%rsp),%xmm0
  movss  0x88(%rsp),%xmm2
  nopl   0x0(%rax,%rax,1)
L7:
  comiss %xmm1,%xmm0
  ja     L181
  comiss %xmm0,%xmm2
  ja     L101
  test   %dl,%dl
  je     L54
  movss  %xmm2,0x88(%rsp)
L54:
  test   %al,%al
  je     L191
  movss  %xmm0,0x84(%rsp)
L191:
  test   %cl,%cl
  je     L29
  movss  %xmm1,0x80(%rsp)
L29:
  lea    D56(%rip),%rdi
  lea    D152(%rip),%rbp
  xor    %ebx,%ebx
  call   <puts@plt>
  mov    0x30(%rsp),%rdx
  mov    %rbp,%rdi
  xor    %esi,%esi
  xor    %eax,%eax
  lea    0x80(%rsp),%r12
  call   <printf@plt>
  mov    0x50(%rsp),%rdx
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    $0x1,%esi
  call   <printf@plt>
  mov    0x58(%rsp),%rdx
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    $0x2,%esi
  lea    D82(%rip),%rbp
  call   <printf@plt>
L68:
  pxor   %xmm0,%xmm0
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  cvtss2sd (%r12,%rbx,4),%xmm0
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    $0x3,%rbx
  jne    L68
  lea    D109(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
L161:
  mov    0x118(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L127
  add    $0x128,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L100:
  xor    %eax,%eax
  call   <strAreEquals@plt>
  test   %eax,%eax
  jne    L90
  mov    %r14d,%ebx
  cmp    $0xffffffff,%ebp
  je     L148
  jmp    L15
  nopl   0x0(%rax)
L181:
  comiss %xmm1,%xmm2
  jbe    L141
  movaps %xmm0,%xmm3
  mov    $0x1,%ecx
  movaps %xmm1,%xmm0
  movaps %xmm3,%xmm1
L101:
  movaps %xmm0,%xmm3
  mov    $0x1,%edx
  movaps %xmm2,%xmm0
  movaps %xmm3,%xmm2
L92:
  mov    $0x1,%eax
  jmp    L7
  nopl   0x0(%rax,%rax,1)
L174:
  cmp    $0xffffffff,%ebp
  setne  %dl
  and    %edx,%eax
  jmp    L177
  nopl   (%rax)
L90:
  lea    D128(%rip),%rdi
  xor    %eax,%eax
  mov    %r14d,%ebp
  mov    %r14d,%ebx
  call   <printf@plt>
  jmp    L44
  nopl   0x0(%rax)
L141:
  movaps %xmm1,%xmm3
  mov    $0x1,%ecx
  movaps %xmm0,%xmm1
  movaps %xmm3,%xmm0
  jmp    L92
L149:
  mov    $0x29a,%eax
  jmp    L161
L127:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D50
datatype: string
name: read_data
arguments: data_label: D103
datatype: string
name: read_data
arguments: data_label: D130
datatype: byte[16]
name: read_data
arguments: data_label: D35
datatype: byte[8]
name: read_data
arguments: data_label: D104
datatype: string
name: read_data
arguments: data_label: D78
datatype: string
name: read_data
arguments: data_label: D160
datatype: string
name: read_data
arguments: data_label: D99
datatype: string
name: read_data
arguments: data_label: D128
datatype: string
name: read_data
arguments: data_label: D153
datatype: string
name: read_data
arguments: data_label: D11
datatype: string
name: read_data
arguments: data_label: D122
datatype: string
name: read_data
arguments: data_label: D56
datatype: string
name: read_data
arguments: data_label: D152
datatype: string
name: read_data
arguments: data_label: D82
datatype: string
name: read_data
arguments: data_label: D109
datatype: string

tool: D50: Times cadastrados:

tool: D103: %d -> %s


tool: {"D130": [0x42,0x61,0x72,0x63,0x65,0x6c,0x6f,0x6e,0x61,0x00,0x4d,0x69,0x6c,0x61,0x6e,0x00]}

tool: {"D35": [0x09,0x00,0x00,0x00,0x05,0x00,0x00,0x00]}

tool: D104: 
Quantidade de jogos: 

tool: D78: %d

tool: D160: 
Resultados das %d partidas (ex: "Vascao 1 x 3 Barcelona"):


tool: D99:  %s %d x %d %s

tool: D128: (Procurando times... 

tool: D153: Ok. Processando escrita... 

tool: D11: Ok. Pronto.)

tool: D122: 
(Classificando... 

tool: D56: Ok. Imprimindo...)

tool: D152: %d: %s


tool: D82: %do lugar tem %f pontos.


tool: D109: (Pronto.)

assistant: ```c
int main() {
  int gamesQtt;
  char table_names[3][10] = {"Barcelona", "Milan", "Vascao"};
  int table_names_sizes[3] = {9, 5, 6};
  float table_data[3][6];
  int i, j, k;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      table_data[i][j] = 0;
    }
  }
  printf("Times cadastrados:\n");
  for (i = 0; i < 3; i++) {
    printf("%d -> %s\n", i, table_names[i]);
  }
  printf("\nQuantidade de jogos: ");
  scanf("%d", &gamesQtt);
  char teamName1[10], teamName2[10];
  int teamScore1, teamScore2;
  int teamIndex1, teamIndex2;
  float pointsAux[3] = {0, 0, 0};
  printf("\nResultados das %d partidas (ex: \"Vascao 1 x 3 Barcelona\"):\n", gamesQtt);
  for (i = 0; i < gamesQtt; i++) {
    scanf(" %s %d x %d %s", teamName1, &teamScore1, &teamScore2, teamName2);
    teamIndex1 = -1;
    teamIndex2 = -1;
    for (j = 0; j < 3; j++) {
      if (strAreEquals(teamName1, table_names[j], table_names_sizes[j]))
        teamIndex1 = j;
      if (strAreEquals(teamName2, table_names[j], table_names_sizes[j]))
        teamIndex2 = j;
      if ((teamIndex1 != -1) && (teamIndex2 != -1))
        break;
    }
    printf("(Procurando times... ");
    if ((teamIndex1 == -1) && (teamIndex2 == -1))
      return 666;
    printf("Ok. Processando escrita... ");
    table_data[teamIndex1][0] += (float)teamScore1;
    table_data[teamIndex1][1] += (float)teamScore2;
    table_data[teamIndex1][2] += (teamScore1 > teamScore2) ? 1.0 : 0.0;
    table_data[teamIndex1][3] += points(teamScore1, teamScore2);
    table_data[teamIndex1][4] += (float)(teamScore1 - teamScore2);
    table_data[teamIndex1][5] = average(table_data[teamIndex1][0], table_data[teamIndex1][1]);
    table_data[teamIndex2][0] += (float)teamScore2;
    table_data[teamIndex2][1] += (float)teamScore1;
    table_data[teamIndex2][2] += (teamScore2 > teamScore1) ? 1.0 : 0.0;
    table_data[teamIndex2][3] += points(teamScore2, teamScore1);
    table_data[teamIndex2][4] += (float)(teamScore2 - teamScore1);
    table_data[teamIndex2][5] = average(table_data[teamIndex2][0], table_data[teamIndex2][1]);
    pointsAux[teamIndex1] = table_data[teamIndex1][3];
    pointsAux[teamIndex2] = table_data[teamIndex2][3];
    printf("Ok. Pronto.)\n");
  }
  int classification[3] = {0, 1, 2};
  float aux;
  int leftIndex, rightIndex, swapped;
  printf("\n(Classificando... ");
  do {
    swapped = 0;
    for (i = 1; i < 3; i++) {
      leftIndex = i - 1;
      rightIndex = i;
      if (pointsAux[leftIndex] < pointsAux[rightIndex]) {
        aux = pointsAux[leftIndex];
        pointsAux[leftIndex] = pointsAux[rightIndex];
        pointsAux[rightIndex] = aux;
        swapped = 1;
      }
    }
  } while (swapped);
  printf("Ok. Imprimindo...)\n");
  for (i = 0; i < 3; i++) {
    printf("%d: %s\n", i, table_names[i]);
  }
  for (i = 0; i < 3; i++) {
    printf("%do lugar tem %f pontos.\n", i, pointsAux[i]);
  }
  printf("(Pronto.)\n");
  return 0;
}
```