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

```asm
<sanityCheck>:
  endbr64
  mov    %rdi,%r9
  cmp    $0x53,%r8b
  je     L57
  jg     L217
  cmp    $0x45,%r8b
  je     L135
  cmp    $0x4e,%r8b
  jne    L118
  lea    (%rcx,%rsi,1),%edi
  mov    $0x1,%eax
  cmp    $0xa,%edi
  jg     L273
  cmp    $0xa,%esi
  jg     L203
  cmp    $0xa,%edx
  jg     L203
  test   %ecx,%ecx
  jle    L105
  movslq %edx,%rdx
  movslq %esi,%rsi
  lea    (%rsi,%rsi,4),%rax
  lea    (%rdx,%rax,2),%rax
  lea    (%r9,%rax,4),%rdi
  lea    -0x1(%rcx),%eax
  add    %rsi,%rax
  lea    (%rax,%rax,4),%rax
  lea    (%rdx,%rax,2),%rax
  lea    0x28(%r9,%rax,4),%rdx
L190:
  mov    (%rdi),%eax
  test   %eax,%eax
  jne    L38
  add    $0x28,%rdi
  cmp    %rdx,%rdi
  jne    L190
  ret
L118:
  mov    $0x0,%eax
  ret
L217:
  cmp    $0x57,%r8b
  jne    L31
  lea    (%rdx,%rcx,1),%edi
  mov    $0x1,%eax
  cmp    $0xa,%edi
  jg     L273
  cmp    $0xa,%esi
  jg     L262
  cmp    $0xa,%edx
  jg     L262
  test   %ecx,%ecx
  jle    L279
  mov    %ecx,%ecx
  movslq %esi,%rsi
  lea    (%rsi,%rsi,4),%rax
  movslq %edx,%rdx
  lea    (%rdx,%rax,2),%rax
  lea    (%r9,%rax,4),%rsi
  mov    $0x0,%edx
L29:
  mov    (%rsi,%rdx,4),%eax
  test   %eax,%eax
  jne    L128
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L29
  ret
L31:
  mov    $0x0,%eax
  ret
L57:
  mov    %esi,%edi
  sub    %ecx,%edi
  mov    $0x1,%eax
  cmp    $0xffffffff,%edi
  jl     L273
  cmp    $0xa,%esi
  jg     L62
  cmp    $0xa,%edx
  jg     L62
  test   %ecx,%ecx
  jle    L96
  movslq %esi,%rsi
  lea    (%rsi,%rsi,4),%rax
  movslq %edx,%rdx
  lea    (%rdx,%rax,2),%rax
  shl    $0x2,%rax
  lea    (%r9,%rax,1),%rdx
  lea    -0x28(%r9,%rax,1),%rax
  lea    -0x1(%rcx),%ecx
  lea    (%rcx,%rcx,4),%rsi
  shl    $0x3,%rsi
  sub    %rsi,%rax
  mov    %rax,%rcx
L1:
  mov    (%rdx),%eax
  test   %eax,%eax
  jne    L14
  sub    $0x28,%rdx
  cmp    %rcx,%rdx
  jne    L1
  ret
L135:
  mov    %edx,%edi
  sub    %ecx,%edi
  mov    $0x1,%eax
  cmp    $0xffffffff,%edi
  jl     L273
  cmp    $0xa,%esi
  jg     L19
  cmp    $0xa,%edx
  jg     L19
  test   %ecx,%ecx
  jle    L171
  movslq %esi,%rsi
  lea    (%rsi,%rsi,4),%rax
  movslq %edx,%rdx
  lea    (%rdx,%rax,2),%rax
  shl    $0x2,%rax
  lea    (%r9,%rax,1),%rdx
  lea    -0x4(%r9,%rax,1),%rax
  lea    -0x1(%rcx),%esi
  shl    $0x2,%rsi
  sub    %rsi,%rax
  mov    %rax,%rcx
L200:
  mov    (%rdx),%eax
  test   %eax,%eax
  jne    L127
  sub    $0x4,%rdx
  cmp    %rcx,%rdx
  jne    L200
  ret
L203:
  mov    $0x1,%eax
  ret
L105:
  mov    $0x0,%eax
  ret
L38:
  mov    $0x2,%eax
  ret
L62:
  mov    $0x1,%eax
  ret
L96:
  mov    $0x0,%eax
  ret
L14:
  mov    $0x2,%eax
  ret
L19:
  mov    $0x1,%eax
  ret
L171:
  mov    $0x0,%eax
  ret
L127:
  mov    $0x2,%eax
  ret
L262:
  mov    $0x1,%eax
  ret
L279:
  mov    $0x0,%eax
  ret
L128:
  mov    $0x1,%eax
L273:
  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;
}
```