LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Request.cpp
// Function: Request::print() const
void Request::print() const
{
	_reqLine.print();

	std::cout << "-------- HEADERS ---------\n";
	for (std::map<std::string, std::string>::const_iterator it = _headers.begin();
			it != _headers.end(); ++it)
		std::cout << it->first << ":" << it->second << "\n";
	
	std::cout << "---------- BODY ----------\n" << _body.getBody();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x30, %rdi
callq 0xe188
movq 0xf5d7(%rip), %rdi      # 0x1cfc8
leaq 0x7c2e(%rip), %rsi      # 0x15626
movl $0x1b, %edx
callq 0x4460
movq 0x90(%rbx), %r14
movq %rbx, -0x30(%rbp)
leaq 0x80(%rbx), %r15
cmpq %r15, %r14
je 0xda7e
leaq 0x7f78(%rip), %r12      # 0x15998
leaq 0x7998(%rip), %r13      # 0x153bf
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq 0xf592(%rip), %rdi      # 0x1cfc8
callq 0x4460
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x4460
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdx
movq %rbx, %rdi
callq 0x4460
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x4460
movq %r14, %rdi
callq 0x4470
movq %rax, %r14
cmpq %r15, %rax
jne 0xda27
movq 0xf543(%rip), %r14      # 0x1cfc8
leaq 0x7bb6(%rip), %rsi      # 0x15642
movl $0x1b, %edx
movq %r14, %rdi
callq 0x4460
movq -0x30(%rbp), %rax
movq 0xc0(%rax), %rsi
movq 0xc8(%rax), %rdx
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4460
nop
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Request.cpp
// Function: Request::parseURI(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Request::parseURI(std::string token)
{
	if (token[0] != '/')
		throw StatusLine(400, REASON_400, "URI must begin with a /");
	
    // URI is case insensitive, transforming it to lowercase
    std::transform(token.begin(), token.end(), token.begin(), asciiToLower);
    
	// Case there is a query in the URI
	size_t querryChar = token.find("?");
	if (querryChar != std::string::npos)
	{
		_reqLine.setPath(token.substr(0, querryChar));
		_reqLine.setQuery(token.substr(querryChar + 1, token.size()));
	}

	// Case there is only path in the URI
	else
		_reqLine.setPath(token);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq (%rsi), %r15
cmpb $0x2f, (%r15)
jne 0xdbc9
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r12
testq %r12, %r12
je 0xdb08
xorl %r13d, %r13d
movsbl (%r15,%r13), %edi
callq 0x136a8
movb %al, (%r15,%r13)
incq %r13
cmpq %r13, %r12
jne 0xdaf2
leaq 0x7ca9(%rip), %rsi      # 0x157b8
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x46c0
cmpq $-0x1, %rax
je 0xdbac
movq %rax, %r15
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x4410
leaq 0x38(%rbx), %rdi
movq %r12, %rsi
callq 0x4240
leaq -0x38(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0xdb64
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
incq %r15
movq 0x8(%r14), %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4410
addq $0x58, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4240
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xdb9d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x38, %rbx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4240
movl $0x48, %edi
callq 0x41f0
movq %rax, %rbx
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x7bbb(%rip), %rsi      # 0x157a0
leaq 0x7bcb(%rip), %rdx      # 0x157b7
leaq -0x48(%rbp), %rdi
callq 0x5796
movb $0x1, %r12b
leaq 0x79ed(%rip), %rdx      # 0x155ec
leaq -0x48(%rbp), %rcx
movq %rbx, %rdi
movl $0x190, %esi            # imm = 0x190
callq 0xe0d4
xorl %r12d, %r12d
leaq 0xf156(%rip), %rsi      # 0x1cd70
leaq 0x521(%rip), %rdx       # 0xe142
movq %rbx, %rdi
callq 0x46a0
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0xdc41
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
testb %r12b, %r12b
jne 0xdc4b
jmp 0xdc7f
movq %rax, %r14
movq %rbx, %rdi
callq 0x42e0
jmp 0xdc7f
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0xdc73
jmp 0xdc7f
movq %rax, %r14
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xdc7f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
movq %r14, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Request.cpp
// Function: Request::parseMethodToken(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Request::parseMethodToken(const std::string& token)
{
	std::string methods[NB_METHODS] = {"GET", "HEAD", "POST", "DELETE"};
	
	for (int i = 0; i < NB_METHODS; ++i)
	{
		// Token should exactly match one of the five methods
		if (!token.compare(_index, methods[i].size(), methods[i]) &&
				token.size() == methods[i].size())
		{
			_reqLine.setMethod(i);
			return ;
		}
	}

	throw StatusLine(400, REASON_400, "unknown method");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x7f30(%rip), %rsi      # 0x15be4
leaq 0x7f2c(%rip), %rdx      # 0x15be7
leaq -0xd0(%rbp), %rbx
movq %rbx, %rdi
callq 0x5796
leaq -0xb0(%rbp), %r12
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x7aa9(%rip), %rsi      # 0x1578c
leaq 0x7aa6(%rip), %rdx      # 0x15790
movq %r12, %rdi
callq 0x5796
leaq -0x90(%rbp), %r12
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x7f0d(%rip), %rsi      # 0x15c15
leaq 0x7f0a(%rip), %rdx      # 0x15c19
movq %r12, %rdi
callq 0x5796
leaq -0x70(%rbp), %r12
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x753c(%rip), %rsi      # 0x15266
leaq 0x753b(%rip), %rdx      # 0x1526c
movq %r12, %rdi
callq 0x5796
xorl %r12d, %r12d
movq 0x20(%r14), %rsi
movq 0x8(%rbx), %rdx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x44f0
testl %eax, %eax
jne 0xdd5d
movq 0x8(%r15), %rax
cmpq 0x8(%rbx), %rax
je 0xddca
incq %r12
addq $0x20, %rbx
cmpq $0x4, %r12
jne 0xdd3c
movl $0x48, %edi
callq 0x41f0
movq %rax, %rbx
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x7a0b(%rip), %rsi      # 0x15791
leaq 0x7a12(%rip), %rdx      # 0x1579f
leaq -0x48(%rbp), %rdi
callq 0x5796
movb $0x1, %r12b
leaq 0x784c(%rip), %rdx      # 0x155ec
leaq -0x48(%rbp), %rcx
movq %rbx, %rdi
movl $0x190, %esi            # imm = 0x190
callq 0xe0d4
xorl %r12d, %r12d
leaq 0xefb5(%rip), %rsi      # 0x1cd70
leaq 0x380(%rip), %rdx       # 0xe142
movq %rbx, %rdi
callq 0x46a0
movl %r12d, 0x30(%r14)
movq $-0x80, %rbx
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0xddea
movq (%r13), %rsi
incq %rsi
callq 0x43e0
addq $-0x20, %r13
addq $0x20, %rbx
jne 0xddd5
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xde0a
jmp 0xde0a
movq %rax, %r14
addq $-0x10, %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0xde27
movq (%r12), %rsi
incq %rsi
callq 0x43e0
leaq -0x20(%r12), %rax
addq $-0x10, %r12
cmpq %rbx, %r12
movq %rax, %r12
jne 0xde11
jmp 0xde8e
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0xde52
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
testb %r12b, %r12b
jne 0xde5c
jmp 0xde69
movq %rax, %r14
movq %rbx, %rdi
callq 0x42e0
jmp 0xde69
movq %rax, %r14
xorl %ebx, %ebx
movq -0x70(%rbp,%rbx), %rdi
leaq (%rbx,%r13), %rax
cmpq %rdi, %rax
je 0xde84
movq (%rax), %rsi
incq %rsi
callq 0x43e0
addq $-0x20, %rbx
cmpq $-0x80, %rbx
jne 0xde6b
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Request.cpp
// Function: Request::parseHTTPVersion(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Request::parseHTTPVersion(const std::string& token)
{
	if (token.size() < 7 || token.compare(0, 5, "HTTP/") || token.compare(6, 1, ".") || 
			!isdigit(static_cast<int>(token[5])) || !isdigit(static_cast<int>(token[7])))
		throw StatusLine(400, REASON_400, "HTTP version not correct");
			
	else if (token.compare("HTTP/1.1"))
		throw StatusLine(505, REASON_505);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
cmpq $0x7, 0x8(%rsi)
jb 0xdf21
movq %rsi, %rbx
leaq 0x7904(%rip), %rcx      # 0x157ba
movl $0x5, %edx
movq %rsi, %rdi
xorl %esi, %esi
callq 0x4510
testl %eax, %eax
jne 0xdf21
leaq 0x78f0(%rip), %rcx      # 0x157c0
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x4510
testl %eax, %eax
jne 0xdf21
movq (%rbx), %rax
movsbl 0x5(%rax), %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0xdf21
movsbl 0x7(%rax), %eax
addl $-0x30, %eax
cmpl $0xa, %eax
jae 0xdf21
leaq 0x7ca8(%rip), %rsi      # 0x15bb0
movq %rbx, %rdi
callq 0x4130
testl %eax, %eax
jne 0xdf83
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x48, %edi
callq 0x41f0
movq %rax, %rbx
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x7885(%rip), %rsi      # 0x157c2
leaq 0x7896(%rip), %rdx      # 0x157da
leaq -0x40(%rbp), %rdi
callq 0x5796
movb $0x1, %r12b
leaq 0x7695(%rip), %rdx      # 0x155ec
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x190, %esi            # imm = 0x190
callq 0xe0d4
xorl %r12d, %r12d
leaq 0xedfe(%rip), %rsi      # 0x1cd70
leaq 0x1c9(%rip), %rdx       # 0xe142
movq %rbx, %rdi
callq 0x46a0
jmp 0xdfdf
movl $0x48, %edi
callq 0x41f0
movq %rax, %rbx
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x7762(%rip), %rdx      # 0x15701
leaq -0x40(%rbp), %rdi
movq %rdx, %rsi
callq 0x5796
movb $0x1, %r12b
leaq 0x7826(%rip), %rdx      # 0x157db
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x1f9, %esi            # imm = 0x1F9
callq 0xe0d4
xorl %r12d, %r12d
leaq 0xeda0(%rip), %rsi      # 0x1cd70
leaq 0x16b(%rip), %rdx       # 0xe142
movq %rbx, %rdi
callq 0x46a0
jmp 0xdfe3
jmp 0xe002
movq %rax, %r14
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xdffb
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x43e0
testb %r12b, %r12b
jne 0xe005
jmp 0xe00d
movq %rax, %r14
movq %rbx, %rdi
callq 0x42e0
movq %r14, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::replaceLocInUri(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, 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&)
void Response::replaceLocInUri(std::string* uri, const std::string& root, const std::string& locName)
{
	// Creating an iterator pointing just after the part that matched the location
	std::string::iterator it = uri->begin() + locName.size();

	// Going to the next '/' (for example, case "/authentificate/ok" matched location "/auth" with a root of "/test"
	//						  >> we need to replace "/authentificate" with "/test" in order to get "/test/ok")
	if (*it != '/' && locName.size() > 1)
		while (*it && *it != '/')
			++it;
	
	// Replacing beginning of the URI with the root path
	uri->erase(uri->begin(), it);

	// To correctly append indexs if last '/' is missing
	if (root[root.size() - 1] != '/')
		uri->insert(uri->begin(), '/');
		
	uri->insert(0, root);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq (%rsi), %rax
movq 0x8(%rcx), %rsi
leaq (%rax,%rsi), %rdx
movb (%rax,%rsi), %cl
cmpb $0x2f, %cl
sete %dil
cmpq $0x2, %rsi
setb %sil
orb %dil, %sil
jne 0xf59d
testb %cl, %cl
je 0xf59d
movzbl %cl, %ecx
cmpl $0x2f, %ecx
je 0xf59d
movb 0x1(%rdx), %cl
incq %rdx
jmp 0xf589
movq 0x8(%rbx), %rcx
addq %rax, %rcx
cmpq %rdx, %rcx
je 0xf5b8
subq %rax, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4480
jmp 0xf5c3
movq $0x0, 0x8(%rbx)
movb $0x0, (%rax)
movq (%r14), %rcx
movq 0x8(%r14), %r8
cmpb $0x2f, -0x1(%rcx,%r8)
je 0xf5f0
movl $0x1, %ecx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x2f, %r8d
callq 0x4750
movq (%r14), %rcx
movq 0x8(%r14), %r8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x4440
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::execPost(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Response::execPost(const std::string& realUri)
{
    // Need to create file so changing code 200 ("OK") to 201 ("created")
    struct stat infoFile;
    if (stat(realUri.c_str(), &infoFile) == -1)
        _staLine = StatusLine(201, REASON_201);
    
    // Creating a new file or appending to existing file post request payload. If 
    // opening failed, throws StatusLine object with error 500 (internal error)
    postToFile(realUri);
    
    // Storing status line and some headers in buffer
    fillStatusLine(_staLine);
    fillServerHeader();
    fillDateHeader();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
leaq -0x118(%rbp), %rsi
callq 0x4360
cmpl $-0x1, %eax
jne 0xfea5
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x58cd(%rip), %rdx      # 0x15701
leaq -0x40(%rbp), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0x5796
leaq 0x5cdc(%rip), %rdx      # 0x15b26
leaq -0x88(%rbp), %rdi
movl $0xc9, %esi
movq %r15, %rcx
callq 0xe0d4
movl 0x10(%rbx), %eax
leaq -0x80(%rbp), %rsi
movl -0x8(%rsi), %ecx
movl %ecx, 0x10(%rbx)
movl %eax, -0x8(%rsi)
leaq 0x18(%rbx), %rdi
callq 0x42d0
leaq 0x38(%rbx), %rdi
leaq -0x60(%rbp), %rsi
callq 0x42d0
leaq -0x88(%rbp), %rdi
callq 0xe142
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xfea5
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x122fe
leaq 0x10(%rbx), %rsi
movq %rbx, %rdi
callq 0xffe4
leaq 0x58(%rbx), %rdi
leaq 0x5a2e(%rip), %rsi      # 0x158f5
callq 0x4760
movq %rbx, %rdi
callq 0x10304
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xfefc
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::execDelete(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Response::execDelete(const std::string& realUri)
{
    if (remove(realUri.c_str()))
        throw (StatusLine(500, REASON_500, "remove function failed in DELETE method"));

    // Storing status line and some headers in buffer
    fillStatusLine(_staLine);
    fillServerHeader();
    fillDateHeader();    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq (%rsi), %rdi
callq 0x4700
testl %eax, %eax
jne 0xff52
leaq 0x10(%rbx), %rsi
movq %rbx, %rdi
callq 0xffe4
leaq 0x58(%rbx), %rdi
leaq 0x59bc(%rip), %rsi      # 0x158f5
callq 0x4760
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10304
movl $0x48, %edi
callq 0x41f0
movq %rax, %rbx
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x5bc0(%rip), %rsi      # 0x15b2e
leaq 0x5be0(%rip), %rdx      # 0x15b55
leaq -0x40(%rbp), %rdi
callq 0x5796
movb $0x1, %r12b
leaq 0x5b65(%rip), %rdx      # 0x15aed
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0xe0d4
xorl %r12d, %r12d
leaq 0xcdcd(%rip), %rsi      # 0x1cd70
leaq -0x1e68(%rip), %rdx     # 0xe142
movq %rbx, %rdi
callq 0x46a0
movq %rax, %r14
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0xffca
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x43e0
testb %r12b, %r12b
jne 0xffd4
jmp 0xffdc
movq %rax, %r14
movq %rbx, %rdi
callq 0x42e0
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: printLoc(Location const*)
void printLoc(const Location* loc)
{
	std::cout << "root: " << loc->getRoot() << "\n";
	for (std::vector<std::string>::const_iterator it = loc->getMethods().begin(); it != loc->getMethods().end(); it++)
		std::cout << "methods: " << *it << "\n";
		
	for (std::vector<std::string>::const_iterator it = loc->getIndex().begin(); it != loc->getIndex().end(); it++)
		std::cout << "index: " << *it << "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb119(%rip), %r14      # 0x1cfc8
leaq 0x3af1(%rip), %rsi      # 0x159a7
movl $0x6, %edx
movq %r14, %rdi
callq 0x4460
movq %rbx, %rdi
callq 0x8c58
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, %rdi
callq 0x4460
leaq 0x34de(%rip), %rsi      # 0x153bf
movl $0x1, %edx
movq %rax, %rdi
callq 0x4460
movq %rbx, %rdi
callq 0x8c6c
movq (%rax), %r13
movq %rbx, %rdi
callq 0x8c6c
cmpq 0x8(%rax), %r13
je 0x11f5e
movq 0xb0ba(%rip), %r14      # 0x1cfc8
leaq 0x3a99(%rip), %r15      # 0x159ae
leaq 0x34a3(%rip), %r12      # 0x153bf
movl $0x9, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4460
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r14, %rdi
callq 0x4460
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x4460
addq $0x20, %r13
movq %rbx, %rdi
callq 0x8c6c
cmpq 0x8(%rax), %r13
jne 0x11f1c
movq %rbx, %rdi
callq 0x8c76
movq (%rax), %r13
movq %rbx, %rdi
callq 0x8c76
cmpq 0x8(%rax), %r13
je 0x11fce
movq 0xb04a(%rip), %r14      # 0x1cfc8
leaq 0x3a33(%rip), %r15      # 0x159b8
leaq 0x3433(%rip), %r12      # 0x153bf
movl $0x7, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4460
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r14, %rdi
callq 0x4460
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x4460
addq $0x20, %r13
movq %rbx, %rdi
callq 0x8c76
cmpq 0x8(%rax), %r13
jne 0x11f8c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::addIndex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
std::string Response::addIndex(const std::string& uri, const std::vector<std::string>& indexs)
{
	struct stat infFile;
	
	for (std::vector<std::string>::const_iterator it = indexs.begin(); it != indexs.end(); ++it)
	{
		// Add each index to the uri
		std::string uriWithIndex(uri + *it);

		// And then try to access the URI resulting from this concatenation
		if (!stat(uriWithIndex.c_str(), &infFile))
			return uriWithIndex;
	}
	
	throw StatusLine(403, REASON_403, "trying to access a directory addIndex method");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq (%rcx), %r12
cmpq 0x8(%rcx), %r12
je 0x12047
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r14
leaq 0x10(%rdi), %r13
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x12507
movq (%r14), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4360
testl %eax, %eax
je 0x120a7
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x1203d
movq (%r13), %rsi
incq %rsi
callq 0x43e0
addq $0x20, %r12
cmpq 0x8(%rbx), %r12
jne 0x12008
movl $0x48, %edi
callq 0x41f0
movq %rax, %rbx
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x3967(%rip), %rsi      # 0x159ca
leaq 0x398c(%rip), %rdx      # 0x159f6
leaq -0x48(%rbp), %rdi
callq 0x5796
movb $0x1, %r12b
leaq 0x3943(%rip), %rdx      # 0x159c0
leaq -0x48(%rbp), %rcx
movq %rbx, %rdi
movl $0x193, %esi            # imm = 0x193
callq 0xe0d4
xorl %r12d, %r12d
leaq 0xacd8(%rip), %rsi      # 0x1cd70
leaq -0x3f5d(%rip), %rdx     # 0xe142
movq %rbx, %rdi
callq 0x46a0
movq %r14, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x120d4
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
testb %r12b, %r12b
jne 0x120de
jmp 0x120e6
movq %rax, %r14
movq %rbx, %rdi
callq 0x42e0
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::postToFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Response::postToFile(const std::string& uri)
{
	std::fstream postFile;

	postFile.open(uri.c_str(), std::ios::app);

	if (!postFile.is_open())
		throw (StatusLine(500, REASON_500, "failed to open file in post method"));
	
	postFile << _req->getBody().getBody();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x250(%rbp), %r15
movq %r15, %rdi
callq 0x4490
movq (%r14), %rsi
movq %r15, %rdi
movl $0x1, %edx
callq 0x4370
leaq -0x1d0(%rbp), %rdi
callq 0x40e0
testb %al, %al
je 0x1237e
movq 0x8(%rbx), %rdi
callq 0xcaba
leaq -0x240(%rbp), %rdi
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
callq 0x4460
leaq -0x250(%rbp), %rdi
callq 0x40c0
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x48, %edi
callq 0x41f0
movq %rax, %rbx
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x3769(%rip), %rsi      # 0x15b03
leaq 0x3784(%rip), %rdx      # 0x15b25
leaq -0x40(%rbp), %rdi
callq 0x5796
movb $0x1, %r12b
leaq 0x3739(%rip), %rdx      # 0x15aed
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0xe0d4
xorl %r12d, %r12d
leaq 0xa9a1(%rip), %rsi      # 0x1cd70
leaq -0x4294(%rip), %rdx     # 0xe142
movq %rbx, %rdi
callq 0x46a0
movq %rax, %r14
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x123f6
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x43e0
testb %r12b, %r12b
jne 0x12400
jmp 0x1240d
movq %rax, %r14
movq %rbx, %rdi
callq 0x42e0
jmp 0x1240d
movq %rax, %r14
leaq -0x250(%rbp), %rdi
callq 0x40c0
movq %r14, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/server/Cgi.cpp
// Function: CGI::~CGI()
CGI::~CGI()
{
	int i = -1;
	while (_envvar[++i]){
		free(_envvar[i]); _envvar[i] = NULL;}
	delete[] _envvar;
	
	i = 0;
	while (_args[i++]){
		free(_args[i]); _args[i] = NULL;}
	delete[] _args;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1306d
xorl %r14d, %r14d
callq 0x44a0
movq (%rbx), %rax
movq $0x0, (%rax,%r14)
movq (%rbx), %rax
movq 0x8(%rax,%r14), %rdi
addq $0x8, %r14
testq %rdi, %rdi
jne 0x1304c
movq %rax, %rdi
callq 0x44e0
movq 0x8(%rbx), %rdi
cmpq $0x0, (%rdi)
je 0x130a9
movl $0x8, %r14d
movq (%rdi,%r14), %rdi
callq 0x44a0
movq 0x8(%rbx), %rax
movq $0x0, (%rax,%r14)
movq 0x8(%rbx), %rdi
cmpq $0x0, (%rdi,%r14)
leaq 0x8(%r14), %r14
jne 0x13085
callq 0x44e0
movq 0x2b0(%rbx), %rdi
leaq 0x2c0(%rbx), %rax
cmpq %rax, %rdi
je 0x130cc
movq (%rax), %rsi
incq %rsi
callq 0x43e0
movq 0x290(%rbx), %rdi
leaq 0x2a0(%rbx), %rax
cmpq %rax, %rdi
je 0x130ea
movq (%rax), %rsi
incq %rsi
callq 0x43e0
movq 0x270(%rbx), %rdi
leaq 0x280(%rbx), %rax
cmpq %rax, %rdi
je 0x13108
movq (%rax), %rsi
incq %rsi
callq 0x43e0
movq 0x250(%rbx), %rdi
leaq 0x260(%rbx), %rax
cmpq %rax, %rdi
je 0x13126
movq (%rax), %rsi
incq %rsi
callq 0x43e0
movq 0x230(%rbx), %rdi
leaq 0x240(%rbx), %rax
cmpq %rax, %rdi
je 0x13144
movq (%rax), %rsi
incq %rsi
callq 0x43e0
addq $0x20, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x40c0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/utils/utils.cpp
// Function: stringDelimSplit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char const*)
std::vector<std::string> stringDelimSplit(std::string const &str, const char *delim)
{
    static std::vector<std::string> strArray;       // use static to return the vector
    size_t posinit = 0, posfind = 0;
    
    strArray.clear();
    while (posfind < str.size()){
        posfind = str.find(delim, posinit + 1);
        
        if (posfind != std::string::npos){
            strArray.push_back(str.substr(posinit, posfind - posinit));
            posinit = posfind;
        }
        else{
            strArray.push_back(str.substr(posinit, str.size() - posinit));
            posfind = str.size();
        }
    }
    return strArray;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, -0x50(%rbp)
movb 0x9ce8(%rip), %al       # 0x1d460
testb %al, %al
je 0x13878
movq 0x9cc1(%rip), %rsi      # 0x1d448
leaq 0x9cba(%rip), %rdi      # 0x1d448
callq 0x9c86
cmpq $0x0, 0x8(%r14)
je 0x13853
xorl %r13d, %r13d
leaq -0x48(%rbp), %r12
leaq 0x1(%r13), %rbx
movq %r15, %rdi
callq 0x41e0
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x46c0
cmpq $-0x1, %rax
je 0x13812
movq %rax, %rbx
movq %rax, %rcx
subq %r13, %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x4410
leaq 0x9c62(%rip), %rdi      # 0x1d448
movq %r12, %rsi
callq 0xa272
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x13807
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %r13
cmpq 0x8(%r14), %rbx
jb 0x137a5
jmp 0x13853
movq 0x8(%r14), %rcx
subq %r13, %rcx
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x4410
leaq 0x9c16(%rip), %rdi      # 0x1d448
movq %rbx, %rsi
callq 0xa272
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x13853
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq 0x9bee(%rip), %rsi      # 0x1d448
movq -0x50(%rbp), %rbx
movq %rbx, %rdi
callq 0x633e
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x48e0
jmp 0x13780
jmp 0x13884
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x138a0
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/utils/utils.cpp
// Function: splitWithSep(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char)
std::vector<std::string> splitWithSep(std::string line, char sep)
{
	std::vector<std::string> res;
	std::istringstream s(line);

	while (std::getline(s, line, sep))
		if (!line.empty())
			res.push_back(line);
	
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq -0x1a0(%rbp), %rdi
movl $0x8, %edx
callq 0x4670
movsbl %r15b, %r15d
leaq -0x1a0(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x4740
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1391d
cmpq $0x0, 0x8(%r14)
je 0x138ed
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14048
jmp 0x138ed
movq 0x968c(%rip), %rsi      # 0x1cfb0
leaq -0x1a0(%rbp), %rdi
callq 0x4550
leaq -0x128(%rbp), %rdi
callq 0x4180
movq %rbx, %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x13976
movq %rax, %r14
movq 0x9652(%rip), %rsi      # 0x1cfb0
leaq -0x1a0(%rbp), %rdi
callq 0x4550
leaq -0x128(%rbp), %rdi
callq 0x4180
movq %rbx, %rdi
callq 0x63d2
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/utils/utils.cpp
// Function: matchLocation(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Location, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, Location>>> const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::pair<const std::string, const Location*> 
		matchLocation(const std::map<std::string, Location>* loc, const std::string& locName)
{
	std::pair<bool, std::map<std::string, Location>::const_iterator> 
						bestMatch(0, loc->begin());

	// Checking each location name, and saving the most long match. As we stored location names in a map,
	// they're already sorted form smaller to longest same words, no need to check size: the last match will 
	// be the longest possible match (ex: if searching for "bla", "bl" location will be stored after "b" location)
	for (std::map<std::string, Location>::const_iterator it = loc->begin(); it != loc->end(); ++it)
	{
		if (!it->first.compare(0, std::string::npos, locName, 0, it->first.size()))
		{
			bestMatch.first = true;
			bestMatch.second = it;
		}
	}
	
	// Case there was no match
	if (!bestMatch.first)
		return std::pair<const std::string, const Location*>("", 0);

	return std::pair<const std::string, const Location*>(bestMatch.second->first, &bestMatch.second->second);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r12
movq 0x18(%rsi), %r13
addq $0x8, %r15
cmpq %r15, %r13
je 0x13a17
movq %rdx, %r14
movq %r12, -0x30(%rbp)
xorl %ebx, %ebx
movq %r13, %r12
leaq 0x20(%r12), %rdi
movq 0x28(%r12), %r9
xorl %esi, %esi
movq $-0x1, %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
sete %al
cmoveq %r12, %r13
orb %al, %bl
movq %r12, %rdi
callq 0x4470
movq %rax, %r12
cmpq %r15, %rax
jne 0x139b3
testb $0x1, %bl
movq -0x30(%rbp), %r12
je 0x13a17
leaq 0x40(%r13), %rbx
leaq 0x10(%r12), %rax
movq %rax, (%r12)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x67e2
jmp 0x13a34
leaq 0x10(%r12), %rax
movq %rax, (%r12)
leaq 0x1cda(%rip), %rdx      # 0x15701
movq %r12, %rdi
movq %rdx, %rsi
callq 0x5796
xorl %ebx, %ebx
movq %rbx, 0x20(%r12)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/utils/utils.cpp
// Function: locationSearcher(std::vector<ServerInfo, std::allocator<ServerInfo>> const*, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>> const&)
std::pair<const std::string, const Location*> 
		locationSearcher(const std::vector<ServerInfo> *srv, std::pair<std::string, std::string> const &names)
{
	// loop for each virtual server for a specific port
	for (size_t i = 0; i < srv->size(); i++){
	
		std::vector<std::string> sinfoNames = (*srv)[i].getNames();

		// loop for each names in each server block
        for (size_t j = 0; j < sinfoNames.size(); j++)
		{
			// virtual server is found
            if (!sinfoNames[j].compare(0, names.first.size() + 1, names.first))
                return matchLocation((*srv)[i].getLocation(), names.second);
        }
	}
	
	// Case no server_names match, using default server block (the first one)
	return matchLocation((*srv)[0].getLocation(), names.second);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, -0x30(%rbp)
movq (%rsi), %rdi
movq %rsi, -0x38(%rbp)
cmpq %rdi, 0x8(%rsi)
je 0x13b0f
xorl %r12d, %r12d
leaq -0x50(%rbp), %rbx
imulq $0x98, %r12, %r13
addq %r13, %rdi
callq 0x5bac
movq %rbx, %rdi
movq %rax, %rsi
callq 0x633e
movq -0x50(%rbp), %rdi
cmpq %rdi, -0x48(%rbp)
je 0x13ad7
xorl %ebx, %ebx
xorl %r15d, %r15d
addq %rbx, %rdi
movq 0x8(%r14), %rdx
incq %rdx
xorl %esi, %esi
movq %r14, %rcx
callq 0x44f0
testl %eax, %eax
je 0x13b2c
incq %r15
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
addq $0x20, %rbx
cmpq %rax, %r15
jb 0x13aa4
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
callq 0x63d2
incq %r12
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rax
subq %rdi, %rax
sarq $0x3, %rax
movabsq $-0x79435e50d79435e5, %rcx # imm = 0x86BCA1AF286BCA1B
imulq %rcx, %rax
cmpq %rax, %r12
jb 0x13a7b
callq 0x5bc0
addq $0x20, %r14
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x13986
jmp 0x13b5a
movq -0x38(%rbp), %rax
addq (%rax), %r13
movq %r13, %rdi
callq 0x5bc0
movq -0x30(%rbp), %rbx
addq $0x20, %r14
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x13986
leaq -0x50(%rbp), %rdi
callq 0x63d2
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13b6e
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x63d2
movq %rbx, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/utils/utils.cpp
// Function: findVirtServ(std::vector<ServerInfo, std::allocator<ServerInfo>> const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
const ServerInfo* findVirtServ(const std::vector<ServerInfo>* infoVirServs, const std::string& hostValue)
{
	// Looking in each virtual server names if one match host header field value
	for (std::vector<ServerInfo>::const_iterator virtServ = infoVirServs->begin(); 
			virtServ != infoVirServs->end(); ++virtServ)
	{
		for (std::vector<std::string>::const_iterator servNames = virtServ->getNames().begin();
				servNames != virtServ->getNames().end(); ++servNames)
		{
			// If we match one server name, saving this virtual server
			if (*servNames == hostValue)
				return &(*virtServ);
		}
	}
	
	// Case no match
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rbx
cmpq 0x8(%rdi), %rbx
je 0x13be8
movq %rsi, %r14
movq %rdi, %r15
movq %rbx, %rdi
callq 0x5bac
movq (%rax), %r12
movq %rbx, %rdi
callq 0x5bac
cmpq 0x8(%rax), %r12
je 0x13bdb
movq 0x8(%r12), %rdx
cmpq 0x8(%r14), %rdx
jne 0x13bd5
testq %rdx, %rdx
je 0x13bea
movq (%r14), %rsi
movq (%r12), %rdi
callq 0x4400
testl %eax, %eax
je 0x13bea
addq $0x20, %r12
jmp 0x13ba7
addq $0x98, %rbx
cmpq 0x8(%r15), %rbx
jne 0x13b9c
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/utils/utils.cpp
// Function: isExtension(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
size_t isExtension(const std::string& uri)
{
	size_t dotPos = uri.find_last_of(".");

	if (dotPos == std::string::npos)
		return std::string::npos;
	
	size_t slashPos = uri.find_last_of("/");

	// If last '.' is after last '/', returning the dot position to compare
	// the extension
	return dotPos = (dotPos > slashPos) ? dotPos : std::string::npos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x1bb6(%rip), %rsi      # 0x157c0
movq $-0x1, %rbx
movl $0x1, %ecx
movq $-0x1, %rdx
callq 0x4790
cmpq $-0x1, %rax
je 0x13c4d
movq %rax, %r15
leaq 0x1b84(%rip), %rsi      # 0x157b6
movl $0x1, %ecx
movq %r14, %rdi
movq $-0x1, %rdx
callq 0x4790
cmpq %rax, %r15
cmovaq %r15, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/utils/utils.cpp
// Function: getCgiExecutableName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Location const*)
std::string* getCgiExecutableName(const std::string& uri, const Location* loc)
{
	size_t dotPos = isExtension(uri);

	// Target ends with a '/', no extension so no cgi
	if (dotPos == std::string::npos)
		return 0;

	// Case target is a script (ends by .cgi)
	if (!uri.compare(dotPos, std::string::npos, ".cgi"))
		return new std::string(".cgi");
	
	// Case target match an extension in the appropriate location block,
	// we return the executable name
	std::map<std::string, std::string>::const_iterator it;
	if (loc && (it = loc->getCgiExe().find(std::string(uri.c_str() + dotPos))) != loc->getCgiExe().end())
		return new std::string(it->second);
	
	// Case the extension doesn't match anything
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r15
callq 0x13bf6
cmpq $-0x1, %rax
je 0x13d2f
movq %rax, %r14
leaq 0x1ef9(%rip), %rcx      # 0x15b82
movq %r15, %rdi
movq %rax, %rsi
movq $-0x1, %rdx
callq 0x4510
testl %eax, %eax
je 0x13d33
testq %rbx, %rbx
je 0x13d2f
movq %rbx, %rdi
callq 0x8c84
movq %rax, %r12
addq (%r15), %r14
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
movq %r14, %rsi
callq 0x518a
leaq -0x48(%rbp), %rsi
movq %r12, %rdi
callq 0x1256c
movq %rax, %r14
movq %rbx, %rdi
callq 0x8c84
movq %rax, %rbx
addq $0x8, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13d01
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
cmpq %rbx, %r14
je 0x13d2f
movl $0x20, %edi
callq 0x43d0
movq %rax, %rbx
addq $0x10, %rax
movq %rax, (%rbx)
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x67e2
jmp 0x13d5d
xorl %ebx, %ebx
jmp 0x13d5d
movl $0x20, %edi
callq 0x43d0
movq %rax, %rbx
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x1e34(%rip), %rsi      # 0x15b82
leaq 0x1e31(%rip), %rdx      # 0x15b86
movq %rbx, %rdi
callq 0x5796
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13d6f
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
jmp 0x13d95
jmp 0x13d7e
movq %rax, %r14
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13d9f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x13d9f
movq %rax, %r14
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/utils/utils.cpp
// Function: printLog(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&)
void printLog(const std::string &msg, const std::string& addInfo)
{
	// current date and time on the current system
	time_t now = time(0);

	// convert now to string form and removing '\n'
	std::string date(ctime(&now));
	date.resize(date.length() - 1);

	#if defined DEBUG
		std::cout << "[" << date << "] " << msg;
		if (!addInfo.empty())
				std::cout << "-------------------------\n" << addInfo << "-------------------------\n\n";
	#else
		std::cout << "[" << date << "] " << msg;
		(void)addInfo;
	#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %edi, %edi
callq 0x4380
leaq -0x48(%rbp), %rdi
movq %rax, (%rdi)
callq 0x41c0
leaq -0x40(%rbp), %r15
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x518a
movq 0x8(%r15), %rsi
decq %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x4140
movq 0x91d0(%rip), %rdi      # 0x1cfc8
leaq 0x1ea4(%rip), %rsi      # 0x15ca3
movl $0x1, %edx
callq 0x4460
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0x91b0(%rip), %rdi      # 0x1cfc8
callq 0x4460
movq %rax, %r15
leaq 0x1e7e(%rip), %rsi      # 0x15ca5
movl $0x2, %edx
movq %rax, %rdi
callq 0x4460
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x4460
cmpq $0x0, 0x8(%rbx)
je 0x13e89
movq 0x9177(%rip), %rdi      # 0x1cfc8
leaq 0x14cc(%rip), %rsi      # 0x15324
movl $0x1a, %edx
callq 0x4460
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x9158(%rip), %rdi      # 0x1cfc8
callq 0x4460
leaq 0x1529(%rip), %rsi      # 0x153a5
movl $0x1b, %edx
movq %rax, %rdi
callq 0x4460
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13ea2
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x43e0
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13ec9
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/llefranc[P]42_webserv/srcs/utils/utils.cpp
// Function: SplitPathForExec(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::pair<std::string, std::string> *SplitPathForExec(std::string const &path)
{
	static std::pair<std::string, std::string> pathAndFile;
	size_t posLastSlash = path.find_last_of("/");

	pathAndFile.first.clear();
	pathAndFile.second.clear();

	pathAndFile.first = ".";
	pathAndFile.first += path.substr(0, posLastSlash);
	pathAndFile.second = ".";
	pathAndFile.second += path.substr(posLastSlash);
	return &pathAndFile;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movb 0x95bd(%rip), %al       # 0x1d4a8
testb %al, %al
je 0x1400c
leaq 0x18bc(%rip), %rsi      # 0x157b6
movl $0x1, %ecx
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x4790
movq %rax, %r14
xorl %eax, %eax
movq %rax, 0x9556(%rip)      # 0x1d470
leaq 0x9547(%rip), %r15      # 0x1d468
movq 0x9540(%rip), %rcx      # 0x1d468
movb %al, (%rcx)
movq %rax, 0x955f(%rip)      # 0x1d490
movq 0x9550(%rip), %rcx      # 0x1d488
movb %al, (%rcx)
movq 0x952f(%rip), %rdx      # 0x1d470
leaq 0x1878(%rip), %rcx      # 0x157c0
movl $0x1, %r8d
movq %r15, %rdi
xorl %esi, %esi
callq 0x45d0
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x4410
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x4150
leaq -0x38(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x13f96
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
movq 0x94f3(%rip), %rdx      # 0x1d490
leaq 0x94e4(%rip), %r15      # 0x1d488
leaq 0x1815(%rip), %rcx      # 0x157c0
movl $0x1, %r8d
movq %r15, %rdi
xorl %esi, %esi
callq 0x45d0
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq $-0x1, %rcx
callq 0x4410
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x4150
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x13ff6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq 0x946b(%rip), %rax      # 0x1d468
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x492f
jmp 0x13ef3
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0x14034
jmp 0x14040
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14040
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x43e0
movq %rbx, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureEvaluation.cpp
// Function: gaps::CreateFeatures(gaps::R3SurfelScene*)
int
CreateFeatures(R3SurfelScene *scene)
{
  // Check if features are already created
  if (scene->NFeatures() > 0) return 1;

  // Create pointset features
  scene->InsertFeature(new R3SurfelPointSetFeature("PointSetZMax", 0, 16, 0.5));
  scene->InsertFeature(new R3SurfelPointSetFeature("PointSetZMean", 0, 8, 1));
  scene->InsertFeature(new R3SurfelPointSetFeature("PointSetZStddev", 0, 8, 1));      
  scene->InsertFeature(new R3SurfelPointSetFeature("PointSetXYMax", 0, 4, 0.5));      
  scene->InsertFeature(new R3SurfelPointSetFeature("PointSetXYStddev1", 0, 2, 1));      
  scene->InsertFeature(new R3SurfelPointSetFeature("PointSetXYStddev2", 0, 2, 1));

  // Return success
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0xac(%rdi)
jg 0x16132
movq %rdi, %r14
movl $0x48, %edi
callq 0x134e0
movq %rax, %rbx
leaq 0xc71bf(%rip), %rsi     # 0xdd178
movsd 0xc716f(%rip), %xmm1    # 0xdd130
movsd 0xc716f(%rip), %xmm2    # 0xdd138
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x3df7c
leaq 0x117c55(%rip), %r15    # 0x12dc30
movq %r15, (%rbx)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0xb0(%rax)
movl $0x48, %edi
callq 0x134e0
movq %rax, %rbx
leaq 0xc7184(%rip), %rsi     # 0xdd185
movsd 0xc7137(%rip), %xmm1    # 0xdd140
movsd 0xc7137(%rip), %xmm2    # 0xdd148
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x3df7c
movq %r15, (%rbx)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0xb0(%rax)
movl $0x48, %edi
callq 0x134e0
movq %rax, %rbx
leaq 0xc7151(%rip), %rsi     # 0xdd193
movsd 0xc70f6(%rip), %xmm1    # 0xdd140
movsd 0xc70f6(%rip), %xmm2    # 0xdd148
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x3df7c
movq %r15, (%rbx)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0xb0(%rax)
movl $0x48, %edi
callq 0x134e0
movq %rax, %rbx
leaq 0xc7120(%rip), %rsi     # 0xdd1a3
movsd 0xc70c5(%rip), %xmm1    # 0xdd150
movsd 0xc70a5(%rip), %xmm2    # 0xdd138
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x3df7c
movq %r15, (%rbx)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0xb0(%rax)
movl $0x48, %edi
callq 0x134e0
movq %rax, %rbx
leaq 0xc70ed(%rip), %rsi     # 0xdd1b1
movsd 0xc708c(%rip), %xmm1    # 0xdd158
movsd 0xc7074(%rip), %xmm2    # 0xdd148
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x3df7c
movq %r15, (%rbx)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0xb0(%rax)
movl $0x48, %edi
callq 0x134e0
movq %rax, %rbx
leaq 0xc70be(%rip), %rsi     # 0xdd1c3
movsd 0xc704b(%rip), %xmm1    # 0xdd158
movsd 0xc7033(%rip), %xmm2    # 0xdd148
xorps %xmm0, %xmm0
movq %rax, %rdi
callq 0x3df7c
movq %r15, (%rbx)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *0xb0(%rax)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
jmp 0x16147
jmp 0x16147
jmp 0x16147
jmp 0x16147
jmp 0x16147
movq %rax, %r14
movl $0x48, %esi
movq %rbx, %rdi
callq 0x134f0
movq %r14, %rdi
callq 0x138b0
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureEvaluation.cpp
// Function: gaps::EvaluateFeatures(gaps::R3SurfelScene*)
int
EvaluateFeatures(R3SurfelScene *scene)
{
  // Evaluate features for every object 
  for (int i = 0; i < scene->NObjects(); i++) {
    R3SurfelObject *object = scene->Object(i);
    object->UpdateFeatureVector();
  }

  // Return success
  return 1;
}

// Assembly:
cmpl $0x0, 0x1c(%rdi)
jle 0x1618f
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x1736e
incq %r14
movslq 0x1c(%rbx), %rax
cmpq %rax, %r14
jl 0x1616f
addq $0x8, %rsp
popq %rbx
popq %r14
movl $0x1, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/R3Surfels/R3SurfelFeatureEvaluation.cpp
// Function: gaps::R3SurfelOverheadGridFeature::R3SurfelOverheadGridFeature(char const*, char const*, double, double, double)
R3SurfelOverheadGridFeature::
R3SurfelOverheadGridFeature(const char *filename, const char *featurename, RNScalar minimum, RNScalar maximum, RNScalar weight)
  : R3SurfelFeature(featurename, minimum, maximum, weight),
    filename(NULL),
    world_to_grid_matrix(R3null_matrix),
    fp(NULL)
{
  // Initialize resolution
  grid_resolution[0] = 0;
  grid_resolution[1] = 0;

  // Open file
  fp = fopen(filename, "rb");
  if (!fp) {
    RNFail("Unable to open overhead grid file %s\n", filename);
    return;
  }

  // Read grid resolution from file
  if (fread(&grid_resolution, sizeof(int), 2, fp) != 2) {
    RNFail("Unable to read grid file %s", filename);
    fclose(fp);
    grid_resolution[0] = 0;
    grid_resolution[1] = 0;
    fp = NULL;
    return;
  }

  // Read world_to_grid transformation from file
  RNScalar m[9];
  if (fread(m, sizeof(RNScalar), 9, fp) != 9) {
    RNFail("Invalid format for grid file %s", filename);
    fclose(fp);
    grid_resolution[0] = 0;
    grid_resolution[1] = 0;
    fp = NULL;
    return;
  }

  // Create world_to_grid transformation matrix
  world_to_grid_matrix = R3Matrix(m);

  // Copy filename
  this->filename = RNStrdup(filename);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x3df7c
leaq 0x11743f(%rip), %rax    # 0x12dc98
movq %rax, (%rbx)
movq $0x0, 0x48(%rbx)
leaq 0x50(%rbx), %r12
leaq 0xcf969(%rip), %rsi     # 0xe61d8
movq %r12, %rdi
callq 0xa060e
xorps %xmm0, %xmm0
movups %xmm0, 0x98(%rbx)
leaq 0xc694d(%rip), %rsi     # 0xdd1d5
movq %r14, %rdi
callq 0x135d0
movq %rax, 0xa0(%rbx)
testq %rax, %rax
je 0x16905
leaq 0x98(%rbx), %r15
movl $0x4, %esi
movl $0x2, %edx
movq %r15, %rdi
movq %rax, %rcx
callq 0x13790
cmpq $0x2, %rax
jne 0x16918
movq 0xa0(%rbx), %rcx
movq %rsp, %rdi
movl $0x8, %esi
movl $0x9, %edx
callq 0x13790
cmpq $0x9, %rax
jne 0x1692b
leaq 0x50(%rsp), %rdi
movq %rsp, %rsi
callq 0xa069e
leaq 0x50(%rsp), %rsi
movq %r12, %rdi
callq 0xa1058
movq %r14, %rdi
callq 0xac67b
movq %rax, 0x48(%rbx)
jmp 0x1694f
leaq 0xc68cc(%rip), %rdi     # 0xdd1d8
movq %r14, %rsi
xorl %eax, %eax
callq 0xac81a
jmp 0x1694f
leaq 0xc68df(%rip), %rdi     # 0xdd1fe
movq %r14, %rsi
xorl %eax, %eax
callq 0xac81a
jmp 0x1693c
leaq 0xc68e8(%rip), %rdi     # 0xdd21a
movq %r14, %rsi
xorl %eax, %eax
callq 0xac81a
movq 0xa0(%rbx), %rdi
callq 0x134d0
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x16962
jmp 0x16962
movq %rax, %r14
movq %rbx, %rdi
callq 0x3e054
movq %r14, %rdi
callq 0x138b0
nop