// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rbx
xorl %edi, %edi
callq 0x4380
leaq -0x1c8(%rbp), %rdi
movq %rax, (%rdi)
callq 0x41c0
leaq -0x1c0(%rbp), %rdi
leaq -0x60(%rbp), %rdx
movq %rax, %rsi
callq 0x518a
leaq -0x40(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
movl $0x20, %edx
callq 0x13978
leaq -0x1b0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x103e8
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x38(%rbp), %rdi
addq $-0x20, %rdi
movl $0x4, %esi
xorl %edx, %edx
callq 0x4140
movq -0x40(%rbp), %rdx
leaq 0x5500(%rip), %rsi      # 0x15907
leaq -0x1a0(%rbp), %rdi
callq 0x6400
leaq 0x54f4(%rip), %rsi      # 0x1590e
leaq -0x1a0(%rbp), %rdi
callq 0x4760
leaq -0x70(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1044a
movq %rdx, -0x80(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x70(%rbp)
jmp 0x10450
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x80(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
callq 0x4150
leaq -0x90(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x104a9
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x104af
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0xa0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5209(%rip), %rsi      # 0x156dd
callq 0x4760
leaq -0xb0(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x10506
movq %rdx, -0xc0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb0(%rbp)
jmp 0x1050c
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0xc0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
callq 0x4150
leaq -0xd0(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x10568
movq %rdx, -0xe0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xd0(%rbp)
jmp 0x1056e
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0xe0(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x514a(%rip), %rsi      # 0x156dd
callq 0x4760
leaq -0xf0(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x105c5
movq %rdx, -0x100(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xf0(%rbp)
jmp 0x105cb
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x100(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rsi
movq 0x88(%rax), %rdx
callq 0x4150
leaq -0x110(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1062d
movq %rdx, -0x120(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x110(%rbp)
jmp 0x10633
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq -0x120(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5085(%rip), %rsi      # 0x156dd
callq 0x4760
leaq -0x130(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1068a
movq %rdx, -0x140(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x130(%rbp)
jmp 0x10692
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x140(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
callq 0x4150
leaq -0x150(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x106ef
movq %rdx, -0x160(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x150(%rbp)
jmp 0x106f7
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x160(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x51f5(%rip), %rsi      # 0x15911
callq 0x4760
leaq -0x170(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1074e
movq %rdx, -0x180(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x170(%rbp)
jmp 0x10755
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0x180(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5508(%rip), %rsi      # 0x15c82
callq 0x4760
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x107a3
movq %rdx, -0x60(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x50(%rbp)
jmp 0x107aa
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x58(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
addq $0x58, %rbx
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x4150
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x107ea
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0x10805
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x160(%rbp), %rdi
cmpq %r12, %rdi
leaq -0x70(%rbp), %rbx
leaq -0x90(%rbp), %r12
leaq -0xb0(%rbp), %r14
je 0x10832
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x140(%rbp), %rdi
cmpq %r13, %rdi
je 0x1084d
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x1086f
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x10891
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x108b3
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x108ce
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x108e9
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x80(%rbp), %rdi
cmpq %rbx, %rdi
je 0x108fe
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0x190(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1091d
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0x40(%rbp), %rdi
callq 0x6396
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x10955
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10955
movq %rax, %rbx
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0x10975
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10975
movq %rax, %rbx
movq -0x160(%rbp), %rdi
cmpq %r12, %rdi
je 0x10995
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10995
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r13, %rdi
je 0x109b5
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x109b5
movq %rax, %rbx
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x109dc
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x109dc
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x10a03
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10a03
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x10a2a
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10a2a
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x10a51
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10a51
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x10a73
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x10a8c
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0x190(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10abc
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10abc
movq %rax, %rbx
jmp 0x10a73
movq %rax, %rbx
jmp 0x10a8c
jmp 0x10ab9
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x6396
movq %rbx, %rdi
callq 0x46d0
movq %rax, %rbx
leaq -0x1b0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10ac5
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10ac5
movq %rax, %rbx
jmp 0x10ac5