// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::fillDateHeader()
void Response::fillDateHeader() 
{
	// current date and time on the current system
	time_t now = time(0);

	// convert now to string form
	char* date_time = ctime(&now);

	// Splitting date line and removing '\n'
	std::vector<std::string> date = splitWithSep(date_time, ' ');
	date.back().resize(4);

	// Formating header date.
	// ctime format = Thu May 20 14:33:40 2021 >> to header date format : Thu, 20 May 2021 12:16:42 GMT
	_buffer += "Date: " + date[0] + ", " + date[2] + " " + date[1] + " " + date[4] + " " + date[3] + " GMT" + CLRF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
xorl %edi, %edi
callq 0x43e0
leaq -0x1a8(%rbp), %rdi
movq %rax, (%rdi)
callq 0x41d0
leaq -0x1a0(%rbp), %rdi
leaq -0x40(%rbp), %rdx
movq %rax, %rsi
callq 0x4ec8
leaq -0x20(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
pushq $0x20
popq %rdx
callq 0xfe28
leaq -0x1a0(%rbp), %rdi
callq 0x47d8
movq -0x18(%rbp), %rdi
addq $-0x20, %rdi
pushq $0x4
popq %rsi
callq 0x4590
movq -0x20(%rbp), %rdx
leaq 0x39d3(%rip), %rsi      # 0x118b5
leaq -0x60(%rbp), %rdi
callq 0x5f8b
leaq 0x39ca(%rip), %rdx      # 0x118bc
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4f37
movq -0x20(%rbp), %rdx
addq $0x40, %rdx
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xaf33
leaq 0x37b8(%rip), %rdx      # 0x116d6
leaq -0xc0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x4f37
movq -0x20(%rbp), %rdx
addq $0x20, %rdx
leaq -0xe0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xaf33
leaq 0x3783(%rip), %rdx      # 0x116d6
leaq -0x100(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4f37
movq -0x20(%rbp), %rdx
subq $-0x80, %rdx
leaq -0x120(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xaf33
leaq 0x374e(%rip), %rdx      # 0x116d6
leaq -0x140(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x4f37
movq -0x20(%rbp), %rdx
addq $0x60, %rdx
leaq -0x160(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xaf33
leaq 0x3902(%rip), %rdx      # 0x118bf
leaq -0x180(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x4f37
leaq 0x3c59(%rip), %rdx      # 0x11c30
leaq -0x40(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x4f37
addq $0x58, %rbx
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x47a0
leaq -0x40(%rbp), %rdi
callq 0x47d8
leaq -0x180(%rbp), %rdi
callq 0x47d8
leaq -0x160(%rbp), %rdi
callq 0x47d8
leaq -0x140(%rbp), %rdi
callq 0x47d8
leaq -0x120(%rbp), %rdi
callq 0x47d8
leaq -0x100(%rbp), %rdi
callq 0x47d8
leaq -0xe0(%rbp), %rdi
callq 0x47d8
leaq -0xc0(%rbp), %rdi
callq 0x47d8
leaq -0xa0(%rbp), %rdi
callq 0x47d8
leaq -0x80(%rbp), %rdi
callq 0x47d8
leaq -0x60(%rbp), %rdi
callq 0x47d8
leaq -0x20(%rbp), %rdi
callq 0x5ef4
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x47d8
jmp 0xe096
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
callq 0x47d8
jmp 0xe0a7
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x47d8
jmp 0xe0b8
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0x47d8
jmp 0xe0c9
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0x47d8
leaq -0x100(%rbp), %rdi
callq 0x47d8
leaq -0xe0(%rbp), %rdi
callq 0x47d8
leaq -0xc0(%rbp), %rdi
callq 0x47d8
leaq -0xa0(%rbp), %rdi
callq 0x47d8
leaq -0x80(%rbp), %rdi
callq 0x47d8
leaq -0x60(%rbp), %rdi
callq 0x47d8
leaq -0x20(%rbp), %rdi
callq 0x5ef4
movq %rbx, %rdi
callq 0x46d0
movq %rax, %rbx
jmp 0xe0d5
movq %rax, %rbx
jmp 0xe0e1
movq %rax, %rbx
jmp 0xe0ed
movq %rax, %rbx
jmp 0xe0f9
movq %rax, %rbx
jmp 0xe105
movq %rax, %rbx
jmp 0xe10e
jmp 0xe148
movq %rax, %rbx
jmp 0xe117
movq %rax, %rbx
leaq -0x1a0(%rbp), %rdi
callq 0x47d8
jmp 0xe120
movq %rax, %rbx
jmp 0xe120
nop