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

```asm
<isFinished>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x70(%rbp)
  movl   $0x1,-0x6c(%rbp)
  movl   $0x2,-0x68(%rbp)
  movl   $0x3,-0x64(%rbp)
  movl   $0x4,-0x60(%rbp)
  movl   $0x5,-0x5c(%rbp)
  movl   $0x6,-0x58(%rbp)
  movl   $0x7,-0x54(%rbp)
  movl   $0x8,-0x50(%rbp)
  movl   $0x0,-0x4c(%rbp)
  movl   $0x3,-0x48(%rbp)
  movl   $0x6,-0x44(%rbp)
  movl   $0x1,-0x40(%rbp)
  movl   $0x4,-0x3c(%rbp)
  movl   $0x7,-0x38(%rbp)
  movl   $0x2,-0x34(%rbp)
  movl   $0x5,-0x30(%rbp)
  movl   $0x8,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x4,-0x24(%rbp)
  movl   $0x8,-0x20(%rbp)
  movl   $0x2,-0x1c(%rbp)
  movl   $0x4,-0x18(%rbp)
  movl   $0x6,-0x14(%rbp)
  movl   $0x0,-0x74(%rbp)
  jmp    L87
L23:
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x70,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x20,%eax
  je     L103
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x70,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x6c,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,%ecx
  jne    L103
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x6c,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x74(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  sub    $0x68,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,%ecx
  jne    L103
  mov    $0x2,%eax
  jmp    L91
L103:
  addl   $0x1,-0x74(%rbp)
L87:
  cmpl   $0x7,-0x74(%rbp)
  jle    L23
  movl   $0x0,-0x74(%rbp)
  jmp    L69
L37:
  mov    -0x74(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x20,%eax
  jne    L29
  mov    $0x0,%eax
  jmp    L91
L29:
  addl   $0x1,-0x74(%rbp)
L69:
  cmpl   $0xb,-0x74(%rbp)
  jle    L37
  mov    $0x1,%eax
L91:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L16
  call   <__stack_chk_fail@plt>
L16:
  leave
  ret
```

assistant: ```c
int isFinished(int grid[]) {
  int arr[8][3] = {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {0, 3, 6}, {1, 4, 7}, {2, 5, 8}, {0, 4, 8}, {2, 4, 6}};
  int i;
  for (i = 0; i < 8; ++i)
    if (grid[arr[i][0]] != ' ' && grid[arr[i][0]] == grid[arr[i][1]] && grid[arr[i][1]] == grid[arr[i][2]])
      return 2;
  for (i = 0; i < 12; ++i)
    if (grid[i] == ' ')
      return 0;
  return 1;
}
```