// File: YSRKEN[P]Shioi/I401/main.cpp
// Function: Board::NextMove(unsigned long, bool)
int NextMove(const size_t depth, bool debug_flg = false) {
		//PutBoard();
		// If the game is end, you don't move.
		if (IsGameEnd()) return -1;
		// Opening move
		if (debug_flg) std::cerr << "Opening" << endl;
		auto result = GetOpeningMove(turn_);
		if (result.second) return result.first;
		// Book move
		if (debug_flg) std::cerr << "Book" << endl;
		auto book_data = book.GetBookData(board_);
		if (book_data.size() != 0) return book_data[RandInt(book_data.size())];
		// If you can make Go-ren, you must do.
		if (debug_flg) std::cerr << "Goren" << endl;
		result = FindGorenMove(turn_);
		if (result.second) return result.first;
		// If enemy can make Go-ren, you must block it.
		if (debug_flg) std::cerr << "Stop Goren" << endl;
		result = FindGorenMove(EnemyTurn(turn_));
		if (result.second) {
			if(turn_ == Stone::White || IsValidMove(result.first)) return result.first;
		}
		// Search of quadruplex's problem(Shioi Tsume)
		if (debug_flg) std::cerr << "Shioi" << endl;
		result = FindShioiMove(turn_, kShioiDepth1);
		if (result.second) return result.first;
		// Search of attack's problem (Oi Tsume)
		if (debug_flg) std::cerr << "Oite" << endl;
		result = FindOiteMove(turn_, kOiteDepth1);
		if (result.second) return result.first;
		// Normal move search
		if (debug_flg) std::cerr << "Normal" << endl;
		result = FindNormalMove(depth, debug_flg);
		if (result.second) return result.first;
		if (result.first >= kBoardSize * kBoardSize) return -2;
		return -1;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x9530
testb $0x1, %al
jne 0x4160
jmp 0x416c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x467f
testb $0x1, -0x19(%rbp)
je 0x4194
movq 0x22e6f(%rip), %rdi     # 0x26fe8
leaq 0x1a105(%rip), %rsi     # 0x1e285
callq 0x21f0
movq %rax, %rdi
movq 0x22df9(%rip), %rsi     # 0x26f88
callq 0x2220
movq -0x110(%rbp), %rdi
movzbl 0xe1(%rdi), %esi
callq 0x9590
movb %dl, -0x38(%rbp)
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movb -0x38(%rbp), %al
movb %al, -0x28(%rbp)
testb $0x1, -0x28(%rbp)
je 0x41ce
movq -0x30(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x467f
testb $0x1, -0x19(%rbp)
je 0x41f6
movq 0x22e0d(%rip), %rdi     # 0x26fe8
leaq 0x1a0ab(%rip), %rsi     # 0x1e28d
callq 0x21f0
movq %rax, %rdi
movq 0x22d97(%rip), %rsi     # 0x26f88
callq 0x2220
movq -0x110(%rbp), %rdx
leaq -0x58(%rbp), %rdi
leaq 0x25728(%rip), %rsi     # 0x29930
callq 0x9930
leaq -0x58(%rbp), %rdi
callq 0x63a0
cmpq $0x0, %rax
je 0x4272
leaq -0x58(%rbp), %rdi
callq 0x63a0
movq %rax, %rdi
callq 0x9aa0
movq %rax, -0x118(%rbp)
jmp 0x4236
movq -0x118(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x9a80
movq (%rax), %rax
movl %eax, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x4676
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5cb0
jmp 0x468b
testb $0x1, -0x19(%rbp)
je 0x42ab
movq 0x22d69(%rip), %rdi     # 0x26fe8
leaq 0x1a011(%rip), %rsi     # 0x1e297
callq 0x21f0
movq %rax, -0x120(%rbp)
jmp 0x4294
movq -0x120(%rbp), %rdi
movq 0x22ce6(%rip), %rsi     # 0x26f88
callq 0x2220
jmp 0x42a9
jmp 0x42ab
movq -0x110(%rbp), %rdi
movzbl 0xe1(%rdi), %esi
callq 0x9ae0
movb %dl, -0x129(%rbp)
movq %rax, -0x128(%rbp)
jmp 0x42cd
movb -0x129(%rbp), %al
movq -0x128(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movb %al, -0x80(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x78(%rbp)
movb -0x80(%rbp), %al
movb %al, -0x70(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xaf40
testb $0x1, -0x28(%rbp)
je 0x431b
movq -0x30(%rbp), %rax
movl %eax, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x4676
testb $0x1, -0x19(%rbp)
je 0x4354
movq 0x22cc0(%rip), %rdi     # 0x26fe8
leaq 0x19f63(%rip), %rsi     # 0x1e292
callq 0x21f0
movq %rax, -0x138(%rbp)
jmp 0x433d
movq -0x138(%rbp), %rdi
movq 0x22c3d(%rip), %rsi     # 0x26f88
callq 0x2220
jmp 0x4352
jmp 0x4354
movq -0x110(%rbp), %rax
movzbl 0xe1(%rax), %edi
callq 0x68d0
movq -0x110(%rbp), %rdi
movzbl %al, %esi
callq 0x9ae0
movb %dl, -0x141(%rbp)
movq %rax, -0x140(%rbp)
jmp 0x4385
movb -0x141(%rbp), %al
movq -0x140(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movb %al, -0xa0(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x98(%rbp)
movb -0xa0(%rbp), %al
movb %al, -0x90(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xaf40
testb $0x1, -0x28(%rbp)
je 0x441b
movq -0x110(%rbp), %rax
movzbl 0xe1(%rax), %eax
cmpl $0x2, %eax
je 0x4406
movq -0x110(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xaf70
movb %al, -0x142(%rbp)
jmp 0x43fa
movb -0x142(%rbp), %al
testb $0x1, %al
jne 0x4406
jmp 0x4419
movq -0x30(%rbp), %rax
movl %eax, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x4676
jmp 0x441b
testb $0x1, -0x19(%rbp)
je 0x4454
movq 0x22bc0(%rip), %rdi     # 0x26fe8
leaq 0x19e6e(%rip), %rsi     # 0x1e29d
callq 0x21f0
movq %rax, -0x150(%rbp)
jmp 0x443d
movq -0x150(%rbp), %rdi
movq 0x22b3d(%rip), %rsi     # 0x26f88
callq 0x2220
jmp 0x4452
jmp 0x4454
movq -0x110(%rbp), %rdi
movzbl 0xe1(%rdi), %esi
movl $0x14, %edx
callq 0xb0b0
movb %dl, -0x159(%rbp)
movq %rax, -0x158(%rbp)
jmp 0x447b
movb -0x159(%rbp), %al
movq -0x158(%rbp), %rcx
movq %rcx, -0xc8(%rbp)
movb %al, -0xc0(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movb -0xc0(%rbp), %al
movb %al, -0xb0(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xaf40
testb $0x1, -0x28(%rbp)
je 0x44d8
movq -0x30(%rbp), %rax
movl %eax, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x4676
testb $0x1, -0x19(%rbp)
je 0x4511
movq 0x22b03(%rip), %rdi     # 0x26fe8
leaq 0x19db7(%rip), %rsi     # 0x1e2a3
callq 0x21f0
movq %rax, -0x168(%rbp)
jmp 0x44fa
movq -0x168(%rbp), %rdi
movq 0x22a80(%rip), %rsi     # 0x26f88
callq 0x2220
jmp 0x450f
jmp 0x4511
movq -0x110(%rbp), %rdi
movzbl 0xe1(%rdi), %esi
movl $0x2, %edx
callq 0xb860
movb %dl, -0x171(%rbp)
movq %rax, -0x170(%rbp)
jmp 0x4538
movb -0x171(%rbp), %al
movq -0x170(%rbp), %rcx
movq %rcx, -0xe8(%rbp)
movb %al, -0xe0(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movb -0xe0(%rbp), %al
movb %al, -0xd0(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xaf40
testb $0x1, -0x28(%rbp)
je 0x4595
movq -0x30(%rbp), %rax
movl %eax, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x4676
testb $0x1, -0x19(%rbp)
je 0x45ce
movq 0x22a46(%rip), %rdi     # 0x26fe8
leaq 0x19cff(%rip), %rsi     # 0x1e2a8
callq 0x21f0
movq %rax, -0x180(%rbp)
jmp 0x45b7
movq -0x180(%rbp), %rdi
movq 0x229c3(%rip), %rsi     # 0x26f88
callq 0x2220
jmp 0x45cc
jmp 0x45ce
movq -0x110(%rbp), %rdi
movq -0x18(%rbp), %rsi
movzbl -0x19(%rbp), %edx
andl $0x1, %edx
callq 0xc0a0
movb %dl, -0x189(%rbp)
movq %rax, -0x188(%rbp)
jmp 0x45f4
movb -0x189(%rbp), %al
movq -0x188(%rbp), %rcx
movq %rcx, -0x108(%rbp)
movb %al, -0x100(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0xf8(%rbp)
movb -0x100(%rbp), %al
movb %al, -0xf0(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xaf40
testb $0x1, -0x28(%rbp)
je 0x464e
movq -0x30(%rbp), %rax
movl %eax, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x4676
cmpq $0xe1, -0x30(%rbp)
jb 0x4668
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
movl $0x1, -0x68(%rbp)
jmp 0x4676
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x68(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x5cb0
movl -0x4(%rbp), %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2370
nopw %cs:(%rax,%rax)
nop