// File: /workspace/github_cpp_makefile_star2_O2/mbourand[P]webserv/srcs/Config/ConfigContext.cpp
// Function: ConfigContext::getErrorPage[abi:cxx11](int) const
std::string ConfigContext::getErrorPage(int code) const
{
	if (_error_pages.find(code) != _error_pages.end())
	{
		try
		{
			std::ifstream file(_error_pages.find(code)->second.c_str(), std::ifstream::in);
			std::string content((std::istreambuf_iterator<char>(file)), (std::istreambuf_iterator<char>()));
			return content;
		}
		catch (std::exception& e) {}
	}
	std::stringstream ss;
	ss << code;
	std::string code_str = ss.str();
	return
"<html>\r\n\
	<head><title>" + code_str + " " + ft::getErrorMessage(code) + "</title></head>\r\n\
	<body>\r\n\
		<center><h1>" + code_str + " " + ft::getErrorMessage(code) + "</h1></center>\r\n\
		<hr><center>Webserv 1.0.0</center>\r\n\
	</body>\r\n\
</html>\r\n";
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x350, %rsp            # imm = 0x350
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
movl %edx, (%rsi)
leaq 0x68(%r15), %r14
movq %r14, %rdi
callq 0x2406c
addq $0x70, %r15
cmpq %r15, %rax
je 0x217b4
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x2406c
movq 0x28(%rax), %rsi
leaq 0x148(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x78d0
movq 0x148(%rsp), %rax
movq -0x18(%rax), %rax
movq 0x230(%rsp,%rax), %rsi
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
pushq $-0x1
popq %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
movl %edx, %r8d
callq 0xcee8
leaq 0x148(%rsp), %rdi
callq 0x7170
jmp 0x2194f
movq %rdx, %r15
movq %rax, %r14
leaq 0x148(%rsp), %rdi
callq 0x7170
jmp 0x2179d
movq %rdx, %r15
movq %rax, %r14
cmpl $0x1, %r15d
jne 0x219f9
movq %r14, %rdi
callq 0x7220
callq 0x77f0
leaq 0x148(%rsp), %rdi
callq 0x73a0
leaq 0x158(%rsp), %rdi
movl 0x4(%rsp), %esi
callq 0x7840
leaq 0x160(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x7780
leaq 0xd818(%rip), %rsi      # 0x2f003
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xc154
leaq 0xdda3(%rip), %rdx      # 0x2f5a4
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xbe83
movl 0x4(%rsp), %esi
leaq 0x48(%rsp), %rdi
callq 0x173e3
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0xc221
leaq 0xd7d8(%rip), %rdx      # 0x2f01a
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xbe83
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0xc1ca
leaq 0xdd2c(%rip), %rdx      # 0x2f5a4
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xbe83
movl 0x4(%rsp), %esi
leaq 0x28(%rsp), %rdi
callq 0x173e3
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0xc221
leaq 0xd787(%rip), %rdx      # 0x2f043
leaq 0x128(%rsp), %rsi
movq %rbx, %rdi
callq 0xbe83
leaq 0x128(%rsp), %rdi
callq 0x79b8
leaq 0x28(%rsp), %rdi
callq 0x79b8
leaq 0x108(%rsp), %rdi
callq 0x79b8
leaq 0xe8(%rsp), %rdi
callq 0x79b8
leaq 0xc8(%rsp), %rdi
callq 0x79b8
leaq 0xa8(%rsp), %rdi
callq 0x79b8
leaq 0x48(%rsp), %rdi
callq 0x79b8
leaq 0x88(%rsp), %rdi
callq 0x79b8
leaq 0x68(%rsp), %rdi
callq 0x79b8
leaq 0x8(%rsp), %rdi
callq 0x79b8
leaq 0x148(%rsp), %rdi
callq 0x73f0
movq %rbx, %rax
addq $0x350, %rsp            # imm = 0x350
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
leaq 0x128(%rsp), %rdi
callq 0x79b8
jmp 0x21974
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x79b8
jmp 0x21983
movq %rax, %r14
leaq 0x108(%rsp), %rdi
callq 0x79b8
jmp 0x21995
movq %rax, %r14
leaq 0xe8(%rsp), %rdi
callq 0x79b8
jmp 0x219a7
movq %rax, %r14
leaq 0xc8(%rsp), %rdi
callq 0x79b8
leaq 0xa8(%rsp), %rdi
callq 0x79b8
leaq 0x48(%rsp), %rdi
callq 0x79b8
leaq 0x88(%rsp), %rdi
callq 0x79b8
leaq 0x68(%rsp), %rdi
callq 0x79b8
leaq 0x8(%rsp), %rdi
callq 0x79b8
leaq 0x148(%rsp), %rdi
callq 0x73f0
movq %r14, %rdi
callq 0x7860
movq %rax, %r14
jmp 0x219b4
movq %rax, %r14
jmp 0x219c1
movq %rax, %r14
jmp 0x219cb
movq %rax, %r14
jmp 0x219d8
movq %rax, %r14
jmp 0x219e2
jmp 0x21a1c
movq %rax, %r14
jmp 0x219ec
nop