// File: /workspace/github_cpp_makefile_star2_O1/mbourand[P]webserv/srcs/Utils/CGI.cpp
// Function: CGI::add_http_headers(std::vector<Header*, std::allocator<Header*>> const&)
void			CGI::add_http_headers(const Request::HeadersVector& headers)
{
	for (Request::HeadersVector::const_iterator it = headers.begin(); it != headers.end(); it++)
	{
		if ((*it)->getType() == AcceptCharsetsHeader().getType() || (*it)->getType() == AcceptEncodingHeader().getType()
			|| (*it)->getType() == AcceptLanguageHeader().getType() || (*it)->getType() == HostHeader().getType()
			|| (*it)->getType() == RefererHeader().getType() || (*it)->getType() == UserAgentHeader().getType()
			|| (*it)->getType().find("X-") == 0)
		{
			std::string	temp;
			temp = "HTTP_" + (*it)->getType();
			for (std::string::iterator its = temp.begin() + 6; its != temp.end(); its++)
			{
				if (*its == '-')
					*its = '_';
				else
					*its = std::toupper(*its);
			}
			temp += '=' + (*it)->getValue();
			m_env.push_back(temp);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rdi, 0x70(%rsp)
movq (%rsi), %r14
movq %rsi, 0x1b8(%rsp)
cmpq 0x8(%rsi), %r14
je 0x153da
leaq 0x18(%rsp), %r12
addq $0xf8, 0x70(%rsp)
leaq 0x8(%rsp), %rbp
leaq 0x48(%rsp), %r13
leaq 0x28(%rsp), %r15
movq (%r14), %rsi
movq (%rsi), %rax
movq %rbp, %rdi
callq *0x10(%rax)
movq %r13, %rdi
callq 0x803c
movq %r15, %rdi
movq %r13, %rsi
callq 0x808a
movq 0x10(%rsp), %rdx
cmpq 0x30(%rsp), %rdx
leaq 0x280(%rsp), %rbx
jne 0x14d87
testq %rdx, %rdx
je 0x14d8c
movq 0x28(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x74c0
testl %eax, %eax
sete %r15b
jmp 0x14d8f
xorl %r15d, %r15d
jmp 0x14d8f
movb $0x1, %r15b
testb %r15b, %r15b
je 0x14daa
movb $0x1, 0x7(%rsp)
xorl %r13d, %r13d
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %eax, %eax
jmp 0x1500c
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x198(%rsp), %rdi
callq *0x10(%rax)
movq %rbx, %rdi
callq 0x8184
leaq 0x178(%rsp), %rdi
movq %rbx, %rsi
callq 0x81d2
movq 0x1a0(%rsp), %rdx
cmpq 0x180(%rsp), %rdx
jne 0x14e03
testq %rdx, %rdx
je 0x14d94
movq 0x178(%rsp), %rsi
movq 0x198(%rsp), %rdi
callq 0x74c0
testl %eax, %eax
je 0x14d94
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x158(%rsp), %rdi
callq *0x10(%rax)
leaq 0x258(%rsp), %rbx
movq %rbx, %rdi
callq 0x823c
leaq 0x138(%rsp), %rdi
movq %rbx, %rsi
callq 0x828a
movq 0x160(%rsp), %rdx
cmpq 0x140(%rsp), %rdx
jne 0x14e6f
movb $0x1, %r13b
testq %rdx, %rdx
je 0x14fee
movq 0x138(%rsp), %rsi
movq 0x158(%rsp), %rdi
callq 0x74c0
testl %eax, %eax
je 0x14fee
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x118(%rsp), %rdi
callq *0x10(%rax)
leaq 0x230(%rsp), %rbx
movq %rbx, %rdi
callq 0x8e70
leaq 0xf8(%rsp), %rdi
movq %rbx, %rsi
callq 0x8f16
movq 0x120(%rsp), %rdx
cmpq 0x100(%rsp), %rdx
jne 0x14edb
movb $0x1, %r13b
testq %rdx, %rdx
je 0x14ff5
movq 0xf8(%rsp), %rsi
movq 0x118(%rsp), %rdi
callq 0x74c0
testl %eax, %eax
je 0x14ff5
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0xd8(%rsp), %rdi
callq *0x10(%rax)
leaq 0x208(%rsp), %rbx
movq %rbx, %rdi
callq 0x98b8
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
callq 0x995e
movq 0xe0(%rsp), %rdx
cmpq 0xc0(%rsp), %rdx
jne 0x14f47
movb $0x1, %r13b
testq %rdx, %rdx
je 0x14ffe
movq 0xb8(%rsp), %rsi
movq 0xd8(%rsp), %rdi
callq 0x74c0
testl %eax, %eax
je 0x14ffe
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x98(%rsp), %rdi
callq *0x10(%rax)
leaq 0x1e0(%rsp), %rbx
movq %rbx, %rdi
callq 0x9c98
leaq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x9d3e
movq 0xa0(%rsp), %rdx
cmpq 0x80(%rsp), %rdx
jne 0x14fad
movb $0x1, %r13b
testq %rdx, %rdx
je 0x153cb
movq 0x78(%rsp), %rsi
movq 0x98(%rsp), %rdi
callq 0x74c0
testl %eax, %eax
je 0x153cb
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x1c0(%rsp), %rbx
movq %rbx, %rdi
callq *0x10(%rax)
movl $0x2, %ecx
movq %rbx, %rdi
leaq 0x25c27(%rip), %rsi     # 0x3abf7
xorl %edx, %edx
callq 0x77f0
testq %rax, %rax
sete 0x7(%rsp)
movb $0x1, %r13b
movb $0x1, %bl
movb $0x1, %r12b
movb $0x1, %bpl
movb $0x1, %al
jmp 0x1500c
xorl %ebx, %ebx
xorl %r12d, %r12d
jmp 0x14ffa
xorl %r12d, %r12d
movb $0x1, %bl
xorl %ebp, %ebp
jmp 0x15005
xorl %ebp, %ebp
movb $0x1, %bl
movb $0x1, %r12b
xorl %eax, %eax
movb $0x1, 0x7(%rsp)
testb %al, %al
je 0x15035
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0x15035
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x74b0
testb %bpl, %bpl
leaq 0x8(%rsp), %rbp
je 0x15093
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x15061
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x1e0(%rsp), %rdi
callq 0x9cd8
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x15093
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x74b0
testb %r12b, %r12b
je 0x150ef
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x150bd
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x208(%rsp), %rdi
callq 0x98f8
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x150ef
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x74b0
testb %bl, %bl
je 0x1514a
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x15118
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x230(%rsp), %rdi
callq 0x8eb0
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x1514a
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x74b0
testb %r13b, %r13b
leaq 0x18(%rsp), %r12
leaq 0x48(%rsp), %r13
je 0x151b0
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x1517e
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x258(%rsp), %rdi
callq 0x8268
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x151b0
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x74b0
testb %r15b, %r15b
jne 0x1520c
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0x151da
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x74b0
leaq 0x280(%rsp), %rdi
callq 0x81b0
movq 0x198(%rsp), %rdi
leaq 0x1a8(%rsp), %rax
cmpq %rax, %rdi
je 0x1520c
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x15228
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %r13, %rdi
callq 0x8068
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x15247
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
cmpb $0x0, 0x7(%rsp)
leaq 0x28(%rsp), %r15
je 0x153b3
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movb $0x0, 0x58(%rsp)
movq (%r14), %rsi
movq (%rsi), %rax
movq %r15, %rdi
callq *0x10(%rax)
movl $0x5, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x2596b(%rip), %rcx     # 0x3abfa
callq 0x7500
movq %r12, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x152b7
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x152bf
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x7590
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x152f9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x15315
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
cmpq $0x6, 0x50(%rsp)
je 0x15349
movq 0x48(%rsp), %rbx
addq $0x6, %rbx
movsbl (%rbx), %edi
movb $0x5f, %al
cmpl $0x2d, %edi
je 0x15335
callq 0x78a0
movb %al, (%rbx)
incq %rbx
movq 0x48(%rsp), %rax
addq 0x50(%rsp), %rax
cmpq %rax, %rbx
jne 0x15326
movq (%r14), %rdi
callq 0x8e44
movq %rbp, %rdi
movl $0x3d, %esi
movq %rax, %rdx
callq 0x169c5
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r13, %rdi
callq 0x7190
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1538a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x1692c
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x153b3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x74b0
addq $0x8, %r14
movq 0x1b8(%rsp), %rax
cmpq 0x8(%rax), %r14
jne 0x14d38
jmp 0x153da
xorl %eax, %eax
movb $0x1, %bl
movb $0x1, %r12b
movb $0x1, %bpl
jmp 0x15007
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x15416
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x15416
movq %rax, %rbx
leaq 0x1e0(%rsp), %rdi
callq 0x9cd8
jmp 0x15428
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x15452
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x15452
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x1547c
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x1547c
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x98f8
jmp 0x1548e
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x154b8
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x154b8
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x154e2
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x154e2
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
callq 0x8eb0
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x1551e
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x1551e
movq %rax, %rbx
jmp 0x154ef
movq %rax, %rbx
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x15552
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x15552
movq %rax, %rbx
jmp 0x1555f
movq %rax, %rbx
jmp 0x15584
movq %rax, %rbx
leaq 0x258(%rsp), %rdi
callq 0x8268
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x15584
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0x155d0
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x155d0
jmp 0x15670
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x15673
movq 0x18(%rsp), %rsi
jmp 0x15637
movq %rax, %rbx
jmp 0x15602
movq %rax, %rbx
leaq 0x280(%rsp), %rdi
callq 0x81b0
movq 0x198(%rsp), %rdi
leaq 0x1a8(%rsp), %rax
cmpq %rax, %rdi
je 0x15602
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x15650
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x15650
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x15673
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x15673
jmp 0x15670
movq %rax, %rbx
jmp 0x155dd
movq %rax, %rbx
jmp 0x1565f
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x8068
leaq 0x18(%rsp), %r12
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1568f
movq 0x18(%rsp), %rsi
jmp 0x15687
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1568f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rdi
callq 0x7810
nop