// File: 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
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1e0(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x54e0
movq %rax, -0x10(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x5220
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x58f0
movq -0x1d8(%rbp), %rsi
movq -0x1d0(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x63e0
jmp 0x1ce58
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x20, %edx
callq 0x20eb0
jmp 0x1ce6c
leaq -0x50(%rbp), %rdi
callq 0x5a08
leaq -0x51(%rbp), %rdi
callq 0x55c0
leaq -0x30(%rbp), %rdi
callq 0x128e0
movq %rax, %rdi
movl $0x4, %esi
callq 0x5750
jmp 0x1ce96
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x10b10
movq %rax, %rdx
leaq 0x6a15(%rip), %rsi      # 0x238c2
leaq -0x1c8(%rbp), %rdi
callq 0x9a60
jmp 0x1cebb
leaq 0x6a07(%rip), %rdx      # 0x238c9
leaq -0x1a8(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x66b0
jmp 0x1ced7
leaq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0x10b10
movq %rax, %rdx
leaq -0x188(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x16dc0
jmp 0x1cefd
leaq 0x67e4(%rip), %rdx      # 0x236e8
leaq -0x168(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x66b0
jmp 0x1cf19
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x10b10
movq %rax, %rdx
leaq -0x148(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x16dc0
jmp 0x1cf3f
leaq 0x67a2(%rip), %rdx      # 0x236e8
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x66b0
jmp 0x1cf5b
leaq -0x30(%rbp), %rdi
movl $0x4, %esi
callq 0x10b10
movq %rax, %rdx
leaq -0x108(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x16dc0
jmp 0x1cf81
leaq 0x6760(%rip), %rdx      # 0x236e8
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x66b0
jmp 0x1cf9d
leaq -0x30(%rbp), %rdi
movl $0x3, %esi
callq 0x10b10
movq %rax, %rdx
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x16dc0
jmp 0x1cfc3
leaq 0x6902(%rip), %rdx      # 0x238cc
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x66b0
jmp 0x1cfdf
leaq 0x6c8f(%rip), %rdx      # 0x23c75
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x66b0
jmp 0x1cffb
movq -0x1e0(%rbp), %rdi
addq $0x58, %rdi
leaq -0x88(%rbp), %rsi
callq 0x56b0
jmp 0x1d014
leaq -0x88(%rbp), %rdi
callq 0x5a08
leaq -0xa8(%rbp), %rdi
callq 0x5a08
leaq -0xc8(%rbp), %rdi
callq 0x5a08
leaq -0xe8(%rbp), %rdi
callq 0x5a08
leaq -0x108(%rbp), %rdi
callq 0x5a08
leaq -0x128(%rbp), %rdi
callq 0x5a08
leaq -0x148(%rbp), %rdi
callq 0x5a08
leaq -0x168(%rbp), %rdi
callq 0x5a08
leaq -0x188(%rbp), %rdi
callq 0x5a08
leaq -0x1a8(%rbp), %rdi
callq 0x5a08
leaq -0x1c8(%rbp), %rdi
callq 0x5a08
leaq -0x30(%rbp), %rdi
callq 0x9950
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d0cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5a08
leaq -0x51(%rbp), %rdi
callq 0x55c0
jmp 0x1d223
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d21a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d20e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d202
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d1f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d1ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d1de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d1d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d1c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d1ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d1ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1d1a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5a08
leaq -0xa8(%rbp), %rdi
callq 0x5a08
leaq -0xc8(%rbp), %rdi
callq 0x5a08
leaq -0xe8(%rbp), %rdi
callq 0x5a08
leaq -0x108(%rbp), %rdi
callq 0x5a08
leaq -0x128(%rbp), %rdi
callq 0x5a08
leaq -0x148(%rbp), %rdi
callq 0x5a08
leaq -0x168(%rbp), %rdi
callq 0x5a08
leaq -0x188(%rbp), %rdi
callq 0x5a08
leaq -0x1a8(%rbp), %rdi
callq 0x5a08
leaq -0x1c8(%rbp), %rdi
callq 0x5a08
leaq -0x30(%rbp), %rdi
callq 0x9950
movq -0x60(%rbp), %rdi
callq 0x58e0
nopl (%rax)