// File: /workspace/github_c_makefile_star2_O3/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 $0x0, (%rsp)
movq (%rdi), %rax
testq %rax, %rax
je 0x1c89
xorl %ecx, %ecx
xorl %r15d, %r15d
cmpb $0x2d, (%rax)
jne 0x1acb
movb 0x1(%rax), %dl
cmpb $0x2d, %dl
je 0x1acb
addq $0x2, %rax
cmpb $0x69, %dl
jne 0x1ab3
movb (%rax), %dl
incq %rax
movl $0x1, %r15d
jmp 0x1aa1
movzbl %dl, %eax
testl %eax, %eax
jne 0x1b54
movq 0x8(%rdi,%rcx,8), %rax
incq %rcx
testq %rax, %rax
jne 0x1a90
movslq %ecx, %rax
movq (%rdi,%rax,8), %rax
testq %rax, %rax
je 0x1c81
testl %r15d, %r15d
movslq %ecx, %rcx
leaq (%rdi,%rcx,8), %r14
movq %rsp, %rcx
cmoveq %rbx, %rcx
movq %rcx, 0x8(%rsp)
leaq 0x10(%rsp), %r13
movq %rax, %rdi
movl $0x3d, %esi
callq 0x2ad4
movq (%r14), %r12
testq %rax, %rax
je 0x1b9e
movq %rax, %rbp
movq %rax, %rdx
subq %r12, %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x2cd4
movq %rax, 0x10(%rsp)
incq %rbp
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x2358
movq %r13, %rdi
callq 0x2d50
movq 0x8(%r14), %rax
addq $0x8, %r14
testq %rax, %rax
jne 0x1af6
jmp 0x1c81
movsbl %dl, %edx
leaq 0x559c(%rip), %rsi      # 0x70fa
movl $0x2, %edi
xorl %eax, %eax
callq 0x3ad4
leaq 0x55a4(%rip), %rsi      # 0x7115
movl $0x2, %edi
xorl %eax, %eax
callq 0x3ad4
leaq 0x55b2(%rip), %rsi      # 0x7136
movl $0x2, %edi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ad4
testq %r12, %r12
je 0x1c81
leaq 0x54a4(%rip), %rsi      # 0x7052
movq %r12, %rdi
callq 0x2a50
testl %eax, %eax
je 0x1ca9
leaq 0x549b(%rip), %rsi      # 0x7060
movq %r12, %rdi
callq 0x2a50
testl %eax, %eax
je 0x1ca9
leaq 0x5480(%rip), %rsi      # 0x705c
movq %r12, %rdi
callq 0x2a50
testl %eax, %eax
je 0x1ca9
leaq 0x5466(%rip), %rsi      # 0x7059
movq %r12, %rdi
callq 0x2a50
testl %eax, %eax
je 0x1ca9
leaq 0x544d(%rip), %rsi      # 0x7057
movq %r12, %rdi
callq 0x2a50
testl %eax, %eax
je 0x1ca9
testl %r15d, %r15d
je 0x1c68
movq (%rsp), %rdi
leaq 0x553f(%rip), %rsi      # 0x7169
callq 0x23f7
testq %rax, %rax
jne 0x1c68
movq (%rbx), %rdi
leaq 0x552b(%rip), %rsi      # 0x7169
callq 0x23f7
testq %rax, %rax
je 0x1c68
movq (%rbx), %rdi
leaq 0x5517(%rip), %rbx      # 0x7169
movq %rbx, %rsi
callq 0x23f7
movq %rsp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2358
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x53e5(%rip), %rsi      # 0x705c
movq %r14, %rdx
callq 0x278c
jmp 0x1c91
testl %r15d, %r15d
je 0x1c89
movq %rsp, %rbx
movq (%rbx), %rdi
callq 0x23c8
movq (%rsp), %rdi
callq 0x2434
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x54a1(%rip), %rsi      # 0x7151
movl $0x2, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3ad4
jmp 0x1c91
nopl (%rax)