// File: /workspace/github_cpp_makefile_star2_O3/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 %rsi, %rbx
leaq 0x48(%rsi), %r14
subq $-0x80, %rbx
leaq 0x2956(%rip), %rsi      # 0xd537
xorl %r12d, %r12d
movl $0x2, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3460
movq %rax, %r15
leaq 0x2938(%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), %ebp
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
movq %r12, -0x8(%r14)
movb %r12b, (%r14)
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq %r12, -0x8(%r15)
movb %r12b, (%r15)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r12, -0x8(%rax)
movb %r12b, (%rax)
testl %ebp, %ebp
jle 0xadcb
leal -0x1(%rbp), %r15d
leaq 0x8(%rsp), %r14
movslq %r12d, %r13
movq 0xa8(%rsp), %rcx
movzbl (%rcx,%r13), %eax
cmpl $0x3a, %eax
je 0xad48
cmpl $0xd, %eax
jne 0xad82
cmpl %r15d, %r12d
jge 0xad82
incq %r13
cmpb $0xa, (%rcx,%r13)
jne 0xad82
cmpq $0x0, 0x10(%rsp)
je 0xaccd
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x31e0
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
leaq 0x68(%rsp), %r12
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0xb87e
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb46c
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xad14
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xad30
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3340
movq $0x0, 0x50(%rsp)
movq 0x48(%rsp), %rax
movb $0x0, (%rax)
leaq 0x28(%rsp), %rax
jmp 0xad6f
cmpl %r15d, %r12d
jge 0xad82
incq %r13
cmpb $0x20, (%rcx,%r13)
jne 0xad82
cmpq $0x0, 0x10(%rsp)
je 0xad7d
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x31e0
movq %r14, %rax
movq $0x0, 0x8(%rax)
movq (%rax), %rax
movb $0x0, (%rax)
movl %r13d, %r12d
jmp 0xad8d
movsbl %al, %esi
movq %r14, %rdi
callq 0x32c0
incl %r12d
cmpl %ebp, %r12d
jl 0xac6e
cmpq $0x0, 0x10(%rsp)
leaq 0x58(%rsp), %r14
leaq 0x38(%rsp), %r15
je 0xadcb
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x31e0
movq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0xb87e
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0xb46c
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xae11
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xae2d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xae49
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0xae60
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0xae77
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xae98
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 0xaec1
jmp 0xaeb0
jmp 0xaec1
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xb436
jmp 0xaec4
jmp 0xaec1
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xaee0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xaefc
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xaf18
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaf39
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3340
movq %rbx, %rdi
callq 0x3510
nop