// File: mbourand[P]webserv/srcs/Methods/PostMethod.cpp
// Function: PostMethod::process(Request const&, ConfigContext const&, ServerSocket const&)
Response PostMethod::process(const Request& request, const ConfigContext& config, const ServerSocket& socket)
{
	const URL& url = request._url;
	int base_depth = 0;
	Response response(200, url._path); //change code on failure
	std::string realPath = config.rootPath(url._path, base_depth);
	try
	{
		realPath = ft::simplify_path(realPath, true, base_depth);
	}
	catch (std::exception& e)
	{
		return (response.setCode(404));
	}
	if (ft::is_directory(realPath))
	{
		try
		{
			std::string index = "/" + config.getParam("index").front();
			realPath += index;
		}
		catch (std::exception& e)
		{}
	}
	std::list<std::string> splitted = ft::split(realPath, "/");
	std::string extension = ft::get_extension(splitted.back());
	if ((!extension.empty() && config.getCGIExtensions().find(extension) != config.getCGIExtensions().end()) || (realPath.find(config.getParam("cgi_dir").front()) == 0))
	{
		try
		{
			CGI	cgi(request, config, socket, realPath);
			cgi.process(response);
		}
		catch(const CGI::CGIException &e)
		{
			Logger::print(e.what(), NULL, ERROR, NORMAL);
			response.setCode(e.code());
		}
	}
	else
	{
		std::fstream file(realPath.c_str());
		if (!file.good() || !file.is_open())
		{
			if (errno == ENOENT || errno == ENOTDIR)
				return Logger::print("File not found", response.setCode(404), ERROR, VERBOSE);
			if (errno == EACCES || errno == EISDIR)
				return Logger::print("Permission denied", response.setCode(403), ERROR, VERBOSE);
			return Logger::print("Unexpected error while trying to open file: " + std::string(strerror(errno)), response.setCode(500), ERROR, VERBOSE);
		}
		std::string content((std::istreambuf_iterator<char>(file)), (std::istreambuf_iterator<char>()));
		std::ostringstream convert;
		struct stat file_stats;
		lstat(realPath.c_str(), &file_stats);
		convert << file_stats.st_size;
		response.addHeader("Content-Length", convert.str());
		convert.str("");
		convert << file_stats.st_mtime;
		struct tm	time;
		strptime(std::string(convert.str()).c_str(), "%s", &time);
		if (time.tm_gmtoff > 0) // convert to GMT
			file_stats.st_mtim.tv_sec -= time.tm_gmtoff;
		if (time.tm_isdst) // substract Daylight saving time
			file_stats.st_mtim.tv_sec -= 3600;
		convert.str("");
		convert << file_stats.st_mtime;
		strptime(std::string(convert.str()).c_str(), "%s", &time);
		char		buffer[1024];
		strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S GMT", &time);
		response.addHeader("Last-Modified", buffer);
		convert.str("");
		response.addDateHeader();
		response.addHeader("Server", "Webserv");
		t_hnode	*hnode = g_webserv.file_formatname->GetNode(realPath.substr(realPath.find_last_of('.') + 1));
		if (hnode != NULL)
			response.addHeader("Content-Type", hnode->value + "; charset=UTF-8");
		response.setBody(content);
	}
	return response;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1240, %rsp           # imm = 0x1240
movq %rdi, -0x10e8(%rbp)
movq %rdi, %rax
movq %rax, -0x10e0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x30(%rbp), %rdx
addq $0x88, %rdx
leaq -0xd8(%rbp), %rdi
movl $0xc8, %esi
callq 0x636c0
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
addq $0x88, %rdx
leaq -0xf8(%rbp), %rdi
leaq -0x34(%rbp), %rcx
callq 0x4cd00
jmp 0x187a0
movl -0x34(%rbp), %ecx
leaq -0x128(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
movl $0x1, %edx
callq 0x32290
jmp 0x187bd
leaq -0xf8(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x97e0
leaq -0x128(%rbp), %rdi
callq 0x9c98
jmp 0x188aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19d67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
movl -0x104(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x19d5b
movq -0x100(%rbp), %rdi
callq 0x92a0
movq %rax, -0x130(%rbp)
leaq -0xd8(%rbp), %rdi
movl $0x194, %esi            # imm = 0x194
callq 0x64560
movq %rax, -0x10f0(%rbp)
jmp 0x1884a
movq -0x10f0(%rbp), %rsi
movq -0x10e8(%rbp), %rdi
callq 0x63570
jmp 0x1885f
movl $0x1, -0x134(%rbp)
callq 0x9a40
jmp 0x18889
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
callq 0x9a40
jmp 0x188a5
jmp 0x19d33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19d5b
jmp 0x19d5b
leaq -0x158(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x92c0
jmp 0x188bf
leaq -0x158(%rbp), %rdi
callq 0x31db0
movb %al, -0x10f1(%rbp)
jmp 0x188d3
leaq -0x158(%rbp), %rdi
callq 0x9c98
movb -0x10f1(%rbp), %al
testb $0x1, %al
jne 0x188ee
jmp 0x18a58
movq -0x20(%rbp), %rax
movq %rax, -0x1108(%rbp)
leaq -0x199(%rbp), %rdi
movq %rdi, -0x1100(%rbp)
callq 0x9b10
movq -0x1100(%rbp), %rdx
leaq 0x54801(%rip), %rsi     # 0x6d11b
leaq -0x198(%rbp), %rdi
callq 0xa780
jmp 0x18928
movq -0x1108(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x4c710
movq %rax, -0x1110(%rbp)
jmp 0x18944
movq -0x1110(%rbp), %rdi
callq 0x14310
movq %rax, %rdx
leaq 0x520fe(%rip), %rsi     # 0x6aa58
leaq -0x178(%rbp), %rdi
callq 0x14000
jmp 0x18968
leaq -0x198(%rbp), %rdi
callq 0x9c98
leaq -0x199(%rbp), %rdi
callq 0x9700
leaq -0xf8(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x9830
jmp 0x18995
leaq -0x178(%rbp), %rdi
callq 0x9c98
jmp 0x18a56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x9c98
jmp 0x19d5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x189fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x9c98
leaq -0x199(%rbp), %rdi
callq 0x9700
jmp 0x18a27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x9c98
movl -0x104(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x19d5b
movq -0x100(%rbp), %rdi
callq 0x92a0
movq %rax, -0x1a8(%rbp)
callq 0x9a40
jmp 0x18a54
jmp 0x18a56
jmp 0x18a58
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x1118(%rbp)
callq 0x9b10
movq -0x1118(%rbp), %rdx
leaq 0x51fdf(%rip), %rsi     # 0x6aa58
leaq -0x1e0(%rbp), %rdi
callq 0xa780
jmp 0x18a87
leaq -0x1c0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0x2f910
jmp 0x18aa3
leaq -0x1e0(%rbp), %rdi
callq 0x9c98
leaq -0x1e1(%rbp), %rdi
callq 0x9700
leaq -0x1c0(%rbp), %rdi
callq 0xce00
movq %rax, %rsi
leaq -0x228(%rbp), %rdi
callq 0x92c0
jmp 0x18ad8
leaq -0x208(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x32930
jmp 0x18aed
leaq -0x228(%rbp), %rdi
callq 0x9c98
leaq -0x208(%rbp), %rdi
callq 0x9a50
movb $0x0, -0x25a(%rbp)
movb $0x0, -0x25b(%rbp)
testb $0x1, %al
jne 0x18ba2
movq -0x20(%rbp), %rdi
callq 0x4c630
movq %rax, -0x1120(%rbp)
jmp 0x18b2d
movq -0x1120(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x14370
movq %rax, -0x1128(%rbp)
jmp 0x18b49
movq -0x1128(%rbp), %rax
movq %rax, -0x230(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4c630
movq %rax, -0x1130(%rbp)
jmp 0x18b69
movq -0x1130(%rbp), %rdi
callq 0x143a0
movq %rax, -0x238(%rbp)
leaq -0x230(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x14340
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x1131(%rbp)
jne 0x18c32
movq -0x20(%rbp), %rax
movq %rax, -0x1148(%rbp)
leaq -0x259(%rbp), %rdi
movq %rdi, -0x1140(%rbp)
callq 0x9b10
movq -0x1140(%rbp), %rdx
movb $0x1, -0x25a(%rbp)
leaq 0x51afc(%rip), %rsi     # 0x6a6d1
leaq -0x258(%rbp), %rdi
callq 0xa780
jmp 0x18be3
movq -0x1148(%rbp), %rdi
movb $0x1, -0x25b(%rbp)
leaq -0x258(%rbp), %rsi
callq 0x4c710
movq %rax, -0x1150(%rbp)
jmp 0x18c06
movq -0x1150(%rbp), %rdi
callq 0x14310
movq %rax, %rsi
leaq -0xf8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x9c80
cmpq $0x0, %rax
sete %al
movb %al, -0x1131(%rbp)
movb -0x1131(%rbp), %al
movb %al, -0x1151(%rbp)
testb $0x1, -0x25b(%rbp)
jne 0x18c49
jmp 0x18c55
leaq -0x258(%rbp), %rdi
callq 0x9c98
testb $0x1, -0x25a(%rbp)
jne 0x18c60
jmp 0x18c6c
leaq -0x259(%rbp), %rdi
callq 0x9700
movb -0x1151(%rbp), %al
testb $0x1, %al
jne 0x18c7b
jmp 0x18f0f
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x380(%rbp), %rdi
leaq -0xf8(%rbp), %r8
callq 0x1d8a0
jmp 0x18c9c
leaq -0x380(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x20e20
jmp 0x18cb1
leaq -0x380(%rbp), %rdi
callq 0x204c0
jmp 0x18eac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x18cf4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x9c98
leaq -0x1e1(%rbp), %rdi
callq 0x9700
jmp 0x19d5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19d25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x9c98
jmp 0x19d25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19d19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x18d95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
testb $0x1, -0x25b(%rbp)
jne 0x18d87
jmp 0x18d93
leaq -0x258(%rbp), %rdi
callq 0x9c98
jmp 0x18d95
testb $0x1, -0x25a(%rbp)
jne 0x18da0
jmp 0x18dac
leaq -0x259(%rbp), %rdi
callq 0x9700
jmp 0x19d19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x18de3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x204c0
movl -0x104(%rbp), %eax
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x19d19
movq -0x100(%rbp), %rdi
callq 0x92a0
movq %rax, -0x388(%rbp)
movq -0x388(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, -0x1168(%rbp)
leaq -0x3a9(%rbp), %rdi
movq %rdi, -0x1160(%rbp)
callq 0x9b10
movq -0x1168(%rbp), %rsi
movq -0x1160(%rbp), %rdx
leaq -0x3a8(%rbp), %rdi
callq 0xa780
jmp 0x18e4f
xorl %eax, %eax
movl %eax, %esi
leaq -0x3a8(%rbp), %rdi
movl $0x3, %edx
movl $0x1, %ecx
callq 0x138a0
jmp 0x18e6b
leaq -0x3a8(%rbp), %rdi
callq 0x9c98
leaq -0x3a9(%rbp), %rdi
callq 0x9700
movq -0x388(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movl %eax, %esi
leaq -0xd8(%rbp), %rdi
callq 0x64560
jmp 0x18ea3
callq 0x9a40
jmp 0x18eaa
jmp 0x18eac
jmp 0x19ce0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x18ee3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x9c98
leaq -0x3a9(%rbp), %rdi
callq 0x9700
jmp 0x18f03
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
callq 0x9a40
jmp 0x18f0a
jmp 0x19d19
leaq -0xf8(%rbp), %rdi
callq 0x92b0
movq %rax, -0x1178(%rbp)
movl $0x8, %edi
movl $0x10, %esi
callq 0x14730
movl %eax, -0x116c(%rbp)
jmp 0x18f39
movl -0x116c(%rbp), %edx
movq -0x1178(%rbp), %rsi
leaq -0x5c0(%rbp), %rdi
callq 0x9880
jmp 0x18f54
movq -0x5c0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x5c0(%rbp,%rax), %rdi
callq 0x9a80
movb %al, -0x1179(%rbp)
jmp 0x18f74
movb -0x1179(%rbp), %al
testb $0x1, %al
jne 0x18f80
jmp 0x18fa4
leaq -0x5c0(%rbp), %rdi
callq 0x9ac0
movb %al, -0x117a(%rbp)
jmp 0x18f94
movb -0x117a(%rbp), %al
testb $0x1, %al
jne 0x1938e
jmp 0x18fa4
callq 0x9080
cmpl $0x2, (%rax)
je 0x18fbc
callq 0x9080
cmpl $0x14, (%rax)
jne 0x190eb
leaq -0x5e1(%rbp), %rdi
movq %rdi, -0x1188(%rbp)
callq 0x9b10
movq -0x1188(%rbp), %rdx
leaq 0x516fc(%rip), %rsi     # 0x6a6d9
leaq -0x5e0(%rbp), %rdi
callq 0xa780
jmp 0x18feb
leaq -0xd8(%rbp), %rdi
movl $0x194, %esi            # imm = 0x194
callq 0x64560
movq %rax, -0x1190(%rbp)
jmp 0x19005
movq -0x1190(%rbp), %rsi
leaq -0x688(%rbp), %rdi
callq 0x63570
jmp 0x1901a
movq -0x10e8(%rbp), %rdi
leaq -0x5e0(%rbp), %rsi
leaq -0x688(%rbp), %rdx
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0x13ef0
jmp 0x1903e
leaq -0x688(%rbp), %rdi
callq 0x634e0
leaq -0x5e0(%rbp), %rdi
callq 0x9c98
leaq -0x5e1(%rbp), %rdi
callq 0x9700
movl $0x1, -0x134(%rbp)
jmp 0x19ca0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19cd2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x190da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x190ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x688(%rbp), %rdi
callq 0x634e0
leaq -0x5e0(%rbp), %rdi
callq 0x9c98
leaq -0x5e1(%rbp), %rdi
callq 0x9700
jmp 0x19cd2
callq 0x9080
cmpl $0xd, (%rax)
je 0x19103
callq 0x9080
cmpl $0x15, (%rax)
jne 0x1921b
leaq -0x6a9(%rbp), %rdi
movq %rdi, -0x1198(%rbp)
callq 0x9b10
movq -0x1198(%rbp), %rdx
leaq 0x5125c(%rip), %rsi     # 0x6a380
leaq -0x6a8(%rbp), %rdi
callq 0xa780
jmp 0x19132
leaq -0xd8(%rbp), %rdi
movl $0x193, %esi            # imm = 0x193
callq 0x64560
movq %rax, -0x11a0(%rbp)
jmp 0x1914c
movq -0x11a0(%rbp), %rsi
leaq -0x750(%rbp), %rdi
callq 0x63570
jmp 0x19161
movq -0x10e8(%rbp), %rdi
leaq -0x6a8(%rbp), %rsi
leaq -0x750(%rbp), %rdx
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0x13ef0
jmp 0x19185
leaq -0x750(%rbp), %rdi
callq 0x634e0
leaq -0x6a8(%rbp), %rdi
callq 0x9c98
leaq -0x6a9(%rbp), %rdi
callq 0x9700
movl $0x1, -0x134(%rbp)
jmp 0x19ca0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1920a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x191fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x750(%rbp), %rdi
callq 0x634e0
leaq -0x6a8(%rbp), %rdi
callq 0x9c98
leaq -0x6a9(%rbp), %rdi
callq 0x9700
jmp 0x19cd2
callq 0x9080
movl (%rax), %edi
callq 0x9230
movq %rax, -0x11b0(%rbp)
leaq -0x791(%rbp), %rdi
movq %rdi, -0x11a8(%rbp)
callq 0x9b10
movq -0x11b0(%rbp), %rsi
movq -0x11a8(%rbp), %rdx
leaq -0x790(%rbp), %rdi
callq 0xa780
jmp 0x1925d
leaq 0x5148d(%rip), %rsi     # 0x6a6f1
leaq -0x770(%rbp), %rdi
leaq -0x790(%rbp), %rdx
callq 0x14790
jmp 0x19279
leaq -0xd8(%rbp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x64560
movq %rax, -0x11b8(%rbp)
jmp 0x19293
movq -0x11b8(%rbp), %rsi
leaq -0x838(%rbp), %rdi
callq 0x63570
jmp 0x192a8
movq -0x10e8(%rbp), %rdi
leaq -0x770(%rbp), %rsi
leaq -0x838(%rbp), %rdx
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0x13ef0
jmp 0x192cc
leaq -0x838(%rbp), %rdi
callq 0x634e0
leaq -0x770(%rbp), %rdi
callq 0x9c98
leaq -0x790(%rbp), %rdi
callq 0x9c98
leaq -0x791(%rbp), %rdi
callq 0x9700
movl $0x1, -0x134(%rbp)
jmp 0x19ca0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x1937d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19371
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19365
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x838(%rbp), %rdi
callq 0x634e0
leaq -0x770(%rbp), %rdi
callq 0x9c98
leaq -0x790(%rbp), %rdi
callq 0x9c98
leaq -0x791(%rbp), %rdi
callq 0x9700
jmp 0x19cd2
leaq -0x868(%rbp), %rdi
leaq -0x5c0(%rbp), %rsi
callq 0x147e0
leaq -0x878(%rbp), %rdi
callq 0x14840
leaq -0x879(%rbp), %rdi
movq %rdi, -0x11c0(%rbp)
callq 0x9b10
movq -0x11c0(%rbp), %r9
movq -0x868(%rbp), %rsi
movl -0x860(%rbp), %edx
movq -0x878(%rbp), %rcx
movl -0x870(%rbp), %r8d
leaq -0x858(%rbp), %rdi
callq 0x14870
jmp 0x193f0
leaq -0x879(%rbp), %rdi
callq 0x9700
leaq -0x9f8(%rbp), %rdi
callq 0x9890
jmp 0x1940a
leaq -0xf8(%rbp), %rdi
callq 0x92b0
movq %rax, %rdi
leaq -0xa88(%rbp), %rsi
callq 0x9c10
movq -0xa58(%rbp), %rsi
leaq -0x9f8(%rbp), %rdi
callq 0x9b70
jmp 0x1943a
leaq -0xaa9(%rbp), %rdi
movq %rdi, -0x11c8(%rbp)
callq 0x9b10
movq -0x11c8(%rbp), %rdx
leaq 0x50ca9(%rip), %rsi     # 0x6a104
leaq -0xaa8(%rbp), %rdi
callq 0xa780
jmp 0x19469
leaq -0xad0(%rbp), %rdi
leaq -0x9f8(%rbp), %rsi
callq 0x96a0
jmp 0x1947e
leaq -0xd8(%rbp), %rdi
leaq -0xaa8(%rbp), %rsi
leaq -0xad0(%rbp), %rdx
callq 0x63770
jmp 0x1949a
leaq -0xad0(%rbp), %rdi
callq 0x9c98
leaq -0xaa8(%rbp), %rdi
callq 0x9c98
leaq -0xaa9(%rbp), %rdi
callq 0x9700
leaq -0xaf1(%rbp), %rdi
movq %rdi, -0x11d0(%rbp)
callq 0x9b10
movq -0x11d0(%rbp), %rdx
leaq 0x51891(%rip), %rsi     # 0x6ad70
leaq -0xaf0(%rbp), %rdi
callq 0xa780
jmp 0x194ed
leaq -0x9f8(%rbp), %rdi
leaq -0xaf0(%rbp), %rsi
callq 0x9300
jmp 0x19502
leaq -0xaf0(%rbp), %rdi
callq 0x9c98
leaq -0xaf1(%rbp), %rdi
callq 0x9700
movq -0xa30(%rbp), %rsi
leaq -0x9f8(%rbp), %rdi
callq 0x9b70
jmp 0x1952f
leaq -0xb50(%rbp), %rdi
leaq -0x9f8(%rbp), %rsi
callq 0x96a0
jmp 0x19544
leaq -0xb50(%rbp), %rdi
callq 0x92b0
movq %rax, %rdi
leaq 0x50e0f(%rip), %rsi     # 0x6a369
leaq -0xb30(%rbp), %rdx
callq 0x90e0
leaq -0xb50(%rbp), %rdi
callq 0x9c98
cmpq $0x0, -0xb08(%rbp)
jle 0x19694
movq -0xb08(%rbp), %rcx
movq -0xa30(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xa30(%rbp)
jmp 0x19694
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x879(%rbp), %rdi
callq 0x9700
jmp 0x19cd2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19cc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19cba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19640
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19634
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0xad0(%rbp), %rdi
callq 0x9c98
leaq -0xaa8(%rbp), %rdi
callq 0x9c98
leaq -0xaa9(%rbp), %rdi
callq 0x9700
jmp 0x19cba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19683
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0xaf0(%rbp), %rdi
callq 0x9c98
leaq -0xaf1(%rbp), %rdi
callq 0x9700
jmp 0x19cba
cmpl $0x0, -0xb10(%rbp)
je 0x196b1
movq -0xa30(%rbp), %rax
subq $0xe10, %rax            # imm = 0xE10
movq %rax, -0xa30(%rbp)
leaq -0xb71(%rbp), %rdi
movq %rdi, -0x11d8(%rbp)
callq 0x9b10
movq -0x11d8(%rbp), %rdx
leaq 0x5169e(%rip), %rsi     # 0x6ad70
leaq -0xb70(%rbp), %rdi
callq 0xa780
jmp 0x196e0
leaq -0x9f8(%rbp), %rdi
leaq -0xb70(%rbp), %rsi
callq 0x9300
jmp 0x196f5
leaq -0xb70(%rbp), %rdi
callq 0x9c98
leaq -0xb71(%rbp), %rdi
callq 0x9700
movq -0xa30(%rbp), %rsi
leaq -0x9f8(%rbp), %rdi
callq 0x9b70
jmp 0x19722
leaq -0xb98(%rbp), %rdi
leaq -0x9f8(%rbp), %rsi
callq 0x96a0
jmp 0x19737
leaq -0xb98(%rbp), %rdi
movq %rdi, -0x11f0(%rbp)
callq 0x92b0
movq %rax, %rdi
leaq 0x50c15(%rip), %rsi     # 0x6a369
leaq -0xb30(%rbp), %rdx
movq %rdx, -0x11e8(%rbp)
callq 0x90e0
movq -0x11f0(%rbp), %rdi
callq 0x9c98
movq -0x11e8(%rbp), %rcx
leaq 0x50f9d(%rip), %rdx     # 0x6a71e
leaq -0xfa0(%rbp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x9550
leaq -0xfc1(%rbp), %rdi
movq %rdi, -0x11e0(%rbp)
callq 0x9b10
movq -0x11e0(%rbp), %rdx
leaq 0x50a18(%rip), %rsi     # 0x6a1cb
leaq -0xfc0(%rbp), %rdi
callq 0xa780
jmp 0x197c1
leaq -0xfe9(%rbp), %rdi
movq %rdi, -0x11f8(%rbp)
callq 0x9b10
movq -0x11f8(%rbp), %rdx
leaq -0xfe8(%rbp), %rdi
leaq -0xfa0(%rbp), %rsi
callq 0xa780
jmp 0x197f0
leaq -0xd8(%rbp), %rdi
leaq -0xfc0(%rbp), %rsi
leaq -0xfe8(%rbp), %rdx
callq 0x63770
jmp 0x1980c
leaq -0xfe8(%rbp), %rdi
callq 0x9c98
leaq -0xfe9(%rbp), %rdi
callq 0x9700
leaq -0xfc0(%rbp), %rdi
callq 0x9c98
leaq -0xfc1(%rbp), %rdi
callq 0x9700
leaq -0x1011(%rbp), %rdi
movq %rdi, -0x1200(%rbp)
callq 0x9b10
movq -0x1200(%rbp), %rdx
leaq 0x51513(%rip), %rsi     # 0x6ad70
leaq -0x1010(%rbp), %rdi
callq 0xa780
jmp 0x1986b
leaq -0x9f8(%rbp), %rdi
leaq -0x1010(%rbp), %rsi
callq 0x9300
jmp 0x19880
leaq -0x1010(%rbp), %rdi
callq 0x9c98
leaq -0x1011(%rbp), %rdi
callq 0x9700
leaq -0xd8(%rbp), %rdi
callq 0x63a60
jmp 0x198a6
leaq -0x1039(%rbp), %rdi
movq %rdi, -0x1208(%rbp)
callq 0x9b10
movq -0x1208(%rbp), %rdx
leaq 0x50985(%rip), %rsi     # 0x6a24c
leaq -0x1038(%rbp), %rdi
callq 0xa780
jmp 0x198d5
leaq -0x1061(%rbp), %rdi
movq %rdi, -0x1210(%rbp)
callq 0x9b10
movq -0x1210(%rbp), %rdx
leaq 0x512bb(%rip), %rsi     # 0x6abb1
leaq -0x1060(%rbp), %rdi
callq 0xa780
jmp 0x19904
leaq -0xd8(%rbp), %rdi
leaq -0x1038(%rbp), %rsi
leaq -0x1060(%rbp), %rdx
callq 0x63770
jmp 0x19920
leaq -0x1060(%rbp), %rdi
callq 0x9c98
leaq -0x1061(%rbp), %rdi
callq 0x9700
leaq -0x1038(%rbp), %rdi
callq 0x9c98
leaq -0x1039(%rbp), %rdi
callq 0x9700
leaq 0x75dc9(%rip), %rax     # 0x8f720
movq 0x8(%rax), %rax
movq %rax, -0x1228(%rbp)
leaq -0xf8(%rbp), %rdi
movq %rdi, -0x1220(%rbp)
movl $0x2e, %esi
movq $-0x1, %rdx
movq %rdx, -0x1218(%rbp)
callq 0x9c00
movq -0x1220(%rbp), %rsi
movq -0x1218(%rbp), %rcx
movq %rax, %rdx
incq %rdx
leaq -0x1090(%rbp), %rdi
callq 0x96b0
jmp 0x199aa
movq -0x1228(%rbp), %rdi
leaq -0x1090(%rbp), %rsi
callq 0x261d0
movq %rax, -0x1230(%rbp)
jmp 0x199c6
leaq -0x1090(%rbp), %rdi
callq 0x9c98
movq -0x1230(%rbp), %rax
movq %rax, -0x1070(%rbp)
cmpq $0x0, -0x1070(%rbp)
je 0x19c69
leaq -0x10b1(%rbp), %rdi
movq %rdi, -0x1238(%rbp)
callq 0x9b10
movq -0x1238(%rbp), %rdx
leaq 0x50743(%rip), %rsi     # 0x6a152
leaq -0x10b0(%rbp), %rdi
callq 0xa780
jmp 0x19a1d
movq -0x1070(%rbp), %rsi
addq $0x20, %rsi
leaq 0x50c81(%rip), %rdx     # 0x6a6b0
leaq -0x10d8(%rbp), %rdi
callq 0x14190
jmp 0x19a3d
leaq -0xd8(%rbp), %rdi
leaq -0x10b0(%rbp), %rsi
leaq -0x10d8(%rbp), %rdx
callq 0x63770
jmp 0x19a59
leaq -0x10d8(%rbp), %rdi
callq 0x9c98
leaq -0x10b0(%rbp), %rdi
callq 0x9c98
leaq -0x10b1(%rbp), %rdi
callq 0x9700
jmp 0x19c69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19ab4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0xb70(%rbp), %rdi
callq 0x9c98
leaq -0xb71(%rbp), %rdi
callq 0x9700
jmp 0x19cba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19b23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19b0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0xfe8(%rbp), %rdi
callq 0x9c98
leaq -0xfe9(%rbp), %rdi
callq 0x9700
leaq -0xfc0(%rbp), %rdi
callq 0x9c98
leaq -0xfc1(%rbp), %rdi
callq 0x9700
jmp 0x19cba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19b66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x1010(%rbp), %rdi
callq 0x9c98
leaq -0x1011(%rbp), %rdi
callq 0x9700
jmp 0x19cba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19bd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19bbd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x1060(%rbp), %rdi
callq 0x9c98
leaq -0x1061(%rbp), %rdi
callq 0x9700
leaq -0x1038(%rbp), %rdi
callq 0x9c98
leaq -0x1039(%rbp), %rdi
callq 0x9700
jmp 0x19cba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x1090(%rbp), %rdi
callq 0x9c98
jmp 0x19cba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19c5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x19c4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x10d8(%rbp), %rdi
callq 0x9c98
leaq -0x10b0(%rbp), %rdi
callq 0x9c98
leaq -0x10b1(%rbp), %rdi
callq 0x9700
jmp 0x19cba
leaq -0xd8(%rbp), %rdi
leaq -0x858(%rbp), %rsi
callq 0x645d0
jmp 0x19c7e
leaq -0x9f8(%rbp), %rdi
callq 0x91a0
leaq -0x858(%rbp), %rdi
callq 0x9c98
movl $0x0, -0x134(%rbp)
leaq -0x5c0(%rbp), %rdi
callq 0x9170
movl -0x134(%rbp), %eax
testl %eax, %eax
jne 0x19cff
jmp 0x19cb8
jmp 0x19ce0
leaq -0x9f8(%rbp), %rdi
callq 0x91a0
leaq -0x858(%rbp), %rdi
callq 0x9c98
leaq -0x5c0(%rbp), %rdi
callq 0x9170
jmp 0x19d19
movq -0x10e8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x63570
jmp 0x19cf5
movl $0x1, -0x134(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x9c98
leaq -0x1c0(%rbp), %rdi
callq 0xceb0
jmp 0x19d33
leaq -0x208(%rbp), %rdi
callq 0x9c98
leaq -0x1c0(%rbp), %rdi
callq 0xceb0
jmp 0x19d5b
leaq -0xf8(%rbp), %rdi
callq 0x9c98
leaq -0xd8(%rbp), %rdi
callq 0x634e0
movq -0x10e0(%rbp), %rax
addq $0x1240, %rsp           # imm = 0x1240
popq %rbp
retq
leaq -0xf8(%rbp), %rdi
callq 0x9c98
leaq -0xd8(%rbp), %rdi
callq 0x634e0
movq -0x100(%rbp), %rdi
callq 0x9af0
movq %rax, %rdi
callq 0xaa90
nopw (%rax,%rax)