// File: /workspace/github_cpp_makefile_star2_O2/dentiny[P]HTTP-Cache-Proxy/./Parser.hpp
// Function: Parser::extractKV(Response&)
void extractKV(Response & response)
	{
		// extract k-v pair header
		const std::string & header = response.header;
		std::unordered_map<std::string, std::string> & kv = response.kv; 
		unsigned idx1 = header.find_first_of("\r\n"); // the first line status and kv-pair is seperated by \r\n
		unsigned idx2 = header.find_first_of("\r\n\r\n"); // header and content is seperated by \r\n\r\n
		std::string kv_header = header.substr(idx1 + 2, idx2 - idx1 - 2); // extract the real header in k-v pair

		// extract k-v pair to the unordered_map
		int N = kv_header.length();
		std::string key;
		std::string val;
		std::string temp;
		for(int idx = 0; idx < N; ++idx)
		{
			char c = kv_header[idx];

			// \r\n the seperator of lines
			if(c == '\r' && idx + 1 <= N - 1 && kv_header[idx + 1] == '\n')
			{
				pushClear(temp, val);
				kv.insert(std::make_pair(key, val));
				key.clear();
				val.clear();
				++idx;
			}

			// : the seperator of key-value pair
			else if(c == ':' && idx + 1 <= N - 1 && kv_header[idx + 1] == ' ')
			{
				pushClear(temp, key);
				++idx;
			}

			// normal characters
			else
			{
				temp += c;
			}
		}
		pushClear(temp, val);
		kv.insert(std::make_pair(key, val));
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %r14
leaq 0x48(%rsi), %r15
subq $-0x80, %rsi
movq %rsi, (%rsp)
leaq 0x1f00(%rip), %rsi      # 0xa537
xorl %ebx, %ebx
movq %r15, %rdi
xorl %edx, %edx
callq 0x31b0
movq %rax, %r12
leaq 0x1ee8(%rip), %rsi      # 0xa535
movq %r15, %rdi
xorl %edx, %edx
callq 0x31b0
leal 0x2(%r12), %edx
subl %r12d, %eax
leal -0x2(%rax), %ecx
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3330
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movl 0x8(%r12), %r12d
movb %bl, (%rax)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %bl, (%rax)
movb %bl, (%rcx)
leal -0x1(%r12), %r13d
leaq 0x48(%rsp), %r15
xorl %ebx, %ebx
cmpl %r12d, %ebx
jge 0x877e
movslq %ebx, %rbp
movq 0x68(%rsp), %rcx
movzbl (%rcx,%rbp), %eax
cmpl $0x3a, %eax
je 0x874a
cmpl $0xd, %eax
jne 0x876c
cmpl %r13d, %ebx
jge 0x876c
incq %rbp
cmpb $0xa, (%rcx,%rbp)
jne 0x876c
movq %r14, %rdi
movq %r15, %rsi
leaq 0x8(%rsp), %rdx
callq 0x5a18
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x8fec
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x8ca6
movq %rbx, %rdi
callq 0x8c90
andq $0x0, 0x30(%rsp)
movq 0x28(%rsp), %rax
xorl %ecx, %ecx
movb %cl, (%rax)
andq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb %cl, (%rax)
movl %ebp, %ebx
jmp 0x8777
cmpl %r13d, %ebx
jge 0x876c
incq %rbp
cmpb $0x20, (%rcx,%rbp)
jne 0x876c
movq %r14, %rdi
movq %r15, %rsi
leaq 0x28(%rsp), %rdx
callq 0x5a18
movl %ebp, %ebx
jmp 0x8777
movsbl %al, %esi
movq %r15, %rdi
callq 0x32a0
incl %ebx
jmp 0x86b3
leaq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x5a18
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x8fec
leaq 0x88(%rsp), %rsi
movq (%rsp), %rdi
callq 0x8ca6
leaq 0x88(%rsp), %rdi
callq 0x8c90
leaq 0x48(%rsp), %rdi
callq 0x3150
leaq 0x8(%rsp), %rdi
callq 0x3150
leaq 0x28(%rsp), %rdi
callq 0x3150
leaq 0x68(%rsp), %rdi
callq 0x3150
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8807
jmp 0x8819
jmp 0x8819
jmp 0x8819
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x8c90
jmp 0x881c
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3150
leaq 0x8(%rsp), %rdi
callq 0x3150
leaq 0x28(%rsp), %rdi
callq 0x3150
leaq 0x68(%rsp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x34b0