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

```asm
<ScoreBoard>:
  endbr64
  sub    $0x38,%rsp
  mov    %rdi,%rsi
  pxor   %xmm0,%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x20(%rsp)
  lea    0x10(%rdi),%rdi
  lea    0xb8(%rsi),%r9
  movaps %xmm0,(%rsp)
  movaps %xmm0,0x10(%rsp)
  nopl   0x0(%rax,%rax,1)
L43:
  mov    -0x10(%rdi),%r8d
  mov    -0xc(%rdi),%eax
  lea    -0xc(%rdi),%rcx
  add    %r8d,%eax
  add    -0x8(%rdi),%eax
L64:
  add    0x8(%rcx),%eax
  lea    0x4(%rax),%edx
  movslq %edx,%rdx
  addl   $0x1,(%rsp,%rdx,4)
  cmp    %rcx,%rdi
  je     L146
  sub    %r8d,%eax
  add    $0x4,%rcx
  mov    -0x4(%rcx),%r8d
  jmp    L64
L146:
  add    $0x1c,%rdi
  cmp    %rdi,%r9
  jne    L43
  lea    0x54(%rsi),%rdi
  lea    0x70(%rsi),%r9
  nopl   0x0(%rax)
L40:
  mov    -0x54(%rdi),%r8d
  mov    -0x38(%rdi),%eax
  lea    -0x54(%rdi),%rcx
  add    %r8d,%eax
  add    -0x1c(%rdi),%eax
L106:
  add    0x54(%rcx),%eax
  add    $0x1c,%rcx
  lea    0x4(%rax),%edx
  movslq %edx,%rdx
  addl   $0x1,(%rsp,%rdx,4)
  cmp    %rcx,%rdi
  je     L58
  sub    %r8d,%eax
  mov    (%rcx),%r8d
  jmp    L106
  nopw   0x0(%rax,%rax,1)
L58:
  add    $0x4,%rdi
  cmp    %rdi,%r9
  jne    L40
  lea    0x80(%rsi),%r9
  xor    %r8d,%r8d
L145:
  mov    %r9,%rcx
  xor    %edi,%edi
L65:
  lea    -0x80(%rcx),%rax
  xor    %edx,%edx
L53:
  add    (%rax),%edx
  add    $0x20,%rax
  cmp    %rax,%rcx
  jne    L53
  add    $0x4,%edx
  add    $0x1,%edi
  add    $0x4,%rcx
  movslq %edx,%rdx
  addl   $0x1,(%rsp,%rdx,4)
  cmp    $0x4,%edi
  jne    L65
  add    $0x1,%r8d
  add    $0x1c,%r9
  cmp    $0x3,%r8d
  jne    L145
  sub    $0xc,%rsi
L98:
  mov    %rsi,%rcx
  xor    %edi,%edi
L78:
  lea    0x60(%rcx),%rax
  xor    %edx,%edx
L113:
  add    (%rax),%edx
  sub    $0x18,%rax
  cmp    %rax,%rcx
  jne    L113
  add    $0x4,%edx
  add    $0x1,%edi
  add    $0x4,%rcx
  movslq %edx,%rdx
  addl   $0x1,(%rsp,%rdx,4)
  cmp    $0x4,%edi
  jne    L78
  add    $0x1,%r8d
  add    $0x1c,%rsi
  cmp    $0x6,%r8d
  jne    L98
  mov    (%rsp),%ecx
  test   %ecx,%ecx
  jne    L77
  mov    0x20(%rsp),%edx
  mov    $0xf4240,%eax
  test   %edx,%edx
  jne    L33
  mov    0x18(%rsp),%edx
  mov    0x14(%rsp),%eax
  mov    0x8(%rsp),%esi
  lea    (%rax,%rdx,2),%eax
  mov    0x1c(%rsp),%edx
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%eax
  lea    (%rsi,%rsi,1),%edx
  sub    0xc(%rsp),%eax
  sub    %edx,%eax
  mov    0x4(%rsp),%edx
  lea    (%rdx,%rdx,4),%edx
  sub    %edx,%eax
L33:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L148
  add    $0x38,%rsp
  ret
L77:
  mov    $0xfff0bdc0,%eax
  jmp    L33
L148:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int ScoreBoard(int scores[][7]) {
  int counters[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
  int x, y;
  for (y = 0; y < 6; y++) {
    int score = scores[y][0] + scores[y][1] + scores[y][2];
    for (x = 3; x < 7; x++) {
      score += scores[y][x];
      counters[score + 4]++;
      score -= scores[y][x - 3];
    }
  }
  for (x = 0; x < 7; x++) {
    int score = scores[0][x] + scores[1][x] + scores[2][x];
    for (y = 3; y < 6; y++) {
      score += scores[y][x];
      counters[score + 4]++;
      score -= scores[y - 3][x];
    }
  }
  for (y = 0; y < 6 - 3; y++) {
    for (x = 0; x < 7 - 3; x++) {
      int score = 0, idx = 0;
      for (idx = 0; idx < 4; idx++) {
        score += scores[y + idx][x + idx];
      }
      counters[score + 4]++;
    }
  }
  for (y = 3; y < 6; y++) {
    for (x = 0; x < 7 - 3; x++) {
      int score = 0, idx = 0;
      for (idx = 0; idx < 4; idx++) {
        score += scores[y - idx][x + idx];
      }
      counters[score + 4]++;
    }
  }
  if (counters[0] != 0)
    return -1000000;
  else if (counters[8] != 0)
    return 1000000;
  else
    return counters[5] + 2 * counters[6] + 5 * counters[7] - counters[3] - 2 * counters[2] - 5 * counters[1];
}
```