// File: /workspace/github_cpp_makefile_star2_O3/kobanium[P]Ray/src/board/GoBoard.cpp
// Function: IsLegalNotEye(game_info_t*, int, int)
bool
IsLegalNotEye( game_info_t *game, const int pos, const int color )
{
  const int *string_id = game->string_id;
  const string_t *string = game->string;

  // 既に石がある
  if (game->board[pos] != S_EMPTY) {
    // 候補手から除外
    game->candidates[pos] = false;
    return false;
  }

  if (game->seki[pos]) {
    return false;
  }

  // 眼
  if (eye[Pat3(game->pat, pos)] != color ||
      string[string_id[NORTH(pos)]].libs == 1 ||
      string[string_id[ WEST(pos)]].libs == 1 ||
      string[string_id[ EAST(pos)]].libs == 1 ||
      string[string_id[SOUTH(pos)]].libs == 1){

    // 自殺手かどうか
    if (nb4_empty[Pat3(game->pat, pos)] == 0 &&
        IsSuicide(game, string, color, pos)) {
      return false;
    }

    // 劫
    if (game->ko_pos == pos &&
        game->ko_move == (game->moves - 1)) {
      return false;
    }

    // 盤端の特殊処理
    if (false_eye[Pat3(game->pat, pos)] == color) {
      if (IsFalseEyeConnection(game, pos, color)) {
        return true;
      } else {
        game->candidates[pos] = false;
        return false;
      }
    }

    return true;
  }

  // 候補手から除外
  game->candidates[pos] = false;

  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb48, %rsp            # imm = 0xB48
movq %rdi, %rbx
movslq %esi, %rax
cmpb $0x0, 0x43f8(%rdi,%rax)
je 0x556f3
movb $0x0, 0x96ce0(%rbx,%rax)
jmp 0x556fd
cmpb $0x0, 0x97029(%rbx,%rax)
je 0x55711
xorl %eax, %eax
addq $0xb48, %rsp            # imm = 0xB48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %r12d
movq %rax, 0x8(%rsp)
leaq 0x9620(%rbx), %r14
leaq 0x4748(%rbx), %r13
movq %r13, %rdi
movl %edx, 0x4(%rsp)
callq 0x4fc2a
movl %eax, %eax
leaq 0x1aab9fa4(%rip), %rcx  # 0x1ab0f6e0
movzbl (%rax,%rcx), %eax
cmpl 0x4(%rsp), %eax
jne 0x557c3
movl 0x21170(%rip), %eax     # 0x768bc
movl %r12d, %ecx
subl %eax, %ecx
movslq %ecx, %rcx
movslq 0x95720(%rbx,%rcx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
cmpl $0x1, 0x4(%r14,%rcx)
je 0x557c3
movq 0x8(%rsp), %rcx
movslq 0x9571c(%rbx,%rcx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
cmpl $0x1, 0x4(%r14,%rcx)
je 0x557c3
movq 0x8(%rsp), %rcx
movslq 0x95724(%rbx,%rcx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
cmpl $0x1, 0x4(%r14,%rcx)
je 0x557c3
addl %r12d, %eax
cltq
movslq 0x95720(%rbx,%rax,4), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
cmpl $0x1, 0x4(%r14,%rax)
jne 0x55ade
movq %r13, %rdi
movl %r12d, %esi
callq 0x4fc2a
movl %eax, %eax
leaq 0x1aae9f09(%rip), %rcx  # 0x1ab3f6e0
cmpb $0x0, (%rax,%rcx)
jne 0x557f7
movq %rbx, %rdi
movq %r14, %rsi
movl 0x4(%rsp), %edx
movl %r12d, %ecx
callq 0x55637
testb %al, %al
jne 0x556fd
cmpl %r12d, 0x43c4(%rbx)
jne 0x55814
movl 0x43b0(%rbx), %eax
decl %eax
cmpl %eax, 0x43c8(%rbx)
je 0x556fd
movq %r13, %rdi
movl %r12d, %esi
callq 0x4fc2a
movl %eax, %eax
leaq 0x1aac9eb8(%rip), %rcx  # 0x1ab1f6e0
movzbl (%rax,%rcx), %ecx
movb $0x1, %al
movl 0x4(%rsp), %esi
cmpl %esi, %ecx
jne 0x556ff
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x50(%rsp)
movl 0x2106a(%rip), %eax     # 0x768bc
movl %r12d, %ecx
subl %eax, %ecx
movl %ecx, 0x20(%rsp)
leal -0x1(%r12), %ecx
movl %ecx, 0x24(%rsp)
leal 0x1(%r12), %ecx
movl %ecx, 0x28(%rsp)
addl %r12d, %eax
movl %eax, 0x2c(%rsp)
xorl %eax, %eax
xorl %r13d, %r13d
movq 0x8(%rsp), %r9
movslq 0x20(%rsp,%rax,4), %rcx
movl 0x95720(%rbx,%rcx,4), %ecx
testl %r13d, %r13d
jle 0x558b1
movl %r13d, %edx
xorl %r10d, %r10d
xorl %edi, %edi
cmpl %ecx, 0x40(%rsp,%r10,4)
sete %r8b
orb %r8b, %dil
incq %r10
cmpq %r10, %rdx
jne 0x55897
testb $0x1, %dil
jne 0x558bb
movslq %r13d, %rdx
incl %r13d
movl %ecx, 0x40(%rsp,%rdx,4)
incq %rax
cmpq $0x4, %rax
jne 0x5587e
movq %r14, 0x10(%rsp)
xorl %r15d, %r15d
leaq 0x1ab0c97d(%rip), %rbp  # 0x1ab62250
leaq 0x40(%rsp), %r14
movslq (%r15,%rbp), %rax
addq %r9, %rax
movsbl 0x43f8(%rbx,%rax), %ecx
xorl %esi, %ecx
cmpl $0x3, %ecx
jne 0x55914
movl 0x95720(%rbx,%rax,4), %esi
movq %rbx, %rdi
movq %r14, %rdx
movl %r13d, %ecx
callq 0x5c2df
movl 0x4(%rsp), %esi
movq 0x8(%rsp), %r9
testb %al, %al
jne 0x55ac9
addq $0x4, %r15
cmpq $0x10, %r15
jne 0x558d8
xorl %r13d, %r13d
xorl %r11d, %r11d
xorl %r14d, %r14d
movslq %r13d, %rax
movslq 0x20(%rsp,%rax,4), %rax
movsbl 0x43f8(%rbx,%rax), %ecx
cmpl %esi, %ecx
jne 0x55a18
movslq 0x95720(%rbx,%rax,4), %rbp
imulq $0x7c8, %rbp, %rax      # imm = 0x7C8
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax), %r15
cmpl $0x2, 0x4(%rcx,%rax)
jne 0x55994
movswl 0x8(%r15), %edx
cmpl %r12d, %edx
movl %r11d, 0x1c(%rsp)
jne 0x55976
movslq %edx, %rax
movswl 0x8(%r15,%rax,2), %edx
movq %rbx, %rdi
callq 0x5bee7
movl 0x4(%rsp), %esi
testb %al, %al
movq 0x8(%rsp), %r9
movl 0x1c(%rsp), %r11d
jne 0x55ad7
testl %r11d, %r11d
jle 0x559ac
movl %r11d, %eax
xorl %ecx, %ecx
cmpl %ebp, 0x30(%rsp,%rcx,4)
je 0x55a18
incq %rcx
cmpq %rcx, %rax
jne 0x5599e
movzwl 0x8(%r15), %edx
xorl %eax, %eax
cmpl $0x2b7, %edx            # imm = 0x2B7
je 0x55a00
movl %r14d, %ecx
xorl %eax, %eax
movswl %dx, %edx
cmpl %r12d, %edx
je 0x559ef
xorl %r13d, %r13d
testl %r14d, %r14d
jle 0x559e2
cmpl %edx, 0x60(%rsp,%r13,4)
je 0x559ef
incq %r13
cmpq %r13, %rcx
jne 0x559d0
movl %r14d, %r13d
leal (%rax,%r14), %edi
movslq %edi, %rdi
movl %edx, 0x60(%rsp,%rdi,4)
incl %eax
movslq %edx, %rdx
movzwl 0x8(%r15,%rdx,2), %edx
cmpl $0x2b7, %edx            # imm = 0x2B7
jne 0x559c0
addl %r14d, %eax
movl 0x4(%r15), %ecx
movslq %r11d, %rdx
movl %ecx, 0x50(%rsp,%rdx,4)
incl %r11d
movl %ebp, 0x30(%rsp,%rdx,4)
movl %eax, %r14d
leal 0x1(%r13), %eax
cmpl $0x3, %r13d
movl %eax, %r13d
jl 0x55927
testl %r11d, %r11d
jle 0x55a4a
movl %r11d, %ecx
xorl %edx, %edx
xorl %r10d, %r10d
movl 0x50(%rsp,%rdx,4), %esi
addl %esi, %r10d
decl %r10d
incq %rdx
cmpq %rdx, %rcx
jne 0x55a36
jmp 0x55a4d
xorl %r10d, %r10d
movslq 0x30(%rsp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
movq 0x10(%rsp), %rdx
movzwl 0x57c(%rdx,%rcx), %esi
cmpl $0x11f, %esi            # imm = 0x11F
je 0x55ab8
movslq 0x34(%rsp), %rdx
imulq $0x7c8, %rdx, %rdx      # imm = 0x7C8
movq 0x10(%rsp), %rdi
addq %rdi, %rdx
addq %rdi, %rcx
movq 0x10(%rsp), %r8
movswq %si, %rsi
imulq $0x7c8, %rsi, %rdi      # imm = 0x7C8
cmpl $0x1, 0x4(%r8,%rdi)
jne 0x55aa8
cmpw $0x0, 0x57c(%rdx,%rsi,2)
jne 0x55ac9
movzwl 0x57c(%rcx,%rsi,2), %esi
cmpl $0x11f, %esi            # imm = 0x11F
jne 0x55a8a
cmpl $0x1, %r11d
movb $0x1, %al
je 0x55ac9
cmpl %r10d, %r14d
je 0x556ff
movb $0x0, 0x96ce0(%rbx,%r9)
jmp 0x556fd
movb $0x1, %al
jmp 0x556ff
movq 0x8(%rsp), %rax
jmp 0x556e9