user: Converte this assembly snippet into its equivalent C code:

```asm
<check_saw2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    %r8,-0x30(%rbp)
  mov    %r9d,-0x34(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L32
L27:
  movl   $0x0,-0x4(%rbp)
  jmp    L74
L12:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    (%rax),%ecx
  mov    $0x1,%eax
  sub    -0x34(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L56
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x4,%rax
  mov    (%rax),%ecx
  mov    $0x1,%eax
  sub    -0x34(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rsi,%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L56
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    (%rax),%ecx
  mov    $0x1,%eax
  sub    -0x34(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  add    %rsi,%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L56
  mov    $0x1,%eax
  jmp    L50
L56:
  addl   $0x1,-0x4(%rbp)
L74:
  cmpl   $0x2,-0x4(%rbp)
  jle    L12
  subl   $0x2,-0x8(%rbp)
L32:
  cmpl   $0x0,-0x8(%rbp)
  jns    L27
  mov    $0x0,%eax
L50:
  pop    %rbp
  ret
```

assistant: ```c
int check_saw2(int(**check_ptr), int position, int lastmove_var, const int(sawmoves_ptr)[4][3], const int(moves_ptr)[2][4][3], int odd_var) {
  for (int trybead = (position - 5); trybead >= 0; trybead -= 2) {
    for (int test = 0; test < 3; test++) {
      if (((check_ptr[position][0] + moves_ptr[1 - odd_var][sawmoves_ptr[lastmove_var][test]][0]) == check_ptr[trybead][0]) && ((check_ptr[position][1] + moves_ptr[1 - odd_var][sawmoves_ptr[lastmove_var][test]][1]) == check_ptr[trybead][1]) && ((check_ptr[position][2] + moves_ptr[1 - odd_var][sawmoves_ptr[lastmove_var][test]][2]) == check_ptr[trybead][2])) {
        return true;
      }
    }
  }
  return false;
}
```