// File: /workspace/github_cpp_makefile_star2_O3/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 0x138a8
leaq -0x1b0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10378
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 0x5570(%rip), %rsi      # 0x15907
leaq -0x1a0(%rbp), %rdi
callq 0x643f
leaq 0x5564(%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 0x103da
movq %rdx, -0x80(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x70(%rbp)
jmp 0x103e0
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 0x10439
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x1043f
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 0x5279(%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 0x10496
movq %rdx, -0xc0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xb0(%rbp)
jmp 0x1049c
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 0x104f8
movq %rdx, -0xe0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xd0(%rbp)
jmp 0x104fe
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 0x51ba(%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 0x10555
movq %rdx, -0x100(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xf0(%rbp)
jmp 0x1055b
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 0x105bd
movq %rdx, -0x120(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x110(%rbp)
jmp 0x105c3
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 0x50f5(%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 0x1061a
movq %rdx, -0x140(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x130(%rbp)
jmp 0x10622
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 0x1067f
movq %rdx, -0x160(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x150(%rbp)
jmp 0x10687
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 0x5265(%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 0x106de
movq %rdx, -0x180(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x170(%rbp)
jmp 0x106e5
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 0x5578(%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 0x10733
movq %rdx, -0x60(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x50(%rbp)
jmp 0x1073a
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 0x1077a
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0x10795
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 0x107c2
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x140(%rbp), %rdi
cmpq %r13, %rdi
je 0x107dd
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x107ff
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x10821
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x10843
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x1085e
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0xa0(%rbp), %rdi
cmpq %r12, %rdi
je 0x10879
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x80(%rbp), %rdi
cmpq %rbx, %rdi
je 0x1088e
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0x190(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x108ad
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0x40(%rbp), %rdi
callq 0x63d2
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 0x108e5
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x108e5
movq %rax, %rbx
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0x10905
movq -0x170(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10905
movq %rax, %rbx
movq -0x160(%rbp), %rdi
cmpq %r12, %rdi
je 0x10925
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10925
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r13, %rdi
je 0x10945
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10945
movq %rax, %rbx
movq -0x120(%rbp), %rdi
leaq -0x110(%rbp), %rax
cmpq %rax, %rdi
je 0x1096c
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x1096c
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x10993
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10993
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x109ba
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x109ba
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x109e1
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x109e1
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x10a03
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x43e0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x10a1c
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x43e0
leaq -0x190(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10a4c
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10a4c
movq %rax, %rbx
jmp 0x10a03
movq %rax, %rbx
jmp 0x10a1c
jmp 0x10a49
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x63d2
movq %rbx, %rdi
callq 0x46d0
movq %rax, %rbx
leaq -0x1b0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10a55
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x43e0
jmp 0x10a55
movq %rax, %rbx
jmp 0x10a55