// File: /workspace/github_cpp_makefile_star2_O2/mbourand[P]webserv/incs/Utils/Logger.hpp
// Function: Response Logger::printImpl<Response>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Response, MessageType, LoggerMode)
T printImpl(std::string message, T rval, MessageType type, LoggerMode messagePriority)
		{
			if (messagePriority < _mode)
				return rval;

			// Format timestamp
			std::stringstream ss;
			struct timeval 	tv;
			tm time;
			gettimeofday(&tv, NULL);
			ss << tv.tv_sec;
			strptime(std::string(ss.str()).c_str(), "%s", &time);
			char buffer[100];
			strftime(buffer, 100, "[%d/%h/%Y %T %z]", &time);

			// Replace non-printable characters by their code
			ss.str("");
			for (size_t i = 0; i < message.size(); i++)
				if (message[i] < 32 || message[i] > 127)
				{
					ss << static_cast<int>(message[i]);
					message.replace(i, 1, "<" + ss.str() + ">");
					ss.str("");
				}

			switch (type)
			{
				case INFO:
					std::cout << RES << "[webserv] " << buffer << " (INFO): " << message << RES << std::endl;
					break;
				case SUCCESS:
					std::cout << GRN << "[webserv] " << buffer << " (SUCCESS): " << message << RES << std::endl;
					break;
				case WARNING:
					std::cerr << YLW << "[webserv] " << buffer << " (WARNING): " << message << RES << std::endl;
					break;
				case ERROR:
					std::cerr << RED << "[webserv] " << buffer << " (ERROR): " << message << RES << std::endl;
					break;
			}
			return rval;
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, %r12
cmpl %r9d, (%rsi)
jle 0xca88
movq %r12, %rdi
movq %rcx, %rsi
callq 0x29f62
movq %r12, %rax
jmp 0xcd55
movl %r8d, %ebp
movq %rdx, %r15
movq %rcx, 0x10(%rsp)
leaq 0x130(%rsp), %rdi
callq 0x73a0
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x77c0
leaq 0x140(%rsp), %rdi
movq (%rbx), %rsi
callq 0x74f0
leaq 0x148(%rsp), %r13
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0x7780
leaq 0x60(%rsp), %rbx
movq (%rbx), %rdi
leaq 0x1f873(%rip), %rsi     # 0x2c359
leaq 0xf8(%rsp), %r14
movq %r14, %rdx
callq 0x70a0
movq %rbx, %rdi
callq 0x79b8
leaq 0x1fc23(%rip), %rdx     # 0x2c728
leaq 0x60(%rsp), %rdi
pushq $0x64
popq %rsi
movq %r14, %rcx
callq 0x7440
leaq 0x20233(%rip), %rsi     # 0x2cd4f
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x8032
movl %ebp, 0xc(%rsp)
movq %r12, 0x18(%rsp)
leaq 0x20(%rsp), %rsi
movq %r13, %rdi
callq 0x7720
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x79b8
xorl %ebx, %ebx
leaq 0xc8(%rsp), %rbp
leaq 0x40(%rsp), %r12
cmpq 0x8(%r15), %rbx
jae 0xcc09
movq (%r15), %rax
movsbl (%rax,%rbx), %esi
cmpl $0x1f, %esi
jg 0xcc01
leaq 0x140(%rsp), %rdi
callq 0x7840
movq %rbp, %rdi
movq %r13, %rsi
callq 0x7780
movq %r12, %rdi
leaq 0x1fba0(%rip), %rsi     # 0x2c739
movq %rbp, %rdx
callq 0xc30e
movq %r14, %rdi
movq %r12, %rsi
leaq 0x1fa75(%rip), %rdx     # 0x2c623
callq 0xbe83
movq %r15, %rdi
movq %rbx, %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x7200
movq %r14, %rdi
callq 0x79b8
movq %r12, %rdi
callq 0x79b8
movq %rbp, %rdi
callq 0x79b8
movq %r14, %rdi
leaq 0x20169(%rip), %rsi     # 0x2cd4f
movq %r12, %rdx
callq 0x8032
movq %r13, %rdi
movq %r14, %rsi
callq 0x7720
movq %r14, %rdi
callq 0x79b8
incq %rbx
jmp 0xcb5d
movl 0xc(%rsp), %eax
cmpl $0x3, %eax
movq 0x18(%rsp), %rbx
ja 0xcd38
movl %eax, %eax
leaq 0x1f6f8(%rip), %rcx     # 0x2c31c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x36374(%rip), %rdi     # 0x42fa8
leaq 0x1fb00(%rip), %rsi     # 0x2c73b
callq 0x7510
leaq 0x1fafa(%rip), %rsi     # 0x2c741
movq %rax, %rdi
callq 0x7510
leaq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x7510
leaq 0x1fae9(%rip), %rsi     # 0x2c74c
jmp 0xcd0e
movq 0x36379(%rip), %rdi     # 0x42fe8
leaq 0x1faf3(%rip), %rsi     # 0x2c769
callq 0x7510
leaq 0x1fabf(%rip), %rsi     # 0x2c741
movq %rax, %rdi
callq 0x7510
leaq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x7510
leaq 0x1fad1(%rip), %rsi     # 0x2c76f
jmp 0xcd0e
movq 0x36341(%rip), %rdi     # 0x42fe8
leaq 0x1face(%rip), %rsi     # 0x2c77c
callq 0x7510
leaq 0x1fa87(%rip), %rsi     # 0x2c741
movq %rax, %rdi
callq 0x7510
leaq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x7510
leaq 0x1faac(%rip), %rsi     # 0x2c782
jmp 0xcd0e
movq 0x362c9(%rip), %rdi     # 0x42fa8
leaq 0x1fa70(%rip), %rsi     # 0x2c756
callq 0x7510
leaq 0x1fa4f(%rip), %rsi     # 0x2c741
movq %rax, %rdi
callq 0x7510
leaq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x7510
leaq 0x1fa4e(%rip), %rsi     # 0x2c75c
movq %rax, %rdi
callq 0x7510
movq %rax, %rdi
movq %r15, %rsi
callq 0x74a0
leaq 0x1fa13(%rip), %rsi     # 0x2c73b
movq %rax, %rdi
callq 0x7510
movq %rax, %rdi
callq 0x7280
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x29f62
leaq 0x130(%rsp), %rdi
callq 0x73f0
movq %rbx, %rax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcd75
jmp 0xcd7f
jmp 0xcd7f
jmp 0xcd7f
jmp 0xcd7f
jmp 0xcd7f
jmp 0xcd7f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0xcdad
movq %rax, %rbx
jmp 0xcdb2
movq %rax, %rbx
jmp 0xcd96
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x79b8
leaq 0x40(%rsp), %rdi
callq 0x79b8
jmp 0xcda5
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x79b8
leaq 0x130(%rsp), %rdi
callq 0x73f0
movq %rbx, %rdi
callq 0x7860
nop