// File: /workspace/github_cpp_makefile_star2_O2/llefranc[P]42_webserv/srcs/server/Response.cpp
// Function: Response::fillLastModifiedHeader(char const*)
void Response::fillLastModifiedHeader(const char* uri)
{
	struct stat infFile;

	if (stat(uri, &infFile) == -1)
		throw StatusLine(404, REASON_404, "fillLastModifiedHeader method");

	struct tm* lm = localtime(&infFile.MTIMESPEC.tv_sec);

	const std::string day[7] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
	const std::string mon[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

	_buffer += "Last-Modified: " + day[lm->tm_wday - 1] + ", " + convertNbToString(lm->tm_mday) + " " + mon[lm->tm_mon] + " " 
			+ convertNbToString(lm->tm_year + 1900) + " " + convertNbToString(lm->tm_hour) + ":" + 
			convertNbToString(lm->tm_min) + ":" + convertNbToString(lm->tm_sec) + " GMT" + CLRF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x578, %rsp            # imm = 0x578
movq %rsi, %rax
movq %rdi, %rbx
leaq -0x5a0(%rbp), %rsi
movq %rax, %rdi
callq 0x43c0
cmpl $-0x1, %eax
je 0xe776
leaq -0x548(%rbp), %rdi
callq 0x4340
movq %rax, %r14
leaq 0x36b2(%rip), %rsi      # 0x118e2
leaq -0x510(%rbp), %r15
leaq -0x430(%rbp), %rdx
movq %r15, %rdi
callq 0x4ec8
leaq -0x4f0(%rbp), %r12
leaq 0x3692(%rip), %rsi      # 0x118e6
leaq -0xe8(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
leaq -0x4d0(%rbp), %r12
leaq 0x3679(%rip), %rsi      # 0x118ea
leaq -0xc8(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
leaq -0x4b0(%rbp), %r12
leaq 0x3660(%rip), %rsi      # 0x118ee
leaq -0xa8(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
leaq -0x490(%rbp), %r12
leaq 0x3647(%rip), %rsi      # 0x118f2
leaq -0x88(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
leaq -0x470(%rbp), %r12
leaq 0x362e(%rip), %rsi      # 0x118f6
leaq -0x68(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
leaq -0x450(%rbp), %r12
leaq 0x3618(%rip), %rsi      # 0x118fa
leaq -0x48(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
leaq 0x3609(%rip), %rsi      # 0x118fe
leaq -0x430(%rbp), %r12
leaq -0xe8(%rbp), %rdx
movq %r12, %rdi
callq 0x4ec8
leaq -0x410(%rbp), %r13
leaq 0x35e9(%rip), %rsi      # 0x11902
leaq -0xc8(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x3f0(%rbp), %r13
leaq 0x35d0(%rip), %rsi      # 0x11906
leaq -0xa8(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x3d0(%rbp), %r13
leaq 0x35b7(%rip), %rsi      # 0x1190a
leaq -0x88(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x3b0(%rbp), %r13
leaq 0x359e(%rip), %rsi      # 0x1190e
leaq -0x68(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x390(%rbp), %r13
leaq 0x3588(%rip), %rsi      # 0x11912
leaq -0x48(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x370(%rbp), %r13
leaq 0x3572(%rip), %rsi      # 0x11916
leaq -0x1a8(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x350(%rbp), %r13
leaq 0x3559(%rip), %rsi      # 0x1191a
leaq -0x188(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x330(%rbp), %r13
leaq 0x3540(%rip), %rsi      # 0x1191e
leaq -0x168(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x310(%rbp), %r13
leaq 0x3527(%rip), %rsi      # 0x11922
leaq -0x148(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x2f0(%rbp), %r13
leaq 0x350e(%rip), %rsi      # 0x11926
leaq -0x128(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
leaq -0x2d0(%rbp), %r13
leaq 0x34f5(%rip), %rsi      # 0x1192a
leaq -0x108(%rbp), %rdx
movq %r13, %rdi
callq 0x4ec8
movslq 0x18(%r14), %rax
shlq $0x5, %rax
leaq (%rax,%r15), %rdx
addq $-0x20, %rdx
leaq 0x34d3(%rip), %rsi      # 0x1192e
leaq -0x268(%rbp), %rdi
callq 0x5f8b
leaq 0x344e(%rip), %rdx      # 0x118bc
leaq -0x288(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x4f37
movslq 0xc(%r14), %rsi
leaq -0x248(%rbp), %rdi
callq 0xfc62
leaq -0x2a8(%rbp), %rdi
leaq -0x288(%rbp), %rsi
leaq -0x248(%rbp), %rdx
callq 0xa3e1
leaq 0x3224(%rip), %rdx      # 0x116d6
leaq -0x108(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x4f37
movslq 0x10(%r14), %rax
shlq $0x5, %rax
leaq (%rax,%rbp), %rdx
addq $-0x430, %rdx           # imm = 0xFBD0
leaq -0x128(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0xaf33
leaq 0x31e4(%rip), %rdx      # 0x116d6
leaq -0x148(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x4f37
movslq 0x14(%r14), %rsi
addq $0x76c, %rsi            # imm = 0x76C
leaq -0x228(%rbp), %rdi
callq 0xfc62
leaq -0x168(%rbp), %rdi
leaq -0x148(%rbp), %rsi
leaq -0x228(%rbp), %rdx
callq 0xa3e1
leaq 0x3199(%rip), %rdx      # 0x116d6
leaq -0x188(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x4f37
movslq 0x8(%r14), %rsi
leaq -0x208(%rbp), %rdi
callq 0xfc62
leaq -0x1a8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0xa3e1
leaq 0x33c5(%rip), %rdx      # 0x11946
leaq -0x48(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x4f37
movslq 0x4(%r14), %rsi
leaq -0x1e8(%rbp), %rdi
callq 0xfc62
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x1e8(%rbp), %rdx
callq 0xa3e1
leaq 0x338a(%rip), %rdx      # 0x11946
leaq -0x88(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x4f37
movslq (%r14), %rsi
leaq -0x1c8(%rbp), %rdi
callq 0xfc62
leaq -0xa8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0x1c8(%rbp), %rdx
callq 0xa3e1
leaq 0x32c3(%rip), %rdx      # 0x118bf
leaq -0xc8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4f37
leaq 0x361a(%rip), %rdx      # 0x11c30
leaq -0xe8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x4f37
addq $0x58, %rbx
leaq -0xe8(%rbp), %rsi
movq %rbx, %rdi
callq 0x47a0
leaq -0xe8(%rbp), %rdi
callq 0x47d8
leaq -0xc8(%rbp), %rdi
callq 0x47d8
leaq -0xa8(%rbp), %rdi
callq 0x47d8
leaq -0x1c8(%rbp), %rdi
callq 0x47d8
leaq -0x88(%rbp), %rdi
callq 0x47d8
leaq -0x68(%rbp), %rdi
callq 0x47d8
leaq -0x1e8(%rbp), %rdi
callq 0x47d8
leaq -0x48(%rbp), %rdi
callq 0x47d8
leaq -0x1a8(%rbp), %rdi
callq 0x47d8
leaq -0x208(%rbp), %rdi
callq 0x47d8
leaq -0x188(%rbp), %rdi
callq 0x47d8
leaq -0x168(%rbp), %rdi
callq 0x47d8
leaq -0x228(%rbp), %rdi
callq 0x47d8
leaq -0x148(%rbp), %rdi
callq 0x47d8
leaq -0x128(%rbp), %rdi
callq 0x47d8
leaq -0x108(%rbp), %rdi
callq 0x47d8
leaq -0x2a8(%rbp), %rdi
callq 0x47d8
leaq -0x248(%rbp), %rdi
callq 0x47d8
leaq -0x288(%rbp), %rdi
callq 0x47d8
leaq -0x268(%rbp), %rdi
callq 0x47d8
movl $0x160, %ebx            # imm = 0x160
leaq (%rbx,%rbp), %rdi
addq $-0x430, %rdi           # imm = 0xFBD0
callq 0x47d8
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0xe72b
movl $0xc0, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x510, %rdi           # imm = 0xFAF0
callq 0x47d8
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0xe74a
addq $0x578, %rsp            # imm = 0x578
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x48
popq %rdi
callq 0x4220
movq %rax, %r14
leaq 0x313c(%rip), %rsi      # 0x118c4
leaq -0x430(%rbp), %rdi
leaq -0x510(%rbp), %rdx
callq 0x4ec8
movb $0x1, %r15b
leaq 0x30d2(%rip), %rdx      # 0x11877
leaq -0x430(%rbp), %rcx
movq %r14, %rdi
movl $0x194, %esi            # imm = 0x194
callq 0xc540
xorl %r15d, %r15d
leaq 0xa5cd(%rip), %rsi      # 0x18d90
leaq -0x2234(%rip), %rdx     # 0xc596
movq %r14, %rdi
callq 0x46b0
movq %rax, %rbx
leaq -0x430(%rbp), %rdi
callq 0x47d8
testb %r15b, %r15b
jne 0xe7ee
jmp 0xe9e9
movq %rax, %rbx
movq %r14, %rdi
callq 0x4330
jmp 0xe9e9
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
callq 0x47d8
jmp 0xe80f
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x47d8
jmp 0xe820
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x47d8
jmp 0xe831
movq %rax, %rbx
leaq -0x1c8(%rbp), %rdi
callq 0x47d8
jmp 0xe842
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x47d8
leaq -0x68(%rbp), %rdi
callq 0x47d8
leaq -0x1e8(%rbp), %rdi
callq 0x47d8
leaq -0x48(%rbp), %rdi
callq 0x47d8
leaq -0x1a8(%rbp), %rdi
callq 0x47d8
leaq -0x208(%rbp), %rdi
callq 0x47d8
leaq -0x188(%rbp), %rdi
callq 0x47d8
leaq -0x168(%rbp), %rdi
callq 0x47d8
leaq -0x228(%rbp), %rdi
callq 0x47d8
leaq -0x148(%rbp), %rdi
callq 0x47d8
leaq -0x128(%rbp), %rdi
callq 0x47d8
leaq -0x108(%rbp), %rdi
callq 0x47d8
leaq -0x2a8(%rbp), %rdi
callq 0x47d8
leaq -0x248(%rbp), %rdi
callq 0x47d8
leaq -0x288(%rbp), %rdi
callq 0x47d8
leaq -0x268(%rbp), %rdi
callq 0x47d8
movl $0x160, %r14d           # imm = 0x160
leaq (%r14,%rbp), %rdi
addq $-0x430, %rdi           # imm = 0xFBD0
callq 0x47d8
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0xe902
jmp 0xe9c9
movq %rax, %rbx
jmp 0xe84e
movq %rax, %rbx
jmp 0xe857
movq %rax, %rbx
jmp 0xe863
movq %rax, %rbx
jmp 0xe86c
movq %rax, %rbx
jmp 0xe878
movq %rax, %rbx
jmp 0xe884
movq %rax, %rbx
jmp 0xe890
movq %rax, %rbx
jmp 0xe89c
movq %rax, %rbx
jmp 0xe8a8
movq %rax, %rbx
jmp 0xe8b4
movq %rax, %rbx
jmp 0xe8c0
movq %rax, %rbx
jmp 0xe8cc
movq %rax, %rbx
jmp 0xe8d8
movq %rax, %rbx
jmp 0xe8e4
movq %rax, %rbx
jmp 0xe8f0
movq %rax, %rbx
jmp 0xe8fc
jmp 0xe9b5
jmp 0xe9b5
jmp 0xe9b5
jmp 0xe9b5
jmp 0xe9b5
jmp 0xe9b5
jmp 0xe9b5
jmp 0xe9b5
jmp 0xe9b5
jmp 0xe9b5
movq %rax, %rbx
addq $-0x20, %r13
movq %r13, %rdi
callq 0x47d8
cmpq %r12, %r13
jne 0xe9b8
movl $0xc0, %r14d
leaq (%r14,%rbp), %rdi
addq $-0x510, %rdi           # imm = 0xFAF0
callq 0x47d8
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0xe9cf
movq %rbx, %rdi
callq 0x46d0
movq %rax, %rbx
jmp 0xe9c9
jmp 0xea00
jmp 0xea00
jmp 0xea00
jmp 0xea00
jmp 0xea00
movq %rax, %rbx
addq $-0x20, %r12
movq %r12, %rdi
callq 0x47d8
cmpq %r15, %r12
jne 0xea03
jmp 0xe9e9
movq %rax, %rbx
jmp 0xe9e9
nop