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

```asm
<check_lines>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x380,%rsp
  mov    %rdi,-0x368(%rbp)
  mov    %rsi,-0x370(%rbp)
  mov    %rdx,-0x378(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x350(%rbp),%rax
  mov    $0x348,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movb   $0x0,-0x35e(%rbp)
  movb   $0x0,-0x35d(%rbp)
  movl   $0x1b,-0x354(%rbp)
  movl   $0x1b,-0x35c(%rbp)
  jmp    L13
L109:
  movl   $0x0,-0x358(%rbp)
  jmp    L195
L15:
  mov    -0x35c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  add    %rax,%rax
  mov    %rax,%rdx
  mov    -0x368(%rbp),%rax
  add    %rax,%rdx
  mov    -0x358(%rbp),%eax
  cltq
  movzbl (%rdx,%rax,1),%eax
  test   %al,%al
  je     L16
  movzbl -0x35e(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x35e(%rbp)
L16:
  addl   $0x1,-0x358(%rbp)
L195:
  cmpl   $0x1d,-0x358(%rbp)
  jle    L15
  cmpb   $0x1e,-0x35e(%rbp)
  jne    L125
  movb   $0x0,-0x35e(%rbp)
  movzbl -0x35d(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x35d(%rbp)
L125:
  cmpb   $0x0,-0x35e(%rbp)
  je     L199
  mov    -0x35c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  add    %rax,%rax
  mov    %rax,%rdx
  mov    -0x368(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x354(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x354(%rbp)
  lea    -0x350(%rbp),%rsi
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  add    %rax,%rax
  add    %rsi,%rax
  mov    $0x1e,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movb   $0x0,-0x35e(%rbp)
L199:
  subl   $0x1,-0x35c(%rbp)
L13:
  cmpl   $0x0,-0x35c(%rbp)
  jns    L109
  cmpb   $0x0,-0x35d(%rbp)
  je     L99
  mov    -0x368(%rbp),%rax
  mov    %rax,%rdx
  lea    -0x350(%rbp),%rax
  mov    $0x348,%ecx
  mov    (%rax),%rsi
  mov    %rsi,(%rdx)
  mov    %ecx,%esi
  add    %rdx,%rsi
  lea    0x8(%rsi),%rdi
  mov    %ecx,%esi
  add    %rax,%rsi
  add    $0x8,%rsi
  mov    -0x10(%rsi),%rsi
  mov    %rsi,-0x10(%rdi)
  lea    0x8(%rdx),%rdi
  and    $0xfffffffffffffff8,%rdi
  sub    %rdi,%rdx
  sub    %rdx,%rax
  add    %edx,%ecx
  and    $0xfffffff8,%ecx
  shr    $0x3,%ecx
  mov    %ecx,%edx
  mov    %edx,%edx
  mov    %rax,%rsi
  mov    %rdx,%rcx
  rep movsq %ds:(%rsi),%es:(%rdi)
  mov    -0x378(%rbp),%rax
  mov    (%rax),%edx
  movsbl -0x35d(%rbp),%eax
  add    %eax,%edx
  mov    -0x378(%rbp),%rax
  mov    %edx,(%rax)
  movsbl -0x35d(%rbp),%eax
  cmp    $0x4,%eax
  je     L115
  cmp    $0x4,%eax
  jg     L114
  cmp    $0x3,%eax
  je     L196
  cmp    $0x3,%eax
  jg     L114
  cmp    $0x1,%eax
  je     L116
  cmp    $0x2,%eax
  je     L37
  jmp    L114
L116:
  mov    -0x370(%rbp),%rax
  mov    (%rax),%eax
  lea    0xa(%rax),%edx
  mov    -0x370(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L99
L37:
  mov    -0x370(%rbp),%rax
  mov    (%rax),%eax
  lea    0x14(%rax),%edx
  mov    -0x370(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L99
L196:
  mov    -0x370(%rbp),%rax
  mov    (%rax),%eax
  lea    0x32(%rax),%edx
  mov    -0x370(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L99
L115:
  mov    -0x370(%rbp),%rax
  mov    (%rax),%eax
  lea    0x50(%rax),%edx
  mov    -0x370(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L99
L114:
  mov    -0x370(%rbp),%rax
  mov    (%rax),%eax
  lea    0x50(%rax),%edx
  mov    -0x370(%rbp),%rax
  mov    %edx,(%rax)
  nop
L99:
  movsbl -0x35d(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L25
  call   <__stack_chk_fail@plt>
L25:
  leave
  ret
```

assistant: ```c
int check_lines(char board[(30 - 2)][(32 - 2)], int *score, int *lines) {
  char tmp_board[(30 - 2)][(32 - 2)];
  memset(tmp_board, 0, (30 - 2) * (32 - 2));
  char cont = 0;
  char lns = 0;
  int i, j;
  int ti = (30 - 2) - 1;
  for (i = (30 - 2) - 1; i >= 0; i--) {
    for (j = 0; j < (32 - 2); j++) {
      if (board[i][j]) {
        cont++;
      }
    }
    if (cont == (32 - 2)) {
      cont = 0;
      lns++;
    }
    if (cont != 0) {
      memcpy(tmp_board[ti--], board[i], (32 - 2));
      cont = 0;
    }
  }
  if (lns != 0) {
    memcpy(board, tmp_board, (30 - 2) * (32 - 2));
    *lines += lns;
    switch (lns) {
    case 1:
      *score += 10;
      break;
    case 2:
      *score += 10 * 2;
      break;
    case 3:
      *score += 10 * 5;
      break;
    case 4:
      *score += 10 * 8;
      break;
    default:
      *score += 10 * 8;
      break;
    }
  }
  return lns;
}
```