// File: Matan-Vinkler[P]Basic-File-System/myfs_main.cpp
// Function: main
int main(int argc, char **argv) {

	if (argc != 2) {
		std::cerr << "Please provide the file to operate on" << std::endl;
		return -1;
	}

	BlockDeviceSimulator *blkdevptr = new BlockDeviceSimulator(argv[1]);
	MyFs myfs(blkdevptr);
	bool exit = false;

	std::cout << "Welcome to " << FS_NAME << std::endl;
	std::cout << "To get help, please type 'help' on the prompt below." << std::endl;
	std::cout << std::endl;

	while (!exit) {
		try {
			std::string cmdline;
			std::cout << FS_NAME << "$ ";
			std::getline(std::cin, cmdline, '\n');
			if (cmdline == std::string(""))
				continue;

			std::vector<std::string> cmd = split_cmd(cmdline);

			if (cmd[0] == LIST_CMD) {
				MyFs::dir_list dlist;
				if (cmd.size() == 1)
					dlist = myfs.list_dir("/");
				else if (cmd.size() == 2)
					dlist = myfs.list_dir(cmd[1]);
				else
					std::cout << LIST_CMD << ": one or zero arguments requested" << std::endl;

				for (size_t i=0; i < dlist.size(); i++) {
					std::cout << std::setw(15) << std::left
						<< dlist[i].name + (dlist[i].is_dir ? "/":"")
						<< std::setw(10) << std::right
						<< dlist[i].file_size << std::endl;
				}
			} else if (cmd[0] == EXIT_CMD) {
				exit = true;
			} else if (cmd[0] == HELP_CMD) {
				std::cout << HELP_STRING;
			} else if (cmd[0] == CREATE_FILE_CMD) {
				if (cmd.size() == 2)
					myfs.create_file(cmd[1], false);
				else
					std::cout << CREATE_FILE_CMD << ": file path requested" << std::endl;
			} else if (cmd[0] == CONTENT_CMD) {
				if (cmd.size() == 2)
					std::cout << myfs.get_content(cmd[1]) << std::endl;
				else
					std::cout << CONTENT_CMD << ": file path requested" << std::endl;
			} else if (cmd[0] == TREE_CMD) {
				recursive_print(myfs, "");
			} else if (cmd[0] == EDIT_CMD) {
				if (cmd.size() == 2) {
					std::cout << "Enter new file content" << std::endl;
					std::string content;
					std::string curr_line;
					std::getline(std::cin, curr_line);
					while (curr_line != "") {
						content += curr_line + "\n";
						std::getline(std::cin, curr_line);
					}
					myfs.set_content(cmd[1], content);
				} else {
					std::cout << EDIT_CMD << ": file path requested" << std::endl;
				}
			} else if (cmd[0] == CREATE_DIR_CMD) {
				if (cmd.size() == 2)
					myfs.create_file(cmd[1], true);
				else
					std::cout << CREATE_DIR_CMD << ": one argument requested" << std::endl;
			} else {
				std::cout << "unknown command: " << cmd[0] << std::endl;
			}
		} catch (std::runtime_error &e) {
			std::cout << e.what() << std::endl;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x5e3d
movq 0x71d2(%rip), %rdi      # 0xcfe8
leaq 0x33ee(%rip), %rsi      # 0x920b
callq 0x3290
movq %rax, %rdi
movq 0x7174(%rip), %rsi      # 0xcfa0
callq 0x32c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6db9
movl $0x10, %edi
callq 0x32a0
movq %rax, -0x350(%rbp)
movb $0x1, -0x4d(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x348(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x3440
movq -0x348(%rbp), %rsi
movq -0x340(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x4400
jmp 0x5e8a
movq -0x350(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x3ef0
jmp 0x5e9c
movb $0x0, -0x4d(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x34d8
leaq -0x39(%rbp), %rdi
callq 0x32f0
movq -0x350(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x4750
movb $0x0, -0x71(%rbp)
movq 0x70eb(%rip), %rdi      # 0xcfc0
leaq 0x3355(%rip), %rsi      # 0x9231
callq 0x3290
movq %rax, -0x358(%rbp)
jmp 0x5eea
movq -0x358(%rbp), %rdi
leaq 0x73a8(%rip), %rsi      # 0xd2a0
callq 0x3270
movq %rax, -0x360(%rbp)
jmp 0x5f06
movq -0x360(%rbp), %rdi
movq 0x708c(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x5f1b
movq 0x709e(%rip), %rdi      # 0xcfc0
leaq 0x3314(%rip), %rsi      # 0x923d
callq 0x3290
movq %rax, -0x368(%rbp)
jmp 0x5f37
movq -0x368(%rbp), %rdi
movq 0x705b(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x5f4c
movq 0x706d(%rip), %rdi      # 0xcfc0
movq 0x7046(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x5f61
jmp 0x5f63
movb -0x71(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5f71
jmp 0x6db0
leaq -0x98(%rbp), %rdi
callq 0x3380
movq 0x703c(%rip), %rdi      # 0xcfc0
leaq 0x7315(%rip), %rsi      # 0xd2a0
callq 0x3270
movq %rax, -0x370(%rbp)
jmp 0x5f99
movq -0x370(%rbp), %rdi
leaq 0x32cb(%rip), %rsi      # 0x9272
callq 0x3290
jmp 0x5fae
movq 0x701b(%rip), %rdi      # 0xcfd0
leaq -0x98(%rbp), %rsi
movl $0xa, %edx
callq 0x3470
jmp 0x5fc8
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x3440
movq -0x378(%rbp), %rdx
leaq 0x320b(%rip), %rsi      # 0x91f4
leaq -0xb8(%rbp), %rdi
callq 0x4400
jmp 0x5ff7
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4e60
movb %al, -0x379(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x34d8
leaq -0xb9(%rbp), %rdi
callq 0x32f0
movb -0x379(%rbp), %al
testb $0x1, %al
jne 0x6037
jmp 0x60cf
movl $0x2, -0xc0(%rbp)
jmp 0x6cf9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6069
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x34d8
leaq -0x39(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x4d(%rbp)
jne 0x607a
jmp 0x608b
movq -0x350(%rbp), %rdi
movl $0x10, %esi
callq 0x32b0
jmp 0x6dce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6dc5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6d24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0x32f0
jmp 0x6d24
leaq -0xf8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3120
jmp 0x60e4
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x5c90
jmp 0x60f9
leaq -0xf8(%rbp), %rdi
callq 0x34d8
leaq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x73c0
movq %rax, %rdi
leaq 0x71a1(%rip), %rsi      # 0xd2c0
callq 0x4e60
testb $0x1, %al
jne 0x612d
jmp 0x6522
leaq -0x110(%rbp), %rdi
callq 0x4ce0
leaq -0xd8(%rbp), %rdi
callq 0x73e0
cmpq $0x1, %rax
jne 0x6227
leaq -0x149(%rbp), %rdi
movq %rdi, -0x388(%rbp)
callq 0x3440
movq -0x388(%rbp), %rdx
leaq 0x3105(%rip), %rsi      # 0x9275
leaq -0x148(%rbp), %rdi
callq 0x4400
jmp 0x617e
leaq -0x128(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0x4bc0
jmp 0x6197
leaq -0x110(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x7400
leaq -0x128(%rbp), %rdi
callq 0x4d00
leaq -0x148(%rbp), %rdi
callq 0x34d8
leaq -0x149(%rbp), %rdi
callq 0x32f0
jmp 0x6324
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x34d8
jmp 0x6d24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6216
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x34d8
leaq -0x149(%rbp), %rdi
callq 0x32f0
jmp 0x6511
leaq -0xd8(%rbp), %rdi
callq 0x73e0
cmpq $0x2, %rax
jne 0x62d3
leaq -0xd8(%rbp), %rdi
movl $0x1, %esi
callq 0x73c0
movq %rax, %rsi
leaq -0x188(%rbp), %rdi
callq 0x3120
jmp 0x625f
leaq -0x168(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x188(%rbp), %rdx
callq 0x4bc0
jmp 0x6278
leaq -0x110(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x7400
leaq -0x168(%rbp), %rdi
callq 0x4d00
leaq -0x188(%rbp), %rdi
callq 0x34d8
jmp 0x6322
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6511
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x34d8
jmp 0x6511
movq 0x6ce6(%rip), %rdi      # 0xcfc0
leaq 0x6fdf(%rip), %rsi      # 0xd2c0
callq 0x3270
movq %rax, -0x390(%rbp)
jmp 0x62ef
movq -0x390(%rbp), %rdi
leaq 0x2f7a(%rip), %rsi      # 0x9277
callq 0x3290
movq %rax, -0x398(%rbp)
jmp 0x630b
movq -0x398(%rbp), %rdi
movq 0x6c87(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x6320
jmp 0x6322
jmp 0x6324
movq $0x0, -0x190(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x3a0(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x4e30
movq %rax, %rcx
movq -0x3a0(%rbp), %rax
cmpq %rcx, %rax
jae 0x6500
movl $0xf, %edi
callq 0x7430
movl %eax, -0x3a4(%rbp)
jmp 0x636e
movl -0x3a4(%rbp), %eax
movl %eax, -0x194(%rbp)
movl -0x194(%rbp), %esi
movq 0x6c39(%rip), %rdi      # 0xcfc0
callq 0x3320
movq %rax, -0x3b0(%rbp)
jmp 0x6395
movq -0x3b0(%rbp), %rdi
leaq 0x10ad(%rip), %rsi      # 0x7450
callq 0x30b0
movq %rax, -0x3b8(%rbp)
jmp 0x63b1
movq -0x190(%rbp), %rsi
leaq -0x110(%rbp), %rdi
movq %rdi, -0x3c8(%rbp)
callq 0x4ef0
movq -0x3c8(%rbp), %rdi
movq %rax, -0x3c0(%rbp)
movq -0x190(%rbp), %rsi
callq 0x4ef0
movq -0x3c0(%rbp), %rsi
movb 0x20(%rax), %cl
leaq 0x2e7f(%rip), %rax      # 0x9275
leaq 0x2df7(%rip), %rdx      # 0x91f4
testb $0x1, %cl
cmovneq %rax, %rdx
leaq -0x1b8(%rbp), %rdi
callq 0x7480
jmp 0x6412
movq -0x3b8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x3270
movq %rax, -0x3d0(%rbp)
jmp 0x642e
movl $0xa, %edi
callq 0x7430
movl %eax, -0x3d4(%rbp)
jmp 0x6440
movq -0x3d0(%rbp), %rdi
movl -0x3d4(%rbp), %eax
movl %eax, -0x1bc(%rbp)
movl -0x1bc(%rbp), %esi
callq 0x3320
movq %rax, -0x3e0(%rbp)
jmp 0x6467
movq -0x3e0(%rbp), %rdi
leaq 0x108b(%rip), %rsi      # 0x7500
callq 0x30b0
movq %rax, -0x3e8(%rbp)
jmp 0x6483
movq -0x190(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x4ef0
movq -0x3e8(%rbp), %rdi
movl 0x24(%rax), %esi
callq 0x3420
movq %rax, -0x3f0(%rbp)
jmp 0x64ae
movq -0x3f0(%rbp), %rdi
movq 0x6ae4(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x64c3
leaq -0x1b8(%rbp), %rdi
callq 0x34d8
movq -0x190(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x190(%rbp)
jmp 0x632f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x34d8
jmp 0x6511
leaq -0x110(%rbp), %rdi
callq 0x4d00
jmp 0x6ce3
leaq -0x110(%rbp), %rdi
callq 0x4d00
jmp 0x6d18
leaq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x73c0
movq %rax, %rdi
leaq 0x6e64(%rip), %rsi      # 0xd3a0
callq 0x4e60
testb $0x1, %al
jne 0x6547
jmp 0x6550
movb $0x1, -0x71(%rbp)
jmp 0x6ce1
leaq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x73c0
movq %rax, %rdi
leaq 0x6e16(%rip), %rsi      # 0xd380
callq 0x4e60
testb $0x1, %al
jne 0x6575
jmp 0x65a0
movq 0x6a44(%rip), %rdi      # 0xcfc0
leaq 0x6e3d(%rip), %rsi      # 0xd3c0
callq 0x3270
jmp 0x658a
jmp 0x6cdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6d18
leaq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x73c0
movq %rax, %rdi
leaq 0x6d46(%rip), %rsi      # 0xd300
callq 0x4e60
testb $0x1, %al
jne 0x65c8
jmp 0x668f
leaq -0xd8(%rbp), %rdi
callq 0x73e0
cmpq $0x2, %rax
jne 0x663b
leaq -0xd8(%rbp), %rdi
movl $0x1, %esi
callq 0x73c0
movq %rax, %rsi
leaq -0x1e0(%rbp), %rdi
callq 0x3120
jmp 0x65fc
leaq -0x70(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
xorl %edx, %edx
callq 0x48c0
jmp 0x6610
leaq -0x1e0(%rbp), %rdi
callq 0x34d8
jmp 0x668a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x34d8
jmp 0x6d18
movq 0x697e(%rip), %rdi      # 0xcfc0
leaq 0x6cb7(%rip), %rsi      # 0xd300
callq 0x3270
movq %rax, -0x3f8(%rbp)
jmp 0x6657
movq -0x3f8(%rbp), %rdi
leaq 0x2c34(%rip), %rsi      # 0x9299
callq 0x3290
movq %rax, -0x400(%rbp)
jmp 0x6673
movq -0x400(%rbp), %rdi
movq 0x691f(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x6688
jmp 0x668a
jmp 0x6cdd
leaq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x73c0
movq %rax, %rdi
leaq 0x6c37(%rip), %rsi      # 0xd2e0
callq 0x4e60
testb $0x1, %al
jne 0x66b7
jmp 0x67e1
leaq -0xd8(%rbp), %rdi
callq 0x73e0
cmpq $0x2, %rax
jne 0x678d
leaq -0xd8(%rbp), %rdi
movl $0x1, %esi
callq 0x73c0
movq %rax, %rsi
leaq -0x220(%rbp), %rdi
callq 0x3120
jmp 0x66ef
leaq -0x200(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x4960
jmp 0x6708
movq 0x68b1(%rip), %rdi      # 0xcfc0
leaq -0x200(%rbp), %rsi
callq 0x3270
movq %rax, -0x408(%rbp)
jmp 0x6724
movq -0x408(%rbp), %rdi
movq 0x686e(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x6739
leaq -0x200(%rbp), %rdi
callq 0x34d8
leaq -0x220(%rbp), %rdi
callq 0x34d8
jmp 0x67dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x677c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x34d8
leaq -0x220(%rbp), %rdi
callq 0x34d8
jmp 0x6d18
movq 0x682c(%rip), %rdi      # 0xcfc0
leaq 0x6b45(%rip), %rsi      # 0xd2e0
callq 0x3270
movq %rax, -0x410(%rbp)
jmp 0x67a9
movq -0x410(%rbp), %rdi
leaq 0x2ae2(%rip), %rsi      # 0x9299
callq 0x3290
movq %rax, -0x418(%rbp)
jmp 0x67c5
movq -0x418(%rbp), %rdi
movq 0x67cd(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x67da
jmp 0x67dc
jmp 0x6cdb
leaq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x73c0
movq %rax, %rdi
leaq 0x6b65(%rip), %rsi      # 0xd360
callq 0x4e60
testb $0x1, %al
jne 0x6809
jmp 0x6912
leaq -0x241(%rbp), %rdi
movq %rdi, -0x420(%rbp)
callq 0x3440
movq -0x420(%rbp), %rdx
leaq 0x29ca(%rip), %rsi      # 0x91f4
leaq -0x240(%rbp), %rdi
callq 0x4400
jmp 0x6838
leaq -0x269(%rbp), %rdi
movq %rdi, -0x428(%rbp)
callq 0x3440
movq -0x428(%rbp), %rdx
leaq 0x299b(%rip), %rsi      # 0x91f4
leaq -0x268(%rbp), %rdi
callq 0x4400
jmp 0x6867
leaq -0x70(%rbp), %rdi
leaq -0x240(%rbp), %rsi
leaq -0x268(%rbp), %rdx
callq 0x6de0
jmp 0x6880
leaq -0x268(%rbp), %rdi
callq 0x34d8
leaq -0x269(%rbp), %rdi
callq 0x32f0
leaq -0x240(%rbp), %rdi
callq 0x34d8
leaq -0x241(%rbp), %rdi
callq 0x32f0
jmp 0x6cd9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x68e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x34d8
leaq -0x269(%rbp), %rdi
callq 0x32f0
leaq -0x240(%rbp), %rdi
callq 0x34d8
leaq -0x241(%rbp), %rdi
callq 0x32f0
jmp 0x6d18
leaq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x73c0
movq %rax, %rdi
leaq 0x6a14(%rip), %rsi      # 0xd340
callq 0x4e60
testb $0x1, %al
jne 0x693a
jmp 0x6b8b
leaq -0xd8(%rbp), %rdi
callq 0x73e0
cmpq $0x2, %rax
jne 0x6b37
movq 0x6669(%rip), %rdi      # 0xcfc0
leaq 0x2951(%rip), %rsi      # 0x92af
callq 0x3290
movq %rax, -0x430(%rbp)
jmp 0x696c
movq -0x430(%rbp), %rdi
movq 0x6626(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x6981
leaq -0x290(%rbp), %rdi
callq 0x3380
leaq -0x2b0(%rbp), %rdi
movq %rdi, -0x438(%rbp)
callq 0x3380
movq -0x438(%rbp), %rsi
movq 0x6622(%rip), %rdi      # 0xcfd0
callq 0x3070
jmp 0x69b5
jmp 0x69b7
leaq 0x2836(%rip), %rsi      # 0x91f4
leaq -0x2b0(%rbp), %rdi
callq 0x7530
movb %al, -0x439(%rbp)
jmp 0x69d2
movb -0x439(%rbp), %al
testb $0x1, %al
jne 0x69e1
jmp 0x6a63
leaq 0x280b(%rip), %rdx      # 0x91f3
leaq -0x2d0(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x7480
jmp 0x69fd
leaq -0x290(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x3360
jmp 0x6a12
leaq -0x2d0(%rbp), %rdi
callq 0x34d8
movq 0x65ab(%rip), %rdi      # 0xcfd0
leaq -0x2b0(%rbp), %rsi
callq 0x3070
jmp 0x6a33
jmp 0x69b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6b1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x34d8
jmp 0x6b1a
leaq -0xd8(%rbp), %rdi
movl $0x1, %esi
callq 0x73c0
movq %rax, %rsi
leaq -0x2f0(%rbp), %rdi
callq 0x3120
jmp 0x6a85
leaq -0x310(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x3120
jmp 0x6a9a
leaq -0x70(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
leaq -0x310(%rbp), %rdx
callq 0x4a70
jmp 0x6ab3
leaq -0x310(%rbp), %rdi
callq 0x34d8
leaq -0x2f0(%rbp), %rdi
callq 0x34d8
leaq -0x2b0(%rbp), %rdi
callq 0x34d8
leaq -0x290(%rbp), %rdi
callq 0x34d8
jmp 0x6b86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x6b0e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x310(%rbp), %rdi
callq 0x34d8
leaq -0x2f0(%rbp), %rdi
callq 0x34d8
leaq -0x2b0(%rbp), %rdi
callq 0x34d8
leaq -0x290(%rbp), %rdi
callq 0x34d8
jmp 0x6d18
movq 0x6482(%rip), %rdi      # 0xcfc0
leaq 0x67fb(%rip), %rsi      # 0xd340
callq 0x3270
movq %rax, -0x448(%rbp)
jmp 0x6b53
movq -0x448(%rbp), %rdi
leaq 0x2738(%rip), %rsi      # 0x9299
callq 0x3290
movq %rax, -0x450(%rbp)
jmp 0x6b6f
movq -0x450(%rbp), %rdi
movq 0x6423(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x6b84
jmp 0x6b86
jmp 0x6cd7
leaq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x73c0
movq %rax, %rdi
leaq 0x677b(%rip), %rsi      # 0xd320
callq 0x4e60
testb $0x1, %al
jne 0x6bb3
jmp 0x6c7a
leaq -0xd8(%rbp), %rdi
callq 0x73e0
cmpq $0x2, %rax
jne 0x6c29
leaq -0xd8(%rbp), %rdi
movl $0x1, %esi
callq 0x73c0
movq %rax, %rsi
leaq -0x330(%rbp), %rdi
callq 0x3120
jmp 0x6be7
leaq -0x70(%rbp), %rdi
leaq -0x330(%rbp), %rsi
movl $0x1, %edx
callq 0x48c0
jmp 0x6bfe
leaq -0x330(%rbp), %rdi
callq 0x34d8
jmp 0x6c78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x330(%rbp), %rdi
callq 0x34d8
jmp 0x6d18
movq 0x6390(%rip), %rdi      # 0xcfc0
leaq 0x66e9(%rip), %rsi      # 0xd320
callq 0x3270
movq %rax, -0x458(%rbp)
jmp 0x6c45
movq -0x458(%rbp), %rdi
leaq 0x2673(%rip), %rsi      # 0x92c6
callq 0x3290
movq %rax, -0x460(%rbp)
jmp 0x6c61
movq -0x460(%rbp), %rdi
movq 0x6331(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x6c76
jmp 0x6c78
jmp 0x6cd5
movq 0x633f(%rip), %rdi      # 0xcfc0
leaq 0x2657(%rip), %rsi      # 0x92df
callq 0x3290
movq %rax, -0x468(%rbp)
jmp 0x6c96
xorl %eax, %eax
movl %eax, %esi
leaq -0xd8(%rbp), %rdi
callq 0x73c0
movq -0x468(%rbp), %rdi
movq %rax, %rsi
callq 0x3270
movq %rax, -0x470(%rbp)
jmp 0x6cbe
movq -0x470(%rbp), %rdi
movq 0x62d4(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x6cd3
jmp 0x6cd5
jmp 0x6cd7
jmp 0x6cd9
jmp 0x6cdb
jmp 0x6cdd
jmp 0x6cdf
jmp 0x6ce1
jmp 0x6ce3
leaq -0xd8(%rbp), %rdi
callq 0x7360
movl $0x0, -0xc0(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x34d8
movl -0xc0(%rbp), %eax
testl %eax, %eax
je 0x6d16
jmp 0x6d11
jmp 0x5f63
jmp 0x6d96
leaq -0xd8(%rbp), %rdi
callq 0x7360
leaq -0x98(%rbp), %rdi
callq 0x34d8
movl -0x4c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x6dc5
movq -0x48(%rbp), %rdi
callq 0x3100
movq %rax, -0x338(%rbp)
movq -0x338(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, %rsi
movq 0x6256(%rip), %rdi      # 0xcfc0
callq 0x3290
movq %rax, -0x478(%rbp)
jmp 0x6d78
movq -0x478(%rbp), %rdi
movq 0x621a(%rip), %rsi      # 0xcfa0
callq 0x32c0
jmp 0x6d8d
callq 0x33e0
jmp 0x6d94
jmp 0x6d96
jmp 0x5f63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x33e0
jmp 0x6dae
jmp 0x6dc5
leaq -0x70(%rbp), %rdi
callq 0x7560
movl -0x4(%rbp), %eax
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
leaq -0x70(%rbp), %rdi
callq 0x7560
movq -0x48(%rbp), %rdi
callq 0x3430
movq %rax, %rdi
callq 0x44b0
nop