// File: /workspace/github_cpp_makefile_star2_O1/iTruth[P]klotski/klotski.cpp
// Function: main
int main(int argc, char *argv[])
{
	if(argc == 1){
		print_help();
		return EXIT_FAILURE;
	}

	int dx = 3;
	int dy = 3;
	bool is_play = false;
	bool is_upset = false;
	bool is_already_upset = false;
	int upset_num = 10;
	bool is_edit = false;
	std::string situation_string;
	bool is_search = false;
	bool is_quiet = false;
	bool is_print_board = false;
	bool is_output_to_file = false;
	std::fstream situation_output_file;
	bool is_read_board_from_file = false;
	std::fstream situation_input_file;
	bool is_research = false;

	const char *optstring = "x:y:pu:e::sqbo:f:rh";
	static struct option long_options[] = {
		{"play",		no_argument, NULL, 'p'},
		{"upset",		required_argument, NULL, 'u'},
		{"edit",		optional_argument, NULL, 'e'},
		{"search",		required_argument, NULL, 's'},
		{"quiet",		no_argument, NULL, 'q'},
		{"board",		no_argument, NULL, 'b'},
		{"output",		required_argument, NULL, 'o'},
		{"file",		required_argument, NULL, 'f'},
		{"research",	no_argument, NULL, 'r'},
		{"help",		no_argument, NULL, 'h'},
		{0, 0, 0, 0}};

	int opt;
	int option_index = 0;
	while((opt = getopt_long(argc, argv,
					optstring, long_options, &option_index)) != -1) {
		switch(opt)
		{
			case 'x':
				try{
					dx = std::stoi(optarg);
				}catch(const std::invalid_argument&){
					cout<<"Invalid argument: x"<<endl;
					return EXIT_FAILURE;
				}
				break;

			case 'y':
				try{
					dy = std::stoi(optarg);
				}catch(const std::invalid_argument&){
					cout<<"Invalid argument: y"<<endl;
					return EXIT_FAILURE;
				}
				break;

			case 'p':
				is_play = true;
				break;

			case 'u':
				is_upset = true;
				try{
					upset_num = std::stoi(optarg);
				}catch(const std::invalid_argument&){
					cout<<"Invalid argument: upset number"<<endl;
					return EXIT_FAILURE;
				}
				break;

			case 'e':
				is_edit = true;
				if(optarg != nullptr){
					situation_string = optarg;
				}
				break;

			case 's':
				is_search = true;
				break;

			case 'q':
				is_quiet = true;
				break;

			case 'b':
				is_print_board = true;
				break;

			case 'o':
				is_output_to_file = true;
				situation_output_file.open(optarg, ios::trunc|ios::out);
				if(!situation_output_file.is_open()){
					cout<<"file not found"<<endl;
					return EXIT_FAILURE;
				}
				break;

			case 'f':
				is_read_board_from_file = true;
				situation_input_file.open(optarg, ios::in);
				if(!situation_input_file.is_open()){
					cout<<"file not found"<<endl;
					return EXIT_FAILURE;
				}
				break;

			case 'r':
				is_research = true;
				break;

			case '?':
			case 'h':
			default:
				print_help();
				return EXIT_SUCCESS;
				break;
		}
	}

	if(is_output_to_file && !is_search){
		cout<<"specifying -o must also specify -s"<<endl;
		return EXIT_FAILURE;
	}

	std::shared_ptr<klotski_board> board = nullptr;

	if(is_read_board_from_file){
		if(is_edit){
			cout<<"specifying -f can't also specify -e"<<endl;
			return EXIT_FAILURE;
		}
		try{
			board = std::make_shared<klotski_board>(situation_input_file, dx, dy);
		}catch(const std::runtime_error&){
			cout<<"file is not a valid board file"<<endl;
			return EXIT_FAILURE;
		}
	}

	if(is_edit){
		try{
			if(situation_string.empty()){
				if(!is_quiet){
					cout<<"Enter "<<dx*dy<<" numbers to construct klotski board"<<endl
						<<"Example input(3x3 board): "<<endl
						<<"1 0 6 7 3 8 2 4 5"<<endl<<endl;
					cout<<"Enter: ";
				}
				std::vector<int> situation;
				for(int i=0; i<dx*dy; ++i){
					int n;
					cin>>n;
					situation.push_back(n);
				}
				board = std::make_shared<klotski_board>(situation, dx, dy);
			}else{
				board = std::make_shared<klotski_board>(situation_string, dx, dy);
			}
		}catch(const std::runtime_error& e){
			cout<<e.what()<<endl;
			return EXIT_FAILURE;
		}
	}

	if(is_upset){
		if(board == nullptr){
			board = std::make_shared<klotski_board>(dx, dy);
		}
		board->upset(upset_num);
		is_already_upset = true;
	}

	if(is_search){
		if(board == nullptr){
			board = std::make_shared<klotski_board>(dx, dy);
		}
		search_answer(board, is_quiet, is_print_board, KLOTSKI_OUTPUT_STREAM);
	}

	if(is_play || is_research){
		int x, y;
		if(board == nullptr){
			board = std::make_shared<klotski_board>(dx, dy);
		}
		if(!is_edit && !is_already_upset){
			board->upset(upset_num);
			is_already_upset = true;
		}
		board->print_board(is_print_board);
		string line;
		string hint = "klotski>";
		while(is_research || !board->is_win()){
			cout<<hint;
			getline(cin, line);
			if(line.empty()){
				continue;
			}
			std::stringstream ss(line);
			ss>>x>>y;
			if(board->move_item(x, y)){
				board->print_board(is_print_board);
				continue;
			}
			line = line.substr(0, line.find_last_not_of(' ')+1);
			auto pos = line.find_first_of(' ');
			const std::string cmd_name = line.substr(0, pos==std::string::npos?line.size():pos);
			const std::string cmd_arg = line.substr(cmd_name.size(), line.size()-1);
			if(cmd_name == "quit" || cmd_name == "q"){
				return EXIT_SUCCESS;
			}else if(cmd_name == "reset" || cmd_name == "r"){
				board->reset();
				if(!is_quiet){
					board->print_board(is_print_board);
				}
			}else if(cmd_name == "print" || cmd_name == "p"){
				board->print_board(is_print_board);
			}else if(cmd_name == "search" || cmd_name == "s"){
				search_answer(board, is_quiet, is_print_board, KLOTSKI_OUTPUT_STREAM);
			}else if(cmd_name == "upset" || cmd_name == "u"){
				try{
					board->upset(std::stoi(cmd_arg));
					if(!is_quiet){
						board->print_board(is_print_board);
					}
				}catch(const std::invalid_argument&){
					cout<<"invalid argument"<<endl
						<<"usage: upset N"<<endl<<endl;
				}
			}else{
				system(line.c_str());
			}
		}
		cout<<"You Win!"<<endl;
	}
	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6e8, %rsp            # imm = 0x6E8
cmpl $0x1, %edi
jne 0x4126
callq 0x369c
movl $0x1, %ebp
jmp 0x50a7
movq %rsi, %rbx
movl %edi, %ebp
movl $0x3, %eax
movl %eax, 0x14(%rsp)
movl %eax, 0x10(%rsp)
leaq 0xe8(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x2c8(%rsp), %rdi
callq 0x32a0
leaq 0x4d8(%rsp), %r14
movq %r14, %rdi
callq 0x32a0
leaq 0x24(%rsp), %r13
movl $0x0, (%r13)
movl $0x80, %ecx
leaq (%r14,%rcx), %rax
movq %rax, 0x118(%rsp)
leaq 0x2c8(%rsp), %rax
addq %rax, %rcx
movq %rcx, 0x60(%rsp)
movl $0xa, %eax
movq %rax, 0x68(%rsp)
movq $0x0, 0x28(%rsp)
leaq 0x5e50(%rip), %r15      # 0xa004
movq $0x0, 0x8(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x0, 0x78(%rsp)
movq $0x0, (%rsp)
movq $0x0, 0x70(%rsp)
xorl %ecx, %ecx
movq %rbx, 0x18(%rsp)
movl %ecx, %r12d
movl %ebp, %edi
movq %rbx, %rsi
leaq 0x60d7(%rip), %rdx      # 0xa2e5
leaq 0xb00b(%rip), %rcx      # 0xf220
movq %r13, %r8
callq 0x33a0
leal -0x62(%rax), %edx
cmpl $0x17, %edx
ja 0x4587
movb $0x1, %cl
movslq (%r15,%rdx,4), %rax
addq %r15, %rax
jmpq *%rax
movb $0x1, %al
movq %rax, 0xb0(%rsp)
movl %r12d, %ecx
jmp 0x41ff
movb $0x1, %al
movq %rax, 0x78(%rsp)
movl %r12d, %ecx
jmp 0x41ff
movq 0xad32(%rip), %rax      # 0xef88
movq (%rax), %rsi
leaq 0x140(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x5600
movq 0x140(%rsp), %r13
callq 0x3040
movq %rax, %r14
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
movl $0xa, %edx
callq 0x32f0
cmpq %r13, 0x30(%rsp)
je 0x50f7
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x50eb
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x50eb
testl %ecx, %ecx
leaq 0x24(%rsp), %r13
jne 0x42d5
movl %ebx, (%r14)
movl %eax, 0x10(%rsp)
jmp 0x4505
movb $0x1, %al
movq %rax, 0x80(%rsp)
movl %r12d, %ecx
jmp 0x41ff
movb $0x1, %al
movq %rax, 0x58(%rsp)
movl %r12d, %ecx
jmp 0x41ff
movq 0xac82(%rip), %rax      # 0xef88
movq (%rax), %rsi
leaq 0x140(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x5600
movq 0x140(%rsp), %r13
callq 0x3040
movq %rax, %r14
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
movl $0xa, %edx
callq 0x32f0
cmpq %r13, 0x30(%rsp)
je 0x50df
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x50d3
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x50d3
movq %rax, 0x68(%rsp)
testl %ecx, %ecx
leaq 0x24(%rsp), %r13
jne 0x438a
movl %ebx, (%r14)
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x43af
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3260
movb $0x1, %al
movq %rax, 0x70(%rsp)
jmp 0x452a
movq 0xabc6(%rip), %rax      # 0xef88
movq (%rax), %r14
movb $0x1, %al
movq %rax, (%rsp)
movl %r12d, %ecx
testq %r14, %r14
je 0x41ff
movq 0xe0(%rsp), %r13
movq %r14, %rdi
callq 0x30d0
leaq 0xd8(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
leaq 0x24(%rsp), %r13
movq %r14, %rcx
movq %rax, %r8
callq 0x3350
movl %r12d, %ecx
jmp 0x41ff
movq 0xab75(%rip), %rax      # 0xef88
movq (%rax), %rsi
leaq 0x2c8(%rsp), %rdi
movl $0x30, %edx
callq 0x3210
movq 0x60(%rsp), %rdi
callq 0x3060
movb $0x1, %cl
movq %rcx, 0x28(%rsp)
jmp 0x446b
movq 0xab46(%rip), %rax      # 0xef88
movq (%rax), %rsi
leaq 0x4d8(%rsp), %rdi
movl $0x8, %edx
callq 0x3210
movq 0x118(%rsp), %rdi
callq 0x3060
movb $0x1, %cl
movq %rcx, 0x8(%rsp)
movl %r12d, %ecx
testb %al, %al
jne 0x41ff
jmp 0x4537
movq 0xab06(%rip), %rax      # 0xef88
movq (%rax), %rsi
leaq 0x140(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x5600
movq 0x140(%rsp), %r13
callq 0x3040
movq %rax, %r14
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
movl $0xa, %edx
callq 0x32f0
cmpq %r13, 0x30(%rsp)
je 0x50c7
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x50bb
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x50bb
testl %ecx, %ecx
leaq 0x24(%rsp), %r13
jne 0x4501
movl %ebx, (%r14)
movl %eax, 0x14(%rsp)
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x452a
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3260
movl %r12d, %ecx
movq 0x18(%rsp), %rbx
jmp 0x41ff
movl $0xe, %edx
leaq 0x5dfd(%rip), %rsi      # 0xa340
movq 0xaa66(%rip), %rbx      # 0xefb0
movq %rbx, %rdi
callq 0x3290
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq 0xaa40(%rip), %rdi      # 0xefb0
callq 0x3030
movl $0x1, %ebp
movq %rax, %rdi
callq 0x3160
jmp 0x5068
cmpl $-0x1, %eax
jne 0x45f9
testb $0x1, 0x28(%rsp)
je 0x459a
testb $0x1, 0x78(%rsp)
je 0x4613
testb $0x1, 0x8(%rsp)
je 0x4605
testb $0x1, (%rsp)
je 0x4624
movq 0xaa02(%rip), %rbx      # 0xefb0
leaq 0x5dbd(%rip), %rsi      # 0xa372
movl $0x23, %edx
movq %rbx, %rdi
callq 0x3290
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq 0xa9d0(%rip), %rdi      # 0xefb0
callq 0x3030
movq %rax, %rdi
callq 0x3160
movl $0x1, %ebp
xorl %edi, %edi
jmp 0x505e
xorl %ebp, %ebp
callq 0x369c
jmp 0x5068
movq $0x0, 0x8(%rsp)
xorl %r15d, %r15d
jmp 0x468a
movl $0x22, %edx
leaq 0x5d30(%rip), %rsi      # 0xa34f
jmp 0x4543
leaq 0x148(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x140(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x4d8(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0x10(%rsp), %r9
callq 0x5fee
movq 0x140(%rsp), %r15
movq 0x148(%rsp), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x468a
callq 0x5648
testb $0x1, (%rsp)
je 0x4715
cmpq $0x0, 0xe0(%rsp)
je 0x473e
leaq 0x148(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x140(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0xd8(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0x10(%rsp), %r9
callq 0x6376
movq 0x140(%rsp), %r15
movq 0x148(%rsp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x4701
callq 0x5648
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x471a
callq 0x5648
jmp 0x471a
movq 0x8(%rsp), %rbx
testb $0x1, 0x70(%rsp)
je 0x4734
testq %r15, %r15
je 0x48ff
movq %rbx, 0x8(%rsp)
jmp 0x496a
movq %rbx, 0x8(%rsp)
jmp 0x4977
testb $0x1, 0x58(%rsp)
jne 0x47f3
movq 0xa860(%rip), %rdi      # 0xefb0
leaq 0x5c5e(%rip), %rsi      # 0xa3b5
movl $0x6, %edx
callq 0x3290
movl 0x10(%rsp), %esi
imull 0x14(%rsp), %esi
movq 0xa83f(%rip), %rdi      # 0xefb0
callq 0x33c0
movq %rax, %rbx
leaq 0x5c3c(%rip), %rsi      # 0xa3bc
movl $0x23, %edx
movq %rax, %rdi
callq 0x3290
movq %rbx, %rdi
callq 0x30e0
movq %rax, %rbx
leaq 0x5c41(%rip), %rsi      # 0xa3e0
movl $0x1a, %edx
movq %rax, %rdi
callq 0x3290
movq %rbx, %rdi
callq 0x30e0
movq %rax, %rbx
leaq 0x5c3d(%rip), %rsi      # 0xa3fb
movl $0x11, %edx
movq %rax, %rdi
callq 0x3290
movq %rbx, %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x30e0
movq 0xa7ce(%rip), %rdi      # 0xefb0
leaq 0x5c24(%rip), %rsi      # 0xa40d
movl $0x7, %edx
callq 0x3290
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
movq $0x0, 0x150(%rsp)
movl 0x10(%rsp), %eax
imull 0x14(%rsp), %eax
testl %eax, %eax
jle 0x4878
xorl %ebp, %ebp
movq 0xa7b8(%rip), %rbx      # 0xefd8
leaq 0x30(%rsp), %r14
leaq 0x140(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3140
movq 0x148(%rsp), %rsi
cmpq 0x150(%rsp), %rsi
je 0x485e
movl 0x30(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x148(%rsp)
jmp 0x4869
movq %r15, %rdi
movq %r14, %rdx
callq 0x60e0
incl %ebp
movl 0x10(%rsp), %eax
imull 0x14(%rsp), %eax
cmpl %eax, %ebp
jl 0x482d
leaq 0x38(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdx
leaq 0x140(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0x10(%rsp), %r9
callq 0x6200
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x48ca
callq 0x5648
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x48d9
callq 0x5648
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x471a
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x3260
jmp 0x471a
leaq 0x148(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x140(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
callq 0x652a
movq 0x140(%rsp), %r15
movq 0x148(%rsp), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
testq %rbx, %rbx
je 0x4958
movq %rbx, %rdi
callq 0x5648
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x496a
callq 0x5648
movq %r15, %rdi
movq 0x68(%rsp), %rsi
callq 0x6b3a
movzbl 0x58(%rsp), %r14d
movzbl 0xb0(%rsp), %r13d
testb $0x1, 0x78(%rsp)
je 0x4999
testq %r15, %r15
je 0x49a3
movq 0x8(%rsp), %rbx
jmp 0x4a0b
movq 0x8(%rsp), %rbx
jmp 0x4a78
leaq 0x148(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x140(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
callq 0x652a
movq 0x140(%rsp), %r15
movq 0x148(%rsp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x49f9
callq 0x5648
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x4a0b
callq 0x5648
movq %r15, 0x108(%rsp)
movq %rbx, 0x110(%rsp)
testq %rbx, %rbx
je 0x4a35
movq 0xa581(%rip), %rax      # 0xefa8
cmpb $0x0, (%rax)
je 0x4a31
incl 0x8(%rbx)
jmp 0x4a35
lock
incl 0x8(%rbx)
testb $0x1, 0x28(%rsp)
jne 0x4a45
movq 0xa56d(%rip), %rcx      # 0xefb0
jmp 0x4a4d
leaq 0x2d8(%rsp), %rcx
movl %r14d, %esi
andl $0x1, %esi
movl %r13d, %edx
andl $0x1, %edx
leaq 0x108(%rsp), %rdi
callq 0x3d62
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x4a78
callq 0x5648
testb $0x1, %r12b
jne 0x4a8e
xorl %ebp, %ebp
testb $0x1, 0x80(%rsp)
je 0x505b
testq %r15, %r15
je 0x4a9a
movq %rbx, 0x8(%rsp)
jmp 0x4b05
leaq 0x148(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x140(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
callq 0x652a
movq 0x140(%rsp), %r15
movq 0x148(%rsp), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
testq %rbx, %rbx
je 0x4af3
movq %rbx, %rdi
callq 0x5648
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x4b05
callq 0x5648
movq (%rsp), %rax
orb 0x70(%rsp), %al
testb $0x1, %al
jne 0x4b1e
movq %r15, %rdi
movq 0x68(%rsp), %rsi
callq 0x6b3a
movq (%r15), %rax
movl %r13d, %esi
andl $0x1, %esi
movq 0xa482(%rip), %rbx      # 0xefb0
movq %r15, %rdi
movl %esi, 0x18(%rsp)
movq %rbx, %rdx
callq *0x8(%rax)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x58b3(%rip), %rsi      # 0xa415
leaq 0x58b4(%rip), %rdx      # 0xa41d
leaq 0x90(%rsp), %rdi
callq 0x56b8
testb $0x1, 0x28(%rsp)
movl %r14d, 0x60(%rsp)
jne 0x4b89
movq %rbx, 0x28(%rsp)
jmp 0x4b96
leaq 0x2d8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xa43b(%rip), %rbp      # 0xefd8
leaq 0x30(%rsp), %rbx
leaq 0x140(%rsp), %r13
leaq 0xb8(%rsp), %r12
andl $0x1, 0x60(%rsp)
testb $0x1, 0x80(%rsp)
jne 0x4bd1
movq %r15, %rdi
callq 0x74c0
testb %al, %al
jne 0x4fcb
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0xa3c8(%rip), %rdi      # 0xefb0
callq 0x3290
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %edx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x33f0
cmpq $0x0, 0x38(%rsp)
je 0x4bb7
movq %r13, %rdi
movq %rbx, %rsi
movl $0x18, %edx
callq 0x3370
movq %r13, %rdi
leaq 0x8c(%rsp), %rsi
callq 0x3140
movq %rax, %rdi
leaq 0x88(%rsp), %rsi
callq 0x3140
movl 0x8c(%rsp), %esi
movl 0x88(%rsp), %edx
movq (%r15), %rax
movq %r15, %rdi
callq *(%rax)
testb %al, %al
je 0x4c81
movq (%r15), %rax
movq %r15, %rdi
movl 0x18(%rsp), %esi
movq 0xa33d(%rip), %rdx      # 0xefb0
callq *0x8(%rax)
movl $0x8, %r14d
jmp 0x4ea1
movq %rbx, %rdi
movl $0x20, %esi
movq $-0x1, %rdx
callq 0x3170
leaq 0x1(%rax), %rcx
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3280
movq %rbx, %rdi
movq %r12, %rsi
callq 0x32b0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x4cd6
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x32c0
cmpq $-0x1, %rax
jne 0x4cf0
movq 0x38(%rsp), %rax
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3280
movq 0xc0(%rsp), %rdx
movq 0x38(%rsp), %rcx
decq %rcx
leaq 0x120(%rsp), %rdi
movq %rbx, %rsi
callq 0x3280
movq %r12, %rdi
leaq 0x56f4(%rip), %rsi      # 0xa41e
callq 0x3080
movl $0x1, %r14d
testl %eax, %eax
je 0x4e57
movq %r12, %rdi
leaq 0x56dc(%rip), %rsi      # 0xa423
callq 0x3080
testl %eax, %eax
je 0x4e57
movq %r12, %rdi
leaq 0x56c7(%rip), %rsi      # 0xa425
callq 0x3080
testl %eax, %eax
je 0x4e18
movq %r12, %rdi
leaq 0x55c9(%rip), %rsi      # 0xa33e
callq 0x3080
testl %eax, %eax
je 0x4e18
movq %r12, %rdi
leaq 0x569f(%rip), %rsi      # 0xa42b
callq 0x3080
testl %eax, %eax
je 0x4e40
movq %r12, %rdi
leaq 0x54fb(%rip), %rsi      # 0xa29e
callq 0x3080
testl %eax, %eax
je 0x4e40
movq %r12, %rdi
leaq 0x53f6(%rip), %rsi      # 0xa1b0
callq 0x3080
testl %eax, %eax
je 0x4ecc
movq %r12, %rdi
leaq 0x559f(%rip), %rsi      # 0xa370
callq 0x3080
testl %eax, %eax
je 0x4ecc
movq %r12, %rdi
leaq 0x5381(%rip), %rsi      # 0xa169
callq 0x3080
testl %eax, %eax
je 0x4efc
movq %r12, %rdi
leaq 0x5632(%rip), %rsi      # 0xa431
callq 0x3080
testl %eax, %eax
je 0x4efc
movq 0x30(%rsp), %rdi
callq 0x31f0
jmp 0x4e54
movq %r15, %rdi
callq 0x6aca
xorl %r14d, %r14d
testb $0x1, 0x58(%rsp)
jne 0x4e57
movq (%r15), %rax
movq %r15, %rdi
movl 0x18(%rsp), %esi
movq 0xa175(%rip), %rdx      # 0xefb0
callq *0x8(%rax)
jmp 0x4e57
movq (%r15), %rax
movq %r15, %rdi
movl 0x18(%rsp), %esi
movq 0xa15f(%rip), %rdx      # 0xefb0
callq *0x8(%rax)
xorl %r14d, %r14d
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x4e7c
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x4ea1
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3260
movq %r13, %rdi
movq 0xa0cd(%rip), %rsi      # 0xef78
callq 0x31c0
leaq 0x1c0(%rsp), %rdi
callq 0x3090
testb $0x7, %r14b
je 0x4bb7
jmp 0x5011
movq %r15, 0xf8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x100(%rsp)
testq %rax, %rax
je 0x4f28
movq 0xa0bb(%rip), %rax      # 0xefa8
cmpb $0x0, (%rax)
je 0x4f1f
movq 0x8(%rsp), %rax
incl 0x8(%rax)
jmp 0x4f28
leaq 0x120(%rsp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x556d
movq %r15, %rdi
movl %eax, %esi
callq 0x6b3a
jmp 0x4e20
movq 0x8(%rsp), %rax
lock
incl 0x8(%rax)
leaq 0xf8(%rsp), %rdi
movl 0x60(%rsp), %esi
movl 0x18(%rsp), %edx
movq 0x28(%rsp), %rcx
callq 0x3d62
movq 0x100(%rsp), %rdi
xorl %r14d, %r14d
testq %rdi, %rdi
je 0x4e57
callq 0x5648
jmp 0x4e57
movq %rax, (%rsp)
cmpl $0x1, %edx
jne 0x514a
movq (%rsp), %rdi
callq 0x30c0
movl $0x10, %edx
movq 0xa02e(%rip), %rdi      # 0xefb0
leaq 0x54aa(%rip), %rsi      # 0xa433
callq 0x3290
movq 0xa01b(%rip), %rdi      # 0xefb0
callq 0x30e0
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x5498(%rip), %rsi      # 0xa444
callq 0x3290
movq %r14, %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x30e0
callq 0x3390
jmp 0x4e54
movq 0x9fde(%rip), %rbx      # 0xefb0
leaq 0x547a(%rip), %rsi      # 0xa453
movl $0x8, %edx
movq %rbx, %rdi
callq 0x3290
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq 0x9fac(%rip), %rdi      # 0xefb0
callq 0x3030
movq %rax, %rdi
callq 0x3160
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x5036
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x5052
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
jmp 0x505e
movq %rbx, %rdi
testq %rdi, %rdi
je 0x5068
callq 0x5648
leaq 0x4d8(%rsp), %rdi
callq 0x3050
leaq 0x2c8(%rsp), %rdi
callq 0x3050
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x50a7
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3260
movl %ebp, %eax
addq $0x6e8, %rsp            # imm = 0x6E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x539a(%rip), %rdi      # 0xa45c
callq 0x3310
leaq 0x538e(%rip), %rdi      # 0xa45c
callq 0x3130
leaq 0x5382(%rip), %rdi      # 0xa45c
callq 0x3310
leaq 0x5376(%rip), %rdi      # 0xa45c
callq 0x3130
leaq 0x536a(%rip), %rdi      # 0xa45c
callq 0x3310
leaq 0x535e(%rip), %rdi      # 0xa45c
callq 0x3130
jmp 0x5110
movq %rax, (%rsp)
callq 0x3390
jmp 0x514a
movq %rax, (%rsp)
jmp 0x514a
jmp 0x520e
movq %rax, (%rsp)
jmp 0x535e
jmp 0x5126
movq %rax, (%rsp)
jmp 0x51db
jmp 0x51ee
movq %rax, (%rsp)
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x514a
callq 0x5648
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x528a
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x528a
movq %rax, (%rsp)
cmpl $0x2, %edx
jne 0x51fb
movq (%rsp), %rdi
callq 0x30c0
movq 0x9e1f(%rip), %rdi      # 0xefb0
leaq 0x51fe(%rip), %rsi      # 0xa396
movl $0x1e, %edx
callq 0x3290
movq 0x9e07(%rip), %rdi      # 0xefb0
callq 0x30e0
callq 0x3390
jmp 0x45ed
jmp 0x51f7
movq %rax, (%rsp)
callq 0x3390
jmp 0x51fb
movq %rax, (%rsp)
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x51db
callq 0x5648
movq %rbx, 0x8(%rsp)
jmp 0x535e
movq %rax, (%rsp)
jmp 0x5342
movq %rdx, %rbx
movq %rax, (%rsp)
jmp 0x5232
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
jmp 0x535e
jmp 0x5319
movq %rdx, %rbx
movq %rax, (%rsp)
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x5232
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x3260
cmpl $0x2, %ebx
jne 0x535e
movq (%rsp), %rdi
callq 0x30c0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0x9d5c(%rip), %rdi      # 0xefb0
movq %rax, %rsi
callq 0x3240
movq %rax, %rdi
callq 0x30e0
movl $0x1, %ebp
callq 0x3390
jmp 0x5054
jmp 0x511b
movq %rax, (%rsp)
callq 0x3390
jmp 0x535e
movq %rax, (%rsp)
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x52d2
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3260
jmp 0x52d2
jmp 0x52ce
jmp 0x52ce
movq %rax, (%rsp)
jmp 0x5532
movq %rax, (%rsp)
jmp 0x553f
jmp 0x5319
jmp 0x5521
movq %rax, (%rsp)
movq 0x9c9f(%rip), %rsi      # 0xef78
leaq 0x140(%rsp), %rdi
callq 0x31c0
leaq 0x1c0(%rsp), %rdi
callq 0x3090
jmp 0x531d
movq %rdx, %r15
movq %rax, (%rsp)
jmp 0x53ae
movq %rdx, %r15
movq %rax, (%rsp)
jmp 0x543c
movq %rdx, %r15
movq %rax, (%rsp)
jmp 0x54ca
movq %rax, (%rsp)
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x5342
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3260
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x535e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3260
cmpq $0x0, 0x8(%rsp)
je 0x5525
movq 0x8(%rsp), %rdi
callq 0x5648
jmp 0x5525
movq %rdx, %r15
movq %rax, (%rsp)
cmpl $0x0, (%r14)
jne 0x5389
movl %ebx, (%r14)
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x53ae
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3260
cmpl $0x1, %r15d
jne 0x5525
movq (%rsp), %rdi
callq 0x30c0
movq 0x9be8(%rip), %rdi      # 0xefb0
leaq 0x4f3e(%rip), %rsi      # 0xa30d
movl $0x13, %edx
callq 0x3290
movq 0x9bd0(%rip), %rdi      # 0xefb0
callq 0x30e0
movl $0x1, %ebp
callq 0x3390
jmp 0x5068
jmp 0x5521
movq %rax, (%rsp)
callq 0x3390
jmp 0x5525
movq %rdx, %r15
movq %rax, (%rsp)
cmpl $0x0, (%r14)
jne 0x5417
movl %ebx, (%r14)
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x543c
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3260
cmpl $0x1, %r15d
jne 0x5525
movq (%rsp), %rdi
callq 0x30c0
movq 0x9b5a(%rip), %rdi      # 0xefb0
leaq 0x4ec4(%rip), %rsi      # 0xa321
movl $0x1e, %edx
callq 0x3290
movq 0x9b42(%rip), %rdi      # 0xefb0
callq 0x30e0
movl $0x1, %ebp
callq 0x3390
jmp 0x5068
jmp 0x5521
movq %rax, (%rsp)
callq 0x3390
jmp 0x5525
movq %rdx, %r15
movq %rax, (%rsp)
cmpl $0x0, (%r14)
jne 0x54a5
movl %ebx, (%r14)
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x54ca
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3260
cmpl $0x1, %r15d
jne 0x5525
movq (%rsp), %rdi
callq 0x30c0
movq 0x9ad0(%rip), %rdi      # 0xefb0
leaq 0x4e12(%rip), %rsi      # 0xa2f9
movl $0x13, %edx
callq 0x3290
movq 0x9ab8(%rip), %rdi      # 0xefb0
callq 0x30e0
movl $0x1, %ebp
callq 0x3390
jmp 0x5068
jmp 0x5521
movq %rax, (%rsp)
callq 0x3390
jmp 0x5525
movq %rax, %rdi
callq 0x563d
movq %rax, (%rsp)
leaq 0x4d8(%rsp), %rdi
callq 0x3050
leaq 0x2c8(%rsp), %rdi
callq 0x3050
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x5564
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3260
movq (%rsp), %rdi
callq 0x33d0