// File: dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::calcExpiration(Response&)
void calcExpiration(Response & response)
	{
		std::unordered_map<std::string, std::string> & kv = response.kv;
		const time_t & response_time = response.cur_time;

		// get fressness time
		int fressness_time = 0;
		if(kv.find("Cache-Control") != kv.end())
		{
			const std::string & cache_control = kv["Cache-Control"];
			int idx = cache_control.find("max-age");
			if(idx != -1)
			{
				// eg: max-age=1234567
				std::string max_age_s = cache_control.substr(idx + 8);
				fressness_time = std::stoi(max_age_s);
			}
		}

		response.expiration_time = response.cur_time + fressness_time;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
subq $-0x80, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0xc0, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x4650
movq -0xc8(%rbp), %rdx
leaq 0x5ca2(%rip), %rsi      # 0x194cf
leaq -0x50(%rbp), %rdi
callq 0x4bf0
jmp 0x13838
movq -0xd0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x14be0
movq %rax, -0xd8(%rbp)
jmp 0x13851
movq -0xd8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x14c10
movq %rax, -0x70(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x14bb0
movb %al, -0xd9(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4250
leaq -0x51(%rbp), %rdi
callq 0x4420
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x1389d
jmp 0x13a19
movq -0x18(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x4650
movq -0xe8(%rbp), %rdx
leaq 0x5c06(%rip), %rsi      # 0x194cf
leaq -0x98(%rbp), %rdi
callq 0x4bf0
jmp 0x138d7
movq -0xf0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xc4c0
movq %rax, -0xf8(%rbp)
jmp 0x138f3
leaq -0x98(%rbp), %rdi
callq 0x4250
leaq -0x99(%rbp), %rdi
callq 0x4420
movq -0xf8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
leaq 0x5c18(%rip), %rsi      # 0x19539
xorl %eax, %eax
movl %eax, %edx
callq 0x46f0
movl %eax, -0xa0(%rbp)
cmpl $-0x1, -0xa0(%rbp)
je 0x13a17
movq -0x78(%rbp), %rsi
movl -0xa0(%rbp), %eax
addl $0x8, %eax
movslq %eax, %rdx
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x108(%rbp)
movq $-0x1, %rcx
callq 0x43f0
movq -0x108(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x13c50
movl %eax, -0xfc(%rbp)
jmp 0x13984
movl -0xfc(%rbp), %eax
movl %eax, -0x24(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4250
jmp 0x13a17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x139be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4250
leaq -0x51(%rbp), %rdi
callq 0x4420
jmp 0x13a3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x139ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x4250
leaq -0x99(%rbp), %rdi
callq 0x4420
jmp 0x13a3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4250
jmp 0x13a3f
jmp 0x13a19
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rcx
movslq -0x24(%rbp), %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xc8(%rax)
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x4640
nopl (%rax,%rax)