// File: /workspace/github_cpp_makefile_star2_O2/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 0x3bed9
movb $0x0, 0x96ce0(%rbx,%rax)
jmp 0x3bee3
cmpb $0x0, 0x97029(%rbx,%rax)
je 0x3bef7
xorl %eax, %eax
addq $0xb48, %rsp            # imm = 0xB48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %r15d
movq %rax, 0x8(%rsp)
leaq 0x9620(%rbx), %r14
leaq 0x4748(%rbx), %r12
movq %r12, %rdi
movl %edx, 0x4(%rsp)
callq 0x37bc6
movl %eax, %eax
leaq 0x1aabe7be(%rip), %rcx  # 0x1aafa6e0
movzbl (%rax,%rcx), %eax
cmpl 0x4(%rsp), %eax
jne 0x3bfa9
movl 0x2598a(%rip), %eax     # 0x618bc
movl %r15d, %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 0x3bfa9
movq 0x8(%rsp), %rcx
movslq 0x9571c(%rbx,%rcx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
cmpl $0x1, 0x4(%r14,%rcx)
je 0x3bfa9
movq 0x8(%rsp), %rcx
movslq 0x95724(%rbx,%rcx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
cmpl $0x1, 0x4(%r14,%rcx)
je 0x3bfa9
addl %r15d, %eax
cltq
movslq 0x95720(%rbx,%rax,4), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
cmpl $0x1, 0x4(%r14,%rax)
jne 0x3c2ee
movq %r12, %rdi
movl %r15d, %esi
callq 0x37bc6
movl %eax, %eax
leaq 0x1aaee723(%rip), %rcx  # 0x1ab2a6e0
cmpb $0x0, (%rax,%rcx)
jne 0x3bfdd
movq %rbx, %rdi
movq %r14, %rsi
movl 0x4(%rsp), %edx
movl %r15d, %ecx
callq 0x3be24
testb %al, %al
jne 0x3bee3
cmpl %r15d, 0x43c4(%rbx)
jne 0x3bffa
movl 0x43b0(%rbx), %eax
decl %eax
cmpl %eax, 0x43c8(%rbx)
je 0x3bee3
movq %r12, %rdi
movl %r15d, %esi
callq 0x37bc6
movl %eax, %eax
leaq 0x1aace6d2(%rip), %rcx  # 0x1ab0a6e0
movzbl (%rax,%rcx), %ecx
movb $0x1, %al
movl 0x4(%rsp), %esi
cmpl %esi, %ecx
jne 0x3bee5
movq %r14, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x50(%rsp)
movl 0x2587f(%rip), %eax     # 0x618bc
movl %r15d, %ecx
subl %eax, %ecx
movl %ecx, 0x20(%rsp)
leal -0x1(%r15), %ecx
movl %ecx, 0x24(%rsp)
leal 0x1(%r15), %ecx
movl %ecx, 0x28(%rsp)
addl %r15d, %eax
movl %eax, 0x2c(%rsp)
xorl %eax, %eax
xorl %r13d, %r13d
movq 0x8(%rsp), %r9
cmpq $0x4, %rax
je 0x3c0c1
xorl %ecx, %ecx
testl %r13d, %r13d
movl $0x0, %edx
cmovgl %r13d, %edx
xorl %r10d, %r10d
cmpq %rcx, %rdx
je 0x3c0a0
movl 0x40(%rsp,%rcx,4), %edi
movslq 0x20(%rsp,%rax,4), %r8
cmpl 0x95720(%rbx,%r8,4), %edi
sete %dil
orb %dil, %r10b
incq %rcx
jmp 0x3c07e
testb $0x1, %r10b
jne 0x3c0bc
movslq 0x20(%rsp,%rax,4), %rcx
movl 0x95720(%rbx,%rcx,4), %ecx
movslq %r13d, %rdx
incl %r13d
movl %ecx, 0x40(%rsp,%rdx,4)
incq %rax
jmp 0x3c067
xorl %r14d, %r14d
leaq 0x1ab11185(%rip), %rbp  # 0x1ab4d250
leaq 0x40(%rsp), %r12
cmpq $0x10, %r14
je 0x3c118
movslq (%r14,%rbp), %rax
addq %r9, %rax
movsbl 0x43f8(%rbx,%rax), %ecx
xorl %esi, %ecx
cmpl $0x3, %ecx
jne 0x3c112
movl 0x95720(%rbx,%rax,4), %esi
movq %rbx, %rdi
movq %r12, %rdx
movl %r13d, %ecx
callq 0x42642
movl 0x4(%rsp), %esi
movq 0x8(%rsp), %r9
testb %al, %al
jne 0x3c2d9
addq $0x4, %r14
jmp 0x3c0d0
xorl %r13d, %r13d
xorl %r11d, %r11d
xorl %r12d, %r12d
cmpl $0x4, %r12d
jge 0x3c23c
movslq %r12d, %rax
movslq 0x20(%rsp,%rax,4), %rax
movsbl 0x43f8(%rbx,%rax), %ecx
cmpl %esi, %ecx
jne 0x3c234
movslq 0x95720(%rbx,%rax,4), %r14
imulq $0x7c8, %r14, %rax      # imm = 0x7C8
movq 0x10(%rsp), %rcx
leaq (%rcx,%rax), %r10
cmpl $0x2, 0x4(%rcx,%rax)
jne 0x3c1a3
movswl 0x8(%r10), %edx
cmpl %r15d, %edx
movl %r11d, 0x1c(%rsp)
jne 0x3c17f
movslq %edx, %rax
movq %r10, %rbp
movswl 0x8(%r10,%rax,2), %edx
jmp 0x3c182
movq %r10, %rbp
movq %rbx, %rdi
callq 0x4221f
movl 0x4(%rsp), %esi
testb %al, %al
movq 0x8(%rsp), %r9
movl 0x1c(%rsp), %r11d
movq %rbp, %r10
jne 0x3c2e7
testl %r11d, %r11d
movl $0x0, %eax
cmovgl %r11d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x3c1c6
leaq 0x1(%rcx), %rdx
cmpl %r14d, 0x30(%rsp,%rcx,4)
movq %rdx, %rcx
jne 0x3c1b1
jmp 0x3c234
leaq 0x8(%r10), %rcx
xorl %eax, %eax
testl %r13d, %r13d
movl $0x0, %edx
cmovgl %r13d, %edx
movq %rcx, %rdi
movswl (%rdi), %r8d
cmpl $0x2b7, %r8d            # imm = 0x2B7
je 0x3c21b
cmpl %r15d, %r8d
je 0x3c212
xorl %r12d, %r12d
cmpq %r12, %rdx
je 0x3c201
cmpl %r8d, 0x60(%rsp,%r12,4)
je 0x3c212
incq %r12
jmp 0x3c1f0
leal (%rax,%r13), %edi
movslq %edi, %rdi
movl %r8d, 0x60(%rsp,%rdi,4)
incl %eax
movl %edx, %r12d
movslq %r8d, %rdi
leaq (%rcx,%rdi,2), %rdi
jmp 0x3c1db
addl %r13d, %eax
movl 0x4(%r10), %ecx
movslq %r11d, %rdx
movl %ecx, 0x50(%rsp,%rdx,4)
incl %r11d
movl %r14d, 0x30(%rsp,%rdx,4)
movl %eax, %r13d
incl %r12d
jmp 0x3c121
xorl %ecx, %ecx
testl %r11d, %r11d
movl $0x0, %edx
cmovgl %r11d, %edx
xorl %r10d, %r10d
cmpq %rcx, %rdx
je 0x3c261
movl 0x50(%rsp,%rcx,4), %esi
addl %esi, %r10d
decl %r10d
incq %rcx
jmp 0x3c24d
movslq 0x30(%rsp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
movq 0x10(%rsp), %rdi
leaq (%rdi,%rcx), %rsi
addq $0x57c, %rsi            # imm = 0x57C
movslq 0x34(%rsp), %rdx
imulq $0x7c8, %rdx, %rdx      # imm = 0x7C8
addq %rdi, %rdx
addq %rdi, %rcx
movq 0x10(%rsp), %r8
movswq (%rsi), %rsi
cmpq $0x11f, %rsi            # imm = 0x11F
je 0x3c2c8
imulq $0x7c8, %rsi, %rdi      # imm = 0x7C8
cmpl $0x1, 0x4(%r8,%rdi)
jne 0x3c2bb
cmpw $0x0, 0x57c(%rdx,%rsi,2)
jne 0x3c2d9
leaq (%rcx,%rsi,2), %rsi
addq $0x57c, %rsi            # imm = 0x57C
jmp 0x3c294
cmpl $0x1, %r11d
movb $0x1, %al
je 0x3c2d9
cmpl %r10d, %r13d
je 0x3bee5
movb $0x0, 0x96ce0(%rbx,%r9)
jmp 0x3bee3
movb $0x1, %al
jmp 0x3bee5
movq 0x8(%rsp), %rax
jmp 0x3becf