// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc78, %rsp            # imm = 0xC78
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %rbx
leaq 0x6c(%rsp), %r14
movl $0x0, (%r14)
leaq 0xb8(%rdx), %rbp
leaq 0x1e0(%rsp), %rdi
movl $0xc8, %esi
movq %rbp, %rdx
callq 0x37384
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x2bd04
movl 0x6c(%rsp), %ecx
leaq 0x280(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movl $0x1, %edx
callq 0x1d582
leaq 0x48(%rsp), %rdi
leaq 0x280(%rsp), %r14
movq %r14, %rsi
callq 0x7590
movq (%r14), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0xfde0
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x160(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x150(%rsp), %rdi
callq 0x8a8a
leaq 0x150(%rsp), %rdi
callq 0x1cfb4
movl %eax, %ebp
movq 0x150(%rsp), %rdi
cmpq %r14, %rdi
je 0xfe32
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x74b0
testb %bpl, %bpl
je 0xfee9
leaq 0x720(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2cf10(%rip), %rsi     # 0x3cd5e
leaq 0x2cf0e(%rip), %rdx     # 0x3cd63
leaq 0x710(%rsp), %rdi
callq 0x80f4
leaq 0x710(%rsp), %rsi
movq %r12, %rdi
callq 0x2b4c6
movq (%rax), %rdx
addq $0x10, %rdx
leaq 0x2ac14(%rip), %rsi     # 0x3aa94
leaq 0x280(%rsp), %rdi
callq 0xe31d
movq 0x710(%rsp), %rdi
cmpq %r14, %rdi
je 0xfeaa
movq 0x720(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x280(%rsp), %rsi
movq 0x288(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x7190
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0xfee9
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
movq %rax, (%rdi)
leaq 0x2ab91(%rip), %rsi     # 0x3aa94
leaq 0x2ab8b(%rip), %rdx     # 0x3aa95
callq 0x80f4
leaq 0x1c8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x280(%rsp), %rdx
callq 0x1c232
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0xff4e
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x1d0(%rsp), %rax
leaq 0x120(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
leaq 0x110(%rsp), %rdi
callq 0x8a8a
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x1d914
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0xffac
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x74b0
cmpq $0x0, 0x138(%rsp)
je 0xffea
movq %r12, %rdi
callq 0x2b494
leaq 0x130(%rsp), %rsi
movq %rax, %rdi
callq 0xf34e
movq %rax, %r14
movq %r12, %rdi
callq 0x2b494
addq $0x8, %rax
cmpq %rax, %r14
je 0xffea
movb $0x1, %bpl
xorl %eax, %eax
jmp 0x10041
leaq 0x100(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2a710(%rip), %rsi     # 0x3a70d
leaq 0x2a710(%rip), %rdx     # 0x3a714
leaq 0xf0(%rsp), %rdi
callq 0x80f4
leaq 0xf0(%rsp), %rsi
movq %r12, %rdi
callq 0x2b4c6
movq (%rax), %rax
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rcx
leaq 0x48(%rsp), %rdi
xorl %edx, %edx
callq 0x77f0
testq %rax, %rax
sete %bpl
movb $0x1, %al
testb %al, %al
je 0x10066
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10066
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x74b0
testb %bpl, %bpl
je 0x100c0
leaq 0x280(%rsp), %rdi
leaq 0x48(%rsp), %r8
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %rbx, %rbp
callq 0x1359c
leaq 0x280(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x1606c
leaq 0x280(%rsp), %rdi
callq 0x15920
leaq 0x1e0(%rsp), %rsi
movq %rbp, %rdi
callq 0x37246
jmp 0x1090a
movq 0x48(%rsp), %rsi
leaq 0x710(%rsp), %rdi
movl $0x18, %edx
callq 0x75d0
movq %rbx, %rbp
movq 0x710(%rsp), %r14
movq -0x18(%r14), %rax
cmpl $0x0, 0x730(%rsp,%rax)
jne 0x10690
leaq 0x790(%rsp), %rdi
callq 0x7130
testb %al, %al
je 0x10690
movq -0x18(%r14), %rax
movq 0x7f8(%rsp,%rax), %rsi
leaq 0xa0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x90(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0xf46a
leaq 0x920(%rsp), %rdi
callq 0x75e0
movq 0x48(%rsp), %rdi
leaq 0x680(%rsp), %r14
movq %r14, %rsi
callq 0x78e0
movq 0x30(%r14), %rsi
leaq 0x920(%rsp), %rdi
callq 0x7470
leaq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
movq %rax, (%rdi)
leaq 0x29f7b(%rip), %rsi     # 0x3a104
leaq 0x29f82(%rip), %rdx     # 0x3a112
callq 0x80f4
leaq 0x928(%rsp), %r14
leaq 0x170(%rsp), %rdi
movq %r14, %rsi
callq 0x7710
leaq 0x1e0(%rsp), %rdi
leaq 0x280(%rsp), %rsi
leaq 0x170(%rsp), %rdx
callq 0x3744c
leaq 0x180(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x101eb
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x10210
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
movq %rax, (%rdi)
leaq 0x2ab71(%rip), %rdx     # 0x3ad9b
movq %rdx, %rsi
callq 0x80f4
leaq 0x280(%rsp), %rsi
movq %r14, %rdi
callq 0x7690
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x10267
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x6d8(%rsp), %r15
leaq 0x920(%rsp), %rdi
movq %r15, %rsi
callq 0x7470
leaq 0x280(%rsp), %rdi
movq %r14, %rsi
callq 0x7710
movq 0x280(%rsp), %rdi
leaq 0x2a107(%rip), %rsi     # 0x3a3a5
leaq 0x170(%rsp), %rdx
callq 0x70b0
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x102d0
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x198(%rsp), %rax
testq %rax, %rax
jle 0x102e8
subq %rax, %r15
movq %r15, 0x6d8(%rsp)
cmpl $0x0, 0x190(%rsp)
je 0x102fe
addq $-0xe10, 0x6d8(%rsp) # imm = 0xF1F0
leaq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
movq %rax, (%rdi)
leaq 0x2aa83(%rip), %rdx     # 0x3ad9b
movq %rdx, %rsi
callq 0x80f4
leaq 0x280(%rsp), %rsi
movq %r14, %rdi
callq 0x7690
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x10355
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x6d8(%rsp), %rsi
leaq 0x920(%rsp), %rdi
callq 0x7470
leaq 0x280(%rsp), %rdi
movq %r14, %rsi
callq 0x7710
movq 0x280(%rsp), %rdi
leaq 0x2a01c(%rip), %rsi     # 0x3a3a5
leaq 0x170(%rsp), %rdx
callq 0x70b0
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x103bb
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x2a398(%rip), %rdx     # 0x3a75a
leaq 0x280(%rsp), %rdi
leaq 0x170(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
callq 0x73f0
leaq 0x18(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x29e2a(%rip), %rsi     # 0x3a216
leaq 0x29e30(%rip), %rdx     # 0x3a223
leaq 0x8(%rsp), %rdi
callq 0x80f4
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x280(%rsp), %r15
movq %r15, %rdi
callq 0x7220
leaq (%rsp,%rax), %rdx
addq $0x280, %rdx            # imm = 0x280
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x80f4
leaq 0x1e0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x3744c
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1045c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10473
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x8(%rsp), %rdi
movq %rbx, (%rdi)
leaq 0x2a919(%rip), %rdx     # 0x3ad9b
movq %rdx, %rsi
callq 0x80f4
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x7690
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x104ae
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x1e0(%rsp), %rdi
callq 0x377cc
leaq 0x8(%rsp), %rdi
movq %rbx, (%rdi)
leaq 0x29dcd(%rip), %rsi     # 0x3a297
leaq 0x29dcc(%rip), %rdx     # 0x3a29d
callq 0x80f4
leaq 0x28(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x2a6f7(%rip), %rsi     # 0x3abdc
leaq 0x2a6f7(%rip), %rdx     # 0x3abe3
callq 0x80f4
leaq 0x1e0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x3744c
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1051f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10536
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x3e02b(%rip), %rax     # 0x4e568
movq 0x8(%rax), %r14
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movl $0x2e, %esi
movq $-0x1, %rdx
callq 0x7900
leaq 0x1(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x74d0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x180c8
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10599
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
testq %r14, %r14
je 0x1062b
leaq 0x8(%rsp), %rdi
movq %rbx, (%rdi)
leaq 0x29ba1(%rip), %rsi     # 0x3a152
leaq 0x29ba6(%rip), %rdx     # 0x3a15e
callq 0x80f4
leaq 0x28(%rsp), %rdi
movq %r13, (%rdi)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
callq 0x8a8a
leaq 0x2a110(%rip), %rsi     # 0x3a6ec
leaq 0x28(%rsp), %rdi
callq 0x78d0
leaq 0x1e0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x3744c
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x10614
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1062b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x1e0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x37f32
movq 0x3d959(%rip), %rsi     # 0x4dfa0
leaq 0x920(%rsp), %rdi
callq 0x72b0
leaq 0x990(%rsp), %rdi
callq 0x71c0
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0x1067e
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x710(%rsp), %rdi
callq 0x7110
jmp 0x100ab
callq 0x7070
movl (%rax), %ecx
cmpl $0x13, %ecx
jg 0x106af
cmpl $0x2, %ecx
je 0x106c1
cmpl $0xd, %ecx
je 0x10755
jmp 0x107e9
cmpl $0x15, %ecx
je 0x10755
cmpl $0x14, %ecx
jne 0x107e9
leaq 0xe0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2a041(%rip), %rsi     # 0x3a715
leaq 0x2a048(%rip), %rdx     # 0x3a723
leaq 0xd0(%rsp), %rdi
callq 0x80f4
leaq 0x1e0(%rsp), %rdi
movl $0x194, %esi            # imm = 0x194
callq 0x37f1c
leaq 0xbd8(%rsp), %rdi
movq %rax, %rsi
callq 0x37246
leaq 0xd0(%rsp), %rsi
leaq 0xbd8(%rsp), %rdx
movq %rbp, %rdi
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0xe256
leaq 0xbd8(%rsp), %rdi
callq 0x371c6
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x108fd
movq 0xe0(%rsp), %rsi
jmp 0x108f5
leaq 0xc0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x29c54(%rip), %rsi     # 0x3a3bc
leaq 0x29c5e(%rip), %rdx     # 0x3a3cd
leaq 0xb0(%rsp), %rdi
callq 0x80f4
leaq 0x1e0(%rsp), %rdi
movl $0x193, %esi            # imm = 0x193
callq 0x37f1c
leaq 0xb38(%rsp), %rdi
movq %rax, %rsi
callq 0x37246
leaq 0xb0(%rsp), %rsi
leaq 0xb38(%rsp), %rdx
movq %rbp, %rdi
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0xe256
leaq 0xb38(%rsp), %rdi
callq 0x371c6
movq 0xb0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x108fd
movq 0xc0(%rsp), %rsi
jmp 0x108f5
movl (%rax), %edi
callq 0x71d0
leaq 0x280(%rsp), %rdi
leaq 0x920(%rsp), %rdx
movq %rax, %rsi
callq 0xde9a
leaq 0x29f1e(%rip), %rcx     # 0x3a72d
leaq 0x280(%rsp), %rdi
movl $0x2c, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x7500
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x10853
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0x1085a
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x78(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1e0(%rsp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0x37f1c
leaq 0xa98(%rsp), %rdi
movq %rax, %rsi
callq 0x37246
leaq 0x70(%rsp), %rsi
leaq 0xa98(%rsp), %rdx
movq %rbp, %rdi
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0xe256
leaq 0xa98(%rsp), %rdi
callq 0x371c6
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x108d8
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x108fd
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x710(%rsp), %rdi
callq 0x7110
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1092b
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x1c8(%rsp), %rdi
callq 0x96d8
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10953
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x1e0(%rsp), %rdi
callq 0x371c6
movq %rbp, %rax
addq $0xc78, %rsp            # imm = 0xC78
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x109c5
jmp 0x109c5
jmp 0x109e2
jmp 0x10af4
movq %rax, (%rsp)
leaq 0xa98(%rsp), %rdi
callq 0x371c6
jmp 0x10ab3
movq %rax, (%rsp)
jmp 0x10acd
jmp 0x10aee
jmp 0x10af4
jmp 0x109e2
jmp 0x10af4
jmp 0x109c5
jmp 0x109e2
jmp 0x10af4
jmp 0x10af4
jmp 0x109e2
jmp 0x10af4
movq %rax, (%rsp)
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x109e6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x109e6
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10af8
movq 0x18(%rsp), %rsi
jmp 0x10a69
jmp 0x10af4
jmp 0x10af4
jmp 0x10af4
jmp 0x10a44
jmp 0x10af4
jmp 0x10af4
jmp 0x10a44
jmp 0x10af4
movq %rax, (%rsp)
leaq 0x180(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10a48
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x10a48
movq %rax, (%rsp)
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x10af8
movq 0x290(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x10af8
jmp 0x10af4
movq %rax, (%rsp)
jmp 0x10b19
jmp 0x10aee
movq %rax, (%rsp)
leaq 0xb38(%rsp), %rdi
callq 0x371c6
jmp 0x10b4c
movq %rax, (%rsp)
leaq 0xbd8(%rsp), %rdi
callq 0x371c6
jmp 0x10b67
movq %rax, (%rsp)
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x10acd
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x10b36
movq 0x290(%rsp), %rsi
jmp 0x10b2e
jmp 0x10aee
movq %rax, (%rsp)
jmp 0x10b36
movq %rax, (%rsp)
movq 0x3d4a1(%rip), %rsi     # 0x4dfa0
leaq 0x920(%rsp), %rdi
callq 0x72b0
leaq 0x990(%rsp), %rdi
callq 0x71c0
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0x10b36
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x710(%rsp), %rdi
callq 0x7110
jmp 0x10e0c
movq %rax, (%rsp)
movq 0xb0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10b36
movq 0xc0(%rsp), %rsi
jmp 0x10b2e
movq %rax, (%rsp)
movq 0xd0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10b36
movq 0xe0(%rsp), %rsi
jmp 0x10b2e
movq %rdx, %r15
movq %rax, (%rsp)
leaq 0x280(%rsp), %rdi
callq 0x15920
jmp 0x10ba0
jmp 0x10e08
movq %rdx, %r15
movq %rax, (%rsp)
cmpl $0x2, %r15d
jne 0x10e0c
movq (%rsp), %rdi
callq 0x7210
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x1a8(%rsp), %rdi
leaq 0x280(%rsp), %rdx
movq %rax, %rsi
callq 0xde9a
leaq 0x1a8(%rsp), %rdi
xorl %esi, %esi
movl $0x3, %edx
movl $0x1, %ecx
callq 0xded8
leaq 0x1b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10c11
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x74b0
movq (%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
leaq 0x1e0(%rsp), %rdi
movl %eax, %esi
callq 0x37f1c
callq 0x7780
movq %rbx, %rbp
jmp 0x100ab
jmp 0x10e08
jmp 0x10c64
movq %rax, (%rsp)
leaq 0x1b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10c68
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x10c68
movq %rax, (%rsp)
callq 0x7780
jmp 0x10e0c
movq %rdx, %rbp
movq %rax, (%rsp)
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x10d33
movq 0x290(%rsp), %rsi
jmp 0x10d2b
movq %rdx, %rbp
movq %rax, (%rsp)
jmp 0x10d33
jmp 0x10e08
movq %rax, (%rsp)
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0x10e0c
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x10e0c
jmp 0x10e08
jmp 0x10e08
movq %rax, (%rsp)
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x10e2d
movq 0x120(%rsp), %rsi
jmp 0x10e25
movq %rax, (%rsp)
jmp 0x10e2d
movq %rdx, %rbp
movq %rax, (%rsp)
movq 0x710(%rsp), %rdi
cmpq %r14, %rdi
je 0x10d33
movq 0x720(%rsp), %rsi
incq %rsi
callq 0x74b0
cmpl $0x1, %ebp
jne 0x10e3a
movq (%rsp), %rdi
callq 0x7210
callq 0x7780
jmp 0xfee9
jmp 0x10da4
movq %rax, (%rsp)
movq 0x280(%rsp), %rdi
leaq 0x290(%rsp), %rax
cmpq %rax, %rdi
je 0x10e3a
movq 0x290(%rsp), %rsi
jmp 0x10d97
jmp 0x10da4
movq %rax, (%rsp)
movq 0x150(%rsp), %rdi
cmpq %r14, %rdi
je 0x10e3a
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x10e3a
movq %rax, (%rsp)
jmp 0x10e3a
movq %rax, (%rsp)
cmpl $0x1, %edx
jne 0x10e3a
movq (%rsp), %rdi
callq 0x7210
leaq 0x1e0(%rsp), %rdi
movl $0x194, %esi            # imm = 0x194
callq 0x37f1c
movq %rbx, %rdi
movq %rax, %rsi
callq 0x37246
callq 0x7780
movq %rbx, %rbp
jmp 0x10938
jmp 0x10da4
movq %rax, (%rsp)
callq 0x7780
jmp 0x10e3a
movq %rax, %rdi
callq 0x96cc
movq %rax, (%rsp)
jmp 0x10e55
movq %rax, (%rsp)
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10e2d
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x1c8(%rsp), %rdi
callq 0x96d8
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10e55
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x1e0(%rsp), %rdi
callq 0x371c6
movq (%rsp), %rdi
callq 0x7810
nop