// File: mbourand[P]webserv/srcs/Config/ConfigContext.cpp
// Function: ConfigContext::ConfigContext(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, ConfigContext const*)
ConfigContext::ConfigContext(const std::string& raw, const std::string& name, const ConfigContext* parent)
	: _autoIndex(false)
{
	handle_parent_and_directives(parent, name);

	for (size_t i = 0; i < raw.size();)
	{
		// On skip les whitepsaces en début de ligne
		i = raw.find_first_not_of(" \t", i);
		if (i == std::string::npos)
			break;

		// Si la ligne est vide ou que c'est un commentaire, on skip la ligne
		if (raw[i] == '\n' || raw[i] == '#')
		{
			i = raw.find('\n', i) + 1;
			continue;
		}

		// On récupère le nom de la directive, par exemple : "server_name" ou "root", etc.
		std::string directive_name = raw.substr(i, raw.find_first_of(" \t", i) - i);
		if (!ft::contains(_directive_names, directive_name))
			throw std::invalid_argument("Unknown directive name in config");

		// Pour empêcher une directive d'apparaître deux fois dans le même context
		if (_params.find(directive_name) != _params.end())
			_params.erase(_params.find(directive_name));

		i += directive_name.size();
		i = raw.find_first_not_of(" \t", i);

		std::string directive_value = raw.substr(i, raw.find('\n', i) - i);
		if (directive_value.empty())
			throw std::invalid_argument("Empty directive value in config");

		if (directive_name == "location")
		{
			// On récupère le chemin de la location (juste après le nom de la directive)
			std::string location_name = raw.substr(i, raw.find_first_of(" \t\n", i) - i);
			i += location_name.size();
			i = raw.find_first_not_of(" \t", i);

			// Si il n'y a pas d'accolate ouvrante, la config est invalide
			if (raw[i] != '{')
				throw std::invalid_argument("Bad curly braces in config");
			i = raw.find_first_not_of(" \t", i + 1);

			// Si il n'y a pas de retour à la ligne après les espaces, la config est invalide
			if (raw[i] != '\n')
				throw std::invalid_argument("Bad new line in config");

			// On récupère le contenu du fichier qui concerne la location
			std::string location_raw = raw.substr(i, find_closing_bracket(raw, i) - i - 2);
			_childs.push_back(ConfigContext(location_raw, location_name, this));
			i += location_raw.size() + 2;
			if (raw.find('\n', i) == std::string::npos)
				break;
			i = raw.find('\n', i) + 1;
			continue;
		}
		else if (directive_name == "server_name")
			parse_server_name(directive_value);
		else if (directive_name == "error_page")
			parse_error_page(directive_value);
		else if (directive_name == "autoindex")
			parse_autoindex(directive_value);
		else if (directive_name == "disable_methods")
			parse_methods(directive_value);
		else if (directive_name == "cgi_ext")
			parse_cgi_ext(directive_value);
		else if (directive_name == "uploads_exts")
			parse_uploads_exts(directive_value);
		else if (directive_name == "auth_basic")
			parse_auth_basic(directive_value);
		else
		{
			std::string directive_value = raw.substr(i, raw.find('\n', i) - i);
			if (directive_value.size() == 0)
				throw std::invalid_argument("Empty directive value in config");
			_params.insert(std::make_pair(directive_name, ft::split(directive_value, " \t")));
		}
		if (raw.find('\n', i) == std::string::npos)
			break;
		i = raw.find('\n', i) + 1;
	}
	if (ft::contains(_directive_names, "listen") && _params.find("listen") == _params.end())
		throw std::invalid_argument("No listen in config");
	set_uploads_default();
	set_root_default(parent);
	set_max_body_size_default();
	set_cgi_dir_default();
	set_auth_basic_default();
	if (_params["auth_basic"].front() != "")
		set_auth_basic_user_file_default();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x308(%rbp)
leaq 0x4731b(%rip), %rax     # 0x8eca8
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, -0x348(%rbp)
callq 0x13880
movq -0x308(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0x340(%rbp)
callq 0x4d4c0
movq -0x308(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0x338(%rbp)
callq 0x4d4e0
movq -0x308(%rbp), %rdi
addq $0x68, %rdi
movq %rdi, -0x330(%rbp)
callq 0x4d500
movq -0x308(%rbp), %rdi
addq $0x98, %rdi
movq %rdi, -0x328(%rbp)
callq 0x13880
movq -0x308(%rbp), %rdi
addq $0xb0, %rdi
movq %rdi, -0x320(%rbp)
callq 0x4d520
movq -0x308(%rbp), %rdi
addq $0xc8, %rdi
movq %rdi, -0x318(%rbp)
callq 0x4d540
movq -0x308(%rbp), %rdi
addq $0xf8, %rdi
movq %rdi, -0x310(%rbp)
callq 0x13880
movq -0x308(%rbp), %rdi
movb $0x0, 0x110(%rdi)
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x488d0
jmp 0x47a6a
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x350(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9480
movq %rax, %rcx
movq -0x350(%rbp), %rax
cmpq %rcx, %rax
jae 0x48543
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x24194(%rip), %rsi     # 0x6bc3c
callq 0x93f0
movq %rax, -0x38(%rbp)
cmpq $-0x1, -0x38(%rbp)
jne 0x47ace
jmp 0x48543
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x48865
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x9720
movsbl (%rax), %eax
cmpl $0xa, %eax
je 0x47af8
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x9720
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x47b17
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0xa, %esi
callq 0x9860
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x47a72
movq -0x10(%rbp), %rdi
movq %rdi, -0x360(%rbp)
movq -0x38(%rbp), %rdx
movq %rdx, -0x358(%rbp)
leaq 0x24108(%rip), %rsi     # 0x6bc3c
callq 0x9360
movq -0x360(%rbp), %rsi
movq -0x358(%rbp), %rdx
movq %rax, %rcx
movq -0x38(%rbp), %rax
subq %rax, %rcx
leaq -0x58(%rbp), %rdi
callq 0x96b0
jmp 0x47b5c
movq -0x308(%rbp), %rdi
addq $0x8, %rdi
leaq -0x58(%rbp), %rsi
callq 0x4d7b0
movb %al, -0x361(%rbp)
jmp 0x47b78
movb -0x361(%rbp), %al
testb $0x1, %al
jne 0x47bf6
jmp 0x47b84
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x370(%rbp)
leaq 0x2550b(%rip), %rsi     # 0x6d0ad
callq 0x9be0
jmp 0x47ba9
movq -0x370(%rbp), %rdi
movq 0x47411(%rip), %rsi     # 0x8efc8
movq 0x473fa(%rip), %rdx     # 0x8efb8
callq 0x9aa0
jmp 0x488ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x48535
movq -0x370(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x94c0
jmp 0x48535
movq -0x308(%rbp), %rdi
addq $0x20, %rdi
leaq -0x58(%rbp), %rsi
callq 0x4d850
movq %rax, -0x378(%rbp)
jmp 0x47c13
movq -0x308(%rbp), %rdi
movq -0x378(%rbp), %rax
movq %rax, -0x60(%rbp)
addq $0x20, %rdi
callq 0x4d880
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x4d820
testb $0x1, %al
jne 0x47c45
jmp 0x47c98
movq -0x308(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0x388(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x4d850
movq %rax, -0x380(%rbp)
jmp 0x47c69
movq -0x388(%rbp), %rdi
movq -0x380(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rsi
callq 0x4d8b0
movq %rax, -0x390(%rbp)
jmp 0x47c8d
movq -0x390(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9480
movq %rax, %rcx
movq -0x38(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x23f7e(%rip), %rsi     # 0x6bc3c
callq 0x93f0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
movq -0x38(%rbp), %rdx
movq %rdx, -0x398(%rbp)
movl $0xa, %esi
callq 0x9860
movq -0x3a0(%rbp), %rsi
movq -0x398(%rbp), %rdx
movq %rax, %rcx
movq -0x38(%rbp), %rax
subq %rax, %rcx
leaq -0x98(%rbp), %rdi
callq 0x96b0
jmp 0x47d0d
leaq -0x98(%rbp), %rdi
callq 0x9a50
testb $0x1, %al
jne 0x47d1f
jmp 0x47d91
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x3a8(%rbp)
leaq 0x23f0a(%rip), %rsi     # 0x6bc47
callq 0x9be0
jmp 0x47d44
movq -0x3a8(%rbp), %rdi
movq 0x47276(%rip), %rsi     # 0x8efc8
movq 0x4725f(%rip), %rdx     # 0x8efb8
callq 0x9aa0
jmp 0x488ce
movq -0x3a8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x94c0
jmp 0x48529
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x48529
leaq 0x2550f(%rip), %rsi     # 0x6d2a7
leaq -0x58(%rbp), %rdi
callq 0xdf50
movb %al, -0x3a9(%rbp)
jmp 0x47da9
movb -0x3a9(%rbp), %al
testb $0x1, %al
jne 0x47db8
jmp 0x480b2
movq -0x10(%rbp), %rdi
movq %rdi, -0x3c0(%rbp)
movq -0x38(%rbp), %rdx
movq %rdx, -0x3b8(%rbp)
leaq 0x23e92(%rip), %rsi     # 0x6bc67
callq 0x9360
movq -0x3c0(%rbp), %rsi
movq -0x3b8(%rbp), %rdx
movq %rax, %rcx
movq -0x38(%rbp), %rax
subq %rax, %rcx
leaq -0xb8(%rbp), %rdi
callq 0x96b0
jmp 0x47e00
leaq -0xb8(%rbp), %rdi
callq 0x9480
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x23e19(%rip), %rsi     # 0x6bc3c
callq 0x93f0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x9720
movsbl (%rax), %eax
cmpl $0x7b, %eax
je 0x47eb3
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x3c8(%rbp)
leaq 0x2526f(%rip), %rsi     # 0x6d0ce
callq 0x9be0
jmp 0x47e66
movq -0x3c8(%rbp), %rdi
movq 0x47154(%rip), %rsi     # 0x8efc8
movq 0x4713d(%rip), %rdx     # 0x8efb8
callq 0x9aa0
jmp 0x488ce
movq -0x3c8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x94c0
jmp 0x480a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x480a1
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
addq $0x1, %rdx
leaq 0x23d76(%rip), %rsi     # 0x6bc3c
callq 0x93f0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x9720
movsbl (%rax), %eax
cmpl $0xa, %eax
je 0x47f45
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x3d0(%rbp)
leaq 0x251e7(%rip), %rsi     # 0x6d0e9
callq 0x9be0
jmp 0x47f09
movq -0x3d0(%rbp), %rdi
movq 0x470b1(%rip), %rsi     # 0x8efc8
movq 0x4709a(%rip), %rdx     # 0x8efb8
callq 0x9aa0
jmp 0x488ce
movq -0x3d0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x94c0
jmp 0x480a1
movq -0x308(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq %rsi, -0x3e8(%rbp)
movq -0x38(%rbp), %rdx
movq %rdx, -0x3e0(%rbp)
callq 0x48a40
movq %rax, -0x3d8(%rbp)
jmp 0x47f70
movq -0x3e0(%rbp), %rdx
movq -0x3e8(%rbp), %rsi
movq -0x3d8(%rbp), %rcx
movq -0x38(%rbp), %rax
subq %rax, %rcx
addq $-0x2, %rcx
leaq -0xd8(%rbp), %rdi
callq 0x96b0
jmp 0x47f9e
movq -0x308(%rbp), %rcx
movq %rcx, %rax
addq $0x50, %rax
movq %rax, -0x3f0(%rbp)
leaq -0x1f0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x47960
jmp 0x47fcf
movq -0x3f0(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x4d8f0
jmp 0x47fe4
leaq -0x1f0(%rbp), %rdi
callq 0x47670
leaq -0xd8(%rbp), %rdi
callq 0x9480
addq $0x2, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0xa, %esi
callq 0x9860
cmpq $-0x1, %rax
jne 0x48054
movl $0x2, -0x1f4(%rbp)
jmp 0x48078
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x48095
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x47670
jmp 0x48095
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0xa, %esi
callq 0x9860
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movl $0x3, -0x1f4(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x9c98
leaq -0xb8(%rbp), %rdi
callq 0x9c98
jmp 0x484eb
leaq -0xd8(%rbp), %rdi
callq 0x9c98
leaq -0xb8(%rbp), %rdi
callq 0x9c98
jmp 0x48529
leaq 0x25047(%rip), %rsi     # 0x6d100
leaq -0x58(%rbp), %rdi
callq 0xdf50
movb %al, -0x3f1(%rbp)
jmp 0x480ca
movb -0x3f1(%rbp), %al
testb $0x1, %al
jne 0x480d6
jmp 0x480f0
movq -0x308(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x48b00
jmp 0x480eb
jmp 0x484a1
leaq 0x25015(%rip), %rsi     # 0x6d10c
leaq -0x58(%rbp), %rdi
callq 0xdf50
movb %al, -0x3f2(%rbp)
jmp 0x48108
movb -0x3f2(%rbp), %al
testb $0x1, %al
jne 0x48114
jmp 0x4812e
movq -0x308(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x48c80
jmp 0x48129
jmp 0x4849f
leaq 0x24fe2(%rip), %rsi     # 0x6d117
leaq -0x58(%rbp), %rdi
callq 0xdf50
movb %al, -0x3f3(%rbp)
jmp 0x48146
movb -0x3f3(%rbp), %al
testb $0x1, %al
jne 0x48152
jmp 0x4816c
movq -0x308(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x49080
jmp 0x48167
jmp 0x4849d
leaq 0x24fae(%rip), %rsi     # 0x6d121
leaq -0x58(%rbp), %rdi
callq 0xdf50
movb %al, -0x3f4(%rbp)
jmp 0x48184
movb -0x3f4(%rbp), %al
testb $0x1, %al
jne 0x48190
jmp 0x481aa
movq -0x308(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x49280
jmp 0x481a5
jmp 0x4849b
leaq 0x24f80(%rip), %rsi     # 0x6d131
leaq -0x58(%rbp), %rdi
callq 0xdf50
movb %al, -0x3f5(%rbp)
jmp 0x481c2
movb -0x3f5(%rbp), %al
testb $0x1, %al
jne 0x481ce
jmp 0x481e8
movq -0x308(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x49580
jmp 0x481e3
jmp 0x48499
leaq 0x24f4a(%rip), %rsi     # 0x6d139
leaq -0x58(%rbp), %rdi
callq 0xdf50
movb %al, -0x3f6(%rbp)
jmp 0x48200
movb -0x3f6(%rbp), %al
testb $0x1, %al
jne 0x4820c
jmp 0x48226
movq -0x308(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x49ac0
jmp 0x48221
jmp 0x48497
leaq 0x24f19(%rip), %rsi     # 0x6d146
leaq -0x58(%rbp), %rdi
callq 0xdf50
movb %al, -0x3f7(%rbp)
jmp 0x4823e
movb -0x3f7(%rbp), %al
testb $0x1, %al
jne 0x4824a
jmp 0x48264
movq -0x308(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x49de0
jmp 0x4825f
jmp 0x48495
movq -0x10(%rbp), %rdi
movq %rdi, -0x408(%rbp)
movq -0x38(%rbp), %rdx
movq %rdx, -0x400(%rbp)
movl $0xa, %esi
callq 0x9860
movq -0x408(%rbp), %rsi
movq -0x400(%rbp), %rdx
movq %rax, %rcx
movq -0x38(%rbp), %rax
subq %rax, %rcx
leaq -0x218(%rbp), %rdi
callq 0x96b0
jmp 0x482aa
leaq -0x218(%rbp), %rdi
callq 0x9480
cmpq $0x0, %rax
jne 0x4832e
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x410(%rbp)
leaq 0x2396d(%rip), %rsi     # 0x6bc47
callq 0x9be0
jmp 0x482e1
movq -0x410(%rbp), %rdi
movq 0x46cd9(%rip), %rsi     # 0x8efc8
movq 0x46cc2(%rip), %rdx     # 0x8efb8
callq 0x9aa0
jmp 0x488ce
movq -0x410(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x94c0
jmp 0x48484
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x48484
movq -0x308(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x420(%rbp)
leaq -0x289(%rbp), %rdi
movq %rdi, -0x418(%rbp)
callq 0x9b10
movq -0x418(%rbp), %rdx
leaq 0x238db(%rip), %rsi     # 0x6bc3c
leaq -0x288(%rbp), %rdi
callq 0xa780
jmp 0x4836f
leaq -0x268(%rbp), %rdi
leaq -0x218(%rbp), %rsi
leaq -0x288(%rbp), %rdx
callq 0x2f910
jmp 0x4838b
leaq -0x250(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x268(%rbp), %rdx
callq 0x4d970
jmp 0x483a4
movq -0x420(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x4d930
movb %dl, -0x429(%rbp)
movq %rax, -0x428(%rbp)
jmp 0x483c6
movb -0x429(%rbp), %al
movq -0x428(%rbp), %rcx
movq %rcx, -0x2a0(%rbp)
movb %al, -0x298(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x4d9b0
leaq -0x268(%rbp), %rdi
callq 0xceb0
leaq -0x288(%rbp), %rdi
callq 0x9c98
leaq -0x289(%rbp), %rdi
callq 0x9700
leaq -0x218(%rbp), %rdi
callq 0x9c98
jmp 0x48495
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x48478
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4846c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x48460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x4d9b0
leaq -0x268(%rbp), %rdi
callq 0xceb0
leaq -0x288(%rbp), %rdi
callq 0x9c98
leaq -0x289(%rbp), %rdi
callq 0x9700
leaq -0x218(%rbp), %rdi
callq 0x9c98
jmp 0x48529
jmp 0x48497
jmp 0x48499
jmp 0x4849b
jmp 0x4849d
jmp 0x4849f
jmp 0x484a1
jmp 0x484a3
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0xa, %esi
callq 0x9860
cmpq $-0x1, %rax
jne 0x484c7
movl $0x2, -0x1f4(%rbp)
jmp 0x484eb
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0xa, %esi
callq 0x9860
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x1f4(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x9c98
leaq -0x58(%rbp), %rdi
callq 0x9c98
movl -0x1f4(%rbp), %eax
movl %eax, -0x430(%rbp)
testl %eax, %eax
je 0x48524
jmp 0x48512
movl -0x430(%rbp), %eax
subl $0x2, %eax
je 0x48543
jmp 0x4851f
jmp 0x47a72
jmp 0x47a72
leaq -0x98(%rbp), %rdi
callq 0x9c98
leaq -0x58(%rbp), %rdi
callq 0x9c98
jmp 0x48865
movq -0x308(%rbp), %rdi
addq $0x8, %rdi
movb $0x0, -0x2ca(%rbp)
movb $0x0, -0x2cb(%rbp)
leaq 0x24bee(%rip), %rsi     # 0x6d151
callq 0x4d9e0
movb %al, -0x431(%rbp)
jmp 0x48570
movb -0x431(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x432(%rbp)
jne 0x48588
jmp 0x48631
movq -0x308(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x448(%rbp)
leaq -0x2c9(%rbp), %rdi
movq %rdi, -0x440(%rbp)
callq 0x9b10
movq -0x440(%rbp), %rdx
movb $0x1, -0x2ca(%rbp)
leaq 0x24b8f(%rip), %rsi     # 0x6d151
leaq -0x2c8(%rbp), %rdi
callq 0xa780
jmp 0x485d0
movq -0x448(%rbp), %rdi
movb $0x1, -0x2cb(%rbp)
leaq -0x2c8(%rbp), %rsi
callq 0x4d850
movq %rax, -0x450(%rbp)
jmp 0x485f3
movq -0x308(%rbp), %rdi
movq -0x450(%rbp), %rax
movq %rax, -0x2a8(%rbp)
addq $0x20, %rdi
callq 0x4d880
movq %rax, -0x2d8(%rbp)
leaq -0x2a8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x4da50
movb %al, -0x432(%rbp)
movb -0x432(%rbp), %al
movb %al, -0x451(%rbp)
testb $0x1, -0x2cb(%rbp)
jne 0x48648
jmp 0x48654
leaq -0x2c8(%rbp), %rdi
callq 0x9c98
testb $0x1, -0x2ca(%rbp)
jne 0x4865f
jmp 0x4866b
leaq -0x2c9(%rbp), %rdi
callq 0x9700
movb -0x451(%rbp), %al
testb $0x1, %al
jne 0x4867a
jmp 0x4872a
movl $0x10, %edi
callq 0x9340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x460(%rbp)
leaq 0x24ac0(%rip), %rsi     # 0x6d158
callq 0x9be0
jmp 0x4869f
movq -0x460(%rbp), %rdi
movq 0x4691b(%rip), %rsi     # 0x8efc8
movq 0x46904(%rip), %rdx     # 0x8efb8
callq 0x9aa0
jmp 0x488ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x486f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
testb $0x1, -0x2cb(%rbp)
jne 0x486e3
jmp 0x486ef
leaq -0x2c8(%rbp), %rdi
callq 0x9c98
jmp 0x486f1
testb $0x1, -0x2ca(%rbp)
jne 0x486fc
jmp 0x48708
leaq -0x2c9(%rbp), %rdi
callq 0x9700
jmp 0x48865
movq -0x460(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x94c0
jmp 0x48865
movq -0x308(%rbp), %rdi
callq 0x4a110
jmp 0x48738
movq -0x308(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4a6c0
jmp 0x4874a
movq -0x308(%rbp), %rdi
callq 0x4aba0
jmp 0x48758
movq -0x308(%rbp), %rdi
callq 0x4b050
jmp 0x48766
movq -0x308(%rbp), %rdi
callq 0x4b600
jmp 0x48774
movq -0x308(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x470(%rbp)
leaq -0x2f9(%rbp), %rdi
movq %rdi, -0x468(%rbp)
callq 0x9b10
movq -0x468(%rbp), %rdx
leaq 0x2499f(%rip), %rsi     # 0x6d146
leaq -0x2f8(%rbp), %rdi
callq 0xa780
jmp 0x487b5
movq -0x470(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x4da80
movq %rax, -0x478(%rbp)
jmp 0x487d1
movq -0x478(%rbp), %rdi
callq 0xcd40
movq %rax, %rdi
leaq 0x22589(%rip), %rsi     # 0x6ad70
callq 0xce40
movb %al, -0x479(%rbp)
jmp 0x487f4
leaq -0x2f8(%rbp), %rdi
callq 0x9c98
leaq -0x2f9(%rbp), %rdi
callq 0x9700
movb -0x479(%rbp), %al
testb $0x1, %al
jne 0x48818
jmp 0x4885c
movq -0x308(%rbp), %rdi
callq 0x4b830
jmp 0x48826
jmp 0x4885c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x4884e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x9c98
leaq -0x2f9(%rbp), %rdi
callq 0x9700
jmp 0x48865
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
movq -0x310(%rbp), %rdi
callq 0xceb0
movq -0x318(%rbp), %rdi
callq 0x4d560
movq -0x320(%rbp), %rdi
callq 0x4d580
movq -0x328(%rbp), %rdi
callq 0xceb0
movq -0x330(%rbp), %rdi
callq 0x4d5a0
movq -0x338(%rbp), %rdi
callq 0x4d5c0
movq -0x340(%rbp), %rdi
callq 0x4d5e0
movq -0x348(%rbp), %rdi
callq 0xceb0
movq -0x28(%rbp), %rdi
callq 0x9af0
nop