// File: /workspace/github_cpp_makefile_star2_O3/YSRKEN[P]Shioi/I401/main.cpp
// Function: Board::Board(char const*, char const*)
Board(const char board_text[], const char turn_text[]) 
		: turn_(turn_text[0] | toStone("Can't read turn data."))
	{
		// Read board-text
		if (strlen(board_text) < kBoardSize * kBoardSize) {
			throw std::invalid_argument("Too short board-text size!");
		}
		for (size_t p : rep(kBoardSize * kBoardSize)) {
			board_[p] = board_text[p] | toStone("Can't read board data.");
		}
		// Initialize IterateTable
		constexpr size_t kTengen = kBoardSize / 2;
		for (size_t y : rep(kBoardSize)) {
			for (size_t x : rep(kBoardSize)) {
				const auto p = ToPosition(x, y);
				kTenGenDist[p] = kTengen - std::max(safe_dist(x, kTengen), safe_dist(y, kTengen));
				// Row(─)
				kIterateTable[p][Direction::Row][Side::Right] = std::min(kBoardSize - x - 1, kSearchWidth);
				kIterateTable[p][Direction::Row][Side::Left ] = std::min(x, kSearchWidth);
				// Column(│)
				kIterateTable[p][Direction::Column][Side::Right] = std::min(kBoardSize - y - 1, kSearchWidth);
				kIterateTable[p][Direction::Column][Side::Left ] = std::min(y, kSearchWidth);
				// Diagonally right(／)
				kIterateTable[p][Direction::DiagR][Side::Right] = min(x, kBoardSize - y - 1, kSearchWidth);
				kIterateTable[p][Direction::DiagR][Side::Left] = min(kBoardSize - x - 1, y, kSearchWidth);
				// Diagonally left(＼)
				kIterateTable[p][Direction::DiagL][Side::Right] = min(kBoardSize - x - 1, kBoardSize - y - 1, kSearchWidth);
				kIterateTable[p][Direction::DiagL][Side::Left] = min(x, y, kSearchWidth);
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movsbl (%rdx), %edi
leaq 0x820d(%rip), %rsi      # 0xb24e
callq 0x2b40
movb %al, 0xe1(%rbx)
movq %r14, %rdi
callq 0x20e0
cmpq $0xe1, %rax
jb 0x31ae
xorl %r12d, %r12d
leaq 0x8215(%rip), %r15      # 0xb27f
movsbl (%r14,%r12), %edi
movq %r15, %rsi
callq 0x2b40
movb %al, (%rbx,%r12)
incq %r12
cmpq $0xe1, %r12
jne 0x306a
leaq 0x3928(%rbx), %rax
addq $0x120, %rbx            # imm = 0x120
xorl %ecx, %ecx
movl $0x5, %edx
leaq -0x7(%rcx), %rdi
negq %rdi
movq %rcx, %rsi
subq $0x7, %rsi
cmovbq %rdi, %rsi
movl $0xe, %edi
subq %rcx, %rdi
cmpq $0x5, %rdi
movl $0x5, %r8d
cmovbq %rdi, %r8
cmpq %rdx, %rcx
movl $0x5, %r9d
cmovbq %rcx, %r9
movl $0x7, %r10d
movq %rbx, %r11
xorl %r14d, %r14d
movq %r14, %r15
subq $0x7, %r15
movq %r15, %r12
cmovbq %r10, %r12
cmpq %rsi, %r12
cmovbeq %rsi, %r12
movl $0x7, %r13d
subq %r12, %r13
movq %r13, (%rax,%r14,8)
leaq 0x7(%r10), %r12
cmpq %rdx, %r12
movl $0x5, %r13d
cmovbq %r12, %r13
movq %r13, -0x30(%r11)
cmpq %rdx, %r14
movl $0x5, %ebp
cmovbq %r14, %rbp
movq %rbp, -0x38(%r11)
cmpq %r14, %rdi
movq %r14, %rbp
cmovbq %rdi, %rbp
movq %r8, -0x20(%r11)
cmpq $0x6, %rbp
cmovaeq %rdx, %rbp
movq %r9, -0x28(%r11)
cmpq %r12, %rcx
cmovbq %rcx, %r12
movq %rbp, -0x10(%r11)
cmpq $0x6, %r12
cmovaeq %rdx, %r12
movq %r12, -0x18(%r11)
cmpq %rdi, %r13
cmovaeq %rdi, %r13
movq %r13, (%r11)
cmpq %r14, %rcx
cmovbq %rcx, %r14
cmpq $0x6, %r14
cmovaeq %rdx, %r14
movq %r14, -0x8(%r11)
addq $0x40, %r11
decq %r10
leaq 0x8(%r15), %r14
cmpq $0xf, %r14
jne 0x30dd
incq %rcx
addq $0x3c0, %rbx            # imm = 0x3C0
addq $0x78, %rax
cmpq $0xf, %rcx
jne 0x309c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x2100
movq %rax, %rbx
leaq 0x80a2(%rip), %rsi      # 0xb264
movq %rax, %rdi
callq 0x2370
movq 0xbdff(%rip), %rsi      # 0xefd0
movq 0xbde0(%rip), %rdx      # 0xefb8
movq %rbx, %rdi
callq 0x2310
movq %rax, %r14
movq %rbx, %rdi
callq 0x2170
movq %r14, %rdi
callq 0x2330
nop