// File: /workspace/github_c_makefile_star2_O1/ffoissey[P]minishell_42/srcs/ft_env.c
// Function: ft_process_env
void		ft_process_env(char **tab, t_list_ex **lst)
{
	int			i;
	int			flag_i;
	t_list_ex	*new_env;
	char		*tmp;
	char		*tmp2;

	i = 0;
	flag_i = 0;
	new_env = NULL;
	if (!ft_env_options(tab, &i, &flag_i))
		return ;
	while (tab[i] && (tmp = ft_strchr(tab[i], '=')))
	{
		tmp2 = ft_strsub(tab[i], 0, tmp - tab[i]);
		ft_lst_changevalue(flag_i ? &new_env : lst, tmp2, tmp + 1);
		ft_strdel(&tmp2);
		i++;
	}
	if (!tab[i])
		ft_lst_printenv(flag_i ? new_env : *lst);
	else if (!ft_is_builtin(tab[i], lst, &new_env, flag_i))
		ft_process_out((flag_i ? new_env : *lst), "env", tab + i);
	ft_freelistex(new_env);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, 0x8(%rsp)
movq (%rdi), %rax
xorl %r15d, %r15d
xorl %ebp, %ebp
testq %rax, %rax
je 0x1b18
cmpb $0x2d, (%rax)
jne 0x1b18
cmpb $0x2d, 0x1(%rax)
je 0x1b18
movq (%r14,%r15,8), %rax
incq %rax
movzbl (%rax), %ecx
cmpl $0x69, %ecx
jne 0x1aca
incq %rax
movl $0x1, %ebp
jmp 0x1ab8
testl %ecx, %ecx
jne 0x1ad8
movq 0x8(%r14,%r15,8), %rax
incq %r15
jmp 0x1aa1
movsbl %cl, %edx
leaq 0x5618(%rip), %rsi      # 0x70fa
movl $0x2, %edi
xorl %eax, %eax
callq 0x3af8
leaq 0x5620(%rip), %rsi      # 0x7115
movl $0x2, %edi
xorl %eax, %eax
callq 0x3af8
leaq 0x562e(%rip), %rsi      # 0x7136
movl $0x2, %edi
xorl %eax, %eax
callq 0x3af8
movb $0x1, %al
jmp 0x1b1a
xorl %eax, %eax
testb %al, %al
jne 0x1cad
movslq %r15d, %rax
leaq (%r14,%rax,8), %r14
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1b8e
testl %ebp, %ebp
leaq 0x8(%rsp), %r15
cmoveq %rbx, %r15
leaq 0x10(%rsp), %r12
movl $0x3d, %esi
callq 0x2b10
testq %rax, %rax
je 0x1b8e
movq %rax, %r13
movq (%r14), %rdi
movq %rax, %rdx
subq %rdi, %rdx
xorl %esi, %esi
callq 0x2d18
movq %rax, 0x10(%rsp)
incq %r13
movq %r15, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x2378
movq %r12, %rdi
callq 0x2d88
movq 0x8(%r14), %rdi
addq $0x8, %r14
testq %rdi, %rdi
jne 0x1b41
movq (%r14), %r15
testq %r15, %r15
je 0x1c90
leaq 0x54b1(%rip), %rsi      # 0x7052
movq %r15, %rdi
callq 0x2a9c
testl %eax, %eax
je 0x1c78
leaq 0x54a8(%rip), %rsi      # 0x7060
movq %r15, %rdi
callq 0x2a9c
testl %eax, %eax
je 0x1c78
leaq 0x548d(%rip), %rsi      # 0x705c
movq %r15, %rdi
callq 0x2a9c
testl %eax, %eax
je 0x1c78
leaq 0x5473(%rip), %rsi      # 0x7059
movq %r15, %rdi
callq 0x2a9c
testl %eax, %eax
je 0x1c78
leaq 0x545a(%rip), %rsi      # 0x7057
movq %r15, %rdi
callq 0x2a9c
testl %eax, %eax
je 0x1c78
testl %ebp, %ebp
je 0x1c59
movq 0x8(%rsp), %rdi
leaq 0x5550(%rip), %rsi      # 0x7169
callq 0x2417
testq %rax, %rax
jne 0x1c59
movq (%rbx), %rdi
leaq 0x553c(%rip), %rsi      # 0x7169
callq 0x2417
testq %rax, %rax
je 0x1c59
movq (%rbx), %rdi
leaq 0x5528(%rip), %r15      # 0x7169
movq %r15, %rsi
callq 0x2417
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2378
testl %ebp, %ebp
leaq 0x8(%rsp), %rax
cmoveq %rbx, %rax
movq (%rax), %rdi
leaq 0x53ee(%rip), %rsi      # 0x705c
movq %r14, %rdx
callq 0x27a0
jmp 0x1ca3
leaq 0x54d2(%rip), %rsi      # 0x7151
movl $0x2, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3af8
jmp 0x1ca3
testl %ebp, %ebp
leaq 0x8(%rsp), %rax
cmoveq %rbx, %rax
movq (%rax), %rdi
callq 0x23e8
movq 0x8(%rsp), %rdi
callq 0x2454
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq