// File: YSRKEN[P]Shioi/I401/./BookDB.hpp
// Function: BookDB::BookDB(char const*)
BookDB(const char *book_name) {
		std::ifstream ifs(book_name);
		if (ifs.fail()) throw std::runtime_error("Book.csv not found.");
		string str;
		while (getline(ifs, str)) {
			// Read CSV data
			string token;
			std::istringstream stream(str);
			vector<size_t> move;
			while (getline(stream, token, ',')) {
				move.push_back(stoi(token));
			}
			// Set BookData
			SetBookData(move);
			move = RotateMove(move);
			SetBookData(move);
			move = RotateMove(move);
			SetBookData(move);
			move = RotateMove(move);
			SetBookData(move);
			move = RotateMove(move);

			move = FlipMove(move);
			SetBookData(move);
			move = RotateMove(move);
			SetBookData(move);
			move = RotateMove(move);
			SetBookData(move);
			move = RotateMove(move);
			SetBookData(move);
		}
		/*for (auto &it : book_[8202465179494830182]) {
		cout << PositionToString(it) << endl;
		}*/
		return;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x590, %rsp            # imm = 0x590
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x4d8(%rbp)
movq %rdi, %rax
movq %rax, -0x4d0(%rbp)
callq 0x47e0
movq -0x10(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x8, %edx
callq 0x2390
jmp 0x3ae4
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x2030
movb %al, -0x4d9(%rbp)
jmp 0x3b04
movb -0x4d9(%rbp), %al
testb $0x1, %al
jne 0x3b13
jmp 0x3ba8
movl $0x10, %edi
callq 0x2110
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x4e8(%rbp)
leaq 0x1a721(%rip), %rsi     # 0x1e252
callq 0x20c0
jmp 0x3b38
movq -0x4e8(%rbp), %rdi
movq 0x234aa(%rip), %rsi     # 0x26ff0
movq 0x2344b(%rip), %rdx     # 0x26f98
callq 0x2350
jmp 0x4098
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x4080
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x4074
movq -0x4e8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
callq 0x21a0
jmp 0x4074
leaq -0x248(%rbp), %rdi
callq 0x2290
leaq -0x218(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x2070
movq %rax, -0x4f0(%rbp)
jmp 0x3bd0
movq -0x4f0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2250
movb %al, -0x4f1(%rbp)
jmp 0x3bee
movb -0x4f1(%rbp), %al
testb $0x1, %al
jne 0x3bfd
jmp 0x4047
leaq -0x268(%rbp), %rdi
callq 0x2290
leaq -0x3e8(%rbp), %rdi
leaq -0x248(%rbp), %rsi
movl $0x8, %edx
callq 0x2330
jmp 0x3c23
leaq -0x400(%rbp), %rdi
callq 0x5880
leaq -0x3e8(%rbp), %rdi
leaq -0x268(%rbp), %rsi
movl $0x2c, %edx
callq 0x23a0
movq %rax, -0x500(%rbp)
jmp 0x3c50
movq -0x500(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2250
movb %al, -0x501(%rbp)
jmp 0x3c6e
movb -0x501(%rbp), %al
testb $0x1, %al
jne 0x3c7d
jmp 0x3d20
xorl %eax, %eax
movl %eax, %esi
leaq -0x268(%rbp), %rdi
movl $0xa, %edx
callq 0x58d0
movl %eax, -0x508(%rbp)
jmp 0x3c9a
movl -0x508(%rbp), %eax
cltq
movq %rax, -0x408(%rbp)
leaq -0x400(%rbp), %rdi
leaq -0x408(%rbp), %rsi
callq 0x58a0
jmp 0x3cbe
jmp 0x3c2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x4068
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x4039
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x400(%rbp), %rdi
callq 0x5cb0
leaq -0x3e8(%rbp), %rdi
callq 0x2100
jmp 0x4039
movq -0x4d0(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x5910
jmp 0x3d35
movq -0x4d0(%rbp), %rsi
leaq -0x420(%rbp), %rdi
leaq -0x400(%rbp), %rdx
callq 0x5b30
jmp 0x3d51
leaq -0x400(%rbp), %rdi
movq %rdi, -0x510(%rbp)
leaq -0x420(%rbp), %rsi
movq %rsi, -0x518(%rbp)
callq 0x5c80
movq -0x518(%rbp), %rdi
callq 0x5cb0
movq -0x4d0(%rbp), %rdi
movq -0x510(%rbp), %rsi
callq 0x5910
jmp 0x3d93
movq -0x4d0(%rbp), %rsi
leaq -0x438(%rbp), %rdi
leaq -0x400(%rbp), %rdx
callq 0x5b30
jmp 0x3daf
leaq -0x400(%rbp), %rdi
movq %rdi, -0x520(%rbp)
leaq -0x438(%rbp), %rsi
movq %rsi, -0x528(%rbp)
callq 0x5c80
movq -0x528(%rbp), %rdi
callq 0x5cb0
movq -0x4d0(%rbp), %rdi
movq -0x520(%rbp), %rsi
callq 0x5910
jmp 0x3df1
movq -0x4d0(%rbp), %rsi
leaq -0x450(%rbp), %rdi
leaq -0x400(%rbp), %rdx
callq 0x5b30
jmp 0x3e0d
leaq -0x400(%rbp), %rdi
movq %rdi, -0x530(%rbp)
leaq -0x450(%rbp), %rsi
movq %rsi, -0x538(%rbp)
callq 0x5c80
movq -0x538(%rbp), %rdi
callq 0x5cb0
movq -0x4d0(%rbp), %rdi
movq -0x530(%rbp), %rsi
callq 0x5910
jmp 0x3e4f
movq -0x4d0(%rbp), %rsi
leaq -0x468(%rbp), %rdi
leaq -0x400(%rbp), %rdx
callq 0x5b30
jmp 0x3e6b
leaq -0x400(%rbp), %rdi
movq %rdi, -0x540(%rbp)
leaq -0x468(%rbp), %rsi
movq %rsi, -0x548(%rbp)
callq 0x5c80
movq -0x548(%rbp), %rdi
callq 0x5cb0
movq -0x4d0(%rbp), %rsi
movq -0x540(%rbp), %rdx
leaq -0x480(%rbp), %rdi
callq 0x5d10
jmp 0x3eb4
leaq -0x400(%rbp), %rdi
movq %rdi, -0x550(%rbp)
leaq -0x480(%rbp), %rsi
movq %rsi, -0x558(%rbp)
callq 0x5c80
movq -0x558(%rbp), %rdi
callq 0x5cb0
movq -0x4d0(%rbp), %rdi
movq -0x550(%rbp), %rsi
callq 0x5910
jmp 0x3ef6
movq -0x4d0(%rbp), %rsi
leaq -0x498(%rbp), %rdi
leaq -0x400(%rbp), %rdx
callq 0x5b30
jmp 0x3f12
leaq -0x400(%rbp), %rdi
movq %rdi, -0x560(%rbp)
leaq -0x498(%rbp), %rsi
movq %rsi, -0x568(%rbp)
callq 0x5c80
movq -0x568(%rbp), %rdi
callq 0x5cb0
movq -0x4d0(%rbp), %rdi
movq -0x560(%rbp), %rsi
callq 0x5910
jmp 0x3f54
movq -0x4d0(%rbp), %rsi
leaq -0x4b0(%rbp), %rdi
leaq -0x400(%rbp), %rdx
callq 0x5b30
jmp 0x3f70
leaq -0x400(%rbp), %rdi
movq %rdi, -0x570(%rbp)
leaq -0x4b0(%rbp), %rsi
movq %rsi, -0x578(%rbp)
callq 0x5c80
movq -0x578(%rbp), %rdi
callq 0x5cb0
movq -0x4d0(%rbp), %rdi
movq -0x570(%rbp), %rsi
callq 0x5910
jmp 0x3fb2
movq -0x4d0(%rbp), %rsi
leaq -0x4c8(%rbp), %rdi
leaq -0x400(%rbp), %rdx
callq 0x5b30
jmp 0x3fce
leaq -0x400(%rbp), %rdi
movq %rdi, -0x580(%rbp)
leaq -0x4c8(%rbp), %rsi
movq %rsi, -0x588(%rbp)
callq 0x5c80
movq -0x588(%rbp), %rdi
callq 0x5cb0
movq -0x4d0(%rbp), %rdi
movq -0x580(%rbp), %rsi
callq 0x5910
jmp 0x4010
leaq -0x400(%rbp), %rdi
callq 0x5cb0
leaq -0x3e8(%rbp), %rdi
callq 0x2100
leaq -0x268(%rbp), %rdi
callq 0x2160
jmp 0x3bb4
leaq -0x268(%rbp), %rdi
callq 0x2160
jmp 0x4068
leaq -0x248(%rbp), %rdi
callq 0x2160
leaq -0x218(%rbp), %rdi
callq 0x2080
addq $0x590, %rsp            # imm = 0x590
popq %rbp
retq
leaq -0x248(%rbp), %rdi
callq 0x2160
leaq -0x218(%rbp), %rdi
callq 0x2080
movq -0x4d8(%rbp), %rdi
callq 0x49a0
movq -0x220(%rbp), %rdi
callq 0x2370
nopl (%rax,%rax)