// File: /workspace/github_cpp_makefile_star2_O2/codeandkey[P]neocortex/src/uci.cpp
// Function: neocortex::uci::start()
void uci::start() {
	std::string handshake  = read_command();
	search::Search searcher;

	if (handshake != "uci") {
		throw std::runtime_error(util::format("Invalid UCI: expected 'uci', read '%s'", handshake.c_str()));
	}

	std::cout << "uciok\n";
	std::cout << "id name " << uci::NAME << "\n";
	std::cout << "id author " << uci::AUTHOR << "\n";
	std::cout << "option name Threads type spin default " << searcher.max_threads() << " min 1 max " << searcher.max_threads() << "\n";

	while (true) {
		std::string command = read_command();
		std::vector<std::string> parts = util::split(command, ' ');

		if (!parts.size()) continue;
			
		if (parts[0] == "quit") {
			break;
		}
		else if (parts[0] == "isready") {
			std::cout << "readyok\n";
		}
		else if (parts[0] == "stop") {
			searcher.stop();
		}
		else if (parts[0] == "setoption") {
			if (parts.size() > 1) {
				if (parts[1] == "Threads") {
					if (parts.size() < 4) {
						neocortex_warn("setoption: not enough parameters\n");
					}
					else {
						if (parts[2] == "value") {
							searcher.set_threads(std::stoi(parts[3]));
						}
						else {
							neocortex_warn("setoption: expected 'value', read '%s'\n", parts[2].c_str());
						}
					}
				}
			}
			else {
				neocortex_warn("setoption: argument required\n");
			}
		}
		else if (parts[0] == "go") {
			int wtime = -1, btime = -1, winc = -1, binc = -1, depth = -1, movetime = -1;
			bool infinite = false;

			/* Parse UCI options. */
			for (size_t i = 1; i < parts.size(); ++i) {
				if (isdigit(parts[i][0])) continue;

				if (parts[i] == "wtime") wtime = safe_parseint(parts, i + 1);
				else if (parts[i] == "btime") btime = safe_parseint(parts, i + 1);
				else if (parts[i] == "winc") winc = safe_parseint(parts, i + 1);
				else if (parts[i] == "binc") binc = safe_parseint(parts, i + 1);
				else if (parts[i] == "depth") depth = safe_parseint(parts, i + 1);
				else if (parts[i] == "movetime") movetime = safe_parseint(parts, i + 1);
				else if (parts[i] == "infinite") infinite = true;
				else if (parts[i] == "movestogo") {} /* ignore movestogo */
				else {
					throw util::fmterr("Invalid argument: %s", parts[i].c_str());
				}
			}

#ifndef NDEBUG
			std::string dbg, fen;
			searcher.get_position().evaluate(&dbg);
			fen = searcher.get_position().to_fen();
			neocortex_info("position [%s]:\n%s\n", fen.c_str(), dbg.c_str());
#endif

			searcher.go(write_info, write_bestmove, wtime, btime, winc, binc, depth, movetime, infinite);
		}
		else if (parts[0] == "dump") {
			std::string dbg, fen;
			searcher.get_position().evaluate(&dbg);
			fen = searcher.get_position().to_fen();
			neocortex_info("position [%s]:\n%s\n", fen.c_str(), dbg.c_str());
			neocortex_info("position [%s] dump:\n%s\n", fen.c_str(), searcher.get_position().dump().c_str());
		}
		else if (parts[0] == "position") {
			searcher.stop();

			if (parts.size() < 2) {
				neocortex_warn("Invalid UCI: position must be followed by 'startpos' or a FEN\n");
				continue;
			}

			Position pos;
			int expected_moves = 2;

			if (parts[1] != "startpos") {
				if (parts.size() < 7) {
					neocortex_warn("Invalid UCI: not enough FEN fields for position [need %d, have %d]\n", 6, parts.size());
					continue;
				}

				std::string fen = util::join(std::vector<std::string>(parts.begin() + 1, parts.begin() + 7), " ");

				pos = fen;
				expected_moves = 7;
			}

			if (expected_moves < (int) parts.size()) {
				if (parts[expected_moves] != "moves") {
					neocortex_warn("Invalid UCI: expected 'moves', read '%s'\n", parts[expected_moves].c_str());
					continue;
				}

				for (size_t i = (size_t) expected_moves + 1; i < parts.size(); ++i) {
					Move pl_moves[MAX_PL_MOVES], matched_move = Move::null;
					int num_pl_moves;

					num_pl_moves = pos.pseudolegal_moves(pl_moves);

					for (int j = 0; j < num_pl_moves; ++j) {
						if (pl_moves[j].match_uci(parts[i])) {
							assert(matched_move == Move::null);
							matched_move = pl_moves[j];
						}
					}

					if (matched_move == Move::null) {
						neocortex_warn("Invalid UCI: unmatched move '%s'\n", parts[i].c_str());
						break;
					}

					pos.make_move(matched_move);
				}
			}

			searcher.load(pos);
			neocortex_debug("Loaded position %s\n", pos.to_fen().c_str());
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28bc8, %rsp          # imm = 0x28BC8
leaq 0xf8(%rsp), %rdi
callq 0x10a24
leaq 0x188d8(%rsp), %rdi
callq 0x7be4
leaq 0x8558(%rsp), %rdi
leaq 0x188d8(%rsp), %rsi
callq 0xd358
leaq 0x18a30(%rsp), %rdi
callq 0xd174
leaq 0x67c7(%rip), %rsi      # 0x160cb
leaq 0xf8(%rsp), %rdi
callq 0x10c47
testb %al, %al
jne 0x10608
movq 0xd678(%rip), %rdi      # 0x1cf98
leaq 0x67cf(%rip), %rsi      # 0x160f6
callq 0x4300
movq 0xd665(%rip), %rdi      # 0x1cf98
leaq 0x67c3(%rip), %rsi      # 0x160fd
callq 0x4300
leaq 0x67c0(%rip), %rsi      # 0x16106
movq %rax, %rdi
callq 0x4300
leaq 0x594b(%rip), %rsi      # 0x152a0
movq %rax, %rdi
callq 0x4300
movq 0xd634(%rip), %rdi      # 0x1cf98
leaq 0x67b5(%rip), %rsi      # 0x16120
callq 0x4300
leaq 0x67b4(%rip), %rsi      # 0x1612b
movq %rax, %rdi
callq 0x4300
leaq 0x591a(%rip), %rsi      # 0x152a0
movq %rax, %rdi
callq 0x4300
movq 0xd603(%rip), %rdi      # 0x1cf98
leaq 0x679e(%rip), %rsi      # 0x1613a
callq 0x4300
movq %rax, %rbx
leaq 0x8558(%rsp), %rdi
callq 0xe9a8
movq %rbx, %rdi
movl %eax, %esi
callq 0x4530
leaq 0x679f(%rip), %rsi      # 0x16161
movq %rax, %rdi
callq 0x4300
movq %rax, %rbx
leaq 0x8558(%rsp), %rdi
callq 0xe9a8
movq %rbx, %rdi
movl %eax, %esi
callq 0x4530
leaq 0x58b5(%rip), %rsi      # 0x152a0
movq %rax, %rdi
callq 0x4300
movl $0x158, %ecx            # imm = 0x158
leaq 0x3e0(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x70(%rsp)
leaq 0x20a50(%rsp), %rax
addq %rcx, %rax
movq %rax, 0x58(%rsp)
leaq 0x10760(%rsp), %r15
addq %r15, %rcx
movq %rcx, 0x20(%rsp)
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
callq 0x10a24
leaq 0x3c0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x43e0
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
pushq $0x20
popq %rdx
callq 0x11f0e
movq %r14, %rdi
callq 0x4120
movq 0x8(%rsp), %rdi
cmpq %rdi, 0x10(%rsp)
je 0x10103
leaq 0x66f3(%rip), %rsi      # 0x1616d
callq 0xf402
testb %al, %al
jne 0x105a6
movq 0x8(%rsp), %rdi
leaq 0x66df(%rip), %rsi      # 0x16172
callq 0xf402
testb %al, %al
je 0xfab4
movq 0xd4f5(%rip), %rdi      # 0x1cf98
leaq 0x66d0(%rip), %rsi      # 0x1617a
callq 0x4300
jmp 0x10103
movq 0x8(%rsp), %rdi
leaq 0x66c3(%rip), %rsi      # 0x16183
callq 0xf402
testb %al, %al
je 0xfadb
leaq 0x8558(%rsp), %rdi
callq 0xd49a
jmp 0x10103
movq 0x8(%rsp), %rdi
leaq 0x66a1(%rip), %rsi      # 0x16188
callq 0xf402
testb %al, %al
je 0xfb5d
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
subq %rdi, %rax
cmpq $0x21, %rax
jb 0xfdb4
addq $0x20, %rdi
leaq 0x6680(%rip), %rsi      # 0x16192
callq 0xf402
testb %al, %al
je 0x10103
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
subq %rdi, %rax
cmpq $0x7f, %rax
ja 0x1017a
leaq 0x3a0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x6652(%rip), %rsi      # 0x1619a
movq %r15, %rdx
callq 0x6302
movq %rbp, %rdi
callq 0x10c51
jmp 0xfdd6
movq 0x8(%rsp), %rdi
leaq 0x66d4(%rip), %rsi      # 0x1623d
callq 0xf402
testb %al, %al
je 0xfde3
movl $0x0, 0x50(%rsp)
pushq $0x2
popq %r15
pushq $0x20
popq %r13
pushq $-0x1
popq %rbx
movl %ebx, %r14d
movl %ebx, %eax
movq %rax, 0x68(%rsp)
movq %rax, 0x60(%rsp)
movl %ebx, 0x54(%rsp)
movl %ebx, %ebp
leaq -0x1(%r15), %rax
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rcx
subq %rdi, %rcx
sarq $0x5, %rcx
cmpq %rcx, %rax
jae 0xff46
movq (%rdi,%r13), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
cmpl $0xa, %eax
jb 0xfd6b
addq %r13, %rdi
leaq 0x662f(%rip), %rsi      # 0x16208
callq 0xf402
testb %al, %al
je 0xfc0e
leaq 0x1a8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10f1a
leaq 0x1a8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x10aa3
movl %eax, %ebx
jmp 0xfd63
movq 0x8(%rsp), %rdi
addq %r13, %rdi
leaq 0x65f1(%rip), %rsi      # 0x1620e
callq 0xf402
testb %al, %al
je 0xfc52
leaq 0x190(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10f1a
leaq 0x190(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x10aa3
movl %eax, %ebp
jmp 0xfd63
movq 0x8(%rsp), %rdi
addq %r13, %rdi
leaq 0x65b3(%rip), %rsi      # 0x16214
callq 0xf402
testb %al, %al
je 0xfc98
leaq 0x178(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10f1a
leaq 0x178(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x10aa3
movl %eax, 0x54(%rsp)
jmp 0xfd63
movq 0x8(%rsp), %rdi
addq %r13, %rdi
leaq 0x6572(%rip), %rsi      # 0x16219
callq 0xf402
testb %al, %al
je 0xfcdd
leaq 0x160(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10f1a
leaq 0x160(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x10aa3
movl %eax, %r14d
jmp 0xfd63
movq 0x8(%rsp), %rdi
addq %r13, %rdi
leaq 0x6532(%rip), %rsi      # 0x1621e
callq 0xf402
testb %al, %al
je 0xfd21
leaq 0x148(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10f1a
leaq 0x148(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x10aa3
movq %rax, 0x68(%rsp)
jmp 0xfd63
movq 0x8(%rsp), %rdi
addq %r13, %rdi
leaq 0x64f4(%rip), %rsi      # 0x16224
callq 0xf402
testb %al, %al
je 0xfd77
leaq 0x130(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10f1a
leaq 0x130(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x10aa3
movq %rax, 0x60(%rsp)
movq %r12, %rdi
callq 0x63ce
addq $0x20, %r13
incq %r15
jmp 0xfb9e
movq 0x8(%rsp), %rdi
addq %r13, %rdi
leaq 0x64a7(%rip), %rsi      # 0x1622d
callq 0xf402
testb %al, %al
je 0xfd97
movb $0x1, %al
movl %eax, 0x50(%rsp)
jmp 0xfd6b
movq 0x8(%rsp), %rdi
addq %r13, %rdi
leaq 0x6490(%rip), %rsi      # 0x16236
callq 0xf402
testb %al, %al
jne 0xfd6b
jmp 0x10679
leaq 0x360(%rsp), %rbp
movq %rbp, %rdi
leaq 0x6424(%rip), %rsi      # 0x161ea
movq %r15, %rdx
callq 0x6302
movq %rbp, %rdi
callq 0x10c51
movq %rbp, %rdi
callq 0x4120
jmp 0x10103
movq 0x8(%rsp), %rdi
leaq 0x6479(%rip), %rsi      # 0x16268
callq 0xf402
testb %al, %al
je 0x1011a
leaq 0x3f0(%rsp), %rax
movq %rax, 0x3e0(%rsp)
andq $0x0, 0x3e8(%rsp)
xorl %ecx, %ecx
movb %cl, 0x3f0(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
andq $0x0, 0x38(%rsp)
movb %cl, 0x40(%rsp)
movq %r15, %rdi
leaq 0x8558(%rsp), %rsi
callq 0xe9ba
movq %r15, %rdi
leaq 0x3e0(%rsp), %rsi
callq 0xb5f4
movq 0x20(%rsp), %rdi
callq 0xd174
movq %r15, %rdi
leaq 0x8558(%rsp), %rsi
callq 0xe9ba
leaq 0x78(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x801e
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x4380
movq %rbx, %rdi
callq 0x4120
movq 0x20(%rsp), %rdi
callq 0xd174
leaq 0x320(%rsp), %rbx
movq %rbx, %rdi
leaq 0x63a8(%rip), %rsi      # 0x16255
movq %r15, %rdx
callq 0x6302
movq 0x30(%rsp), %rsi
movq 0x3e0(%rsp), %rdx
movq %rbx, %rdi
callq 0x10f6d
movq %rbx, %rdi
callq 0x4120
leaq 0x200(%rsp), %rdi
leaq 0x638c(%rip), %rsi      # 0x1626d
leaq 0x2f(%rsp), %rdx
callq 0x6302
movq 0x30(%rsp), %rbx
movq %r15, %rdi
leaq 0x8558(%rsp), %rsi
callq 0xe9ba
leaq 0x78(%rsp), %rdi
movq %r15, %rsi
callq 0xc9e2
movq 0x78(%rsp), %rdx
leaq 0x200(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x10f6d
leaq 0x78(%rsp), %rdi
callq 0x4120
movq 0x20(%rsp), %rdi
callq 0xd174
movq %r12, %rdi
callq 0x4120
jmp 0x100e4
leaq 0x3f0(%rsp), %rax
movq %rax, 0x3e0(%rsp)
andq $0x0, 0x3e8(%rsp)
xorl %ecx, %ecx
movb %cl, 0x3f0(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
andq $0x0, 0x38(%rsp)
movb %cl, 0x40(%rsp)
leaq 0x10760(%rsp), %r15
movq %r15, %rdi
leaq 0x8558(%rsp), %rsi
callq 0xe9ba
movq %r15, %rdi
leaq 0x3e0(%rsp), %rsi
callq 0xb5f4
movq 0x20(%rsp), %rdi
callq 0xd174
movq %r15, %rdi
leaq 0x8558(%rsp), %rsi
callq 0xe9ba
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x801e
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x4380
movq %r12, %rdi
callq 0x4120
movq 0x20(%rsp), %rdi
callq 0xd174
leaq 0x340(%rsp), %r12
movq %r12, %rdi
leaq 0x6256(%rip), %rsi      # 0x16255
movq %r15, %rdx
callq 0x6302
movq 0x30(%rsp), %rsi
movq 0x3e0(%rsp), %rdx
movq %r12, %rdi
callq 0x10f6d
movq %r12, %rdi
callq 0x4120
andq $0x0, 0xe0(%rsp)
leaq 0xb30(%rip), %rax       # 0x10b64
movq %rax, 0xd8(%rsp)
leaq 0x1b65(%rip), %rax      # 0x11ba8
movq %rax, 0xf0(%rsp)
andq $0x0, 0xc0(%rsp)
leaq 0x1b8b(%rip), %rax      # 0x11be6
movq %rax, 0xe8(%rsp)
leaq 0xb5a(%rip), %rax       # 0x10bc4
movq %rax, 0xb8(%rsp)
leaq 0x1b8f(%rip), %rax      # 0x11c08
movq %rax, 0xd0(%rsp)
leaq 0x1b8c(%rip), %rax      # 0x11c14
movq %rax, 0xc8(%rsp)
movzbl 0x50(%rsp), %eax
andl $0x1, %eax
leaq 0x8558(%rsp), %rdi
leaq 0xd8(%rsp), %r12
movq %r12, %rsi
leaq 0xb8(%rsp), %r13
movq %r13, %rdx
movl %ebx, %ecx
movl %ebp, %r8d
movl 0x54(%rsp), %r9d
pushq %rax
pushq 0x68(%rsp)
pushq 0x78(%rsp)
pushq %r14
callq 0xd4c6
addq $0x20, %rsp
movq %r13, %rdi
callq 0xef5c
movq %r12, %rdi
callq 0xef5c
leaq 0x30(%rsp), %rdi
callq 0x4120
leaq 0x3e0(%rsp), %rdi
callq 0x4120
leaq 0x98(%rsp), %rbx
leaq 0x8(%rsp), %rdi
callq 0x63ce
movq %rbx, %rdi
callq 0x4120
jmp 0xfa30
movq 0x8(%rsp), %rdi
leaq 0x615f(%rip), %rsi      # 0x16285
callq 0xf402
testb %al, %al
je 0x10103
leaq 0x8558(%rsp), %rdi
callq 0xd49a
movq 0x10(%rsp), %rax
subq 0x8(%rsp), %rax
cmpq $0x20, %rax
ja 0x101e5
leaq 0x300(%rsp), %r12
movq %r12, %rdi
leaq 0x612c(%rip), %rsi      # 0x1628e
movq %r15, %rdx
callq 0x6302
movq %r12, %rdi
callq 0x10c51
movq %r12, %rdi
jmp 0xfdd9
addq $0x40, %rdi
leaq 0x6037(%rip), %rsi      # 0x161bc
callq 0xf402
testb %al, %al
je 0x101b5
movq 0x8(%rsp), %rdi
addq $0x60, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0xce79
leaq 0x8558(%rsp), %rdi
movl %eax, %esi
callq 0xd3ea
jmp 0x10103
leaq 0x380(%rsp), %rbp
movq %rbp, %rdi
leaq 0x5ffb(%rip), %rsi      # 0x161c2
movq %r15, %rdx
callq 0x6302
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rsi
movq %rbp, %rdi
callq 0x10dac
jmp 0xfdd6
movq %r15, %rdi
callq 0x7be4
movq 0x8(%rsp), %rdi
addq $0x20, %rdi
leaq 0x60d0(%rip), %rsi      # 0x162cd
callq 0x10c47
pushq $0x2
popq %rbx
testb %al, %al
je 0x10326
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rax
subq %rdx, %rax
cmpq $0xdf, %rax
ja 0x1026f
leaq 0x2e0(%rsp), %r12
movq %r12, %rdi
leaq 0x60a2(%rip), %rsi      # 0x162d6
leaq 0x3e0(%rsp), %rdx
callq 0x6302
leaq 0x98(%rsp), %rbx
movq 0x10(%rsp), %rdx
subq 0x8(%rsp), %rdx
sarq $0x5, %rdx
movq %r12, %rdi
pushq $0x6
popq %rsi
callq 0x110e9
movq %r12, %rdi
callq 0x4120
jmp 0x103a6
leaq 0x20(%rdx), %rsi
addq $0xe0, %rdx
leaq 0x118(%rsp), %rdi
leaq 0x3e0(%rsp), %rcx
callq 0x11264
leaq 0x2c0(%rsp), %r13
movq %r13, %rdi
leaq 0x5c5e(%rip), %rsi      # 0x15eff
leaq 0x78(%rsp), %rdx
callq 0x6302
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
leaq 0x118(%rsp), %r12
movq %r12, %rsi
movq %r13, %rdx
callq 0x12228
movq %r13, %rdi
callq 0x4120
movq %r12, %rdi
callq 0x63ce
leaq 0x2a0(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x43e0
leaq 0x3e0(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7d0c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11296
movq 0x70(%rsp), %rdi
callq 0xd174
movq %r12, %rdi
callq 0x4120
leaq 0x30(%rsp), %rdi
callq 0x4120
pushq $0x7
popq %rbx
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rax
subq %rdi, %rax
shrq $0x5, %rax
cmpl %eax, %ebx
jge 0x10502
movl %ebx, %eax
shll $0x5, %eax
addq %rax, %rdi
leaq 0x5fcc(%rip), %rsi      # 0x1631a
callq 0x10c47
movl %ebx, %r15d
testb %al, %al
je 0x103ab
leaq 0x280(%rsp), %r12
movq %r12, %rdi
leaq 0x5fb4(%rip), %rsi      # 0x16320
leaq 0x3e0(%rsp), %rdx
callq 0x6302
leaq 0x98(%rsp), %rbx
movq 0x8(%rsp), %rax
shll $0x5, %r15d
movq (%rax,%r15), %rsi
movq %r12, %rdi
callq 0x10dac
movq %r12, %rdi
callq 0x4120
leaq 0x10760(%rsp), %r15
jmp 0x10597
incq %r15
movq 0x10(%rsp), %rax
subq 0x8(%rsp), %rax
sarq $0x5, %rax
cmpq %rax, %r15
jae 0x10502
xorl %ebx, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x3e0, %rdi            # imm = 0x3E0
callq 0x6d44
addq $0xc, %rbx
cmpq $0x4b0, %rbx            # imm = 0x4B0
jne 0x103c7
leaq 0x167dd(%rip), %rcx     # 0x26bc8
movl 0x8(%rcx), %eax
movl %eax, 0x38(%rsp)
movq (%rcx), %rax
movq %rax, 0x30(%rsp)
leaq 0x10760(%rsp), %rdi
leaq 0x3e0(%rsp), %rsi
callq 0x8a04
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
imulq $0xc, %rax, %r13
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x10499
movq %r15, %rsi
shlq $0x5, %rsi
addq 0x8(%rsp), %rsi
leaq 0x1e0(%rsp), %rdi
callq 0x43e0
leaq (%rsp,%r12), %rbx
addq $0x3e0, %rbx            # imm = 0x3E0
movq %rbx, %rdi
leaq 0x1e0(%rsp), %r14
movq %r14, %rsi
callq 0x6f8c
movl %eax, %ebp
movq %r14, %rdi
callq 0x4120
testb %bpl, %bpl
je 0x10493
leaq 0x30(%rsp), %rdi
leaq 0x16751(%rip), %rsi     # 0x26bc8
callq 0x6fee
testb %al, %al
je 0x105e9
movl 0x8(%rbx), %eax
movl %eax, 0x38(%rsp)
movq (%rbx), %rax
movq %rax, 0x30(%rsp)
addq $0xc, %r12
jmp 0x10420
leaq 0x30(%rsp), %rdi
leaq 0x16723(%rip), %rsi     # 0x26bc8
callq 0x6fee
testb %al, %al
jne 0x104c9
movq 0x30(%rsp), %rsi
movl 0x38(%rsp), %edx
leaq 0x10760(%rsp), %rdi
callq 0x8258
jmp 0x103ab
leaq 0x260(%rsp), %rbx
movq %rbx, %rdi
leaq 0x5eb3(%rip), %rsi      # 0x1638e
leaq 0x78(%rsp), %rdx
callq 0x6302
movq 0x8(%rsp), %rax
shlq $0x5, %r15
movq (%rax,%r15), %rsi
movq %rbx, %rdi
callq 0x10dac
movq %rbx, %rdi
callq 0x4120
leaq 0x20a50(%rsp), %rdi
leaq 0x10760(%rsp), %r15
movq %r15, %rsi
callq 0xeb68
leaq 0x8558(%rsp), %rdi
leaq 0x20a50(%rsp), %rsi
callq 0xe3d0
movq 0x58(%rsp), %rdi
callq 0xd174
leaq 0x1c0(%rsp), %rdi
leaq 0x5e68(%rip), %rsi      # 0x163b0
leaq 0x30(%rsp), %rdx
callq 0x6302
leaq 0x98(%rsp), %rbx
leaq 0x3e0(%rsp), %rdi
movq %r15, %rsi
callq 0x801e
movq 0x3e0(%rsp), %rsi
leaq 0x1c0(%rsp), %r14
movq %r14, %rdi
callq 0x112e2
leaq 0x3e0(%rsp), %rdi
callq 0x4120
movq %r14, %rdi
callq 0x4120
movq 0x20(%rsp), %rdi
callq 0xd174
jmp 0x10103
leaq 0x8(%rsp), %rdi
callq 0x63ce
leaq 0x98(%rsp), %rdi
callq 0x4120
leaq 0x8558(%rsp), %rdi
callq 0xd460
leaq 0xf8(%rsp), %rdi
callq 0x4120
addq $0x28bc8, %rsp          # imm = 0x28BC8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5d5a(%rip), %rdi      # 0x1634a
leaq 0x5d6e(%rip), %rsi      # 0x16365
leaq 0x5d73(%rip), %rcx      # 0x16371
movl $0xa9, %edx
callq 0x41f0
pushq $0x10
popq %rdi
callq 0x4150
movq %rax, %r14
leaq 0x5ab5(%rip), %rsi      # 0x160cf
leaq 0x240(%rsp), %rdi
leaq 0x3e0(%rsp), %rdx
callq 0x6302
movq 0xf8(%rsp), %rdx
leaq 0x10760(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x67cf
movb $0x1, %bpl
leaq 0x10760(%rsp), %rsi
movq %r14, %rdi
callq 0x44c0
xorl %ebp, %ebp
movq 0xc988(%rip), %rsi      # 0x1cff0
movq 0xc911(%rip), %rdx      # 0x1cf80
movq %r14, %rdi
callq 0x4520
jmp 0x106d4
pushq $0x8
popq %rdi
callq 0x4150
movq %rax, %r14
leaq 0x5bb5(%rip), %rsi      # 0x16240
leaq 0x220(%rsp), %rdi
leaq 0x10760(%rsp), %rdx
callq 0x6302
movq 0x8(%rsp), %rax
movq (%rax,%r13), %rdx
movb $0x1, %bpl
leaq 0x220(%rsp), %rsi
movq %r14, %rdi
callq 0x633d
xorl %ebp, %ebp
movq 0xc903(%rip), %rsi      # 0x1cfc8
movq 0xc91c(%rip), %rdx      # 0x1cfe8
movq %r14, %rdi
callq 0x4520
movq %rax, %rbx
leaq 0x260(%rsp), %rdi
jmp 0x109b2
jmp 0x109c2
movq %rax, %rbx
leaq 0x280(%rsp), %rdi
jmp 0x109b2
jmp 0x109c2
movq %rax, %rbx
leaq 0x2e0(%rsp), %rdi
jmp 0x109b2
jmp 0x109c2
movq %rax, %rbx
leaq 0x2a0(%rsp), %rdi
callq 0x4120
jmp 0x10728
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x109b2
movq %rax, %rbx
leaq 0x2c0(%rsp), %rdi
callq 0x4120
jmp 0x10747
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x63ce
jmp 0x109c5
jmp 0x109c2
movq %rax, %rbx
leaq 0x220(%rsp), %rdi
callq 0x4120
testb %bpl, %bpl
jne 0x1077b
jmp 0x109cf
movq %rax, %rbx
movq %r14, %rdi
callq 0x4240
jmp 0x109cf
movq %rax, %rbx
leaq 0x3e0(%rsp), %rdi
callq 0x4120
jmp 0x1079d
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
jmp 0x109b2
jmp 0x109c2
movq %rax, %rbx
movq 0x58(%rsp), %rdi
callq 0xd174
jmp 0x109c5
movq %rax, %rbx
leaq 0x380(%rsp), %rdi
jmp 0x1096d
jmp 0x109bd
movq %rax, %rbx
leaq 0x300(%rsp), %rdi
jmp 0x1096d
jmp 0x109bd
jmp 0x109bd
movq %rax, %rbx
leaq 0x10760(%rsp), %rdi
callq 0x4120
jmp 0x10808
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x240(%rsp), %rdi
callq 0x4120
testb %bpl, %bpl
jne 0x1084c
jmp 0x109fd
jmp 0x109c2
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
jmp 0x109a0
movq %rax, %rbx
leaq 0x3a0(%rsp), %rdi
jmp 0x1096d
jmp 0x109bd
movq %rax, %rbx
movq %r14, %rdi
callq 0x4240
jmp 0x109fd
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
jmp 0x109a0
movq 0x20(%rsp), %r12
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x4120
jmp 0x10885
movq 0x20(%rsp), %r12
movq %rax, %rbx
movq %r12, %rdi
callq 0xd174
jmp 0x10892
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
jmp 0x108a9
jmp 0x108cb
movq %rax, %rbx
leaq 0x320(%rsp), %rdi
callq 0x4120
jmp 0x1095b
jmp 0x108cb
jmp 0x108b9
jmp 0x108cb
movq %rax, %rbx
movq 0x20(%rsp), %rdi
callq 0xd174
jmp 0x1095b
movq %rax, %rbx
jmp 0x1095b
movq %rax, %rbx
leaq 0x18a30(%rsp), %rdi
callq 0xd174
jmp 0x10a0a
movq %rax, %rbx
jmp 0x10a0a
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
jmp 0x109a0
movq %rax, %rbx
leaq 0x360(%rsp), %rdi
jmp 0x1096d
jmp 0x109bd
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xef5c
leaq 0xd8(%rsp), %rdi
callq 0xef5c
jmp 0x1095b
movq %rax, %rbx
leaq 0x340(%rsp), %rdi
callq 0x4120
jmp 0x1095b
jmp 0x10958
jmp 0x10949
jmp 0x10958
movq %rax, %rbx
movq 0x20(%rsp), %rdi
callq 0xd174
jmp 0x1095b
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4120
leaq 0x3e0(%rsp), %rdi
callq 0x4120
jmp 0x109cf
jmp 0x109c2
movq %rax, %rbx
leaq 0x178(%rsp), %rdi
jmp 0x109a0
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
jmp 0x109a0
jmp 0x10a1f
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x63ce
jmp 0x109cf
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
callq 0x4120
jmp 0x109c5
jmp 0x109c2
jmp 0x109bd
movq %rax, %rbx
jmp 0x109cf
movq %rax, %rbx
movq 0x20(%rsp), %rdi
callq 0xd174
leaq 0x8(%rsp), %rdi
callq 0x63ce
jmp 0x109f0
movq %rax, %rbx
leaq 0x3c0(%rsp), %rdi
callq 0x4120
jmp 0x109f0
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x4120
leaq 0x8558(%rsp), %rdi
callq 0xd460
leaq 0xf8(%rsp), %rdi
callq 0x4120
movq %rbx, %rdi
callq 0x4550
movq %rax, %rbx
jmp 0x109fd