user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x160,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x140(%rbp),%rax
  mov    $0x90,%edx
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0xb0(%rbp),%rax
  mov    $0x90,%edx
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x15c(%rbp)
L117:
  addl   $0x1,-0x15c(%rbp)
  movl   $0x0,-0x158(%rbp)
  jmp    L99
L60:
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <gets@plt>
  movl   $0x0,-0x154(%rbp)
  jmp    L64
L87:
  mov    -0x158(%rbp),%eax
  lea    0x2(%rax),%edx
  mov    -0x154(%rbp),%eax
  lea    0x2(%rax),%ecx
  mov    -0x154(%rbp),%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%esi
  movslq %ecx,%r8
  movslq %edx,%rdi
  mov    %rdi,%rax
  add    %rax,%rax
  add    %rdi,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %r8,%rax
  sub    $0x140,%rax
  mov    %sil,(%rax)
  movslq %ecx,%rcx
  movslq %edx,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rbp,%rax
  add    %rcx,%rax
  sub    $0x140,%rax
  movzbl (%rax),%eax
  mov    %al,-0x15d(%rbp)
  cmpb   $0x6b,-0x15d(%rbp)
  jne    L10
  mov    -0x158(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x150(%rbp)
  mov    -0x154(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x14c(%rbp)
  jmp    L57
L10:
  cmpb   $0x4b,-0x15d(%rbp)
  jne    L57
  mov    -0x158(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x148(%rbp)
  mov    -0x154(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x144(%rbp)
L57:
  addl   $0x1,-0x154(%rbp)
L64:
  cmpl   $0x7,-0x154(%rbp)
  jle    L87
  addl   $0x1,-0x158(%rbp)
L99:
  cmpl   $0x7,-0x158(%rbp)
  jle    L60
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <gets@plt>
  lea    -0xb0(%rbp),%rcx
  lea    -0x140(%rbp),%rax
  mov    $0x90,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L61
  mov    -0x14c(%rbp),%edx
  mov    -0x150(%rbp),%ecx
  lea    -0x140(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <check_the_check@plt>
  test   %rax,%rax
  je     L66
  mov    -0x15c(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L117
L66:
  mov    -0x144(%rbp),%edx
  mov    -0x148(%rbp),%ecx
  lea    -0x140(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <check_the_check@plt>
  test   %rax,%rax
  je     L48
  mov    -0x15c(%rbp),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L117
L48:
  mov    -0x15c(%rbp),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L117
L61:
  nop
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D2
data_type: string
name: read_data
arguments: label: D19
data_type: string
name: read_data
arguments: label: D17
data_type: string

tool: D2: Game #%d: black king is in check.


tool: D19: Game #%d: white king is in check.


tool: D17: Game #%d: no king is in check.


assistant: ```c
int main() {
  char chess_board[12][12];
  char empty_board[12][12];
  char line[16], piece;
  int count, i, j;
  int i_black_king, j_black_king, i_white_king, j_white_king;
  memset(chess_board, '.', 12 * 12 * sizeof(char));
  memset(empty_board, '.', 12 * 12 * sizeof(char));
  count = 0;
  while (1) {
    ++count;
    for (i = 0; i < 8; i++) {
      gets(line);
      for (j = 0; j < 8; j++) {
        piece = chess_board[i + 2][j + 2] = line[j];
        if (piece == 'k')
          i_black_king = i + 2, j_black_king = j + 2;
        else if (piece == 'K')
          i_white_king = i + 2, j_white_king = j + 2;
      }
    }
    gets(line);
    if (memcmp(chess_board, empty_board, 12 * 12 * sizeof(char)) == 0)
      break;
    if (check_the_check(chess_board, i_black_king, j_black_king))
      printf("Game #%d: black king is in check.\n", count);
    else if (check_the_check(chess_board, i_white_king, j_white_king))
      printf("Game #%d: white king is in check.\n", count);
    else
      printf("Game #%d: no king is in check.\n", count);
  }
  return 0;
}
```