// File: /workspace/github_cpp_makefile_star2_O3/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, 0x30(%rsp)
movq (%rsi), %r14
movq %rsi, 0x1e0(%rsp)
cmpq 0x8(%rsi), %r14
je 0x15311
addq $0xf8, 0x30(%rsp)
leaq 0x8(%rsp), %r13
leaq 0x1e8(%rsp), %r15
leaq 0x38(%rsp), %r12
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x1c0(%rsp), %rdi
callq *0x10(%rax)
movq %r13, %rdi
callq 0x803c
leaq 0x1a0(%rsp), %rdi
movq %r13, %rbp
movq %r13, %rsi
callq 0x808a
movq 0x1c8(%rsp), %rdx
cmpq 0x1a8(%rsp), %rdx
jne 0x14d23
movb $0x1, %bl
movq 0x1a0(%rsp), %r13
testq %rdx, %rdx
je 0x1513a
movq 0x1c0(%rsp), %rdi
movq %r13, %rsi
callq 0x74c0
testl %eax, %eax
je 0x1513a
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x180(%rsp), %rdi
callq *0x10(%rax)
movq %r12, %rbx
movq %r12, %rdi
callq 0x818c
leaq 0x160(%rsp), %rdi
movq %rbx, %rsi
callq 0x81da
movq 0x188(%rsp), %rdx
cmpq 0x168(%rsp), %rdx
jne 0x14d8c
movb $0x1, %bl
movq 0x160(%rsp), %r13
testq %rdx, %rdx
je 0x150e5
movq 0x180(%rsp), %rdi
movq %r13, %rsi
callq 0x74c0
testl %eax, %eax
je 0x150e5
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x140(%rsp), %rdi
callq *0x10(%rax)
movq %r15, %rbx
movq %r15, %rdi
callq 0x8244
leaq 0x120(%rsp), %rdi
movq %rbx, %rsi
callq 0x8292
movq 0x148(%rsp), %rdx
cmpq 0x128(%rsp), %rdx
jne 0x14df5
movb $0x1, %bl
movq 0x120(%rsp), %r13
testq %rdx, %rdx
je 0x15090
movq 0x140(%rsp), %rdi
movq %r13, %rsi
callq 0x74c0
testl %eax, %eax
je 0x15090
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x100(%rsp), %rdi
callq *0x10(%rax)
leaq 0x280(%rsp), %rbx
movq %rbx, %rdi
callq 0x8e7c
leaq 0xe0(%rsp), %rdi
movq %rbx, %rsi
callq 0x8f22
movq 0x108(%rsp), %rdx
cmpq 0xe8(%rsp), %rdx
jne 0x14e63
movb $0x1, %bl
movq 0xe0(%rsp), %r13
testq %rdx, %rdx
je 0x15036
movq 0x100(%rsp), %rdi
movq %r13, %rsi
callq 0x74c0
testl %eax, %eax
je 0x15036
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0xc0(%rsp), %rdi
callq *0x10(%rax)
leaq 0x258(%rsp), %rbx
movq %rbx, %rdi
callq 0x9898
leaq 0xa0(%rsp), %rdi
movq %rbx, %rsi
callq 0x993e
movq 0xc8(%rsp), %rdx
cmpq 0xa8(%rsp), %rdx
jne 0x14ed1
movb $0x1, %bl
movq 0xa0(%rsp), %r13
testq %rdx, %rdx
je 0x14fdc
movq 0xc0(%rsp), %rdi
movq %r13, %rsi
callq 0x74c0
testl %eax, %eax
je 0x14fdc
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x80(%rsp), %rdi
callq *0x10(%rax)
leaq 0x230(%rsp), %rbx
movq %rbx, %rdi
callq 0x9c78
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x9d1e
movq 0x88(%rsp), %rdx
cmpq 0x68(%rsp), %rdx
jne 0x14f2e
movb $0x1, %bl
movq 0x60(%rsp), %r13
testq %rdx, %rdx
je 0x14f88
movq 0x80(%rsp), %rdi
movq %r13, %rsi
callq 0x74c0
testl %eax, %eax
je 0x14f88
movq (%r14), %rsi
movq (%rsi), %rax
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
callq *0x10(%rax)
movl $0x2, %ecx
movq %rbx, %rdi
leaq 0x25ca6(%rip), %rsi     # 0x3abf7
xorl %edx, %edx
callq 0x77f0
testq %rax, %rax
sete %bl
movq 0x210(%rsp), %rdi
leaq 0x220(%rsp), %rax
cmpq %rax, %rdi
je 0x14f83
movq 0x220(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x60(%rsp), %r13
leaq 0x70(%rsp), %rax
cmpq %rax, %r13
je 0x14fa2
movq 0x70(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x74b0
leaq 0x230(%rsp), %rdi
callq 0x9cb8
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x14fd4
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xa0(%rsp), %r13
leaq 0xb0(%rsp), %rax
cmpq %rax, %r13
je 0x14ffc
movq 0xb0(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x74b0
leaq 0x258(%rsp), %rdi
callq 0x98d8
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x1502e
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0xe0(%rsp), %r13
leaq 0xf0(%rsp), %rax
cmpq %rax, %r13
je 0x15056
movq 0xf0(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x74b0
leaq 0x280(%rsp), %rdi
callq 0x8ebc
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x15088
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x120(%rsp), %r13
leaq 0x130(%rsp), %rax
cmpq %rax, %r13
je 0x150b0
movq 0x130(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x74b0
movq %r15, %rdi
callq 0x8270
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x150dd
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x160(%rsp), %r13
leaq 0x170(%rsp), %rax
cmpq %rax, %r13
je 0x15105
movq 0x170(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x74b0
movq %r12, %rdi
callq 0x81b8
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x15132
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x1a0(%rsp), %r13
leaq 0x1b0(%rsp), %rax
cmpq %rax, %r13
je 0x1515a
movq 0x1b0(%rsp), %rsi
incq %rsi
movq %r13, %rdi
callq 0x74b0
movq %rbp, %r13
movq %rbp, %rdi
callq 0x8068
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0x1518a
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x74b0
testb %bl, %bl
leaq 0x48(%rsp), %rbp
je 0x152fb
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%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 0x25a2b(%rip), %rcx     # 0x3abfa
callq 0x7500
movq %rbp, 0x38(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x151f7
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x151fe
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x40(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r13, %rdi
movq %r12, %rsi
callq 0x7590
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0x15238
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x1e8(%rsp), %rdi
leaq 0x1f8(%rsp), %rax
cmpq %rax, %rdi
je 0x1525d
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x74b0
cmpq $0x6, 0x10(%rsp)
je 0x15291
movq 0x8(%rsp), %rbx
addq $0x6, %rbx
movsbl (%rbx), %edi
movb $0x5f, %al
cmpl $0x2d, %edi
je 0x1527d
callq 0x78a0
movb %al, (%rbx)
incq %rbx
movq 0x8(%rsp), %rax
addq 0x10(%rsp), %rax
cmpq %rax, %rbx
jne 0x1526e
movq (%r14), %rdi
callq 0x8e50
movq %r12, %rdi
movl $0x3d, %esi
movq %rax, %rdx
callq 0x1690c
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r13, %rdi
callq 0x7190
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0x152d2
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x16870
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x152fb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
addq $0x8, %r14
movq 0x1e0(%rsp), %rax
cmpq 0x8(%rax), %r14
jne 0x14cba
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x15347
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x15347
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
callq 0x9cb8
jmp 0x15359
movq %rax, %rbx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x15383
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x15383
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x153ad
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x153ad
movq %rax, %rbx
leaq 0x258(%rsp), %rdi
callq 0x98d8
jmp 0x153bf
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x153e9
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x153e9
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x15413
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x15413
movq %rax, %rbx
leaq 0x280(%rsp), %rdi
callq 0x8ebc
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x1544f
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x1544f
movq %rax, %rbx
jmp 0x15420
movq %rax, %rbx
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x15483
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x15483
movq %rax, %rbx
jmp 0x15490
movq %rax, %rbx
jmp 0x154b5
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
callq 0x8270
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0x154b5
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x1553c
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x1553c
jmp 0x155c3
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %rbp, %rdi
je 0x155c6
movq 0x48(%rsp), %rsi
jmp 0x1551d
movq %rax, %rbx
movq 0x1e8(%rsp), %rdi
leaq 0x1f8(%rsp), %rax
cmpq %rax, %rdi
je 0x155c6
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x155c6
jmp 0x155c3
movq %rax, %rbx
jmp 0x1556b
movq %rax, %rbx
jmp 0x15546
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x81b8
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x1556b
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x74b0
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x1559a
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x74b0
jmp 0x1559a
movq %rax, %rbx
jmp 0x155a4
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8068
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0x155e2
movq 0x1d0(%rsp), %rsi
jmp 0x155da
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x155e2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x74b0
movq %rbx, %rdi
callq 0x7810