// File: 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
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movq %rcx, -0x368(%rbp)
movq %rdx, -0x360(%rbp)
movq %rdi, -0x358(%rbp)
movq %rdi, %rax
movq %rax, -0x350(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %eax
cmpl (%rcx), %eax
jge 0x16355
movq -0x368(%rbp), %rsi
movq -0x358(%rbp), %rdi
callq 0x63570
jmp 0x16aa1
leaq -0x1b0(%rbp), %rdi
callq 0x9490
xorl %eax, %eax
movl %eax, %esi
leaq -0x1c0(%rbp), %rdi
callq 0x9a10
leaq -0x1a0(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
callq 0x9b70
jmp 0x16386
leaq -0x228(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x9660
jmp 0x1639b
leaq -0x228(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x92b0
movq %rax, %rdi
leaq 0x53fb1(%rip), %rsi     # 0x6a369
leaq -0x1f8(%rbp), %rdx
movq %rdx, -0x378(%rbp)
callq 0x90e0
movq -0x380(%rbp), %rdi
callq 0x9c98
movq -0x378(%rbp), %rcx
leaq 0x54353(%rip), %rdx     # 0x6a738
leaq -0x290(%rbp), %rdi
movl $0x64, %esi
callq 0x9550
leaq -0x2b1(%rbp), %rdi
movq %rdi, -0x370(%rbp)
callq 0x9b10
movq -0x370(%rbp), %rdx
leaq 0x54959(%rip), %rsi     # 0x6ad70
leaq -0x2b0(%rbp), %rdi
callq 0xa780
jmp 0x16425
leaq -0x1b0(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x9750
jmp 0x1643a
leaq -0x2b0(%rbp), %rdi
callq 0x9c98
leaq -0x2b1(%rbp), %rdi
callq 0x9700
movq $0x0, -0x2c0(%rbp)
movq -0x360(%rbp), %rdi
movq -0x2c0(%rbp), %rax
movq %rax, -0x388(%rbp)
callq 0x9480
movq %rax, %rcx
movq -0x388(%rbp), %rax
cmpq %rcx, %rax
jae 0x16740
movq -0x360(%rbp), %rdi
movq -0x2c0(%rbp), %rsi
callq 0x9c70
movq %rax, -0x390(%rbp)
jmp 0x164a6
movq -0x390(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jl 0x164e4
movq -0x360(%rbp), %rdi
movq -0x2c0(%rbp), %rsi
callq 0x9c70
movq %rax, -0x398(%rbp)
jmp 0x164d1
movq -0x398(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7f, %eax
jle 0x16727
movq -0x360(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
movq %rax, -0x3a8(%rbp)
movq -0x2c0(%rbp), %rsi
callq 0x9c70
movq %rax, -0x3a0(%rbp)
jmp 0x1650e
movq -0x3a8(%rbp), %rdi
movq -0x3a0(%rbp), %rax
movsbl (%rax), %esi
callq 0x9ad0
jmp 0x16526
movq -0x2c0(%rbp), %rax
movq %rax, -0x3b0(%rbp)
leaq -0x320(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x9660
jmp 0x16549
leaq 0x541f9(%rip), %rsi     # 0x6a749
leaq -0x300(%rbp), %rdi
leaq -0x320(%rbp), %rdx
callq 0x14790
jmp 0x16565
leaq 0x540c7(%rip), %rdx     # 0x6a633
leaq -0x2e0(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x13970
jmp 0x16581
movq -0x3b0(%rbp), %rsi
movq -0x360(%rbp), %rdi
movl $0x1, %edx
leaq -0x2e0(%rbp), %rcx
callq 0x9270
jmp 0x165a2
leaq -0x2e0(%rbp), %rdi
callq 0x9c98
leaq -0x300(%rbp), %rdi
callq 0x9c98
leaq -0x320(%rbp), %rdi
callq 0x9c98
leaq -0x341(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x9b10
movq -0x3b8(%rbp), %rdx
leaq 0x54789(%rip), %rsi     # 0x6ad70
leaq -0x340(%rbp), %rdi
callq 0xa780
jmp 0x165f5
leaq -0x1b0(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x9750
jmp 0x1660a
leaq -0x340(%rbp), %rdi
callq 0x9c98
leaq -0x341(%rbp), %rdi
callq 0x9700
jmp 0x16727
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x200(%rbp)
movl %eax, -0x204(%rbp)
jmp 0x16a93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x200(%rbp)
movl %eax, -0x204(%rbp)
jmp 0x16670
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x200(%rbp)
movl %eax, -0x204(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x9c98
leaq -0x2b1(%rbp), %rdi
callq 0x9700
jmp 0x16a93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x200(%rbp)
movl %eax, -0x204(%rbp)
jmp 0x166d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x200(%rbp)
movl %eax, -0x204(%rbp)
jmp 0x166c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x200(%rbp)
movl %eax, -0x204(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x9c98
leaq -0x300(%rbp), %rdi
callq 0x9c98
leaq -0x320(%rbp), %rdi
callq 0x9c98
jmp 0x16a93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x200(%rbp)
movl %eax, -0x204(%rbp)
jmp 0x16716
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x200(%rbp)
movl %eax, -0x204(%rbp)
leaq -0x340(%rbp), %rdi
callq 0x9c98
leaq -0x341(%rbp), %rdi
callq 0x9700
jmp 0x16a93
jmp 0x16729
movq -0x2c0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2c0(%rbp)
jmp 0x1645d
movl -0x24(%rbp), %eax
movq %rax, -0x3c0(%rbp)
subq $0x3, %rax
ja 0x16a70
movq -0x3c0(%rbp), %rax
leaq 0x53bba(%rip), %rcx     # 0x6a31c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x78836(%rip), %rdi     # 0x8efa8
leaq 0x53fd2(%rip), %rsi     # 0x6a74b
callq 0x9670
movq %rax, -0x3c8(%rbp)
jmp 0x16787
movq -0x3c8(%rbp), %rdi
leaq 0x53fbc(%rip), %rsi     # 0x6a751
callq 0x9670
movq %rax, -0x3d0(%rbp)
jmp 0x167a3
movq -0x3d0(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x9670
movq %rax, -0x3d8(%rbp)
jmp 0x167bf
movq -0x3d8(%rbp), %rdi
leaq 0x53f8f(%rip), %rsi     # 0x6a75c
callq 0x9670
movq %rax, -0x3e0(%rbp)
jmp 0x167db
movq -0x360(%rbp), %rsi
movq -0x3e0(%rbp), %rdi
callq 0x95d0
movq %rax, -0x3e8(%rbp)
jmp 0x167f7
movq -0x3e8(%rbp), %rdi
leaq 0x53f46(%rip), %rsi     # 0x6a74b
callq 0x9670
movq %rax, -0x3f0(%rbp)
jmp 0x16813
movq -0x3f0(%rbp), %rdi
movq 0x7875f(%rip), %rsi     # 0x8ef80
callq 0x96d0
jmp 0x16828
jmp 0x16a70
movq 0x78774(%rip), %rdi     # 0x8efa8
leaq 0x53f2b(%rip), %rsi     # 0x6a766
callq 0x9670
movq %rax, -0x3f8(%rbp)
jmp 0x16849
movq -0x3f8(%rbp), %rdi
leaq 0x53efa(%rip), %rsi     # 0x6a751
callq 0x9670
movq %rax, -0x400(%rbp)
jmp 0x16865
movq -0x400(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x9670
movq %rax, -0x408(%rbp)
jmp 0x16881
movq -0x408(%rbp), %rdi
leaq 0x53edd(%rip), %rsi     # 0x6a76c
callq 0x9670
movq %rax, -0x410(%rbp)
jmp 0x1689d
movq -0x360(%rbp), %rsi
movq -0x410(%rbp), %rdi
callq 0x95d0
movq %rax, -0x418(%rbp)
jmp 0x168b9
movq -0x418(%rbp), %rdi
leaq 0x53e84(%rip), %rsi     # 0x6a74b
callq 0x9670
movq %rax, -0x420(%rbp)
jmp 0x168d5
movq -0x420(%rbp), %rdi
movq 0x7869d(%rip), %rsi     # 0x8ef80
callq 0x96d0
jmp 0x168ea
jmp 0x16a70
movq 0x786f2(%rip), %rdi     # 0x8efe8
leaq 0x53e7c(%rip), %rsi     # 0x6a779
callq 0x9670
movq %rax, -0x428(%rbp)
jmp 0x1690b
movq -0x428(%rbp), %rdi
leaq 0x53e38(%rip), %rsi     # 0x6a751
callq 0x9670
movq %rax, -0x430(%rbp)
jmp 0x16927
movq -0x430(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x9670
movq %rax, -0x438(%rbp)
jmp 0x16943
movq -0x438(%rbp), %rdi
leaq 0x53e2e(%rip), %rsi     # 0x6a77f
callq 0x9670
movq %rax, -0x440(%rbp)
jmp 0x1695f
movq -0x360(%rbp), %rsi
movq -0x440(%rbp), %rdi
callq 0x95d0
movq %rax, -0x448(%rbp)
jmp 0x1697b
movq -0x448(%rbp), %rdi
leaq 0x53dc2(%rip), %rsi     # 0x6a74b
callq 0x9670
movq %rax, -0x450(%rbp)
jmp 0x16997
movq -0x450(%rbp), %rdi
movq 0x785db(%rip), %rsi     # 0x8ef80
callq 0x96d0
jmp 0x169ac
jmp 0x16a70
movq 0x78630(%rip), %rdi     # 0x8efe8
leaq 0x53dcd(%rip), %rsi     # 0x6a78c
callq 0x9670
movq %rax, -0x458(%rbp)
jmp 0x169cd
movq -0x458(%rbp), %rdi
leaq 0x53d76(%rip), %rsi     # 0x6a751
callq 0x9670
movq %rax, -0x460(%rbp)
jmp 0x169e9
movq -0x460(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x9670
movq %rax, -0x468(%rbp)
jmp 0x16a05
movq -0x468(%rbp), %rdi
leaq 0x53d7f(%rip), %rsi     # 0x6a792
callq 0x9670
movq %rax, -0x470(%rbp)
jmp 0x16a21
movq -0x360(%rbp), %rsi
movq -0x470(%rbp), %rdi
callq 0x95d0
movq %rax, -0x478(%rbp)
jmp 0x16a3d
movq -0x478(%rbp), %rdi
leaq 0x53d00(%rip), %rsi     # 0x6a74b
callq 0x9670
movq %rax, -0x480(%rbp)
jmp 0x16a59
movq -0x480(%rbp), %rdi
movq 0x78519(%rip), %rsi     # 0x8ef80
callq 0x96d0
jmp 0x16a6e
jmp 0x16a70
movq -0x368(%rbp), %rsi
movq -0x358(%rbp), %rdi
callq 0x63570
jmp 0x16a85
leaq -0x1b0(%rbp), %rdi
callq 0x94e0
jmp 0x16aa1
leaq -0x1b0(%rbp), %rdi
callq 0x94e0
jmp 0x16ab1
movq -0x350(%rbp), %rax
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
movq -0x200(%rbp), %rdi
callq 0x9af0
nopl (%rax)