// File: /workspace/github_cpp_makefile_star2_O1/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
leaq 0x48(%rsi), %r14
subq $-0x80, %rsi
movq %rsi, 0x40(%rsp)
leaq 0x27d6(%rip), %rsi      # 0xd537
xorl %ebx, %ebx
movl $0x2, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3460
movq %rax, %r15
leaq 0x27b9(%rip), %rsi      # 0xd535
movl $0x4, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3460
leal 0x2(%r15), %edx
subl %r15d, %eax
leal -0x2(%rax), %ecx
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3360
movl 0x8(%r15), %r14d
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
testl %r14d, %r14d
jle 0xaf21
leal -0x1(%r14), %r12d
movq %rsp, %r15
xorl %ebx, %ebx
movslq %ebx, %r13
movq 0xa8(%rsp), %rcx
movzbl (%rcx,%r13), %eax
cmpl $0x3a, %eax
je 0xaed0
cmpl $0xd, %eax
jne 0xaf0b
cmpl %r12d, %ebx
jge 0xaecc
leaq 0x1(%r13), %rbp
cmpb $0xa, (%rcx,%rbp)
jne 0xaecc
cmpq $0x0, 0x8(%rsp)
je 0xae49
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x31e0
movq $0x0, 0x8(%rsp)
movq (%rsp), %rax
movb $0x0, (%rax)
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
leaq 0x48(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0xba0e
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0xb5f4
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xae92
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xaeae
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3340
xorl %ecx, %ecx
movq %rcx, 0x50(%rsp)
movq 0x48(%rsp), %rax
movb $0x0, (%rax)
movq %rcx, 0x28(%rsp)
leaq 0x20(%rsp), %rax
movl %ebp, %r13d
jmp 0xaf00
cmpb $0x3a, %al
jne 0xaf0b
cmpl %r12d, %ebx
jge 0xaf0b
incq %r13
cmpb $0x20, (%rcx,%r13)
jne 0xaf0b
cmpq $0x0, 0x8(%rsp)
je 0xaf06
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x31e0
movq $0x0, 0x8(%rsp)
movq %r15, %rax
movq (%rax), %rax
movb $0x0, (%rax)
movl %r13d, %ebx
jmp 0xaf16
movsbl %al, %esi
movq %r15, %rdi
callq 0x32c0
incl %ebx
cmpl %r14d, %ebx
jl 0xadeb
cmpq $0x0, 0x8(%rsp)
je 0xaf46
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x31e0
movq $0x0, 0x8(%rsp)
movq (%rsp), %rax
movb $0x0, (%rax)
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0xba0e
leaq 0x68(%rsp), %rsi
movq 0x40(%rsp), %rdi
callq 0xb5f4
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xaf8e
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xafa9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3340
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xafc4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xafe0
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xaffc
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb01d
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3340
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb046
jmp 0xb035
jmp 0xb046
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xb5be
jmp 0xb049
jmp 0xb046
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xb064
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xb080
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb09c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb0bd
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3340
movq %rbx, %rdi
callq 0x3510
nop