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

```asm
<sanityCheck>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %r8d,%eax
  mov    %al,-0x28(%rbp)
  movsbl -0x28(%rbp),%eax
  cmp    $0x57,%eax
  je     L18
  cmp    $0x57,%eax
  jg     L66
  cmp    $0x53,%eax
  je     L144
  cmp    $0x53,%eax
  jg     L66
  cmp    $0x45,%eax
  je     L311
  cmp    $0x4e,%eax
  jne    L66
  mov    -0x1c(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cmp    $0xa,%eax
  jg     L137
  cmpl   $0xa,-0x1c(%rbp)
  jg     L137
  cmpl   $0xa,-0x20(%rbp)
  jle    L246
L137:
  mov    $0x1,%eax
  jmp    L168
L246:
  movl   $0x0,-0x10(%rbp)
  jmp    L319
L158:
  mov    -0x1c(%rbp),%edx
  mov    -0x10(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%eax
  movslq %eax,%rsi
  movslq %ecx,%rcx
  mov    %rcx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  add    %rax,%rax
  add    %rsi,%rax
  mov    (%rdx,%rax,4),%eax
  test   %eax,%eax
  je     L370
  mov    $0x2,%eax
  jmp    L168
L370:
  addl   $0x1,-0x10(%rbp)
L319:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L158
  jmp    L66
L144:
  mov    -0x1c(%rbp),%eax
  sub    -0x24(%rbp),%eax
  cmp    $0xffffffff,%eax
  jl     L114
  cmpl   $0xa,-0x1c(%rbp)
  jg     L114
  cmpl   $0xa,-0x20(%rbp)
  jle    L145
L114:
  mov    $0x1,%eax
  jmp    L168
L145:
  movl   $0x0,-0xc(%rbp)
  jmp    L205
L229:
  mov    -0x1c(%rbp),%eax
  sub    -0xc(%rbp),%eax
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%ecx
  movslq %ecx,%rsi
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  add    %rax,%rax
  add    %rsi,%rax
  mov    (%rdx,%rax,4),%eax
  test   %eax,%eax
  je     L315
  mov    $0x2,%eax
  jmp    L168
L315:
  addl   $0x1,-0xc(%rbp)
L205:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L229
  jmp    L66
L311:
  mov    -0x20(%rbp),%eax
  sub    -0x24(%rbp),%eax
  cmp    $0xffffffff,%eax
  jl     L215
  cmpl   $0xa,-0x1c(%rbp)
  jg     L215
  cmpl   $0xa,-0x20(%rbp)
  jle    L131
L215:
  mov    $0x1,%eax
  jmp    L168
L131:
  movl   $0x0,-0x8(%rbp)
  jmp    L19
L386:
  mov    -0x20(%rbp),%eax
  sub    -0x8(%rbp),%eax
  mov    -0x18(%rbp),%rdx
  movslq %eax,%rsi
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  add    %rax,%rax
  add    %rsi,%rax
  mov    (%rdx,%rax,4),%eax
  test   %eax,%eax
  je     L53
  mov    $0x2,%eax
  jmp    L168
L53:
  addl   $0x1,-0x8(%rbp)
L19:
  mov    -0x8(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L386
  jmp    L66
L18:
  mov    -0x20(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cmp    $0xa,%eax
  jg     L183
  cmpl   $0xa,-0x1c(%rbp)
  jg     L183
  cmpl   $0xa,-0x20(%rbp)
  jle    L95
L183:
  mov    $0x1,%eax
  jmp    L168
L95:
  movl   $0x0,-0x4(%rbp)
  jmp    L323
L193:
  mov    -0x20(%rbp),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    -0x18(%rbp),%rdx
  movslq %eax,%rsi
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  add    %rax,%rax
  add    %rsi,%rax
  mov    (%rdx,%rax,4),%eax
  test   %eax,%eax
  je     L217
  mov    $0x1,%eax
  jmp    L168
L217:
  addl   $0x1,-0x4(%rbp)
L323:
  mov    -0x4(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L193
  nop
L66:
  mov    $0x0,%eax
L168:
  pop    %rbp
  ret
```

assistant: ```c
int(sanityCheck(int (*board)[10][10], int row, int col, int length, char direction)) {
  switch (direction) {
  case 'N':
    if (row + length > 10 || row > 10 || col > 10) {
      return 1;
    }
    for (int i = 0; i < length; i++) {
      if ((*board)[row + i][col] != 0) {
        return 2;
      }
    }
    break;
  case 'S':
    if (row - length < -1 || row > 10 || col > 10) {
      return 1;
    }
    for (int i = 0; i < length; i++) {
      if ((*board)[row - i][col] != 0) {
        return 2;
      }
    }
    break;
  case 'E':
    if (col - length < -1 || row > 10 || col > 10) {
      return 1;
    }
    for (int i = 0; i < length; i++) {
      if ((*board)[row][col - i] != 0) {
        return 2;
      }
    }
    break;
  case 'W':
    if (col + length > 10 || row > 10 || col > 10) {
      return 1;
    }
    for (int i = 0; i < length; i++) {
      if ((*board)[row][col + i] != 0) {
        return 1;
      }
    }
    break;
  }
  return 0;
}
```