// File: YSRKEN[P]Shioi/I401/main.cpp
// Function: Board::GetOpeningMove(Stone)
Result GetOpeningMove(const Stone /*turn*/) {
		size_t count = CountStone();
		if (count == 0) {
			return{ ToPosition(7, 7), true };
		}
		else if (board_[ToPosition(7, 7)] != Stone::Black) return{};
		else if (count == 1) {
			constexpr static size_t next_move[] = { ToPosition(7, 6), ToPosition(8, 6) };
			return{ next_move[RandInt(2)], true };
		}
		else if (count == 2) {
			// Ka-getsu
			if (board_[ToPosition(7, 6)] == Stone::White) return{ToPosition(8, 6), true};
			if (board_[ToPosition(8, 7)] == Stone::White) return{ToPosition(8, 8), true};
			if (board_[ToPosition(7, 8)] == Stone::White) return{ToPosition(6, 8), true};
			if (board_[ToPosition(6, 7)] == Stone::White) return{ToPosition(6, 6), true};
			// Ho-getsu
			if (board_[ToPosition(8, 6)] == Stone::White) return{ToPosition(8, 8), true};
			if (board_[ToPosition(8, 8)] == Stone::White) return{ToPosition(6, 8), true};
			if (board_[ToPosition(6, 8)] == Stone::White) return{ToPosition(6, 6), true};
			if (board_[ToPosition(6, 6)] == Stone::White) return{ToPosition(8, 6), true};
		}
		return{};
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movb %sil, %al
movq %rdi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0xde10
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x95eb
movl $0x7, %esi
movq %rsi, %rdi
callq 0x3100
movq %rax, -0x30(%rbp)
movb $0x1, -0x31(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x31(%rbp), %rdx
callq 0xdec0
jmp 0x991e
movl $0x7, %esi
movq %rsi, %rdi
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x5590
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x961d
leaq -0x10(%rbp), %rdi
callq 0xdef0
jmp 0x991e
cmpq $0x1, -0x28(%rbp)
jne 0x9652
movl $0x2, %edi
callq 0x9aa0
leaq 0x14f8b(%rip), %rsi     # 0x1e5c0
shlq $0x3, %rax
addq %rax, %rsi
movb $0x1, -0x32(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x32(%rbp), %rdx
callq 0xdf10
jmp 0x991e
cmpq $0x2, -0x28(%rbp)
jne 0x990f
movl $0x7, %edi
movl $0x6, %esi
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x5590
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x96b0
movl $0x8, %edi
movl $0x6, %esi
callq 0x3100
movq %rax, -0x40(%rbp)
movb $0x1, -0x41(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x41(%rbp), %rdx
callq 0xdec0
jmp 0x991e
movl $0x8, %edi
movl $0x7, %esi
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x5590
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x9701
movl $0x8, %esi
movq %rsi, %rdi
callq 0x3100
movq %rax, -0x50(%rbp)
movb $0x1, -0x51(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x51(%rbp), %rdx
callq 0xdec0
jmp 0x991e
movl $0x7, %edi
movl $0x8, %esi
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x5590
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x9754
movl $0x6, %edi
movl $0x8, %esi
callq 0x3100
movq %rax, -0x60(%rbp)
movb $0x1, -0x61(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x61(%rbp), %rdx
callq 0xdec0
jmp 0x991e
movl $0x6, %edi
movl $0x7, %esi
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x5590
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x97a5
movl $0x6, %esi
movq %rsi, %rdi
callq 0x3100
movq %rax, -0x70(%rbp)
movb $0x1, -0x71(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x71(%rbp), %rdx
callq 0xdec0
jmp 0x991e
movl $0x8, %edi
movl $0x6, %esi
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x5590
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x97fc
movl $0x8, %esi
movq %rsi, %rdi
callq 0x3100
movq %rax, -0x80(%rbp)
movb $0x1, -0x81(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x81(%rbp), %rdx
callq 0xdec0
jmp 0x991e
movl $0x8, %esi
movq %rsi, %rdi
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x5590
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x9859
movl $0x6, %edi
movl $0x8, %esi
callq 0x3100
movq %rax, -0x90(%rbp)
movb $0x1, -0x91(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x91(%rbp), %rdx
callq 0xdec0
jmp 0x991e
movl $0x6, %edi
movl $0x8, %esi
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x5590
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x98b3
movl $0x6, %esi
movq %rsi, %rdi
callq 0x3100
movq %rax, -0xa0(%rbp)
movb $0x1, -0xa1(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xa1(%rbp), %rdx
callq 0xdec0
jmp 0x991e
movl $0x6, %esi
movq %rsi, %rdi
callq 0x3100
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x5590
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x990d
movl $0x8, %edi
movl $0x6, %esi
callq 0x3100
movq %rax, -0xb0(%rbp)
movb $0x1, -0xb1(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0xb1(%rbp), %rdx
callq 0xdec0
jmp 0x991e
jmp 0x990f
jmp 0x9911
jmp 0x9913
jmp 0x9915
leaq -0x10(%rbp), %rdi
callq 0xdef0
movq -0x10(%rbp), %rax
movb -0x8(%rbp), %dl
addq $0xc0, %rsp
popq %rbp
retq
nop