// File: mbourand[P]webserv/srcs/Utils/CGI.cpp
// Function: CGI::VectorToArray()
void	CGI::VectorToArray(void)
{
	m_c_env = new char*[m_env.size() + 1];
	for (size_t i = 0; i < m_env.size(); i++)
	{
		m_c_env[i] = new char[m_env[i].length() + 1];
		ft::strncpy(m_c_env[i], m_env[i].c_str(), m_env[i].size() + 1);
	}
	m_c_env[m_env.size()] = NULL;
	m_c_args = new char*[m_args.size() + 1];
	for (size_t i = 0; i < m_args.size(); i++)
	{
		m_c_args[i] = new char[m_args[i].size() + 1];
		ft::strncpy(m_c_args[i], m_args[i].c_str(), m_args[i].size() + 1);
	}
	m_c_args[m_args.size()] = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0xf8, %rdi
callq 0x21d70
addq $0x1, %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x118(%rax)
movq $0x0, -0x10(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0xf8, %rdi
callq 0x21d70
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x20ca1
movq -0x20(%rbp), %rdi
addq $0xf8, %rdi
movq -0x10(%rbp), %rsi
callq 0x21ac0
movq %rax, %rdi
callq 0x9960
movq %rax, %rdi
addq $0x1, %rdi
callq 0x9030
movq -0x20(%rbp), %rdi
movq %rax, %rdx
movq 0x118(%rdi), %rax
movq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x118(%rdi), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
addq $0xf8, %rdi
movq -0x10(%rbp), %rsi
callq 0x21ac0
movq %rax, %rdi
callq 0x92b0
movq -0x20(%rbp), %rdi
movq %rax, -0x30(%rbp)
addq $0xf8, %rdi
movq -0x10(%rbp), %rsi
callq 0x21ac0
movq %rax, %rdi
callq 0x9480
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x32810
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x20bcb
movq -0x20(%rbp), %rdi
movq 0x118(%rdi), %rax
movq %rax, -0x40(%rbp)
addq $0xf8, %rdi
callq 0x21d70
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq $0x0, (%rax,%rcx,8)
addq $0xe0, %rdi
callq 0x21d70
addq $0x1, %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x110(%rax)
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
addq $0xe0, %rdi
callq 0x21d70
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x20dec
movq -0x20(%rbp), %rdi
addq $0xe0, %rdi
movq -0x18(%rbp), %rsi
callq 0x21ac0
movq %rax, %rdi
callq 0x9480
movq %rax, %rdi
addq $0x1, %rdi
callq 0x9030
movq -0x20(%rbp), %rdi
movq %rax, %rdx
movq 0x110(%rdi), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x110(%rdi), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
addq $0xe0, %rdi
movq -0x18(%rbp), %rsi
callq 0x21ac0
movq %rax, %rdi
callq 0x92b0
movq -0x20(%rbp), %rdi
movq %rax, -0x50(%rbp)
addq $0xe0, %rdi
movq -0x18(%rbp), %rsi
callq 0x21ac0
movq %rax, %rdi
callq 0x9480
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x32810
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x20d16
movq -0x20(%rbp), %rdi
movq 0x110(%rdi), %rax
movq %rax, -0x60(%rbp)
addq $0xe0, %rdi
callq 0x21d70
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq $0x0, (%rax,%rcx,8)
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)