LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/ServerSocket.cpp
// Function: ServerSocket::createSocket()
void ServerSocket::createSocket()
{
	// Creating a TCP socket
	if ((_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
		throw std::runtime_error("Fatal error: socket function failed\n");

	// Setting its options
	int yes = true;
	if (setsockopt(_fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1)
		throw std::runtime_error("Fatal error: setsockopt function failed\n");
	
	// Initializing structure for socket information (IP, port..)
	struct sockaddr_in socketAddr;
	bzero((char *) &socketAddr, sizeof(socketAddr));
	socketAddr.sin_family = AF_INET;
	socketAddr.sin_addr.s_addr = INADDR_ANY;
	socketAddr.sin_port = htons(_port);
	
	// Binding the socket to a port
	if (bind(_fd, (struct sockaddr *) &socketAddr, sizeof(socketAddr)) < 0)
		throw std::runtime_error("Fatal error: bind function failed\n");

	listen(_fd, _maxClient);
	printLog(" >> PORT " + convertNbToString(_port) + ": HTTP socket created\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, %rbx
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x4120
movl %eax, 0x8(%rbx)
testl %eax, %eax
js 0xaa32
leaq -0x18(%rbp), %rcx
movl $0x1, (%rcx)
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x46e0
cmpl $-0x1, %eax
je 0xaa4e
leaq -0xa8(%rbp), %rsi
andq $0x0, 0x8(%rsi)
movw $0x2, (%rsi)
andl $0x0, 0x4(%rsi)
movzwl (%rbx), %eax
rolw $0x8, %ax
movw %ax, 0x2(%rsi)
movl 0x8(%rbx), %edi
pushq $0x10
popq %rdx
callq 0x4090
testl %eax, %eax
js 0xaa6a
movl 0x4(%rbx), %esi
movl 0x8(%rbx), %edi
callq 0x4480
movslq (%rbx), %rsi
leaq -0x98(%rbp), %rbx
movq %rbx, %rdi
callq 0xfc62
leaq 0x6bd8(%rip), %rsi      # 0x11596
leaq -0x58(%rbp), %rdi
movq %rbx, %rdx
callq 0x4f60
leaq 0x6bcf(%rip), %rdx      # 0x115a0
leaq -0x78(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4f37
leaq 0x6d15(%rip), %rsi      # 0x116fa
leaq -0x38(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x4ec8
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x10271
leaq -0x38(%rbp), %rdi
callq 0x47d8
leaq -0x78(%rbp), %rdi
callq 0x47d8
leaq -0x58(%rbp), %rdi
callq 0x47d8
leaq -0x98(%rbp), %rdi
callq 0x47d8
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x4220
movq %rax, %r14
leaq 0x6ae1(%rip), %rsi      # 0x11525
movq %rax, %rdi
callq 0x41c0
jmp 0xaa84
pushq $0x10
popq %rdi
callq 0x4220
movq %rax, %r14
leaq 0x6aea(%rip), %rsi      # 0x1154a
movq %rax, %rdi
callq 0x41c0
jmp 0xaa84
pushq $0x10
popq %rdi
callq 0x4220
movq %rax, %r14
leaq 0x6af7(%rip), %rsi      # 0x11573
movq %rax, %rdi
callq 0x41c0
movq 0xe565(%rip), %rsi      # 0x18ff0
movq 0xe536(%rip), %rdx      # 0x18fc8
movq %r14, %rdi
callq 0x46b0
jmp 0xaa9e
jmp 0xaa9e
movq %rax, %rbx
movq %r14, %rdi
callq 0x4330
jmp 0xaae4
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x47d8
jmp 0xaabc
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x47d8
jmp 0xaaca
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x47d8
jmp 0xaad8
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x47d8
movq %rbx, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Request.cpp
// Function: swap(Request&, Request&)
void swap(Request& a, Request& b)
{
	std::swap(a._buffer, b._buffer);
	std::swap(a._index, b._index);
	std::swap(a._infoVirServs, b._infoVirServs);
	
	swap(a._reqLine, b._reqLine);
	std::swap(a._headers, b._headers);
	swap(a._body, b._body);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4320
movq 0x20(%r14), %rax
movq 0x20(%rbx), %rcx
movq %rcx, 0x20(%r14)
movq %rax, 0x20(%rbx)
movq 0x28(%r14), %rax
movq 0x28(%rbx), %rcx
movq %rcx, 0x28(%r14)
movq %rax, 0x28(%rbx)
leaq 0x30(%r14), %rdi
leaq 0x30(%rbx), %rsi
callq 0xc68f
leaq 0x78(%r14), %rdi
leaq 0x78(%rbx), %rsi
callq 0xc92a
movl $0xa8, %eax
addq %rax, %r14
addq %rax, %rbx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xc6c8
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Request.cpp
// Function: Request::newLineReceived(unsigned long)
bool Request::newLineReceived(size_t posCLRF)
{
    // Protecting against too long fields
    if (_reqLine.getPath().empty() && _buffer.size() - _index > MAX_URI_LEN)
        throw StatusLine(414, REASON_414);
    else if (!_body.isReceiving() && _buffer.size() - _index > MAX_HEADER_LEN)
        throw StatusLine(431, REASON_431);

	else if (posCLRF == std::string::npos)
		return false;

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpq $0x0, 0x40(%rdi)
jne 0xb6bc
movq 0x8(%rdi), %rax
subq 0x20(%rdi), %rax
cmpq $0x1f41, %rax           # imm = 0x1F41
jae 0xb73c
cmpb $0x0, 0xa8(%rdi)
jne 0xb6d5
movq 0x8(%rdi), %rax
subq 0x20(%rdi), %rax
cmpq $0x1f41, %rax           # imm = 0x1F41
jae 0xb6e7
cmpq $-0x1, %rsi
setne %al
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x6001(%rip), %rsi      # 0x116fa
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x5f94(%rip), %rdx      # 0x116a4
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x1af, %esi            # imm = 0x1AF
callq 0xc540
xorl %r15d, %r15d
leaq 0xd665(%rip), %rsi      # 0x18d90
leaq 0xe64(%rip), %rdx       # 0xc596
movq %rbx, %rdi
callq 0x46b0
jmp 0xb78f
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x5fac(%rip), %rsi      # 0x116fa
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x5f32(%rip), %rdx      # 0x11697
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x19e, %esi            # imm = 0x19E
callq 0xc540
xorl %r15d, %r15d
leaq 0xd610(%rip), %rsi      # 0x18d90
leaq 0xe0f(%rip), %rdx       # 0xc596
movq %rbx, %rdi
callq 0x46b0
jmp 0xb793
jmp 0xb7a6
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xb7a9
jmp 0xb7b1
movq %rax, %r14
movq %rbx, %rdi
callq 0x4330
movq %r14, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Request.cpp
// Function: Request::findMaxSize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
long Request::findMaxSize(const std::string& hostValue)
{
	const ServerInfo* servMatch = findVirtServ(_infoVirServs, hostValue);

	// Case no match with host header, using default virtual server
	if (!servMatch)
		servMatch = &_infoVirServs->front();

	return servMatch->getMaxClientsBS();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x100b9
testq %rax, %rax
jne 0xbaf0
movq 0x28(%rbx), %rax
movq (%rax), %rax
movq %rax, %rdi
callq 0x598a
movslq (%rax), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Request.cpp
// Function: Request::parseBody()
void Request::parseBody()
{
	size_t lenToRead = _buffer.size() - _index;
	
	// Ignoring end of buffer if we received the amount of octets expected
	if (lenToRead > _body.getSize())
		_body.setSize(lenToRead);
	
	// Storing the part of body received until content-length octects are received
	if (_body.recvBuffer(_buffer, _index, lenToRead) == -1)
		throw StatusLine(413, REASON_413, "received more octets than max body size limit");
	_index += lenToRead;

	if (!_body.getSize())
		throw StatusLine(200, REASON_200);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movq 0x20(%rdi), %rdx
subq %rdx, %r14
addq $0xa8, %rdi
cmpq 0xb0(%rbx), %r14
jbe 0xbe26
movq %r14, 0xb0(%rbx)
movq %rbx, %rsi
movq %r14, %rcx
callq 0xc62e
cmpl $-0x1, %eax
je 0xbe4f
addq %r14, 0x20(%rbx)
cmpq $0x0, 0xb0(%rbx)
je 0xbea4
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x5808(%rip), %rsi      # 0x11669
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x57df(%rip), %rdx      # 0x11657
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x19d, %esi            # imm = 0x19D
callq 0xc540
xorl %r15d, %r15d
leaq 0xcefd(%rip), %rsi      # 0x18d90
leaq 0x6fc(%rip), %rdx       # 0xc596
movq %rbx, %rdi
callq 0x46b0
jmp 0xbef7
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x5844(%rip), %rsi      # 0x116fa
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x574f(%rip), %rdx      # 0x1161c
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0xc8, %esi
callq 0xc540
xorl %r15d, %r15d
leaq 0xcea8(%rip), %rsi      # 0x18d90
leaq 0x6a7(%rip), %rdx       # 0xc596
movq %rbx, %rdi
callq 0x46b0
jmp 0xbefb
jmp 0xbf0e
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xbf11
jmp 0xbf19
movq %rax, %r14
movq %rbx, %rdi
callq 0x4330
movq %r14, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Request.cpp
// Function: Request::clear()
void Request::clear()
{
	_index = 0;
	_buffer.clear();
	
	_reqLine.clear();
	_headers.clear();
	_body.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x20(%rdi)
andq $0x0, 0x8(%rdi)
movq (%rdi), %rax
xorl %r14d, %r14d
movb %r14b, (%rax)
orl $-0x1, 0x30(%rdi)
andq $0x0, 0x40(%rdi)
movq 0x38(%rdi), %rax
movb %r14b, (%rax)
andq $0x0, 0x60(%rdi)
movq 0x58(%rdi), %rax
movb %r14b, (%rax)
addq $0x78, %rdi
callq 0xc78c
movb %r14b, 0xa8(%rbx)
andq $0x0, 0xb0(%rbx)
andq $0x0, 0xc8(%rbx)
movq 0xc0(%rbx), %rax
movb %r14b, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xc5ba
movq 0xd025(%rip), %r14      # 0x18fd0
leaq 0x566d(%rip), %rsi      # 0x1161f
movq %r14, %rdi
callq 0x4420
movq 0x90(%rbx), %r13
movq %rbx, -0x30(%rbp)
addq $0x80, %rbx
leaq 0x5973(%rip), %r15      # 0x11946
leaq 0x53c9(%rip), %r12      # 0x113a3
cmpq %rbx, %r13
je 0xc01a
leaq 0x20(%r13), %rsi
movq %r14, %rdi
callq 0x43b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4420
leaq 0x40(%r13), %rsi
movq %rax, %rdi
callq 0x43b0
movq %rax, %rdi
movq %r12, %rsi
callq 0x4420
movq %r13, %rdi
callq 0x44a0
movq %rax, %r13
jmp 0xbfda
movq 0xcfaf(%rip), %rdi      # 0x18fd0
leaq 0x5613(%rip), %rsi      # 0x1163b
callq 0x4420
movq -0x30(%rbp), %rsi
addq $0xc0, %rsi
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x43b0
// File: /workspace/github_cpp_makefile_star2_O2/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 0xc12d
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %r12
xorl %r13d, %r13d
cmpq %r13, %r12
je 0xc091
movsbl (%r15,%r13), %edi
callq 0xfc4c
movb %al, (%r15,%r13)
incq %r13
jmp 0xc079
leaq 0x5719(%rip), %rsi      # 0x117b1
movq %r14, %rdi
xorl %edx, %edx
callq 0x47c0
cmpq $-0x1, %rax
je 0xc110
movq %rax, %r15
leaq -0x50(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x4460
leaq 0x38(%rbx), %rdi
movq %r12, %rsi
callq 0x4270
leaq -0x50(%rbp), %rdi
callq 0x47d8
incq %r15
movq 0x8(%r14), %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4460
addq $0x58, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4270
leaq -0x50(%rbp), %rdi
callq 0x47d8
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 0x4270
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x565a(%rip), %rsi      # 0x11799
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x548f(%rip), %rdx      # 0x115e5
leaq -0x50(%rbp), %rcx
movq %rbx, %rdi
movl $0x190, %esi            # imm = 0x190
callq 0xc540
xorl %r15d, %r15d
leaq 0xcc1f(%rip), %rsi      # 0x18d90
leaq 0x41e(%rip), %rdx       # 0xc596
movq %rbx, %rdi
callq 0x46b0
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xc196
jmp 0xc1ae
movq %rax, %r14
movq %rbx, %rdi
callq 0x4330
jmp 0xc1ae
jmp 0xc1a2
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x47d8
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x59bd(%rip), %rsi      # 0x11b92
leaq -0xd0(%rbp), %rbx
leaq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x4ec8
leaq -0xb0(%rbp), %r12
leaq 0x558f(%rip), %rsi      # 0x11785
leaq -0x21(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
leaq -0x90(%rbp), %r12
leaq 0x59b3(%rip), %rsi      # 0x11bc3
leaq -0x23(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
leaq -0x70(%rbp), %r12
leaq 0x5023(%rip), %rsi      # 0x1124a
leaq -0x22(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
xorl %r12d, %r12d
cmpq $0x4, %r12
je 0xc297
movq 0x20(%r14), %rsi
movq 0x8(%rbx), %rdx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x4530
testl %eax, %eax
jne 0xc25d
movq 0x8(%r15), %rax
cmpq 0x8(%rbx), %rax
je 0xc266
incq %r12
addq $0x20, %rbx
jmp 0xc236
movl %r12d, 0x30(%r14)
pushq $0x60
popq %rbx
leaq (%rbx,%rbp), %rdi
addq $-0xd0, %rdi
callq 0x47d8
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0xc26d
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x54e1(%rip), %rsi      # 0x1178a
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x5325(%rip), %rdx      # 0x115e5
leaq -0x48(%rbp), %rcx
movq %rbx, %rdi
movl $0x190, %esi            # imm = 0x190
callq 0xc540
xorl %r15d, %r15d
leaq 0xcab5(%rip), %rsi      # 0x18d90
leaq 0x2b4(%rip), %rdx       # 0xc596
movq %rbx, %rdi
callq 0x46b0
jmp 0xc2ee
jmp 0xc2ee
movq %rax, %r14
addq $-0x20, %r12
movq %r12, %rdi
callq 0x47d8
cmpq %rbx, %r12
jne 0xc2f1
jmp 0xc344
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xc31a
jmp 0xc327
movq %rax, %r14
movq %rbx, %rdi
callq 0x4330
jmp 0xc327
movq %rax, %r14
pushq $0x60
popq %rbx
leaq (%rbx,%rbp), %rdi
addq $-0xd0, %rdi
callq 0x47d8
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0xc32a
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x28, %rsp
cmpq $0x7, 0x8(%rsi)
jb 0xc3cd
movq %rsi, %rbx
leaq 0x5449(%rip), %rcx      # 0x117b3
pushq $0x5
popq %rdx
movq %rsi, %rdi
xorl %esi, %esi
callq 0x4550
testl %eax, %eax
jne 0xc3cd
leaq 0x5437(%rip), %rcx      # 0x117b9
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x4550
testl %eax, %eax
jne 0xc3cd
movq (%rbx), %rax
movsbl 0x5(%rax), %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
ja 0xc3cd
movsbl 0x7(%rax), %eax
addl $-0x30, %eax
cmpl $0xa, %eax
jae 0xc3cd
leaq 0x57a8(%rip), %rsi      # 0x11b5e
movq %rbx, %rdi
callq 0x4170
testl %eax, %eax
jne 0xc422
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x53dc(%rip), %rsi      # 0x117bb
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x51ef(%rip), %rdx      # 0x115e5
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x190, %esi            # imm = 0x190
callq 0xc540
xorl %r15d, %r15d
leaq 0xc97f(%rip), %rsi      # 0x18d90
leaq 0x17e(%rip), %rdx       # 0xc596
movq %rbx, %rdi
callq 0x46b0
jmp 0xc475
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x52c6(%rip), %rsi      # 0x116fa
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x5389(%rip), %rdx      # 0x117d4
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x1f9, %esi            # imm = 0x1F9
callq 0xc540
xorl %r15d, %r15d
leaq 0xc92a(%rip), %rsi      # 0x18d90
leaq 0x129(%rip), %rdx       # 0xc596
movq %rbx, %rdi
callq 0x46b0
jmp 0xc479
jmp 0xc48c
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xc48f
jmp 0xc497
movq %rax, %r14
movq %rbx, %rdi
callq 0x4330
movq %r14, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/./msg_format/Body.hpp
// Function: swap(Body&, Body&)
void swap(Body& a, Body& b)
		{
			std::swap(a._recv, b._recv);
			std::swap(a._size, b._size);
			std::swap(a._maxSize, b._maxSize);
			std::swap(a._buff, b._buff);
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rdi), %al
movb (%rsi), %cl
movb %cl, (%rdi)
movb %al, (%rsi)
movq 0x8(%rdi), %rax
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x8(%rsi)
movq 0x10(%rdi), %rax
movq 0x10(%rsi), %rcx
movq %rcx, 0x10(%rdi)
movq %rax, 0x10(%rsi)
addq $0x18, %rdi
addq $0x18, %rsi
popq %rbp
jmp 0x4320
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: swap(Response&, Response&)
void swap(Response& a, Response& b)
{
	std::swap(a._infoVirServs, b._infoVirServs);
	std::swap(a._req, b._req);
	swap(a._staLine, b._staLine);
	std::swap(a._buffer, b._buffer);
    std::swap(a._autoIndex, b._autoIndex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq (%rsi), %rcx
movq %rcx, (%rdi)
movq %rax, (%rsi)
movq 0x8(%rdi), %rax
movq 0x8(%rsi), %rcx
movq %rcx, 0x8(%rdi)
movq %rax, 0x8(%rsi)
addq $0x10, %rdi
addq $0x10, %rsi
callq 0xefd6
leaq 0x58(%r14), %rdi
leaq 0x58(%rbx), %rsi
callq 0x4320
movb 0x78(%r14), %al
movb 0x78(%rbx), %cl
movb %cl, 0x78(%r14)
movb %al, 0x78(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq %rsi, %r14
movq (%rsi), %rsi
movq 0x8(%rcx), %rcx
leaq (%rsi,%rcx), %rdx
movb (%rsi,%rcx), %al
cmpb $0x2f, %al
sete %dil
cmpq $0x2, %rcx
setb %cl
orb %dil, %cl
jne 0xd4e9
testb %al, %al
je 0xd4e9
movzbl %al, %eax
cmpl $0x2f, %eax
je 0xd4e9
movb 0x1(%rdx), %al
incq %rdx
jmp 0xd4d5
movq %r14, %rdi
callq 0x40d0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpb $0x2f, -0x1(%rax,%rcx)
je 0xd50d
movq (%r14), %rsi
pushq $0x2f
popq %rdx
movq %r14, %rdi
callq 0x4760
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x4640
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::execCgi(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>>*)
void Response::execCgi(const std::string& realUri, std::string* cgiName)
{
    struct stat st;
    if (stat(realUri.c_str(), &st) == -1)
	{
        throw StatusLine(404, REASON_404, "fillCgi method: " + realUri);
	}

	Body cgiRep;
	CGI cgi(&cgiRep, _req, realUri, *cgiName);
	
	cgi.executeCGI();
	
	fillStatusLine(_staLine);
	fillServerHeader();
	fillDateHeader();
	fillContentlengthHeader(convertNbToString(cgiRep.getSize()));

	_buffer += cgiRep.getBody();
	
	delete cgiName;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x3c0, %rsp            # imm = 0x3C0
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
movq (%rsi), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x43c0
cmpl $-0x1, %eax
je 0xd92b
xorl %eax, %eax
leaq -0x60(%rbp), %rbx
movb %al, -0x18(%rbx)
andq $0x0, -0x10(%rbx)
orq $-0x1, -0x8(%rbx)
leaq -0x50(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
movq 0x8(%r15), %rdx
leaq -0x348(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movq %r12, %rcx
movq %r14, %r8
callq 0xf09c
leaq -0x348(%rbp), %rdi
callq 0xf766
leaq 0x10(%r15), %rsi
movq %r15, %rdi
callq 0xdd08
movq %r15, %rdi
callq 0xde5a
movq %r15, %rdi
callq 0xde70
movq -0x70(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0xfc62
leaq -0x40(%rbp), %rsi
movq %r15, %rdi
callq 0xe164
leaq -0x40(%rbp), %rdi
callq 0x47d8
addq $0x58, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x47a0
movq %r14, %rdi
callq 0x47d8
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x4440
leaq -0x348(%rbp), %rdi
callq 0xf6c4
movq %rbx, %rdi
callq 0x47d8
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x3f44(%rip), %rsi      # 0x11881
leaq -0x348(%rbp), %rdi
movq %r12, %rdx
callq 0x5f8b
movb $0x1, %r15b
leaq 0x3f21(%rip), %rdx      # 0x11877
leaq -0x348(%rbp), %rcx
movq %rbx, %rdi
movl $0x194, %esi            # imm = 0x194
callq 0xc540
xorl %r15d, %r15d
leaq 0xb41c(%rip), %rsi      # 0x18d90
leaq -0x13e5(%rip), %rdx     # 0xc596
movq %rbx, %rdi
callq 0x46b0
movq %rax, %r14
leaq -0x348(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xd99c
jmp 0xd9d2
movq %rax, %r14
movq %rbx, %rdi
callq 0x4330
jmp 0xd9d2
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x47d8
jmp 0xd9be
jmp 0xd9bb
movq %rax, %r14
jmp 0xd9ca
movq %rax, %r14
leaq -0x348(%rbp), %rdi
callq 0xf6c4
movq %rbx, %rdi
callq 0x47d8
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::execGet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Response::execGet(const std::string& realUri)
{
    // Storing status line and some headers in buffer
    fillStatusLine(_staLine);
    fillServerHeader();
    fillDateHeader();
    
    if (!_autoIndex)
    {
        FileParser body(realUri.c_str(), true); // CAHNGER

        // Setting size after storing the body in FileParser object, then setting Last-Modified header
        fillContentlengthHeader(convertNbToString(body.getRequestFileSize()));
        fillLastModifiedHeader(realUri.c_str());
        _buffer += CLRF;

        // For GET, writing the body previously stored to the buffer
        if (_req->getMethod() == GET)
            _buffer += body.getRequestFile();
    }

    // Filling autoindex
    else
    {
        std::string autoIndexPage;
        autoIndexDisplayer(realUri, &autoIndexPage);

        fillContentlengthHeader(convertNbToString(autoIndexPage.size()));
        _buffer += CLRF + autoIndexPage;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %rsi
callq 0xdd08
movq %rbx, %rdi
callq 0xde5a
movq %rbx, %rdi
callq 0xde70
cmpb $0x0, 0x78(%rbx)
je 0xda9b
leaq -0x300(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x310(%rbp), %rsi
movq %r14, %rdi
callq 0x10678
movq -0x308(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xfc62
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0xe164
leaq -0x38(%rbp), %rdi
callq 0x47d8
leaq 0x41cf(%rip), %rsi      # 0x11c30
leaq -0x38(%rbp), %rdi
leaq -0x310(%rbp), %rdx
callq 0x5f8b
addq $0x58, %rbx
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0x47a0
leaq -0x38(%rbp), %rdi
callq 0x47d8
leaq -0x310(%rbp), %rdi
callq 0x47d8
jmp 0xdb27
movq (%r14), %rsi
leaq -0x310(%rbp), %r15
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x65f6
movq %r15, %rdi
callq 0x6b02
leaq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0xfc62
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
callq 0xe164
leaq -0x38(%rbp), %rdi
callq 0x47d8
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xe1e8
leaq 0x58(%rbx), %r14
leaq 0x4141(%rip), %rsi      # 0x11c30
movq %r14, %rdi
callq 0x4770
movq 0x8(%rbx), %rdi
callq 0xb3a2
testl %eax, %eax
jne 0xdb1b
leaq -0x310(%rbp), %rdi
callq 0x69bc
movq %r14, %rdi
movq %rax, %rsi
callq 0x47a0
leaq -0x310(%rbp), %rdi
callq 0x695c
addq $0x2f8, %rsp            # imm = 0x2F8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdb47
jmp 0xdb57
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x47d8
jmp 0xdb6d
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x47d8
jmp 0xdb5a
jmp 0xdb57
movq %rax, %rbx
leaq -0x310(%rbp), %rdi
callq 0x47d8
jmp 0xdb79
jmp 0xdb6a
movq %rax, %rbx
leaq -0x310(%rbp), %rdi
callq 0x695c
movq %rbx, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rdi
leaq -0x118(%rbp), %rsi
callq 0x43c0
cmpl $-0x1, %eax
jne 0xdc02
leaq 0x3b47(%rip), %rsi      # 0x116fa
leaq -0x40(%rbp), %r15
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
callq 0x4ec8
leaq 0x3f0a(%rip), %rdx      # 0x11ad4
leaq -0x88(%rbp), %rdi
movl $0xc9, %esi
movq %r15, %rcx
callq 0xc540
leaq 0x10(%rbx), %rdi
leaq -0x88(%rbp), %r15
movq %r15, %rsi
callq 0xefd6
movq %r15, %rdi
callq 0xc596
leaq -0x40(%rbp), %rdi
callq 0x47d8
movq %rbx, %rdi
movq %r14, %rsi
callq 0xee0e
leaq 0x10(%rbx), %rsi
movq %rbx, %rdi
callq 0xdd08
movq %rbx, %rdi
callq 0xde5a
movq %rbx, %rdi
callq 0xde70
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x47d8
movq %rbx, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rsi), %rdi
callq 0x4700
testl %eax, %eax
jne 0xdc8e
leaq 0x10(%rbx), %rsi
movq %rbx, %rdi
callq 0xdd08
movq %rbx, %rdi
callq 0xde5a
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xde70
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x3e3c(%rip), %rsi      # 0x11adc
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x3de4(%rip), %rdx      # 0x11a9b
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0xc540
xorl %r15d, %r15d
leaq 0xb0be(%rip), %rsi      # 0x18d90
leaq -0x1743(%rip), %rdx     # 0xc596
movq %rbx, %rdi
callq 0x46b0
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xdcf7
jmp 0xdcff
movq %rax, %r14
movq %rbx, %rdi
callq 0x4330
movq %r14, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::fillStatusLine(StatusLine const&)
void Response::fillStatusLine(const StatusLine& staLine)
{
	_buffer = "HTTP/1.1 " + convertNbToString(staLine.getCode()) + " " + staLine.getReason();
	if (!staLine.getAdditionalInfo().empty())
		_buffer += " (" + staLine.getAdditionalInfo() + ")";
	_buffer += CLRF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movslq (%rsi), %rsi
leaq -0x98(%rbp), %r15
movq %r15, %rdi
callq 0xfc62
leaq 0x3c11(%rip), %rsi      # 0x11948
leaq -0x78(%rbp), %rdi
movq %r15, %rdx
callq 0x4f60
leaq 0x398c(%rip), %rdx      # 0x116d6
leaq -0x38(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4f37
leaq 0x8(%r14), %rdx
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0xaf33
addq $0x58, %rbx
leaq -0x58(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x44f0
movq %r15, %rdi
callq 0x47d8
leaq -0x38(%rbp), %rdi
callq 0x47d8
leaq -0x78(%rbp), %rdi
callq 0x47d8
leaq -0x98(%rbp), %rdi
callq 0x47d8
cmpq $0x0, 0x30(%r14)
je 0xddf3
addq $0x28, %r14
leaq 0x3b9f(%rip), %rsi      # 0x11952
leaq -0x38(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x5f8b
leaq 0x3471(%rip), %rdx      # 0x1123a
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0x4f37
leaq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x47a0
leaq -0x58(%rbp), %rdi
callq 0x47d8
leaq -0x38(%rbp), %rdi
callq 0x47d8
leaq 0x3e36(%rip), %rsi      # 0x11c30
movq %rbx, %rdi
callq 0x4770
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x47d8
jmp 0xde21
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
jmp 0xde4d
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x47d8
jmp 0xde38
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x47d8
jmp 0xde46
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x47d8
movq %rbx, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O2/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 0xa518(%rip), %r14      # 0x18fd0
leaq 0x2e96(%rip), %rsi      # 0x11955
movq %r14, %rdi
callq 0x4420
movq %rax, %r15
movq %rbx, %rdi
callq 0x83bc
movq %r15, %rdi
movq %rax, %rsi
callq 0x43b0
leaq 0x28bf(%rip), %r15      # 0x113a3
movq %rax, %rdi
movq %r15, %rsi
callq 0x4420
movq %rbx, %rdi
callq 0x83d0
movq (%rax), %r12
leaq 0x2e5b(%rip), %r13      # 0x1195c
movq %rbx, %rdi
callq 0x83d0
cmpq 0x8(%rax), %r12
je 0xeb36
movq %r14, %rdi
movq %r13, %rsi
callq 0x4420
movq %rax, %rdi
movq %r12, %rsi
callq 0x43b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4420
addq $0x20, %r12
jmp 0xeb01
movq %rbx, %rdi
callq 0x83da
movq (%rax), %r14
movq 0xa488(%rip), %r15      # 0x18fd0
leaq 0x2e17(%rip), %r12      # 0x11966
leaq 0x284d(%rip), %r13      # 0x113a3
movq %rbx, %rdi
callq 0x83da
cmpq 0x8(%rax), %r14
je 0xeb8b
movq %r15, %rdi
movq %r12, %rsi
callq 0x4420
movq %rax, %rdi
movq %r14, %rsi
callq 0x43b0
movq %rax, %rdi
movq %r13, %rsi
callq 0x4420
addq $0x20, %r14
jmp 0xeb56
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movq %rdx, %r15
movq %rdi, %r14
movq (%rcx), %r12
leaq -0xe0(%rbp), %r13
cmpq 0x8(%rbx), %r12
je 0xec07
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xef9e
movq (%r14), %rdi
movq %r13, %rsi
callq 0x43c0
testl %eax, %eax
je 0xebf2
movq %r14, %rdi
callq 0x47d8
addq $0x20, %r12
jmp 0xebc1
movq %r14, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x2d5f(%rip), %rsi      # 0x11978
leaq -0x50(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x2d3e(%rip), %rdx      # 0x1196e
leaq -0x50(%rbp), %rcx
movq %rbx, %rdi
movl $0x193, %esi            # imm = 0x193
callq 0xc540
xorl %r15d, %r15d
leaq 0xa145(%rip), %rsi      # 0x18d90
leaq -0x26bc(%rip), %rdx     # 0xc596
movq %rbx, %rdi
callq 0x46b0
movq %rax, %r14
leaq -0x50(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xec70
jmp 0xec78
movq %rax, %r14
movq %rbx, %rdi
callq 0x4330
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::checkMethods(int, 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&) const
void Response::checkMethods(int method, const std::vector<std::string>& methodsAllowed) const
{
	std::string tab[NB_METHODS] = { "GET", "HEAD", "POST", "DELETE" };

	for (std::vector<std::string>::const_iterator it = methodsAllowed.begin();
			it != methodsAllowed.end(); ++it)
		if (!it->compare(tab[method]))
			return ;

	throw StatusLine(405, REASON_405, "checkMethods method");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rdx, %rbx
movl %esi, %r12d
leaq 0x2ef3(%rip), %rsi      # 0x11b92
leaq -0xd0(%rbp), %r14
leaq -0x48(%rbp), %rdx
movq %r14, %rdi
callq 0x4ec8
leaq -0xb0(%rbp), %r15
leaq 0x2ac5(%rip), %rsi      # 0x11785
leaq -0x21(%rbp), %rdx
movq %r15, %rdi
callq 0x4ec8
leaq -0x90(%rbp), %r15
leaq 0x2ee9(%rip), %rsi      # 0x11bc3
leaq -0x23(%rbp), %rdx
movq %r15, %rdi
callq 0x4ec8
leaq -0x70(%rbp), %r15
leaq 0x2559(%rip), %rsi      # 0x1124a
leaq -0x22(%rbp), %rdx
movq %r15, %rdi
callq 0x4ec8
movq (%rbx), %r14
movslq %r12d, %rax
shlq $0x5, %rax
leaq (%rax,%rbp), %r15
addq $-0xd0, %r15
cmpq 0x8(%rbx), %r14
je 0xed58
movq %r14, %rdi
movq %r15, %rsi
callq 0x4040
addq $0x20, %r14
testl %eax, %eax
jne 0xed12
pushq $0x60
popq %rbx
leaq (%rbx,%rbp), %rdi
addq $-0xd0, %rdi
callq 0x47d8
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0xed2e
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %r14
leaq 0x2c4e(%rip), %rsi      # 0x119b8
leaq -0x48(%rbp), %rdi
leaq -0x21(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x2c24(%rip), %rdx      # 0x119a5
leaq -0x48(%rbp), %rcx
movq %r14, %rdi
movl $0x195, %esi            # imm = 0x195
callq 0xc540
xorl %r15d, %r15d
leaq 0x9ff4(%rip), %rsi      # 0x18d90
leaq -0x280d(%rip), %rdx     # 0xc596
movq %r14, %rdi
callq 0x46b0
jmp 0xedaf
jmp 0xedaf
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x47d8
cmpq %r14, %r15
jne 0xedb2
jmp 0xee06
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xeddb
jmp 0xede8
movq %rax, %rbx
movq %r14, %rdi
callq 0x4330
jmp 0xede8
movq %rax, %rbx
pushq $0x60
popq %r14
leaq (%r14,%rbp), %rdi
addq $-0xd0, %rdi
callq 0x47d8
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0xedec
movq %rbx, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x250(%rbp), %r15
movq %r15, %rdi
callq 0x44b0
movq (%r14), %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x43d0
leaq -0x1d0(%rbp), %rdi
callq 0x4100
testb %al, %al
je 0xee87
movq 0x8(%rbx), %rdi
callq 0xb38a
leaq -0x240(%rbp), %rdi
addq $0x18, %rax
movq %rax, %rsi
callq 0x43b0
leaq -0x250(%rbp), %rdi
callq 0x40e0
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %rbx
leaq 0x2c18(%rip), %rsi      # 0x11ab1
leaq -0x40(%rbp), %rdi
leaq -0x19(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x2beb(%rip), %rdx      # 0x11a9b
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0xc540
xorl %r15d, %r15d
leaq 0x9ec5(%rip), %rsi      # 0x18d90
leaq -0x293c(%rip), %rdx     # 0xc596
movq %rbx, %rdi
callq 0x46b0
movq %rax, %r14
leaq -0x40(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xeef0
jmp 0xeefd
movq %rax, %r14
movq %rbx, %rdi
callq 0x4330
jmp 0xeefd
movq %rax, %r14
leaq -0x250(%rbp), %rdi
callq 0x40e0
movq %r14, %rdi
callq 0x46d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
xorl %r14d, %r14d
movq (%rbx), %rdi
movq (%rdi,%r14), %rax
testq %rax, %rax
je 0xf6f3
movq %rax, %rdi
callq 0x44c0
movq (%rbx), %rax
andq $0x0, (%rax,%r14)
addq $0x8, %r14
jmp 0xf6d1
callq 0x4510
pushq $0x8
popq %r14
movq 0x8(%rbx), %rdi
cmpq $0x0, -0x8(%rdi,%r14)
je 0xf720
movq (%rdi,%r14), %rdi
callq 0x44c0
movq 0x8(%rbx), %rax
andq $0x0, (%rax,%r14)
addq $0x8, %r14
jmp 0xf6fc
callq 0x4510
leaq 0x290(%rbx), %rdi
callq 0x8cde
leaq 0x270(%rbx), %rdi
callq 0x47d8
leaq 0x250(%rbx), %rdi
callq 0x47d8
leaq 0x230(%rbx), %rdi
callq 0x47d8
addq $0x20, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x40e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Cgi.cpp
// Function: CGI::mySwap(CGI&, CGI&)
void CGI::mySwap(CGI &a, CGI &b)
{
	std::swap(a._envvar, b._envvar);
	std::swap(a._emptyBody, b._emptyBody);
	std::swap(a._req, b._req);
	std::swap(a._exec, b._exec);
	std::swap(a._path_info, b._path_info);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq (%rsi), %rax
movq (%rdx), %rcx
movq %rcx, (%rsi)
movq %rax, (%rdx)
movq 0x10(%rsi), %rax
movq 0x10(%rdx), %rcx
movq %rcx, 0x10(%rsi)
movq %rax, 0x10(%rdx)
movq 0x18(%rsi), %rax
movq 0x18(%rdx), %rcx
movq %rcx, 0x18(%rsi)
movq %rax, 0x18(%rdx)
movl $0x230, %esi            # imm = 0x230
leaq (%r14,%rsi), %rdi
addq %rdx, %rsi
callq 0x4320
movl $0x290, %eax            # imm = 0x290
addq %rax, %r14
addq %rax, %rbx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xfc20
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %rsp
movq %rdx, -0x38(%rbp)
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
movb 0x9781(%rip), %al       # 0x19478
testb %al, %al
je 0xfdc1
leaq 0x975a(%rip), %rdi      # 0x19460
callq 0x8c9a
xorl %r14d, %r14d
leaq -0x58(%rbp), %r13
leaq 0x1(%r14), %r12
movq %r14, %rax
cmpq 0x8(%r15), %rax
jae 0xfd9c
movq %r15, %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rdx
callq 0x47c0
cmpq $-0x1, %rax
jne 0xfd66
movq 0x8(%r15), %rcx
subq %r14, %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4460
leaq 0x9710(%rip), %rdi      # 0x19460
movq %r13, %rsi
callq 0x955e
movq %r13, %rdi
callq 0x47d8
movq 0x8(%r15), %rax
jmp 0xfd19
movq %rax, %rbx
movq %rax, %rcx
subq %r14, %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4460
leaq 0x96dc(%rip), %rdi      # 0x19460
movq %r13, %rsi
callq 0x955e
movq %r13, %rdi
callq 0x47d8
movq %rbx, %r14
jmp 0xfd12
leaq 0x96bd(%rip), %rsi      # 0x19460
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x5ea0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x96b0(%rip), %rdi      # 0x19478
callq 0x4730
testl %eax, %eax
je 0xfcff
xorps %xmm0, %xmm0
movups %xmm0, 0x9681(%rip)     # 0x19460
andq $0x0, 0x9689(%rip)      # 0x19470
leaq 0x9672(%rip), %rsi      # 0x19460
leaq -0x9f01(%rip), %rdi     # 0x5ef4
leaq 0x95f4(%rip), %rdx      # 0x193f0
callq 0x43a0
leaq 0x9670(%rip), %rdi      # 0x19478
callq 0x42d0
jmp 0xfcff
jmp 0xfe14
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x47d8
movq %rbx, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O2/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)
andq $0x0, 0x10(%rdi)
leaq -0x1a0(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x4690
movsbl %r15b, %r15d
leaq -0x1a0(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x4750
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xfe98
cmpq $0x0, 0x8(%r14)
je 0xfe68
movq %rbx, %rdi
movq %r14, %rsi
callq 0x104c4
jmp 0xfe68
leaq -0x1a0(%rbp), %rdi
callq 0x4210
movq %rbx, %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0xfecb
movq %rax, %r14
leaq -0x1a0(%rbp), %rdi
callq 0x4210
movq %rbx, %rdi
callq 0x5ef4
movq %r14, %rdi
callq 0x46d0
// File: /workspace/github_cpp_makefile_star2_O2/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
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
movq 0x18(%rsi), %r12
addq $0x8, %r15
xorl %r13d, %r13d
movq %r12, %rbx
cmpq %r15, %r12
je 0xff3c
leaq 0x20(%r12), %rdi
movq 0x28(%r12), %r9
xorl %esi, %esi
pushq $-0x1
popq %rdx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x4070
testl %eax, %eax
sete %al
cmoveq %r12, %rbx
orb %al, %r13b
movq %r12, %rdi
callq 0x44a0
movq %rax, %r12
jmp 0xff04
testb $0x1, %r13b
je 0xff5c
leaq 0x20(%rbx), %rsi
addq $0x40, %rbx
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x4580
movq %rbx, 0x20(%r14)
jmp 0xff77
leaq -0x38(%rbp), %rdx
andq $0x0, (%rdx)
leaq 0x178f(%rip), %rsi      # 0x116fa
movq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x10500
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq