// File: /workspace/github_cpp_makefile_star2_O1/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 0xa328
leaq 0x198(%rsp), %rdi
leaq 0x260(%rsp), %rbx
movq %rbx, %rsi
callq 0xec44
movq %rbx, %rdi
callq 0x96d8
leaq 0xb8(%r14), %rdx
leaq 0x2fa33(%rip), %rsi     # 0x3a3fb
leaq 0x260(%rsp), %rdi
movq %rdx, 0x130(%rsp)
callq 0xe31d
leaq 0x2fbc7(%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 0xaa29
movq %rdx, 0x110(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x120(%rsp)
jmp 0xaa2f
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), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0xaa6b
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x198(%rsp), %rbp
leaq 0x198(%rsp), %rax
cmpq %rax, %rbp
je 0xb2e5
leaq 0x18(%rsp), %rax
leaq 0x8(%rsp), %r13
leaq 0x2ffff(%rip), %r14     # 0x3aa94
leaq 0x1e0(%rsp), %rcx
movq %rcx, %rbx
movq %rax, 0x8(%rsp)
movq 0x1d8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x8a8a
movq %r13, %rdi
movq %r14, %rsi
callq 0x78d0
movq 0x10(%rbp), %rsi
movq 0x18(%rbp), %rdx
movq %r13, %r12
movq %r13, %rdi
callq 0x7190
movq %r15, 0x260(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xab09
movq %rdx, 0x260(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x270(%rsp)
jmp 0xab10
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x268(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xab47
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %r13
movq %rbx, %rdi
leaq 0x2fafd(%rip), %rsi     # 0x3a651
movq 0x130(%rsp), %rdx
callq 0xe31d
movq %r13, %rdi
movq %r14, %rsi
callq 0x78d0
leaq 0x60(%rsp), %rsi
movq %rsi, 0x50(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xab94
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0xab9a
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(%rbp), %rsi
movq 0x18(%rbp), %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 0xabf8
movq %rdx, 0x138(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x148(%rsp)
jmp 0xabfe
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 0x2fa46(%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 0xac61
movq %rdx, 0x158(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x168(%rsp)
jmp 0xac67
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(%rbp), %rsi
movq 0x18(%rbp), %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 0xaccb
movq %rdx, 0x178(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x188(%rsp)
jmp 0xacd1
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 0x2f976(%rip), %rsi     # 0x3a671
callq 0x78d0
leaq 0xe0(%rsp), %rsi
movq %rsi, 0xd0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x1b0(%rsp), %r13
je 0xad3c
movq %rdx, 0xd0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe0(%rsp)
jmp 0xad42
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xd8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x260(%rsp), %rax
movq 0x268(%rsp), %rcx
movb -0x1(%rax,%rcx), %r15b
cmpb $0x2f, %r15b
setne %r14b
je 0xadbc
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq %r13, %rdi
leaq 0x2f8f0(%rip), %rsi     # 0x3a686
leaq 0x2f8f7(%rip), %rdx     # 0x3a694
callq 0x80f4
leaq 0xb0(%rsp), %rdi
leaq 0x260(%rsp), %rdx
movq %r13, %rcx
callq 0xa6a4
jmp 0xade7
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0x2fe1d(%rip), %rsi     # 0x3abf8
leaq 0x2fe17(%rip), %rdx     # 0x3abf9
callq 0x80f4
movq 0xd0(%rsp), %rcx
movl $0xf, %esi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rcx
je 0xae09
movq 0xe0(%rsp), %rsi
movq 0xd8(%rsp), %r8
movq 0xb8(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0xae46
movl $0xf, %esi
leaq 0xc0(%rsp), %rdi
cmpq %rdi, 0xb0(%rsp)
je 0xae41
movq 0xc0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xae5d
movq 0xb0(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x7190
jmp 0xae6e
leaq 0xb0(%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 0xae99
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0xae9f
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 0x2f7ad(%rip), %rsi     # 0x3a675
callq 0x78d0
leaq 0x100(%rsp), %rsi
movq %rsi, 0xf0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xaf01
movq %rdx, 0xf0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x100(%rsp)
jmp 0xaf07
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xf8(%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 0xaf66
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x2fca0(%rip), %rsi     # 0x3abf8
leaq 0x2fc9a(%rip), %rdx     # 0x3abf9
callq 0x80f4
jmp 0xaf7b
leaq 0x90(%rsp), %rdi
leaq 0x260(%rsp), %rdx
callq 0xa89e
movq 0xf0(%rsp), %rcx
movl $0xf, %esi
leaq 0x100(%rsp), %rax
cmpq %rax, %rcx
je 0xaf9d
movq 0x100(%rsp), %rsi
movq 0xf8(%rsp), %r8
movq 0x98(%rsp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
jbe 0xafda
movl $0xf, %esi
leaq 0xa0(%rsp), %rdi
cmpq %rdi, 0x90(%rsp)
je 0xafd5
movq 0xa0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0xaff1
movq 0x90(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
callq 0x7190
jmp 0xb002
leaq 0x90(%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 0xb027
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0xb02d
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 0x2f63f(%rip), %rsi     # 0x3a695
callq 0x78d0
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xb083
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0xb089
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
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
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb0d4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
leaq 0x2f9ac(%rip), %r14     # 0x3aa94
je 0xb0f7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0xb11c
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0xb141
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xb163
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0xb188
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x74b0
cmpb $0x2f, %r15b
leaq 0x270(%rsp), %r15
movq %rbx, %rcx
je 0xb1c1
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0xb1c1
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rcx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xb1e9
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rcx
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0xb211
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rcx
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0xb239
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rcx
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0xb261
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rcx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xb280
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rcx
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0xb2a8
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rcx
movq 0x260(%rsp), %rdi
cmpq %r15, %rdi
je 0xb2c8
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rcx
movq (%rbp), %rbp
leaq 0x198(%rsp), %rax
cmpq %rax, %rbp
movq %r12, %r13
leaq 0x18(%rsp), %rax
jne 0xaa9d
leaq 0x2f3cc(%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 0x37384
movq 0x260(%rsp), %rdi
cmpq %r15, %rdi
je 0xb359
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 0x2ed79(%rip), %rsi     # 0x3a104
leaq 0x2ed80(%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 0x3744c
leaq 0x38(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0xb3de
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xb3f5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x110(%rsp), %rsi
movq %r12, %rdi
callq 0x37f32
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x2f987(%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 0xb440
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r12, %rdi
callq 0x377cc
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x2ee40(%rip), %rsi     # 0x3a297
leaq 0x2ee3f(%rip), %rdx     # 0x3a29d
callq 0x80f4
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x2f76a(%rip), %rsi     # 0x3abdc
leaq 0x2f76a(%rip), %rdx     # 0x3abe3
callq 0x80f4
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x3744c
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xb4a7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xb4be
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x2ec85(%rip), %rsi     # 0x3a152
leaq 0x2ec8a(%rip), %rdx     # 0x3a15e
callq 0x80f4
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x2f1fb(%rip), %rsi     # 0x3a6e3
leaq 0x2f20c(%rip), %rdx     # 0x3a6fb
callq 0x80f4
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x3744c
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xb51d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xb534
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x42a65(%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 0xb57a
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x198(%rsp), %rdi
callq 0x96d8
movq %r12, %rax
addq $0x5b8, %rsp            # imm = 0x5B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb5a5
jmp 0xb5e2
jmp 0xb8cc
movq %rax, %r13
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
jne 0xb5d3
jmp 0xb5e5
jmp 0xb5e2
jmp 0xb8cc
jmp 0xb5e2
jmp 0xb8cc
movq %rax, %r13
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb5e5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0xb5e5
movq %rax, %r13
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xb8cf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0xb8cf
jmp 0xb8cc
movq %rax, %r13
jmp 0xb8f0
jmp 0xb954
jmp 0xb92a
jmp 0xb92a
movq %rax, %r13
leaq 0x270(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbbcf
movq 0x270(%rsp), %rsi
jmp 0xbbc7
movq %rax, %r13
jmp 0xbbcf
movq %rax, %r13
cmpl $0x1, %edx
jne 0xbbcf
movq %r13, %rdi
callq 0x7210
callq 0x7070
movl (%rax), %eax
testl %eax, %eax
je 0xb6ff
cmpl $0xd, %eax
je 0xb706
cmpl $0x2, %eax
jne 0xb77f
leaq 0x250(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2ed12(%rip), %rsi     # 0x3a3a8
leaq 0x2ed1e(%rip), %rdx     # 0x3a3bb
leaq 0x240(%rsp), %rdi
callq 0x80f4
leaq 0xb8(%r14), %rdx
leaq 0x518(%rsp), %rdi
movl $0x194, %esi            # imm = 0x194
callq 0x37384
leaq 0x240(%rsp), %rsi
leaq 0x518(%rsp), %rdx
movq 0x48(%rsp), %rdi
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0xe256
leaq 0x518(%rsp), %rdi
callq 0x371c6
movq 0x240(%rsp), %rdi
jmp 0xb7f9
movb $0x1, %bl
jmp 0xb80b
leaq 0x230(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2eca3(%rip), %rsi     # 0x3a3bc
leaq 0x2ecad(%rip), %rdx     # 0x3a3cd
leaq 0x220(%rsp), %rdi
callq 0x80f4
leaq 0xb8(%r14), %rdx
leaq 0x478(%rsp), %rdi
movl $0x193, %esi            # imm = 0x193
callq 0x37384
leaq 0x220(%rsp), %rsi
leaq 0x478(%rsp), %rdx
movq 0x48(%rsp), %rdi
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0xe256
leaq 0x478(%rsp), %rdi
callq 0x371c6
movq 0x220(%rsp), %rdi
jmp 0xb7f9
leaq 0x210(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2ec3c(%rip), %rsi     # 0x3a3ce
leaq 0x2ec61(%rip), %rdx     # 0x3a3fa
leaq 0x200(%rsp), %rdi
callq 0x80f4
leaq 0xb8(%r14), %rdx
leaq 0x3d8(%rsp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x37384
leaq 0x200(%rsp), %rsi
leaq 0x3d8(%rsp), %rdx
movq 0x48(%rsp), %rdi
movl $0x3, %ecx
movl $0x1, %r8d
callq 0xe256
leaq 0x3d8(%rsp), %rdi
callq 0x371c6
movq 0x200(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb809
movq (%rbx), %rsi
incq %rsi
callq 0x74b0
xorl %ebx, %ebx
callq 0x7780
testb %bl, %bl
movq 0x48(%rsp), %r12
jne 0xa9ba
jmp 0xb57a
movq %rax, %r13
leaq 0x3d8(%rsp), %rdi
callq 0x371c6
jmp 0xb837
movq %rax, %r13
movq 0x200(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb8b5
movq 0x210(%rsp), %rsi
jmp 0xb8a8
jmp 0xb8b2
movq %rax, %r13
leaq 0x478(%rsp), %rdi
callq 0x371c6
jmp 0xb865
movq %rax, %r13
movq 0x220(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb8b5
movq 0x230(%rsp), %rsi
jmp 0xb8a8
jmp 0xb8b2
movq %rax, %r13
leaq 0x518(%rsp), %rdi
callq 0x371c6
jmp 0xb893
movq %rax, %r13
movq 0x240(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb8b5
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0xb8b5
movq %rax, %r13
callq 0x7780
jmp 0xbbcf
jmp 0xb646
movq %rax, %rdi
callq 0x96cc
movq %rax, %r13
movq 0x426ca(%rip), %rsi     # 0x4dfa0
leaq 0x260(%rsp), %rdi
callq 0x72b0
leaq 0x2d0(%rsp), %rdi
callq 0x71c0
movq 0x48(%rsp), %rdi
callq 0x371c6
jmp 0xbbaa
movq %rax, %r13
leaq 0x270(%rsp), %r15
leaq 0x60(%rsp), %rbx
jmp 0xbabd
movq %rax, %r13
movb $0x1, %r14b
jmp 0xba83
movq %rax, %r13
movb $0x1, %r14b
jmp 0xbaad
movq %rax, %r13
jmp 0xbbaa
jmp 0xb934
movq %rax, %r13
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbbaa
movq 0x18(%rsp), %rsi
jmp 0xbba2
movq %rax, %r13
jmp 0xbb8d
movq %rax, %r13
jmp 0xbb68
movq %rax, %r13
leaq 0x60(%rsp), %rbx
jmp 0xbb51
movq %rax, %r13
leaq 0x60(%rsp), %rbx
jmp 0xbb2c
movq %rax, %r13
leaq 0x60(%rsp), %rbx
jmp 0xbb07
movq %rax, %r13
leaq 0x60(%rsp), %rbx
jmp 0xbae2
movq %rax, %r13
jmp 0xba5e
movq %rax, %r13
jmp 0xba3c
movq %rax, %r13
jmp 0xba17
movq %rax, %r13
jmp 0xb9f2
movq %rax, %r13
jmp 0xb9d6
movq %rax, %r13
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb9d6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xb9f2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0xba17
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0xba3c
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xba5e
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0xba83
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x74b0
testb %r14b, %r14b
je 0xbaad
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0xbaad
movq 0x1c0(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x270(%rsp), %r15
leaq 0x60(%rsp), %rbx
testb %r14b, %r14b
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xbae2
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0xbb07
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0xbb2c
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0xbb51
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x50(%rsp), %rdi
cmpq %rbx, %rdi
je 0xbb68
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0xbb8d
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x260(%rsp), %rdi
cmpq %r15, %rdi
je 0xbbaa
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x110(%rsp), %rdi
leaq 0x120(%rsp), %rax
cmpq %rax, %rdi
je 0xbbcf
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x198(%rsp), %rdi
callq 0x96d8
movq %r13, %rdi
callq 0x7810