// File: /workspace/github_cpp_makefile_star2_O2/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 0x3bb1
callq 0x358c
pushq $0x1
popq %rbx
jmp 0x44eb
movq %rsi, %r14
movl %edi, %ebp
pushq $0x3
popq %rax
movl %eax, 0x4(%rsp)
movl %eax, (%rsp)
leaq 0xd0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x2c8(%rsp), %rdi
callq 0x3290
leaq 0x4d8(%rsp), %rbx
movq %rbx, %rdi
callq 0x3290
leaq 0x64(%rsp), %rax
andl $0x0, (%rax)
movl $0x80, %ecx
leaq (%rbx,%rcx), %rax
movq %rax, 0x90(%rsp)
leaq 0x2c8(%rsp), %rax
addq %rax, %rcx
movq %rcx, 0x98(%rsp)
pushq $0xa
popq %rax
movq $0x0, 0x40(%rsp)
leaq 0x66b5(%rip), %r12      # 0xa2e5
leaq 0xc5d9(%rip), %r15      # 0x10210
leaq 0x63c6(%rip), %r13      # 0xa004
movq $0x0, 0x30(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x8(%rsp)
movl %eax, 0x24(%rsp)
movq $0x0, 0x48(%rsp)
xorl %ecx, %ecx
movl %ecx, %ebx
movl %ebp, %edi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
leaq 0x64(%rsp), %r8
callq 0x3390
leal -0x62(%rax), %edx
cmpl $0x17, %edx
ja 0x3e65
movb $0x1, %cl
movslq (%r13,%rdx,4), %rax
addq %r13, %rax
jmpq *%rax
movb $0x1, %al
movq %rax, 0x88(%rsp)
movl %ebx, %ecx
jmp 0x3c86
movb $0x1, %al
movq %rax, 0x28(%rsp)
movl %ebx, %ecx
jmp 0x3c86
movq 0xc2ab(%rip), %rax      # 0xff80
movq (%rax), %rsi
leaq 0x140(%rsp), %r12
movq %r12, %rdi
leaq 0x68(%rsp), %rdx
callq 0x4944
movq %r12, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x4928
movl %eax, (%rsp)
jmp 0x3e2c
movb $0x1, %al
movq %rax, 0x50(%rsp)
movl %ebx, %ecx
jmp 0x3c86
movb $0x1, %al
movq %rax, 0x38(%rsp)
movl %ebx, %ecx
jmp 0x3c86
movq 0xc25b(%rip), %rax      # 0xff80
movq (%rax), %rsi
leaq 0x140(%rsp), %r12
movq %r12, %rdi
leaq 0x68(%rsp), %rdx
callq 0x4944
movq %r12, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x4928
movl %eax, 0x24(%rsp)
movq %r12, %rdi
callq 0x30e0
movb $0x1, %al
movq %rax, 0x48(%rsp)
jmp 0x3e34
movq 0xc217(%rip), %rax      # 0xff80
movq (%rax), %rsi
movb $0x1, %al
movq %rax, 0x8(%rsp)
movl %ebx, %ecx
testq %rsi, %rsi
je 0x3c86
leaq 0xc0(%rsp), %rdi
callq 0x33f0
movl %ebx, %ecx
jmp 0x3c86
movq 0xc1e7(%rip), %rax      # 0xff80
movq (%rax), %rsi
leaq 0x2c8(%rsp), %rdi
pushq $0x30
popq %rdx
callq 0x3220
movq 0x98(%rsp), %rdi
callq 0x3060
movb $0x1, %cl
movq %rcx, 0x40(%rsp)
jmp 0x3df0
movq 0xc1b7(%rip), %rax      # 0xff80
movq (%rax), %rsi
leaq 0x4d8(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x3220
movq 0x90(%rsp), %rdi
callq 0x3060
movb $0x1, %cl
movq %rcx, 0x30(%rsp)
movl %ebx, %ecx
testb %al, %al
jne 0x3c86
jmp 0x3e42
movq 0xc17d(%rip), %rax      # 0xff80
movq (%rax), %rsi
leaq 0x140(%rsp), %r12
movq %r12, %rdi
leaq 0x68(%rsp), %rdx
callq 0x4944
movq %r12, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x4928
movl %eax, 0x4(%rsp)
movq %r12, %rdi
callq 0x30e0
movl %ebx, %ecx
leaq 0x64a8(%rip), %r12      # 0xa2e5
jmp 0x3c86
leaq 0x64f7(%rip), %rsi      # 0xa340
movq 0xc158(%rip), %rdi      # 0xffa8
callq 0x3240
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x44c4
cmpl $-0x1, %eax
jne 0x3ebd
movq 0x40(%rsp), %r13
testb $0x1, %r13b
je 0x3e80
testb $0x1, 0x28(%rsp)
je 0x3f28
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
testb $0x1, 0x30(%rsp)
je 0x3ec9
testb $0x1, 0x8(%rsp)
je 0x3f34
movq 0xc107(%rip), %rdi      # 0xffa8
leaq 0x64ca(%rip), %rsi      # 0xa372
callq 0x3240
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x44ba
xorl %ebx, %ebx
callq 0x358c
jmp 0x44c4
testb $0x1, 0x8(%rsp)
je 0x3f70
cmpq $0x0, 0xc8(%rsp)
je 0x44ff
leaq 0x140(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rsp, %rcx
callq 0x49f0
leaq 0x10(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x57f4
leaq 0x148(%rsp), %rdi
callq 0x4a42
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x3f79
leaq 0x6420(%rip), %rsi      # 0xa34f
jmp 0x3e49
leaq 0x140(%rsp), %rdi
leaq 0x4d8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rsp, %rcx
callq 0x498a
leaq 0x10(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x57f4
leaq 0x148(%rsp), %rdi
callq 0x4a42
movq $0x0, 0x8(%rsp)
testb $0x1, 0x48(%rsp)
je 0x3fcd
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
jne 0x3fc4
leaq 0x140(%rsp), %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x4a14
leaq 0x10(%rsp), %r14
leaq 0x140(%rsp), %rsi
movq %r14, %rdi
callq 0x57f4
leaq 0x148(%rsp), %rdi
callq 0x4a42
movq (%r14), %rdi
movl 0x24(%rsp), %esi
callq 0x6202
movzbl 0x38(%rsp), %ebp
movzbl 0x88(%rsp), %r15d
testb $0x1, 0x28(%rsp)
je 0x406e
cmpq $0x0, 0x10(%rsp)
jne 0x4022
leaq 0x140(%rsp), %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x4a14
leaq 0x10(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x57f4
leaq 0x148(%rsp), %rdi
callq 0x4a42
leaq 0xb0(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x4b80
testb $0x1, %r13b
jne 0x4046
movq 0xbf64(%rip), %rcx      # 0xffa8
jmp 0x404e
leaq 0x2d8(%rsp), %rcx
movl %ebp, %esi
andl $0x1, %esi
movl %r15d, %edx
andl $0x1, %edx
movq %r14, %rdi
callq 0x3987
leaq 0xb8(%rsp), %rdi
callq 0x4a42
testb $0x1, %bl
jne 0x4080
xorl %ebx, %ebx
testb $0x1, 0x50(%rsp)
je 0x44ba
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
jne 0x40c4
leaq 0x140(%rsp), %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x4a14
leaq 0x10(%rsp), %rbx
leaq 0x140(%rsp), %rsi
movq %rbx, %rdi
callq 0x57f4
leaq 0x148(%rsp), %rdi
callq 0x4a42
movq (%rbx), %rdi
movq 0x48(%rsp), %rax
orb 0x8(%rsp), %al
testb $0x1, %al
jne 0x40df
movl 0x24(%rsp), %esi
callq 0x6202
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movl %r15d, %esi
andl $0x1, %esi
movq 0xbeb9(%rip), %rbx      # 0xffa8
movl %esi, 0x8(%rsp)
movq %rbx, %rdx
callq *0x8(%rax)
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x6304(%rip), %rsi      # 0xa415
leaq 0x120(%rsp), %rdi
leaq 0x140(%rsp), %rdx
callq 0x4944
testb $0x1, %r13b
movl %ebp, 0x30(%rsp)
jne 0x4137
movq %rbx, 0x28(%rsp)
jmp 0x4144
leaq 0x2d8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xbe5d(%rip), %r12      # 0xffa8
leaq 0x120(%rsp), %r13
leaq 0x68(%rsp), %rbx
leaq 0x140(%rsp), %rbp
leaq 0x100(%rsp), %r14
andl $0x1, 0x30(%rsp)
testb $0x1, 0x50(%rsp)
jne 0x4186
movq 0x10(%rsp), %rdi
callq 0x68e0
testb %al, %al
jne 0x4486
movq %r12, %rdi
movq %r13, %rsi
callq 0x3210
movq 0xbe40(%rip), %rdi      # 0xffd8
movq %rbx, %rsi
callq 0x3040
cmpq $0x0, 0x70(%rsp)
je 0x416d
movq %rbp, %rdi
movq %rbx, %rsi
pushq $0x18
popq %rdx
callq 0x3360
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x3150
movq %rax, %rdi
leaq 0x5c(%rsp), %rsi
callq 0x3150
movq 0x10(%rsp), %rdi
movl 0x60(%rsp), %esi
movl 0x5c(%rsp), %edx
movq (%rdi), %rax
callq *(%rax)
testb %al, %al
je 0x41fd
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movl 0x8(%rsp), %esi
movq %r12, %rdx
callq *0x8(%rax)
jmp 0x4335
movq %r13, %r15
movq %rbx, %rdi
pushq $0x20
popq %r13
movl %r13d, %esi
pushq $-0x1
popq %rdx
callq 0x3170
leaq 0x1(%rax), %rcx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3270
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32a0
movq %r14, %rdi
callq 0x30e0
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x32b0
cmpq $-0x1, %rax
jne 0x424e
movq 0x70(%rsp), %rax
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3270
movq %r15, %r13
movq 0x108(%rsp), %rdx
movq 0x70(%rsp), %rcx
decq %rcx
leaq 0xe0(%rsp), %rdi
movq %rbx, %rsi
callq 0x3270
movq %r14, %rdi
leaq 0x6193(%rip), %rsi      # 0xa41e
callq 0x4a35
testb %al, %al
jne 0x445d
movq %r14, %rdi
leaq 0x6181(%rip), %rsi      # 0xa423
callq 0x4a35
testb %al, %al
jne 0x445d
movq %r14, %rdi
leaq 0x616c(%rip), %rsi      # 0xa425
callq 0x4a35
testb %al, %al
jne 0x42d5
movq %r14, %rdi
leaq 0x6072(%rip), %rsi      # 0xa33e
callq 0x4a35
testb %al, %al
je 0x42e8
movq 0x10(%rsp), %rdi
callq 0x6198
testb $0x1, 0x38(%rsp)
je 0x430e
jmp 0x4320
movq %r14, %rdi
leaq 0x6139(%rip), %rsi      # 0xa42b
callq 0x4a35
testb %al, %al
jne 0x430e
movq %r14, %rdi
leaq 0x5f99(%rip), %rsi      # 0xa29e
callq 0x4a35
testb %al, %al
je 0x4342
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movl 0x8(%rsp), %esi
movq %r12, %rdx
callq *0x8(%rax)
leaq 0xe0(%rsp), %rdi
callq 0x30e0
movq %r14, %rdi
callq 0x30e0
movq %rbp, %rdi
callq 0x31c0
jmp 0x416d
movq %r14, %rdi
leaq 0x5e64(%rip), %rsi      # 0xa1b0
callq 0x4a35
testb %al, %al
jne 0x4368
movq %r14, %rdi
leaq 0x6011(%rip), %rsi      # 0xa370
callq 0x4a35
testb %al, %al
je 0x43a4
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x4b80
movq %r15, %rdi
movl 0x30(%rsp), %esi
movl 0x8(%rsp), %edx
movq 0x28(%rsp), %rcx
callq 0x3987
leaq 0xa8(%rsp), %rdi
callq 0x4a42
jmp 0x4320
movq %r14, %rdi
leaq 0x5dbb(%rip), %rsi      # 0xa169
callq 0x4a35
testb %al, %al
jne 0x43ca
movq %r14, %rdi
leaq 0x6070(%rip), %rsi      # 0xa431
callq 0x4a35
testb %al, %al
je 0x43f7
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0xe0(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x4928
movq 0x40(%rsp), %rdi
movl %eax, %esi
callq 0x6202
jmp 0x42df
movq 0x68(%rsp), %rdi
callq 0x31f0
jmp 0x4320
movq %rax, %r13
cmpl $0x1, %edx
jne 0x4656
movq %r13, %rdi
callq 0x30b0
movq %r12, %rdi
leaq 0x600f(%rip), %rsi      # 0xa433
callq 0x3240
movq %rax, %rdi
callq 0x30f0
movq %rax, %rdi
leaq 0x6009(%rip), %rsi      # 0xa444
callq 0x3240
movq %rax, %rdi
callq 0x30f0
movq %rax, %rdi
callq 0x30f0
callq 0x3380
movq %r15, %r13
jmp 0x4320
leaq 0xe0(%rsp), %rdi
callq 0x30e0
leaq 0x100(%rsp), %rdi
callq 0x30e0
leaq 0x140(%rsp), %rdi
callq 0x31c0
jmp 0x44a1
movq 0xbb1b(%rip), %rdi      # 0xffa8
leaq 0x5fbf(%rip), %rsi      # 0xa453
callq 0x3240
movq %rax, %rdi
callq 0x30f0
leaq 0x120(%rsp), %rdi
callq 0x30e0
leaq 0x68(%rsp), %rdi
callq 0x30e0
xorl %ebx, %ebx
leaq 0x18(%rsp), %rdi
callq 0x4a42
leaq 0x4d8(%rsp), %rdi
callq 0x3050
leaq 0x2c8(%rsp), %rdi
callq 0x3050
leaq 0xc0(%rsp), %rdi
callq 0x30e0
movl %ebx, %eax
addq $0x6e8, %rsp            # imm = 0x6E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, 0x38(%rsp)
jne 0x458d
movq 0xba97(%rip), %rdi      # 0xffa8
leaq 0x5e9d(%rip), %rsi      # 0xa3b5
callq 0x3240
movl (%rsp), %esi
imull 0x4(%rsp), %esi
movq %rax, %rdi
callq 0x33b0
leaq 0x5e88(%rip), %rsi      # 0xa3bc
movq %rax, %rdi
callq 0x3240
movq %rax, %rdi
callq 0x30f0
leaq 0x5e95(%rip), %rsi      # 0xa3e0
movq %rax, %rdi
callq 0x3240
movq %rax, %rdi
callq 0x30f0
leaq 0x5e99(%rip), %rsi      # 0xa3fb
movq %rax, %rdi
callq 0x3240
movq %rax, %rdi
callq 0x30f0
movq %rax, %rdi
callq 0x30f0
movq 0xba27(%rip), %rdi      # 0xffa8
leaq 0x5e85(%rip), %rsi      # 0xa40d
callq 0x3240
xorps %xmm0, %xmm0
leaq 0x140(%rsp), %r12
andq $0x0, 0x10(%r12)
movaps %xmm0, (%r12)
xorl %ebp, %ebp
movq 0xba2c(%rip), %r14      # 0xffd8
leaq 0x68(%rsp), %r15
movl (%rsp), %eax
imull 0x4(%rsp), %eax
cmpl %eax, %ebp
jge 0x45d7
movq %r14, %rdi
movq %r15, %rsi
callq 0x3150
movq %r12, %rdi
movq %r15, %rsi
callq 0x49ae
incl %ebp
jmp 0x45b1
leaq 0x68(%rsp), %rdi
leaq 0x140(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rsp, %rcx
callq 0x49cc
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x57f4
leaq 0x70(%rsp), %rdi
callq 0x4a42
leaq 0x140(%rsp), %rdi
callq 0x509c
jmp 0x3f79
jmp 0x4628
movq %rax, %r13
callq 0x3380
jmp 0x4656
movq %rax, %r13
jmp 0x4656
jmp 0x46fb
jmp 0x46cd
jmp 0x46cd
jmp 0x46c5
jmp 0x46cd
movq %rax, %r13
leaq 0xa8(%rsp), %rdi
callq 0x4a42
leaq 0xe0(%rsp), %rdi
callq 0x30e0
jmp 0x46ea
movq %rax, %r13
cmpl $0x2, %edx
jne 0x4798
movq %r13, %rdi
callq 0x30b0
movq 0xb925(%rip), %rdi      # 0xffa8
leaq 0x5d0c(%rip), %rsi      # 0xa396
callq 0x3240
movq %rax, %rdi
callq 0x30f0
callq 0x3380
jmp 0x3eb5
jmp 0x46cd
movq %rax, %r13
callq 0x3380
jmp 0x4798
movq %rax, %r13
leaq 0xb8(%rsp), %rdi
callq 0x4a42
jmp 0x4798
movq %rdx, %rbx
movq %rax, %r13
jmp 0x470e
movq %rax, %r13
jmp 0x4798
jmp 0x477e
movq %rax, %r13
jmp 0x478e
jmp 0x476c
movq %rax, %r13
leaq 0x100(%rsp), %rdi
callq 0x30e0
jmp 0x476f
jmp 0x476c
movq %rdx, %rbx
movq %rax, %r13
leaq 0x140(%rsp), %rdi
callq 0x509c
cmpl $0x2, %ebx
jne 0x4798
movq %r13, %rdi
callq 0x30b0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0xb879(%rip), %rdi      # 0xffa8
movq %rax, %rsi
callq 0x3240
movq %rax, %rdi
callq 0x30f0
callq 0x3380
jmp 0x3eb5
jmp 0x46cd
movq %rax, %r13
callq 0x3380
jmp 0x4798
movq %rax, %r13
jmp 0x48d8
movq %rax, %r13
jmp 0x48e5
jmp 0x48c8
jmp 0x477e
movq %rax, %r13
leaq 0x140(%rsp), %rdi
callq 0x31c0
jmp 0x4781
movq %rax, %r13
leaq 0x120(%rsp), %rdi
callq 0x30e0
leaq 0x68(%rsp), %rdi
callq 0x30e0
leaq 0x18(%rsp), %rdi
callq 0x4a42
jmp 0x48cb
movq %rdx, %rbx
movq %rax, %r13
leaq 0x140(%rsp), %rdi
callq 0x30e0
jmp 0x47c2
movq %rdx, %rbx
movq %rax, %r13
cmpl $0x1, %ebx
jne 0x48cb
movq %r13, %rdi
callq 0x30b0
movq 0xb7ce(%rip), %rdi      # 0xffa8
leaq 0x5b40(%rip), %rsi      # 0xa321
callq 0x3240
movq %rax, %rdi
callq 0x30f0
callq 0x3380
jmp 0x3e5d
jmp 0x48c8
movq %rax, %r13
callq 0x3380
jmp 0x48cb
movq %rdx, %rbx
movq %rax, %r13
leaq 0x140(%rsp), %rdi
callq 0x30e0
jmp 0x4825
movq %rdx, %rbx
movq %rax, %r13
cmpl $0x1, %ebx
jne 0x48cb
movq %r13, %rdi
callq 0x30b0
movq 0xb76b(%rip), %rdi      # 0xffa8
leaq 0x5ab5(%rip), %rsi      # 0xa2f9
callq 0x3240
movq %rax, %rdi
callq 0x30f0
callq 0x3380
jmp 0x3e5d
jmp 0x48c8
movq %rax, %r13
callq 0x3380
jmp 0x48cb
movq %rdx, %rbx
movq %rax, %r13
leaq 0x140(%rsp), %rdi
callq 0x30e0
jmp 0x4882
movq %rdx, %rbx
movq %rax, %r13
cmpl $0x1, %ebx
jne 0x48cb
movq %r13, %rdi
callq 0x30b0
movq 0xb712(%rip), %rdi      # 0xffa8
leaq 0x5a70(%rip), %rsi      # 0xa30d
callq 0x3240
movq %rax, %rdi
callq 0x30f0
callq 0x3380
jmp 0x3e5d
jmp 0x48c8
movq %rax, %r13
callq 0x3380
jmp 0x48cb
movq %rax, %rdi
callq 0x497f
movq %rax, %r13
leaq 0x4d8(%rsp), %rdi
callq 0x3050
leaq 0x2c8(%rsp), %rdi
callq 0x3050
leaq 0xc0(%rsp), %rdi
callq 0x30e0
movq %r13, %rdi
callq 0x33c0