// File: /workspace/github_cpp_makefile_star2_O3/mbourand[P]webserv/srcs/Methods/GetMethod.cpp
// Function: GetMethod::directory_listing(Request const&, ConfigContext const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Response GetMethod::directory_listing(const Request& request, const ConfigContext&, const std::string &realPath)
{
	const URL& url = request._url;
	std::list<std::string> list;
	try
	{
		list = list_directory(realPath);
	}
	catch (std::exception& e)
	{
		if (errno == ENOENT)
			return Logger::print("Directory not found", Response(404, url._path), ERROR, VERBOSE);
		if (errno == EACCES)
			return Logger::print("Permission denied", Response(403, url._path), ERROR, VERBOSE);
		if (errno != 0)
			return Logger::print("Unknown error while trying to open directory", Response(500, url._path), ERROR, NORMAL);
	}


	std::string body =
"<html>\r\n\
	<head>\r\n\
		<title>Index</title>\r\n\
		<style>\r\n\
			table{\r\n\
				width:100%;\r\n\
			}\r\n\
			table td{\r\n\
				white-space: nowrap;\r\n\
				border: none;\r\n\
				padding-right: 20;\r\n\
			}\r\n\
			table td:last-child{\r\n\
				width:100%;\r\n\
			}\r\n\
		</style>\r\n\
	</head>\r\n\
	<body>\r\n\
		<style>\r\n\
			table, td {\r\n\
				border: 1px solid black;\r\n\
			}\r\n\
\r\n\
			table {\r\n\
				width: 100%;\r\n\
				border-collapse: collapse;\r\n\
			}\r\n\
		</style>\r\n\
\r\n\
		<h1 align=\"center\">Index of " + url._path + "/</h1>\r\n\
		<hr>\r\n\
		<table style=\"border: none;\">\r\n\
			<tbody>\r\n\
				<tr>\r\n\
					<th>Name</th>\r\n\
					<th>Last Modified</th>\r\n\
					<th>Size</th>\r\n\
					<th></th>\r\n\
				</tr>";

	for (std::list<std::string>::iterator it = list.begin(); it != list.end(); it++)
	{
		std::string path = realPath + "/" + *it;
		body +=
"				<tr>\r\n\
					<td><a href=\"" + url._path + "/" + *it + "\">" + *it + "</a></td>\r\n\
					<td>" + (path[path.size() - 1] == '/' ? "-" : get_last_modified_format(path, "%d-%b-%Y %H:%M")) + "</td>\r\n\
					<td>" + (path[path.size() - 1] == '/' ? "-" : get_file_size(path)) + "</td>\r\n\
					<td></td>\r\n\
				</tr>\r\n";
	}
	body +=
"			</tbody>\r\n\
		</table>\r\n\
	</body>\r\n\
</html>";


	Response response(200, url._path.substr(0, url._path.size() - 1));
	std::ostringstream convert;

	convert << body.size();
	response.addHeader("Content-Length", convert.str());
	response.setBody(body);
	convert.str("");
	response.addDateHeader();
	response.addHeader("Server", "Webserv");
	response.addHeader("Content-Type", "text/html; charset=UTF-8");

	return response;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5b8, %rsp            # imm = 0x5B8
movq %rdx, %r14
movq %rdi, 0x48(%rsp)
leaq 0x198(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
movq $0x0, 0x10(%rax)
leaq 0x260(%rsp), %rdi
movq %r8, 0x1d8(%rsp)
movq %r8, %rdx
callq 0xa2fe
leaq 0x198(%rsp), %rdi
leaq 0x260(%rsp), %rbx
movq %rbx, %rsi
callq 0xebf6
movq %rbx, %rdi
callq 0x96b6
leaq 0xb8(%r14), %rdx
leaq 0x2fa5d(%rip), %rsi     # 0x3a3fb
leaq 0x260(%rsp), %rdi
movq %rdx, 0x130(%rsp)
callq 0xe2cb
leaq 0x2fbf1(%rip), %rsi     # 0x3a5ab
leaq 0x260(%rsp), %rdi
callq 0x78d0
leaq 0x120(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %r14, 0x1d0(%rsp)
je 0xa9ff
movq %rdx, 0x110(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x120(%rsp)
jmp 0xaa05
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x118(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x270(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0xaa41
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x198(%rsp), %r12
leaq 0x198(%rsp), %rax
cmpq %rax, %r12
je 0xb29a
leaq 0x18(%rsp), %rbp
leaq 0x8(%rsp), %r15
leaq 0x1e0(%rsp), %rcx
movq %rcx, %r13
movq %rbp, 0x8(%rsp)
movq 0x1d8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x8a92
movq %r15, %rdi
leaq 0x2fffc(%rip), %rsi     # 0x3aa94
callq 0x78d0
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
movq %r15, %rbx
movq %r15, %rdi
callq 0x7190
movq %r14, 0x260(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xaade
movq %rdx, 0x260(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x270(%rsp)
jmp 0xaae5
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x268(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xab17
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %r15
movq %r13, %rdi
leaq 0x2fb2d(%rip), %rsi     # 0x3a651
movq 0x130(%rsp), %rdx
callq 0xe2cb
movq %r15, %rdi
leaq 0x2ff59(%rip), %rsi     # 0x3aa94
callq 0x78d0
leaq 0x60(%rsp), %rsi
movq %rsi, 0x50(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xab68
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0xab6e
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
leaq 0x50(%rsp), %rdi
callq 0x7190
leaq 0x148(%rsp), %rsi
movq %rsi, 0x138(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xabce
movq %rdx, 0x138(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x148(%rsp)
jmp 0xabd4
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x140(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x138(%rsp), %rdi
leaq 0x2fa70(%rip), %rsi     # 0x3a66e
callq 0x78d0
leaq 0x168(%rsp), %rsi
movq %rsi, 0x158(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xac37
movq %rdx, 0x158(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x168(%rsp)
jmp 0xac3d
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x160(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
leaq 0x158(%rsp), %rdi
callq 0x7190
leaq 0x188(%rsp), %rsi
movq %rsi, 0x178(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xaca3
movq %rdx, 0x178(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x188(%rsp)
jmp 0xaca9
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x180(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x178(%rsp), %rdi
leaq 0x2f99e(%rip), %rsi     # 0x3a671
callq 0x78d0
leaq 0xa0(%rsp), %rsi
movq %rsi, 0x90(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x1b0(%rsp), %r15
je 0xad14
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0xad1a
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x98(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x260(%rsp), %rax
movq 0x268(%rsp), %rcx
movb -0x1(%rax,%rcx), %r14b
cmpb $0x2f, %r14b
jne 0xad7d
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0xf0(%rsp), %rdi
leaq 0x2fe89(%rip), %rsi     # 0x3abf8
leaq 0x2fe83(%rip), %rdx     # 0x3abf9
callq 0x80f4
jmp 0xadbb
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %r15, %rdi
leaq 0x2f8ef(%rip), %rsi     # 0x3a686
leaq 0x2f8f6(%rip), %rdx     # 0x3a694
callq 0x80f4
leaq 0xf0(%rsp), %rdi
leaq 0x260(%rsp), %rdx
movq %r15, %rcx
callq 0xa67a
movq 0x90(%rsp), %rcx
movl $0xf, %edi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rcx
je 0xaddd
movq 0xa0(%rsp), %rdi
movq 0x98(%rsp), %r8
movq 0xf0(%rsp), %rsi
movq 0xf8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0xae1d
movl $0xf, %edi
leaq 0x100(%rsp), %r9
cmpq %r9, %rsi
je 0xae18
movq 0x100(%rsp), %rdi
cmpq %rdi, %rax
jbe 0xae2c
leaq 0x90(%rsp), %rdi
callq 0x7190
jmp 0xae3d
leaq 0xf0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7500
leaq 0x80(%rsp), %rsi
movq %rsi, 0x70(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xae68
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0xae6e
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x78(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x70(%rsp), %rdi
leaq 0x2f7de(%rip), %rsi     # 0x3a675
callq 0x78d0
leaq 0xc0(%rsp), %rsi
movq %rsi, 0xb0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xaed0
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0xaed6
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xb8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x260(%rsp), %rax
movq 0x268(%rsp), %rcx
cmpb $0x2f, -0x1(%rax,%rcx)
jne 0xaf35
leaq 0xe0(%rsp), %rax
movq %rax, 0xd0(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0x2fcd1(%rip), %rsi     # 0x3abf8
leaq 0x2fccb(%rip), %rdx     # 0x3abf9
callq 0x80f4
jmp 0xaf4a
leaq 0xd0(%rsp), %rdi
leaq 0x260(%rsp), %rdx
callq 0xa874
movq 0xb0(%rsp), %rcx
movl $0xf, %edi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rcx
je 0xaf6c
movq 0xc0(%rsp), %rdi
movq 0xb8(%rsp), %r8
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
jbe 0xafac
movl $0xf, %edi
leaq 0xe0(%rsp), %r9
cmpq %r9, %rsi
je 0xafa7
movq 0xe0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0xafbb
leaq 0xb0(%rsp), %rdi
callq 0x7190
jmp 0xafcc
leaq 0xd0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7500
leaq 0x38(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xaff1
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0xaff7
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x28(%rsp), %rdi
leaq 0x2f675(%rip), %rsi     # 0x3a695
callq 0x78d0
movq %rbp, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb048
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xb04f
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x110(%rsp), %rdi
callq 0x7190
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb095
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb0b1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xb0d6
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0xb0fb
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xb11d
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0xb142
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x74b0
cmpb $0x2f, %r14b
leaq 0x270(%rsp), %r14
movq %r13, %rcx
je 0xb17b
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0xb17b
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %rcx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0xb1a3
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %rcx
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0xb1cb
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %rcx
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0xb1f3
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %rcx
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0xb21b
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %rcx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xb23a
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %rcx
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0xb262
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %rcx
movq 0x260(%rsp), %rdi
cmpq %r14, %rdi
je 0xb282
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %rcx
movq (%r12), %r12
leaq 0x198(%rsp), %rax
cmpq %rax, %r12
movq %rbx, %r15
jne 0xaa6c
leaq 0x2f417(%rip), %rsi     # 0x3a6b8
leaq 0x110(%rsp), %rdi
callq 0x78d0
movq 0x1d0(%rsp), %rax
movq 0xc0(%rax), %rcx
decq %rcx
leaq 0x260(%rsp), %rdi
movq 0x130(%rsp), %rsi
xorl %edx, %edx
callq 0x74d0
movq 0x48(%rsp), %r12
leaq 0x260(%rsp), %rdx
movq %r12, %rdi
movl $0xc8, %esi
callq 0x36f58
movq 0x260(%rsp), %rdi
cmpq %r14, %rdi
je 0xb30e
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x260(%rsp), %rdi
callq 0x75e0
movq 0x118(%rsp), %rsi
leaq 0x260(%rsp), %rdi
callq 0x7330
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2edc4(%rip), %rsi     # 0x3a104
leaq 0x2edcb(%rip), %rdx     # 0x3a112
leaq 0x8(%rsp), %rdi
callq 0x80f4
leaq 0x268(%rsp), %rbx
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x7710
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x37020
leaq 0x38(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0xb393
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xb3aa
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x110(%rsp), %rsi
movq %r12, %rdi
callq 0x37b04
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x2f9d2(%rip), %rdx     # 0x3ad9b
movq %rdx, %rsi
callq 0x80f4
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x7690
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xb3f5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r12, %rdi
callq 0x373a0
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x2ee8b(%rip), %rsi     # 0x3a297
leaq 0x2ee8a(%rip), %rdx     # 0x3a29d
callq 0x80f4
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x2f7b5(%rip), %rsi     # 0x3abdc
leaq 0x2f7b5(%rip), %rdx     # 0x3abe3
callq 0x80f4
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x37020
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xb45c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xb473
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x2ecd0(%rip), %rsi     # 0x3a152
leaq 0x2ecd5(%rip), %rdx     # 0x3a15e
callq 0x80f4
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x2f246(%rip), %rsi     # 0x3a6e3
leaq 0x2f257(%rip), %rdx     # 0x3a6fb
callq 0x80f4
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x37020
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xb4d2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xb4e9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x42ab0(%rip), %rsi     # 0x4dfa0
leaq 0x260(%rsp), %rdi
callq 0x72b0
leaq 0x2d0(%rsp), %rdi
callq 0x71c0
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0xb52f
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x198(%rsp), %rdi
callq 0x96b6
movq %r12, %rax
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb55a
jmp 0xb597
jmp 0xb881
movq %rax, %r13
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
jne 0xb588
jmp 0xb59a
jmp 0xb597
jmp 0xb881
jmp 0xb597
jmp 0xb881
movq %rax, %r13
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb59a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0xb59a
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xb884
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0xb884
jmp 0xb881
movq %rax, %r13
jmp 0xb8a5
jmp 0xb905
jmp 0xb8e0
jmp 0xb8e0
movq %rax, %r13
leaq 0x270(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbb79
movq 0x270(%rsp), %rsi
jmp 0xbb71
movq %rax, %r13
jmp 0xbb79
movq %rax, %r13
cmpl $0x1, %edx
jne 0xbb79
movq %r13, %rdi
callq 0x7210
callq 0x7070
movl (%rax), %eax
testl %eax, %eax
je 0xb6b4
cmpl $0xd, %eax
je 0xb6bb
cmpl $0x2, %eax
jne 0xb734
leaq 0x250(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2ed5d(%rip), %rsi     # 0x3a3a8
leaq 0x2ed69(%rip), %rdx     # 0x3a3bb
leaq 0x240(%rsp), %rdi
callq 0x80f4
leaq 0xb8(%r14), %rdx
leaq 0x518(%rsp), %rdi
movl $0x194, %esi            # imm = 0x194
callq 0x36f58
leaq 0x240(%rsp), %rsi
leaq 0x518(%rsp), %rdx
movq 0x48(%rsp), %rdi
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0xe204
leaq 0x518(%rsp), %rdi
callq 0x36d9a
movq 0x240(%rsp), %rdi
jmp 0xb7ae
movb $0x1, %bl
jmp 0xb7c0
leaq 0x230(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2ecee(%rip), %rsi     # 0x3a3bc
leaq 0x2ecf8(%rip), %rdx     # 0x3a3cd
leaq 0x220(%rsp), %rdi
callq 0x80f4
leaq 0xb8(%r14), %rdx
leaq 0x478(%rsp), %rdi
movl $0x193, %esi            # imm = 0x193
callq 0x36f58
leaq 0x220(%rsp), %rsi
leaq 0x478(%rsp), %rdx
movq 0x48(%rsp), %rdi
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0xe204
leaq 0x478(%rsp), %rdi
callq 0x36d9a
movq 0x220(%rsp), %rdi
jmp 0xb7ae
leaq 0x210(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2ec87(%rip), %rsi     # 0x3a3ce
leaq 0x2ecac(%rip), %rdx     # 0x3a3fa
leaq 0x200(%rsp), %rdi
callq 0x80f4
leaq 0xb8(%r14), %rdx
leaq 0x3d8(%rsp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x36f58
leaq 0x200(%rsp), %rsi
leaq 0x3d8(%rsp), %rdx
movq 0x48(%rsp), %rdi
movl $0x3, %ecx
movl $0x1, %r8d
callq 0xe204
leaq 0x3d8(%rsp), %rdi
callq 0x36d9a
movq 0x200(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb7be
movq (%rbx), %rsi
incq %rsi
callq 0x74b0
xorl %ebx, %ebx
callq 0x7780
testb %bl, %bl
movq 0x48(%rsp), %r12
jne 0xa990
jmp 0xb52f
movq %rax, %r13
leaq 0x3d8(%rsp), %rdi
callq 0x36d9a
jmp 0xb7ec
movq %rax, %r13
movq 0x200(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb86a
movq 0x210(%rsp), %rsi
jmp 0xb85d
jmp 0xb867
movq %rax, %r13
leaq 0x478(%rsp), %rdi
callq 0x36d9a
jmp 0xb81a
movq %rax, %r13
movq 0x220(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb86a
movq 0x230(%rsp), %rsi
jmp 0xb85d
jmp 0xb867
movq %rax, %r13
leaq 0x518(%rsp), %rdi
callq 0x36d9a
jmp 0xb848
movq %rax, %r13
movq 0x240(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb86a
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0xb86a
movq %rax, %r13
callq 0x7780
jmp 0xbb79
jmp 0xb5fb
movq %rax, %rdi
callq 0x96aa
movq %rax, %r13
movq 0x42715(%rip), %rsi     # 0x4dfa0
leaq 0x260(%rsp), %rdi
callq 0x72b0
leaq 0x2d0(%rsp), %rdi
callq 0x71c0
movq 0x48(%rsp), %rdi
callq 0x36d9a
jmp 0xbb54
jmp 0xb8b6
movq %rax, %r13
leaq 0x270(%rsp), %r14
leaq 0x60(%rsp), %rbx
jmp 0xba67
movq %rax, %r13
leaq 0x270(%rsp), %r14
leaq 0x60(%rsp), %rbx
jmp 0xba42
movq %rax, %r13
jmp 0xbb54
jmp 0xb8ea
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xbb54
movq 0x18(%rsp), %rsi
jmp 0xbb4c
movq %rax, %r13
jmp 0xbb37
movq %rax, %r13
jmp 0xbb12
movq %rax, %r13
leaq 0x60(%rsp), %rbx
jmp 0xbafb
movq %rax, %r13
leaq 0x60(%rsp), %rbx
jmp 0xbad6
movq %rax, %r13
leaq 0x60(%rsp), %rbx
jmp 0xbab1
movq %rax, %r13
leaq 0x60(%rsp), %rbx
jmp 0xba8c
movq %rax, %r13
jmp 0xba0a
movq %rax, %r13
jmp 0xb9e8
movq %rax, %r13
jmp 0xb9c3
movq %rax, %r13
jmp 0xb99e
movq %rax, %r13
jmp 0xb982
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb982
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb99e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xb9c3
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0xb9e8
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xba0a
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0xba2f
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x74b0
cmpb $0x2f, %r14b
leaq 0x270(%rsp), %r14
leaq 0x60(%rsp), %rbx
je 0xba67
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0xba67
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0xba8c
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0xbab1
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0xbad6
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0xbafb
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0xbb12
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0xbb37
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x260(%rsp), %rdi
cmpq %r14, %rdi
je 0xbb54
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0xbb79
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x198(%rsp), %rdi
callq 0x96b6
movq %r13, %rdi
callq 0x7810