user: Translate the below assembly code into C programming language:

```asm
<sanityCheck>:
  endbr64
  cmp    $0x53,%r8b
  je     L440
  jg     L614
  cmp    $0x45,%r8b
  je     L94
  cmp    $0x4e,%r8b
  jne    L1039
  lea    (%rcx,%rsi,1),%r8d
  mov    $0x1,%eax
  cmp    $0xa,%r8d
  jg     L215
  cmp    $0xa,%esi
  jg     L147
  cmp    $0xa,%edx
  jg     L147
  test   %ecx,%ecx
  jle    L1039
  movslq %esi,%r8
  movslq %edx,%rdx
  lea    (%r8,%r8,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x1,%ecx
  je     L215
  lea    0x1(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x2,%ecx
  je     L215
  lea    0x2(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x3,%ecx
  je     L215
  lea    0x3(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x4,%ecx
  je     L215
  lea    0x4(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x5,%ecx
  je     L215
  lea    0x5(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x6,%ecx
  je     L215
  lea    0x6(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x7,%ecx
  je     L215
  lea    0x7(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x8,%ecx
  je     L215
  lea    0x8(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x9,%ecx
  je     L215
  lea    0x9(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0xa,%ecx
  je     L215
  add    $0xa,%esi
  movslq %esi,%rsi
  lea    (%rsi,%rsi,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0xb,%ecx
  je     L215
  lea    (%r8,%r8,4),%rax
  mov    $0xb,%esi
  lea    (%rdx,%rax,2),%rax
  lea    (%rdi,%rax,4),%rdx
  jmp    L891
  nopl   0x0(%rax)
L42:
  add    $0x1,%esi
  add    $0x28,%rdx
  cmp    %esi,%ecx
  je     L977
L891:
  mov    0x1b8(%rdx),%eax
  test   %eax,%eax
  je     L42
L294:
  mov    $0x2,%eax
  ret
  nop
L614:
  cmp    $0x57,%r8b
  jne    L1039
  lea    (%rdx,%rcx,1),%r8d
  mov    $0x1,%eax
  cmp    $0xa,%r8d
  jg     L215
  cmp    $0xa,%esi
  jg     L147
  cmp    $0xa,%edx
  jg     L147
  test   %ecx,%ecx
  jle    L1039
  movslq %esi,%r8
  movslq %edx,%rax
  lea    (%r8,%r8,4),%rsi
  add    %rsi,%rsi
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L147
  cmp    $0x1,%ecx
  je     L215
  lea    0x1(%rdx),%eax
  cltq
  add    %rax,%rsi
  mov    (%rdi,%rsi,4),%eax
  test   %eax,%eax
  jne    L147
  cmp    $0x2,%ecx
  je     L215
  lea    0x2(%rdx),%eax
  lea    (%r8,%r8,4),%rsi
  cltq
  add    %rsi,%rsi
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L147
  cmp    $0x3,%ecx
  je     L215
  lea    0x3(%rdx),%eax
  cltq
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L147
  cmp    $0x4,%ecx
  je     L215
  lea    0x4(%rdx),%eax
  cltq
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  je     L208
  nopl   (%rax)
L147:
  mov    $0x1,%eax
L215:
  ret
  xchg   %ax,%ax
L1039:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L94:
  mov    %edx,%r8d
  mov    $0x1,%eax
  sub    %ecx,%r8d
  cmp    $0xffffffff,%r8d
  jl     L215
  cmp    $0xa,%esi
  jg     L147
  cmp    $0xa,%edx
  jg     L147
  test   %ecx,%ecx
  jle    L1039
  movslq %esi,%r8
  movslq %edx,%rax
  lea    (%r8,%r8,4),%rsi
  add    %rsi,%rsi
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x1,%ecx
  je     L215
  lea    -0x1(%rdx),%eax
  cltq
  add    %rax,%rsi
  mov    (%rdi,%rsi,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x2,%ecx
  je     L215
  lea    -0x2(%rdx),%eax
  lea    (%r8,%r8,4),%rsi
  cltq
  add    %rsi,%rsi
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x3,%ecx
  je     L215
  lea    -0x3(%rdx),%eax
  cltq
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x4,%ecx
  je     L215
  lea    -0x4(%rdx),%eax
  cltq
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x5,%ecx
  je     L215
  lea    -0x5(%rdx),%eax
  cltq
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x6,%ecx
  je     L215
  lea    -0x6(%rdx),%eax
  cltq
  add    %rax,%rsi
  mov    (%rdi,%rsi,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x7,%ecx
  je     L215
  lea    -0x7(%rdx),%eax
  lea    (%r8,%r8,4),%rsi
  cltq
  add    %rsi,%rsi
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x8,%ecx
  je     L215
  lea    -0x8(%rdx),%eax
  cltq
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x9,%ecx
  je     L215
  sub    $0x9,%edx
  xor    %eax,%eax
  movslq %edx,%rdx
  add    %rdx,%rsi
  mov    (%rdi,%rsi,4),%ecx
  test   %ecx,%ecx
  setne  %al
  add    %eax,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L440:
  mov    %esi,%r8d
  mov    $0x1,%eax
  sub    %ecx,%r8d
  cmp    $0xffffffff,%r8d
  jl     L215
  cmp    $0xa,%esi
  jg     L147
  cmp    $0xa,%edx
  jg     L147
  test   %ecx,%ecx
  jle    L1039
  movslq %esi,%r8
  movslq %edx,%rdx
  lea    (%r8,%r8,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x1,%ecx
  je     L215
  lea    -0x1(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x2,%ecx
  je     L215
  lea    -0x2(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x3,%ecx
  je     L215
  lea    -0x3(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x4,%ecx
  je     L215
  lea    -0x4(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x5,%ecx
  je     L215
  lea    -0x5(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x6,%ecx
  je     L215
  lea    -0x6(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x7,%ecx
  je     L215
  lea    -0x7(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x8,%ecx
  je     L215
  lea    -0x8(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0x9,%ecx
  je     L215
  lea    -0x9(%rsi),%eax
  cltq
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0xa,%ecx
  je     L215
  sub    $0xa,%esi
  movslq %esi,%rsi
  lea    (%rsi,%rsi,4),%rax
  lea    (%rdx,%rax,2),%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L294
  cmp    $0xb,%ecx
  je     L215
  lea    (%r8,%r8,4),%rax
  mov    $0xb,%esi
  lea    (%rdx,%rax,2),%rax
  lea    (%rdi,%rax,4),%rdx
  jmp    L848
  nop
L428:
  add    $0x1,%esi
  sub    $0x28,%rdx
  cmp    %esi,%ecx
  je     L508
L848:
  mov    -0x1b8(%rdx),%eax
  test   %eax,%eax
  je     L428
  jmp    L294
  xchg   %ax,%ax
L208:
  cmp    $0x5,%ecx
  je     L215
  lea    0x5(%rdx),%eax
  cltq
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L147
  cmp    $0x6,%ecx
  je     L215
  lea    0x6(%rdx),%eax
  cltq
  add    %rax,%rsi
  mov    (%rdi,%rsi,4),%eax
  test   %eax,%eax
  jne    L147
  cmp    $0x7,%ecx
  je     L215
  lea    0x7(%rdx),%eax
  lea    (%r8,%r8,4),%rsi
  cltq
  add    %rsi,%rsi
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L147
  cmp    $0x8,%ecx
  je     L215
  lea    0x8(%rdx),%eax
  cltq
  add    %rsi,%rax
  mov    (%rdi,%rax,4),%eax
  test   %eax,%eax
  jne    L147
  cmp    $0x9,%ecx
  je     L215
  add    $0x9,%edx
  xor    %eax,%eax
  movslq %edx,%rdx
  add    %rdx,%rsi
  mov    (%rdi,%rsi,4),%edx
  test   %edx,%edx
  setne  %al
  ret
L508:
  ret
L977:
  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;
}
```