LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/builtin_export.c
// Function: export_builtin_new_env
int		export_builtin_new_env(char *str, char *str2, t_list **head)
{
	t_env	*env;
	t_list	*new_link;

	if (!(env = ft_memalloc(sizeof(t_env))))
		return (0);
	if (!(env->label = ft_strdup(str)))
	{
		free(env);
		return (0);
	}
	if (!(env->value = ft_strdup(str2)))
	{
		free(env->label);
		free(env);
		return (0);
	}
	if (!(new_link = ft_lstnew(env)))
	{
		env_del_struct(env);
		return (0);
	}
	ft_lstadd_back(head, new_link);
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
pushq $0x18
popq %rdi
callq 0x9fb0
xorl %ebx, %ebx
testq %rax, %rax
je 0x36ec
movq %rax, %r14
movq %r13, %rdi
callq 0x9aec
movq %rax, (%r14)
testq %rax, %rax
je 0x36e4
movq %r12, %rdi
callq 0x9aec
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x36dc
movq %r14, %rdi
callq 0x9e58
testq %rax, %rax
je 0x36f8
movq %r15, %rdi
movq %rax, %rsi
callq 0x9dac
pushq $0x1
popq %rbx
jmp 0x36ec
movq (%r14), %rdi
callq 0x2230
movq %r14, %rdi
callq 0x2230
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0x325f
jmp 0x36ec
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/builtin_export2.c
// Function: export_builtin_no_arg
void		export_builtin_no_arg(t_list **head, t_control *control)
{
	const t_list	*env = *head;
	t_env			*tmp;
	t_env			*sort;
	int				list_size;

	control->exit_status = 0;
	list_size = ft_lstsize(*head);
	while (list_size--)
	{
		env = *head;
		sort = NULL;
		while (env)
		{
			tmp = env->content;
			if (tmp->tmpdeclare == 0 && alpha_cmp(tmp, sort) < 0)
				sort = tmp;
			env = env->next;
		}
		if (sort && sort->tmpdeclare == 0)
		{
			export_no_arg_display(sort);
			sort->tmpdeclare = 1;
		}
	}
	export_builtin_no_arg_end(*head);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r12
andl $0x0, 0x4(%rsi)
movq (%rdi), %rdi
callq 0x9e74
movl %eax, %ebp
pushq $0x1
popq %r15
subl $0x1, %ebp
jb 0x37cd
movq %r12, %rbx
xorl %r13d, %r13d
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x3763
movq (%rbx), %r14
cmpl $0x0, 0x10(%r14)
jne 0x375d
testq %r13, %r13
je 0x375a
movq (%r14), %rdi
movq (%r13), %rsi
callq 0x9ffc
testl %eax, %eax
jns 0x375d
movq %r14, %r13
addq $0x8, %rbx
jmp 0x3733
testq %r13, %r13
je 0x3724
cmpl $0x0, 0x10(%r13)
jne 0x3724
leaq 0x79f8(%rip), %rdi      # 0xb16e
movl %r15d, %esi
callq 0x9668
movq (%r13), %rdi
movl %r15d, %esi
callq 0x9668
leaq 0x79e9(%rip), %rdi      # 0xb17a
movl %r15d, %esi
callq 0x9668
movq 0x8(%r13), %rdi
movl %r15d, %esi
callq 0x9668
leaq 0x800c(%rip), %rdi      # 0xb7b8
movl %r15d, %esi
callq 0x95cc
movl $0x1, 0x10(%r13)
jmp 0x3724
movq (%r12), %rax
andl $0x0, 0x10(%rax)
addq $0x8, %r12
movq (%r12), %r12
testq %r12, %r12
jne 0x37c1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/builtin_cd.c
// Function: cd_builtin
int		cd_builtin(t_list *env, char **argv, t_control *control)
{
	int ret;

	if (!argv[1] || !ft_strcmp("~", argv[1]))
		ret = cd_special("HOME", env, control);
	else if (!ft_strcmp("-", argv[1]))
	{
		if ((ret = cd_special("OLDPWD", env, control)) == 1)
			ft_putendl_fd(control->cwd, STDOUT_FILENO);
	}
	else
		ret = ft_chdir(argv[1], env, control);
	if (ret == 0)
		control->quit = 1;
	else if (errno)
		ft_perror(argv[0], argv[1], strerror(errno));
	control->exit_status = (ret == 1 ? 0 : 1);
	return (ret == 0 ? 0 : 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rsi), %rsi
pushq $0x1
popq %rbp
testq %rsi, %rsi
je 0x383a
leaq 0x7ade(%rip), %rdi      # 0xb2ea
callq 0x9ffc
testl %eax, %eax
je 0x383a
movq 0x8(%r14), %rsi
leaq 0x7d88(%rip), %rdi      # 0xb5a8
callq 0x9ffc
testl %eax, %eax
je 0x389a
movq 0x8(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x391c
jmp 0x384c
leaq 0x793c(%rip), %rdi      # 0xb17d
movq %r15, %rsi
movq %rbx, %rdx
callq 0x38c4
movl %eax, %r15d
testl %r15d, %r15d
je 0x387b
callq 0x2040
movl (%rax), %edi
testl %edi, %edi
je 0x3883
movq (%r14), %r12
movq 0x8(%r14), %r14
callq 0x2210
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x24e8
jmp 0x3883
orb $0x1, (%rbx)
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %eax, %eax
cmpl $0x1, %r15d
setne %al
movl %eax, 0x4(%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x78e1(%rip), %rdi      # 0xb182
movq %r15, %rsi
movq %rbx, %rdx
callq 0x38c4
movl %eax, %r15d
cmpl $0x1, %eax
jne 0x384f
movq 0x78(%rbx), %rdi
movl %ebp, %esi
callq 0x95cc
movl %ebp, %r15d
jmp 0x3854
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/builtin_cd.c
// Function: ft_chdir
int		ft_chdir(char *target_dir, t_list *env, t_control *control)
{
	char	**oldpwd;
	char	**pwd_env;

	pwd_env = env_get_addr("PWD", 3, env);
	oldpwd = env_get_addr("OLDPWD", 6, env);
	if (chdir(target_dir) == -1)
		return (-1);
	if (oldpwd)
	{
		free(*oldpwd);
		if (!(*oldpwd = ft_strdup(control->cwd)))
			return (0);
	}
	if (!(ft_getcwd(&control->cwd)))
		return (0);
	if (pwd_env && ft_getcwd(pwd_env) == 0)
		return (0);
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x7851(%rip), %rdi      # 0xb185
pushq $0x3
popq %rsi
movq %r15, %rdx
callq 0x32e3
movq %rax, %rbx
leaq 0x7839(%rip), %rdi      # 0xb182
pushq $0x6
popq %rsi
movq %r15, %rdx
callq 0x32e3
movq %rax, %r15
movq %r12, %rdi
callq 0x20a0
cmpl $-0x1, %eax
je 0x39a9
testq %r15, %r15
je 0x3982
movq (%r15), %rdi
callq 0x2230
movq 0x78(%r14), %rdi
callq 0x9aec
movq %rax, (%r15)
testq %rax, %rax
je 0x39b7
addq $0x78, %r14
movq %r14, %rdi
callq 0x3ab2
xorl %ebp, %ebp
testl %eax, %eax
je 0x39ac
testq %rbx, %rbx
je 0x39a5
movq %rbx, %rdi
callq 0x3ab2
testl %eax, %eax
je 0x39ac
pushq $0x1
jmp 0x39ab
pushq $-0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x39ac
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/builtin_cd_utils.c
// Function: ft_ls
void	ft_ls(char *directory, int showdot)
{
	struct dirent	*reader;
	DIR				*dir;
	int				i;

	i = 1;
	if (!(dir = opendir(directory)))
	{
		printf("Couldn't read this directory (%s)\n", directory);
		return ;
	}
	while ((reader = readdir(dir)) != NULL)
	{
		if (!(showdot == 0 && reader->d_name[0] == '.'))
		{
			ft_putstr_fd("\033[0;93m", 1);
			ft_putstr_fd(reader->d_name, 1);
			ft_putstr_fd("\033[0m", 1);
			ft_putstr_fd((i++ % 3 != 0 ? "     \t\t" : "\n"), 1);
		}
	}
	ft_putstr_fd(((i - 1) % 3 == 0 ? "" : "\n"), 1);
	closedir(dir);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
callq 0x2080
testq %rax, %rax
je 0x3a93
movq %rax, %rbx
pushq $0x1
popq %r14
pushq $0x3
popq %r12
movl %r14d, %r13d
movq %rbx, %rdi
callq 0x2170
testq %rax, %rax
je 0x3a57
movq %rax, %r15
testl %ebp, %ebp
jne 0x3a03
cmpb $0x2e, 0x13(%r15)
je 0x39e8
leaq 0x77c2(%rip), %rdi      # 0xb1cc
movl %r14d, %esi
callq 0x9668
addq $0x13, %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x9668
leaq 0x8222(%rip), %rdi      # 0xbc4a
movl %r14d, %esi
callq 0x9668
movl %r13d, %eax
xorl %edx, %edx
divl %r12d
leaq 0x7a1d(%rip), %rdi      # 0xb45c
testl %edx, %edx
je 0x3a4a
leaq 0x778a(%rip), %rdi      # 0xb1d4
incl %r13d
movl %r14d, %esi
callq 0x9668
jmp 0x39e8
decl %r13d
movl %r13d, %eax
cltd
idivl %r12d
testl %edx, %edx
leaq 0x7771(%rip), %rax      # 0xb1db
leaq 0x79eb(%rip), %rdi      # 0xb45c
cmoveq %rax, %rdi
pushq $0x1
popq %rsi
callq 0x9668
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2120
leaq 0x770f(%rip), %rdi      # 0xb1a9
movq %r14, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20c0
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/builtin_cd_utils.c
// Function: ft_getcwd
int		ft_getcwd(char **target)
{
	if (!(getcwd(*target, ft_strlen(*target))))
	{
		errno = 0;
		ft_free((void **)target);
		if (!(*target = getcwd(NULL, 0)))
			return (0);
	}
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
movq %r14, %rdi
callq 0x9be0
movq %r14, %rdi
movq %rax, %rsi
callq 0x20f0
testq %rax, %rax
jne 0x3af8
callq 0x2040
andl $0x0, (%rax)
movq %rbx, %rdi
callq 0xa018
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
callq 0x20f0
movq %rax, (%rbx)
testq %rax, %rax
je 0x3afc
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/builtin_exit.c
// Function: exit_builtin
int		exit_builtin(char **argv, t_control *control)
{
	int has_sign;

	control->quit = 1;
	if (control->parent_pid == getpid())
		ft_putendl_fd("exit", 2);
	if (!argv || !argv[1])
		return (1);
	has_sign = (argv[1][0] == '-' || argv[1][0] == '+' ? 1 : 0);
	if (!ft_isonly_ft(argv[1] + has_sign, ft_isdigit, 1))
	{
		ft_perror("exit", argv[1], "numeric argument required");
		control->exit_status = (IS_APPLE ? 255 : 2);
	}
	else if (ft_array_len(argv) >= 3)
	{
		ft_perror("exit", NULL, "too many arguments");
		control->quit = 0;
		control->exit_status = 1;
	}
	else
		control->exit_status = (unsigned char)ft_atoi(argv[1]);
	return (1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
orb $0x1, (%rsi)
movl 0x8(%rsi), %ebp
callq 0x2070
cmpl %eax, %ebp
jne 0x3b48
leaq 0x769c(%rip), %rdi      # 0xb1dc
pushq $0x2
popq %rsi
callq 0x95cc
testq %r14, %r14
je 0x3bc9
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x3bc9
movb (%rdi), %al
addb $-0x2b, %al
andb $-0x3, %al
cmpb $0x1, %al
adcq $0x0, %rdi
leaq 0x58a3(%rip), %rsi      # 0x940c
pushq $0x1
popq %rbp
movl %ebp, %edx
callq 0x9450
testl %eax, %eax
je 0x3b9e
movq %r14, %rdi
callq 0x9f50
cmpl $0x3, %eax
jl 0x3bba
leaq 0x7651(%rip), %rdi      # 0xb1dc
leaq 0x7669(%rip), %rdx      # 0xb1fb
xorl %esi, %esi
callq 0x24e8
andb $-0x2, (%rbx)
jmp 0x3bc6
movq 0x8(%r14), %rsi
leaq 0x7633(%rip), %rdi      # 0xb1dc
leaq 0x7631(%rip), %rdx      # 0xb1e1
callq 0x24e8
pushq $0x2
popq %rbp
jmp 0x3bc6
movq 0x8(%r14), %rdi
callq 0x9374
movzbl %al, %ebp
movl %ebp, 0x4(%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/input_root.c
// Function: input_root
t_list	*input_root(t_control *control)
{
	t_list *tokens_lst;

	control->ctrl_c = 0;
	control->term->prompt_ps1 = 1;
	if (!reset_prompts(control->env, control->term))
	{
		control->quit = 1;
		return (NULL);
	}
	if (!history_add_new_link(control))
	{
		control->quit = 1;
		return (NULL);
	}
	tokens_lst = input_root_assist_and_prompt(control);
	return (tokens_lst);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andb $-0x3, (%rdi)
movq 0x18(%rdi), %rsi
movl $0x1, 0x30(%rsi)
movq 0x20(%rdi), %rdi
callq 0x3dd4
testl %eax, %eax
je 0x3c08
movq %rbx, %rdi
callq 0x5637
testl %eax, %eax
je 0x3c08
movq %rbx, %rdi
popq %rbx
jmp 0x3c0f
orb $0x1, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/input_root.c
// Function: input_root_assist_and_prompt
t_list	*input_root_assist_and_prompt(t_control *control)
{
	t_list *tokens_lst;

	tokens_lst = NULL;
	while (!tokens_lst && !control->quit && !control->ctrl_c \
			&& !control->lexer_end.unexpected)
	{
		if (!terminfo_load_win_size(control->term) && (control->quit = 1))
			break ;
		control->term->clipboard.highlight = 0;
		if (control->term->prompt_ps1)
			ft_putstr_fd(control->term->ps1, 2);
		else
			ft_putstr_fd(control->term->ps2, 2);
		if (!input_reset_term_struct(control))
			return (NULL);
		tokens_lst = input_reading_and_lexing(control);
		control->term->prompt_ps1 = 0;
		ft_free((void **)&(control->term->line));
	}
	if (control->lexer_end.unexpected)
		input_synthax_error(control, control->lexer_end.unexpected);
//	debug_tokens_list(tokens_lst);
	//ft_lstclear(&tokens_lst, del_token);
	return (tokens_lst);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
pushq $0x2
popq %rbp
testq %r14, %r14
jne 0x3c80
testb $0x3, (%rbx)
jne 0x3c80
movl 0x2c(%rbx), %esi
testl %esi, %esi
jne 0x3c87
movq 0x18(%rbx), %rdi
callq 0x407e
testl %eax, %eax
je 0x3c7d
movq 0x18(%rbx), %rax
andl $0x0, 0x60(%rax)
xorl %ecx, %ecx
cmpl $0x0, 0x30(%rax)
sete %cl
movq 0x38(%rax,%rcx,8), %rdi
movl %ebp, %esi
callq 0x9668
movq %rbx, %rdi
callq 0x3c9c
testl %eax, %eax
je 0x3c91
movq %rbx, %rdi
callq 0x3cea
movq %rax, %r14
movq 0x18(%rbx), %rdi
andl $0x0, 0x30(%rdi)
callq 0xa018
jmp 0x3c1c
orb $0x1, (%rbx)
movl 0x2c(%rbx), %esi
testl %esi, %esi
je 0x3c94
movq %rbx, %rdi
callq 0x3d49
jmp 0x3c94
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/input_root.c
// Function: input_reset_term_struct
int		input_reset_term_struct(t_control *control)
{
	if (!terminfo_cursor_get_pos(control, &(control->term->cursor_start)))
		return (0);
	control->term->cursor = control->term->cursor_start;
	control->term->prompt_len = control->term->cursor.x;
	control->term->inline_position = -1;
	control->term->line_len = 0;
	control->term->current_history_link = control->history->head;
	return (1);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rsi
addq $0x20, %rsi
callq 0x42bc
testl %eax, %eax
je 0x3ce6
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rcx
movq %rcx, 0x10(%rax)
movq 0x18(%rbx), %rax
movl 0x10(%rax), %ecx
movl %ecx, 0x48(%rax)
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movq %rcx, 0x8(%rax)
movq 0x10(%rbx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x58(%rax)
pushq $0x1
popq %rax
jmp 0x3ce8
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/input_root.c
// Function: input_reading_and_lexing
t_list	*input_reading_and_lexing(t_control *control)
{
	t_list *token_lst;

	token_lst = NULL;
	read_root(control, 0, 0);
	if (!terminfo_clipboard_disable_highlight(control))
		return (NULL);
	if (!terminfo_cursor_move_endl(control, 0))
		return (NULL);
	ft_putchar_fd('\n', 1);
	if (control->quit)
		return (NULL);
	if (!history_root(control, control->history))
		return (NULL);
	//printf("\n\033[38;5;27mENTERING LEXER WITH: [\033[0m%s\033[38;5;27m]\033[0m\n\n", control->history->head->content);
	token_lst = lexer_root((char *)(control->history->head->content), control);
	return (token_lst);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
xorl %edx, %edx
callq 0x51e8
movq %rbx, %rdi
callq 0x4eff
testl %eax, %eax
je 0x3d45
movq %rbx, %rdi
xorl %esi, %esi
callq 0x477f
testl %eax, %eax
je 0x3d45
pushq $0xa
popq %rdi
pushq $0x1
popq %rsi
callq 0x95b4
testb $0x1, (%rbx)
jne 0x3d45
movq 0x10(%rbx), %rsi
movq %rbx, %rdi
callq 0x55b8
testl %eax, %eax
je 0x3d45
movq 0x10(%rbx), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x2610
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/input_root.c
// Function: input_synthax_error
void	input_synthax_error(t_control *control, unsigned int unexpected)
{
	ft_putstr_fd("minishell: synthax error near unexpected token `", 2);
	if (unexpected == SEMI)
		ft_putchar_fd(';', 2);
	else if (unexpected == PIPE)
		ft_putchar_fd('|', 2);
	else if (unexpected == OR_IF)
		ft_putstr_fd("||", 2);
	else if (unexpected == AND)
		ft_putchar_fd('&', 2);
	else if (unexpected == AND_IF)
		ft_putstr_fd("&&", 2);
	else if (unexpected == LBRACE)
		ft_putchar_fd('(', 2);
	else if (unexpected == RBRACE)
		ft_putchar_fd(')', 2);
	else if (unexpected == LESS || unexpected == DLESS || unexpected == GREAT \
			|| unexpected == DGREAT)
		ft_putstr_fd("newline", 2);
	ft_putstr_fd("'\n", 2);
	control->lexer_end.unexpected = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x74ea(%rip), %rdi      # 0xb244
pushq $0x2
popq %rsi
callq 0x9668
decl %r14d
cmpl $0xc, %r14d
ja 0x3db9
leaq 0x749e(%rip), %rax      # 0xb210
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x74f9(%rip), %rdi      # 0xb27b
jmp 0x3da0
leaq 0x74ed(%rip), %rdi      # 0xb278
jmp 0x3da0
pushq $0x28
jmp 0x3db0
pushq $0x26
jmp 0x3db0
pushq $0x3b
jmp 0x3db0
leaq 0x74d5(%rip), %rdi      # 0xb275
pushq $0x2
popq %rsi
callq 0x9668
jmp 0x3db9
pushq $0x7c
jmp 0x3db0
pushq $0x29
popq %rdi
pushq $0x2
popq %rsi
callq 0x95b4
leaq 0x74c3(%rip), %rdi      # 0xb283
pushq $0x2
popq %rsi
callq 0x9668
andl $0x0, 0x2c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/reset_prompts.c
// Function: reset_prompts
int	reset_prompts(t_list *env, t_term *term)
{
	char	**ps1;
	char	**ps2;

	ps2 = env_get_addr("PS2", 3, env);
	ps1 = env_get_addr("PS1", 3, env);
	if (!reset_prompt(ps1, &term->ps1))
		return (0);
	return (reset_prompt(ps2, &term->ps2));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x749d(%rip), %rdi      # 0xb286
pushq $0x3
popq %r12
movq %r12, %rsi
movq %r15, %rdx
callq 0x32e3
movq %rax, %r14
leaq 0x7488(%rip), %rdi      # 0xb28a
movq %r12, %rsi
movq %r15, %rdx
callq 0x32e3
leaq 0x38(%rbx), %rsi
movq %rax, %rdi
callq 0x3e45
testl %eax, %eax
je 0x3e37
addq $0x40, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3e45
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/reset_prompts.c
// Function: reset_prompt
int	reset_prompt(char **ref_from_env, char **term_ps)
{
	if (!ref_from_env || !*ref_from_env)
	{
		if (!*term_ps || !ft_strlen(*term_ps))
		{
			ft_free((void **)term_ps);
			if (!(*term_ps = ft_strdup("")))
				return (0);
		}
	}
	else if (!*term_ps || ft_strcmp(*ref_from_env, *term_ps))
	{
		ft_free((void **)term_ps);
		if (!(*term_ps = ft_strdup(*ref_from_env)))
			return (0);
	}
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
je 0x3e7a
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x3e7a
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x3e6d
callq 0x9ffc
testl %eax, %eax
je 0x3ea8
movq %rbx, %rdi
callq 0xa018
movq (%r14), %rdi
jmp 0x3e9b
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x3e8c
callq 0x9be0
testq %rax, %rax
jne 0x3ea8
movq %rbx, %rdi
callq 0xa018
leaq 0x7340(%rip), %rdi      # 0xb1db
callq 0x9aec
movq %rax, (%rbx)
testq %rax, %rax
je 0x3ead
pushq $0x1
popq %rax
jmp 0x3eaf
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/termios_utils.c
// Function: termios_reset_cooked_mode
int	termios_reset_cooked_mode(t_control *control, struct termios *saved_copy)
{
	struct termios new;

	if (tcgetattr(STDIN_FILENO, &new) == -1)
	{
		control->quit = 1;
		control->exit_status = 1;
		ft_perror("tcgetattr can't get", NULL, strerror(errno));
		return (0);
	}
	if (!ft_memcmp(saved_copy, &new, sizeof(struct termios)))
		return (1);
	if (tcsetattr(STDIN_FILENO, TCSAFLUSH, saved_copy) == -1)
	{
		control->quit = 1;
		control->exit_status = 1;
		ft_perror("tcsetattr can't reset", NULL, strerror(errno));
		return (0);
	}
	return (1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
xorl %edi, %edi
callq 0x21c0
cmpl $-0x1, %eax
je 0x3fca
leaq 0x4(%rsp), %rsi
pushq $0x3c
popq %rdx
movq %r14, %rdi
callq 0x952c
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x3ff6
pushq $0x2
popq %rsi
xorl %edi, %edi
movq %r14, %rdx
callq 0x21d0
cmpl $-0x1, %eax
jne 0x3ff6
leaq 0x72ee(%rip), %r14      # 0xb2b6
jmp 0x3fd1
leaq 0x72bd(%rip), %r14      # 0xb28e
orb $0x1, (%rbx)
movl $0x1, 0x4(%rbx)
callq 0x2040
movl (%rax), %edi
callq 0x2210
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x24e8
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_utils.c
// Function: terminfo_init_database
t_term	*terminfo_init_database(void)
{
	int		res;
	t_term	*term;

	res = setupterm(NULL, STDOUT_FILENO, NULL);
	if (res == ERR)
		return (NULL); //note: ERR is defined to 1 in the library. {mli norm 🤔}
	if (!(term = terminfo_init_struct()))
		return (NULL);
	if (!terminfo_load_win_size(term))
		return (terminfo_free_struct(term));
	if (!terminfo_load_array_esc_seq(term))
		return (terminfo_free_struct(term));
	return (term);
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
pushq $0x1
popq %rsi
xorl %edi, %edi
xorl %edx, %edx
callq 0x2190
cmpl $-0x1, %eax
je 0x4043
callq 0x4048
testq %rax, %rax
je 0x4041
movq %rax, %rbx
movq %rax, %rdi
callq 0x407e
movq %rbx, %rdi
callq 0x412c
testl %eax, %eax
jne 0x4043
movq %rbx, %rdi
callq 0x40b3
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_utils.c
// Function: terminfo_free_struct
void	*terminfo_free_struct(t_term *term)
{
	free(term->line);
	free(term->ps1);
	free(term->ps2);
	ft_array_free(term->array_esc_seq, \
			ft_array_len(term->array_esc_seq));
	ft_free((void **)&term->clipboard.paste_me);
	free(term);
	return (NULL);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2230
movq 0x38(%rbx), %rdi
callq 0x2230
movq 0x40(%rbx), %rdi
callq 0x2230
movq 0x50(%rbx), %r14
movq %r14, %rdi
callq 0x9f50
movq %r14, %rdi
movl %eax, %esi
callq 0x9ed4
leaq 0x70(%rbx), %rdi
callq 0xa018
movq %rbx, %rdi
callq 0x2230
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_utils2.c
// Function: terminfo_load_array_esc_seq
int		terminfo_load_array_esc_seq(t_term *term)
{
	char	**array;
	int		i;

	array = (char *[]){KEY_ESC_, KEY_UP_, KEY_RIGHT_,
		KEY_LEFT_, KEY_DOWN_, KEY_HOME_, KEY_DELETE_, KEY_END_, KEY_PAGE_UP_,
		KEY_PAGE_DOWN_, KEY_UP_CTRL_, KEY_DOWN_CTRL_, KEY_RIGHT_CTRL_,
		KEY_LEFT_CTRL_, NULL};
	i = 0;
	if (!(term->array_esc_seq = (char **)malloc(sizeof(char *) * (1 + \
						NUMBER_SPECIAL_KEYS))))
		return (0);
	term->array_esc_seq[NUMBER_SPECIAL_KEYS] = NULL;
	while (i < NUMBER_SPECIAL_KEYS)
	{
		if (!(term->array_esc_seq[i] = ft_strdup((char *)array[i])))
		{
			ft_array_free(term->array_esc_seq, i);
			return (0);
		}
		i++;
	}
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x78
popq %rdi
callq 0x2180
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x4189
andq $0x0, 0x70(%rax)
leaq 0xea8d(%rip), %r15      # 0x12be0
xorl %r14d, %r14d
pushq $0x1
popq %rbp
cmpq $0xe, %r14
je 0x418b
movq (%r15), %rdi
callq 0x9aec
movq 0x50(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
testq %rax, %rax
je 0x417d
incq %r14
addq $0x8, %r15
jmp 0x4159
movq 0x50(%rbx), %rdi
movl %r14d, %esi
callq 0x9ed4
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_utils2.c
// Function: terminfo_refresh_screen_from_start
int		terminfo_refresh_screen_from_start(t_control *control)
{
	char *caps;

	control->term->cursor_saved = control->term->cursor;
	if (!terminfo_update_bottom_screen_and_cursor(control))
		return (0);
	if (!terminfo_cursor_move(control, 0, control->term->cursor_start.y))
		return (0);
	if (!(caps = terminfo_get_caps("ed", control)))
		return (0);
	tputs(caps, 1, ft_putchar);
	if (control->term->prompt_ps1)
		ft_putstr_fd(control->term->ps1, 2);
	else
		ft_putstr_fd(control->term->ps2, 2);
	ft_putstr_fd(control->term->line, 1);
	if (!(terminfo_cursor_saved_reset(control)))
		return (0);
	return (1);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq 0x10(%rax), %rcx
movq %rcx, 0x18(%rax)
callq 0x425a
testl %eax, %eax
je 0x424f
movq 0x18(%rbx), %rax
movl 0x24(%rax), %edx
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x45b2
testl %eax, %eax
je 0x4251
leaq 0x7001(%rip), %rdi      # 0xb1f8
callq 0x21e0
testq %rax, %rax
je 0x4251
leaq 0x5dd4(%rip), %rdx      # 0x9fdc
pushq $0x1
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x2030
movq 0x18(%rbx), %rax
xorl %ecx, %ecx
cmpl $0x0, 0x30(%rax)
sete %cl
movq 0x38(%rax,%rcx,8), %rdi
pushq $0x2
popq %rsi
callq 0x9668
movq 0x18(%rbx), %rax
movq (%rax), %rdi
movl %ebp, %esi
callq 0x9668
movq %rbx, %rdi
callq 0x4397
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
jmp 0x4251
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_utils2.c
// Function: terminfo_update_bottom_screen_and_cursor
int		terminfo_update_bottom_screen_and_cursor(t_control *control)
{
	t_int_pair	cursor_end;
	char		*caps;

	cursor_end = terminfo_cursor_get_endl(control);
	if (!(caps = terminfo_get_caps("ind", control)))
		return (0);
	while (cursor_end.y >= control->term->size_window.y)
	{
		cursor_end.y--;
		control->term->cursor_start.y--;
		tputs(caps, 1, ft_putchar);
	}
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x43be
movq %rax, %r14
leaq 0x70a2(%rip), %rdi      # 0xb316
callq 0x21e0
testq %rax, %rax
je 0x42ae
movq %rax, %r15
shrq $0x20, %r14
pushq $0x1
popq %rbp
leaq 0x5d4d(%rip), %r12      # 0x9fdc
movq 0x18(%rbx), %rax
cmpl 0x2c(%rax), %r14d
jl 0x42b0
decl %r14d
decl 0x24(%rax)
movq %r15, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x2030
jmp 0x428f
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_position.c
// Function: terminfo_cursor_get_pos_assist
void		terminfo_cursor_get_pos_assist(char *caps, t_int_pair *cursor)
{
	int		first_coord;
	char	c;

	first_coord = 1;
	cursor->x = 0;
	cursor->y = 0;
	tputs(caps, 1, ft_putchar);
	while (read(STDIN_FILENO, &c, 1) == 1)
	{
		if (c == '\033' || c == '[')
			continue;
		if (first_coord && ft_isdigit(c))
		{
			cursor->y *= 10;
			cursor->y += c - 48;
			continue;
		}
		first_coord = 0;
		if (ft_isdigit(c))
		{
			cursor->x *= 10;
			cursor->x += c - 48;
		}
		if (c == 'R')
			break ;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
andq $0x0, (%rsi)
leaq 0x5cca(%rip), %rdx      # 0x9fdc
pushq $0x1
popq %rsi
callq 0x2030
xorl %ebp, %ebp
leaq 0xf(%rsp), %r14
pushq $0x1
popq %r15
xorl %edi, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2130
cmpq $0x1, %rax
jne 0x438a
movsbl 0xf(%rsp), %r12d
movl %r12d, %eax
andb $-0x41, %al
cmpb $0x1b, %al
je 0x4325
testb $0x1, %bpl
jne 0x436a
movl %r12d, %edi
callq 0x940c
testl %eax, %eax
je 0x436a
imull $0xa, 0x4(%rbx), %eax
addl %r12d, %eax
addl $-0x30, %eax
movl %eax, 0x4(%rbx)
xorl %ebp, %ebp
jmp 0x4325
movl %r12d, %edi
callq 0x940c
testl %eax, %eax
je 0x4381
imull $0xa, (%rbx), %eax
addl %r12d, %eax
addl $-0x30, %eax
movl %eax, (%rbx)
movb $0x1, %bpl
cmpb $0x52, %r12b
jne 0x4325
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_position.c
// Function: terminfo_cursor_saved_reset
int			terminfo_cursor_saved_reset(t_control *control)
{
	control->term->cursor = control->term->cursor_saved;
	if (!terminfo_cursor_move(control, control->term->cursor.x, \
				control->term->cursor.y))
		return (0);
	return (1);
}

// Assembly:
pushq %rax
movq 0x18(%rdi), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x10(%rax)
movq 0x18(%rdi), %rax
movl 0x10(%rax), %esi
movl 0x14(%rax), %edx
callq 0x45b2
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_position.c
// Function: terminfo_cursor_get_endl
t_int_pair	terminfo_cursor_get_endl(t_control *control)
{
	t_int_pair	cursor_end;
	char		*str;
	int			i;

	cursor_end = control->term->cursor_start;
	str = control->term->line;
	i = 0;
	if (!control->term->line)
		return (control->term->cursor_start);
	while (str[i])
	{
		if (str[i] == '\n' || cursor_end.x == control->term->size_window.x - 1)
		{
			cursor_end.x = -1;
			cursor_end.y++;
		}
		i++;
		cursor_end.x++;
	}
	return (cursor_end);
}

// Assembly:
movq 0x18(%rdi), %rdx
movl 0x20(%rdx), %eax
movl 0x24(%rdx), %ecx
movq (%rdx), %rsi
testq %rsi, %rsi
je 0x43f9
pushq $-0x1
popq %rdi
movzbl (%rsi), %r8d
cmpl $0xa, %r8d
je 0x43ee
testl %r8d, %r8d
je 0x43f9
movl 0x28(%rdx), %r8d
decl %r8d
cmpl %r8d, %eax
jne 0x43f2
incl %ecx
movl %edi, %eax
incl %eax
incq %rsi
jmp 0x43d3
shlq $0x20, %rcx
movl %eax, %eax
orq %rcx, %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move.c
// Function: terminfo_cursor_move_right
int	terminfo_cursor_move_right(t_control *control)
{
	char	*caps;
	int		cur_line_end_index;

	cur_line_end_index = terminfo_predict_current_line_end_index(control);
	if (control->term->inline_position + 1 >= control->term->line_len)
		return (1);
	if (control->term->inline_position + 1 == cur_line_end_index)
	{
		if (!terminfo_cursor_move_diagonally_down(control))
			return (0);
	}
	else
	{
		control->term->cursor.x++;
		if (!(caps = terminfo_get_caps("cuf1", control)))
			return (0);
		tputs(caps, 1, ft_putchar);
	}
	control->term->inline_position++;
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x4c03
movq 0x18(%r14), %rcx
movl 0xc(%rcx), %edx
incl %edx
pushq $0x1
popq %rbx
cmpl 0x8(%rcx), %edx
jge 0x4467
cmpl %eax, %edx
jne 0x4433
movq %r14, %rdi
callq 0x4471
testl %eax, %eax
jne 0x445c
jmp 0x4465
incl 0x10(%rcx)
leaq 0x6ee0(%rip), %rdi      # 0xb31d
movq %r14, %rsi
callq 0x41b9
testq %rax, %rax
je 0x4465
leaq 0x5b8b(%rip), %rdx      # 0x9fdc
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2030
movq 0x18(%r14), %rax
incl 0xc(%rax)
jmp 0x4467
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move.c
// Function: terminfo_cursor_move_diagonally_down
int	terminfo_cursor_move_diagonally_down(t_control *control)
{
	char *caps;

	if (control->term->cursor.y + 1 == control->term->size_window.y)
	{
		if (!(caps = terminfo_edit_caps(control, "indn", 1)))
			return (0);
		control->term->cursor_start.y--;
		control->term->cursor_saved.y--;
		control->term->cursor.y--;
		tputs(caps, 1, ft_putchar);
	}
	if (!terminfo_cursor_move(control, 0, control->term->cursor.y + 1))
		return (0);
	control->term->cursor.x = 0;
	control->term->cursor.y += 1;
	return (1);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movl 0x14(%rax), %edx
incl %edx
cmpl 0x2c(%rax), %edx
jne 0x44c4
leaq 0x6e9b(%rip), %rsi      # 0xb327
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x4198
testq %rax, %rax
je 0x44e4
movq 0x18(%rbx), %rcx
decl 0x24(%rcx)
decl 0x1c(%rcx)
decl 0x14(%rcx)
leaq 0x5b2c(%rip), %rdx      # 0x9fdc
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2030
movq 0x18(%rbx), %rax
movl 0x14(%rax), %edx
incl %edx
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x45b2
testl %eax, %eax
je 0x44e6
movq 0x18(%rbx), %rax
andl $0x0, 0x10(%rax)
incl 0x14(%rax)
pushq $0x1
popq %rbp
jmp 0x44e6
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move.c
// Function: terminfo_cursor_move_left
int	terminfo_cursor_move_left(t_control *control)
{
	char		*caps;

	if (control->term->inline_position < 0)
		return (1);
	if (control->term->cursor.x == 0)
	{
		if (!terminfo_cursor_move_diagonally_up(control))
			return (0);
	}
	else
	{
		if (!(caps = terminfo_get_caps("cub1", control)))
			return (0);
		tputs(caps, 1, ft_putchar);
		control->term->cursor.x--;
	}
	control->term->inline_position--;
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x18(%rdi), %rax
pushq $0x1
popq %rbx
cmpl $0x0, 0xc(%rax)
js 0x454f
movq %rdi, %r14
cmpl $0x0, 0x10(%rax)
je 0x4538
leaq 0x6e12(%rip), %rdi      # 0xb322
movq %r14, %rsi
callq 0x41b9
testq %rax, %rax
je 0x454d
leaq 0x5ab8(%rip), %rdx      # 0x9fdc
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2030
movq 0x18(%r14), %rax
decl 0x10(%rax)
jmp 0x4548
movq %r14, %rdi
callq 0x4559
testl %eax, %eax
je 0x454d
movq 0x18(%r14), %rax
decl 0xc(%rax)
jmp 0x454f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move.c
// Function: terminfo_cursor_move_diagonally_up
int	terminfo_cursor_move_diagonally_up(t_control *control)
{
	t_int_pair	previous_end;

	if (control->term->cursor_start.y == control->term->cursor.y)
		return (1);
	previous_end = terminfo_predict_previous_line_cursor_end(control);
	if (!terminfo_cursor_move(control, previous_end.x, previous_end.y))
		return (0);
	control->term->cursor = previous_end;
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x18(%rdi), %rax
movl 0x24(%rax), %ecx
pushq $0x1
popq %rbx
cmpl 0x14(%rax), %ecx
je 0x45a4
movq %rdi, %r14
callq 0x4c93
movq %rax, %r15
movq %rax, %r12
shrq $0x20, %r12
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x45b2
testl %eax, %eax
je 0x45a2
movq 0x18(%r14), %rax
movl %r15d, 0x10(%rax)
movl %r12d, 0x14(%rax)
jmp 0x45a4
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move2.c
// Function: terminfo_cursor_move_up
void	terminfo_cursor_move_up(t_control *control, t_int_pair *cursor)
{
	t_int_pair	previous_end;

	if (cursor->y <= control->term->cursor_start.y)
		return ;
	previous_end = terminfo_predict_previous_line_cursor_end(control);
	if (cursor->y == control->term->cursor_start.y + 1 \
			&& cursor->x < control->term->prompt_len)
		read_process_control_combo(control, CTRL_A_COMBO);
	else if (cursor->x > previous_end.x)
	{
		terminfo_cursor_move(control, previous_end.x, previous_end.y);
		control->term->inline_position -= cursor->x + 1;
		*cursor = previous_end;
	}
	else
	{
		terminfo_cursor_move(control, cursor->x, cursor->y - 1);
		control->term->inline_position -= cursor->x \
										+ (previous_end.x - cursor->x) + 1;
		cursor->y--;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x4(%rsi), %eax
movq 0x18(%rdi), %rcx
cmpl 0x24(%rcx), %eax
jle 0x4695
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4c93
movq %rax, %r15
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movq 0x18(%r14), %rax
movl 0x24(%rax), %ecx
incl %ecx
cmpl %ecx, %edx
jne 0x464f
cmpl 0x48(%rax), %esi
jge 0x464f
pushq $0x1
popq %rsi
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x5557
cmpl %r15d, %esi
jle 0x467d
movq %r15, %r12
shrq $0x20, %r12
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x45b2
movl (%rbx), %eax
notl %eax
movq 0x18(%r14), %rcx
addl %eax, 0xc(%rcx)
movl %r15d, (%rbx)
movl %r12d, 0x4(%rbx)
jmp 0x4695
decl %edx
movq %r14, %rdi
callq 0x45b2
notl %r15d
movq 0x18(%r14), %rax
addl %r15d, 0xc(%rax)
decl 0x4(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move2.c
// Function: terminfo_cursor_move_down
void	terminfo_cursor_move_down(t_control *control, t_int_pair *cursor)
{
	t_int_pair	cursor_end;
	int			len_next;
	int			current_len;

	len_next = terminfo_predict_next_line_len(control);
	cursor_end = terminfo_cursor_get_endl(control);
	current_len = terminfo_predict_current_line_len(control);
	if (cursor->y >= cursor_end.y)
		return ;
	if (cursor->x >= len_next - 1)
	{
		cursor->y++;
		if (cursor->y == cursor_end.y && cursor->x >= len_next)
			len_next++;
		terminfo_cursor_move(control, len_next - 1, cursor->y);
		control->term->inline_position += current_len - cursor->x \
											+ len_next - 1;
		cursor->x = len_next - 1;
	}
	else
	{
		terminfo_cursor_move(control, cursor->x, ++(cursor->y));
		control->term->inline_position += current_len;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x4ce2
movl %eax, %r12d
movq %rbx, %rdi
callq 0x43be
movq %rax, %r13
shrq $0x20, %r13
movq %rbx, %rdi
callq 0x4b94
movl 0x4(%r14), %edx
cmpl %r13d, %edx
jge 0x4739
movl %eax, %r15d
movl (%r14), %esi
leal -0x1(%r12), %eax
incl %edx
movl %edx, 0x4(%r14)
cmpl %eax, %esi
jge 0x4701
movq %rbx, %rdi
callq 0x45b2
movq 0x18(%rbx), %rax
addl %r15d, 0xc(%rax)
jmp 0x4739
cmpl %r13d, %edx
sete %al
cmpl %r12d, %esi
setge %cl
andb %al, %cl
movzbl %cl, %eax
leal (%r12,%rax), %r13d
leal (%r12,%rax), %ebp
decl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x45b2
movq 0x18(%rbx), %rax
leal (%r15,%r13), %ecx
decl %ecx
subl (%r14), %ecx
addl %ecx, 0xc(%rax)
movl %ebp, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move2.c
// Function: terminfo_cursor_track_position
int		terminfo_cursor_track_position(t_control *control, int add)
{
	if (add)
	{
		if (control->term->cursor.x + 1 == control->term->size_window.x)
		{
			if (!terminfo_cursor_move_diagonally_down(control))
				return (0);
		}
		else
			control->term->cursor.x++;
	}
	else
	{
		if (control->term->cursor.x == 0)
		{
			if (!terminfo_cursor_move_diagonally_up(control))
				return (0);
		}
		else
			control->term->cursor.x--;
	}
	return (1);
}

// Assembly:
pushq %rax
movq 0x18(%rdi), %rax
movl 0x10(%rax), %ecx
testl %esi, %esi
je 0x4762
incl %ecx
cmpl 0x28(%rax), %ecx
jne 0x4768
callq 0x4471
jmp 0x4772
testl %ecx, %ecx
je 0x476d
decl %ecx
movl %ecx, 0x10(%rax)
jmp 0x4776
callq 0x4559
testl %eax, %eax
je 0x477b
pushq $0x1
popq %rax
popq %rcx
retq
xorl %eax, %eax
jmp 0x4779
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move2.c
// Function: terminfo_cursor_move_endl
int		terminfo_cursor_move_endl(t_control *control, int start)
{
	t_int_pair cursor_end;

	if (start)
	{
		if (!terminfo_cursor_move(control, control->term->cursor_start.x, \
					control->term->cursor_start.y))
			return (0);
		control->term->cursor = control->term->cursor_start;
	}
	else
	{
		cursor_end = terminfo_cursor_get_endl(control);
		if (!terminfo_cursor_move(control, cursor_end.x, cursor_end.y))
			return (0);
		control->term->cursor = cursor_end;
	}
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x47af
movq 0x18(%rbx), %rax
movl 0x20(%rax), %esi
movl 0x24(%rax), %edx
movq %rbx, %rdi
callq 0x45b2
testl %eax, %eax
je 0x47e4
movq 0x18(%rbx), %rax
movq 0x20(%rax), %rcx
movq %rcx, 0x10(%rax)
jmp 0x47df
movq %rbx, %rdi
callq 0x43be
movq %rax, %r14
movq %rax, %r15
shrq $0x20, %r15
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x45b2
testl %eax, %eax
je 0x47e4
movq 0x18(%rbx), %rax
movl %r14d, 0x10(%rax)
movl %r15d, 0x14(%rax)
pushq $0x1
popq %rax
jmp 0x47e6
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move3.c
// Function: terminfo_cursor_move_next_word
int		terminfo_cursor_move_next_word(t_control *control)
{
	int index;
	int	right_motion;
	int j;
	int	current_len;

	j = 0;
	if (-1 == (index = terminfo_cursor_find_next_word_start(control)))
		return (1);
	right_motion = index - control->term->inline_position - 1;
	while (j < right_motion)
	{
		current_len = terminfo_predict_current_line_len(control);
		terminfo_cursor_track_position(control, 1);
		if (control->term->cursor.x == current_len)
			terminfo_cursor_move_diagonally_down(control);
		control->term->inline_position++;
		j++;
	}
	if (!terminfo_cursor_move(control, control->term->cursor.x, \
				control->term->cursor.y))
		return (0);
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4874
cmpl $-0x1, %eax
je 0x4866
movq 0x18(%rbx), %rcx
movl 0xc(%rcx), %edx
notl %edx
addl %edx, %eax
xorl %r15d, %r15d
testl %eax, %eax
cmovgl %eax, %r15d
pushq $0x1
popq %rbp
subl $0x1, %r15d
jb 0x484d
movq %rbx, %rdi
callq 0x4b94
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4748
movq 0x18(%rbx), %rcx
cmpl %r14d, 0x10(%rcx)
jne 0x4848
movq %rbx, %rdi
callq 0x4471
movq 0x18(%rbx), %rcx
incl 0xc(%rcx)
jmp 0x4817
movl 0x10(%rcx), %esi
movl 0x14(%rcx), %edx
movq %rbx, %rdi
callq 0x45b2
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0x4869
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move3.c
// Function: terminfo_cursor_find_next_word_start
int		terminfo_cursor_find_next_word_start(t_control *control)
{
	int		i;
	char	*str;

	if ((str = control->term->line) == NULL)
		return (-1);
	i = control->term->inline_position + 1;
	while (str[i])
	{
		if (str[i] == ' ' || str[i] == '\n')
		{
			while (str[i] && (str[i] == ' ' || str[i] == '\n'))
				i++;
			if (str[i])
				return (i);
			else
				return (-1);
		}
		i++;
	}
	return (-1);
}

// Assembly:
movq 0x18(%rdi), %rcx
movq (%rcx), %rdx
pushq $-0x1
popq %rax
testq %rdx, %rdx
je 0x48bf
movslq 0xc(%rcx), %rcx
addq %rcx, %rdx
movzbl 0x1(%rdx), %esi
testl %esi, %esi
je 0x48bf
incq %rdx
incl %ecx
cmpl $0x20, %esi
je 0x48a8
cmpl $0xa, %esi
jne 0x488a
jmp 0x48a8
incl %ecx
incq %rdx
movzbl (%rdx), %esi
cmpl $0x20, %esi
je 0x48a3
cmpl $0xa, %esi
je 0x48a3
xorl %eax, %eax
cmpb $0x1, %sil
sbbl %eax, %eax
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move3.c
// Function: terminfo_cursor_move_previous_word
int		terminfo_cursor_move_previous_word(t_control *control)
{
	int index;
	int	left_motion;
	int j;

	j = 0;
	if (-1 == (index = terminfo_cursor_find_previous_word_start(control)))
		return (1);
	left_motion = control->term->inline_position + 1 - index;
	while (j < left_motion)
	{
		terminfo_cursor_track_position(control, 0);
		control->term->inline_position--;
		j++;
	}
	if (!terminfo_cursor_move(control, control->term->cursor.x, \
				control->term->cursor.y))
		return (0);
	return (1);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x491d
cmpl $-0x1, %eax
je 0x4913
movq 0x18(%rbx), %rcx
movl 0xc(%rcx), %ebp
subl %eax, %ebp
incl %ebp
xorl %eax, %eax
testl %ebp, %ebp
cmovlel %eax, %ebp
subl $0x1, %ebp
jb 0x48fa
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4748
movq 0x18(%rbx), %rcx
decl 0xc(%rcx)
jmp 0x48e2
movl 0x10(%rcx), %esi
movl 0x14(%rcx), %edx
movq %rbx, %rdi
callq 0x45b2
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0x4916
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_cursor_move3.c
// Function: terminfo_cursor_find_previous_word_start
int		terminfo_cursor_find_previous_word_start(t_control *control)
{
	int		i;
	char	*str;

	str = control->term->line;
	i = control->term->inline_position;
	if (i == -1)
		return (-1);
	while (str[i] && (str[i] == ' ' || str[i] == '\n'))
		i--;
	if (i == -1)
		return (-1);
	while (i >= 0)
	{
		if (str[i] == ' ' || str[i] == '\n')
			return (i + 1);
		i--;
	}
	return (0);
}

// Assembly:
movq 0x18(%rdi), %rcx
movslq 0xc(%rcx), %rdx
pushq $-0x1
popq %rax
cmpq $-0x1, %rdx
je 0x4966
movq (%rcx), %rcx
movzbl (%rcx,%rdx), %esi
cmpl $0x20, %esi
je 0x493f
cmpl $0xa, %esi
jne 0x4944
decq %rdx
jmp 0x4931
cmpq $-0x1, %rdx
je 0x4966
movl %edx, %eax
testl %eax, %eax
js 0x4967
movl %eax, %edx
movzbl (%rcx,%rdx), %edx
cmpl $0x20, %edx
je 0x4964
cmpl $0xa, %edx
je 0x4964
decl %eax
jmp 0x494c
incl %eax
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_insert_character.c
// Function: terminfo_insert_char
int		terminfo_insert_char(t_control *control, char c)
{
	int cur_line_len;
	int	saved_inline_position;

	cur_line_len = terminfo_predict_current_line_len(control);
	if (cur_line_len == control->term->size_window.x)
	{
		control->term->cursor_saved = control->term->cursor;
		saved_inline_position = control->term->inline_position;
		if (!terminfo_insert_char_cascade(control))
			return (0);
		if (!(terminfo_cursor_saved_reset(control)))
			return (0);
		control->term->inline_position = saved_inline_position;
	}
	if (!terminfo_insert_in_place(control, c))
		return (0);
	if (!(terminfo_cursor_track_position(control, 1)))
		return (0);
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x4b94
movq 0x18(%rbx), %rcx
cmpl 0x28(%rcx), %eax
jne 0x49e9
movq 0x10(%rcx), %rax
movq %rax, 0x18(%rcx)
movq 0x18(%rbx), %rax
movl 0xc(%rax), %r15d
movq %rbx, %rdi
callq 0x4a20
xorl %r14d, %r14d
testl %eax, %eax
je 0x4a12
movq %rbx, %rdi
callq 0x4397
testl %eax, %eax
je 0x4a12
movq 0x18(%rbx), %rax
movl %r15d, 0xc(%rax)
movsbl %bpl, %esi
movq %rbx, %rdi
callq 0x4aa5
testl %eax, %eax
je 0x4a0f
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x4748
xorl %r14d, %r14d
testl %eax, %eax
setne %r14b
jmp 0x4a12
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_insert_character.c
// Function: terminfo_insert_char_cascade
int		terminfo_insert_char_cascade(t_control *control)
{
	char	cascade_me;
	char	*str;
	int		offset;
	int		end_index;

	str = control->term->line;
	while (terminfo_predict_current_line_len(control) \
			== control->term->size_window.x)
	{
		end_index = terminfo_predict_current_line_end_index(control);
		offset = end_index - control->term->inline_position;
		cascade_me = str[end_index];
		if (!terminfo_cursor_move_diagonally_down(control))
			return (0);
		if (!terminfo_insert_in_place(control, cascade_me))
			return (0);
		control->term->inline_position += offset;
		if (control->term->inline_position >= control->term->line_len)
			break ;
	}
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq (%rax), %r12
pushq $0x1
popq %r15
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x4b94
movq 0x18(%rbx), %rcx
cmpl 0x28(%rcx), %eax
jne 0x4a90
movq %rbx, %rdi
callq 0x4c03
movl %eax, %ebp
movq 0x18(%rbx), %rax
movslq %ebp, %rcx
subl 0xc(%rax), %ebp
movb (%r12,%rcx), %r13b
movq %rbx, %rdi
callq 0x4471
testl %eax, %eax
je 0x4a93
movsbl %r13b, %esi
movq %rbx, %rdi
callq 0x4aa5
testl %eax, %eax
je 0x4a93
movq 0x18(%rbx), %rax
addl 0xc(%rax), %ebp
movl %ebp, 0xc(%rax)
cmpl 0x8(%rax), %ebp
jl 0x4a3c
movl %r15d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_insert_character.c
// Function: terminfo_insert_in_place
int		terminfo_insert_in_place(t_control *control, char c)
{
	char *caps;

	if (c != '\n')
	{
		if (!(caps = terminfo_edit_caps(control, "ich", 1)))
			return (0);
		tputs(caps, 1, ft_putchar);
		ft_putchar_fd(c, 1);
	}
	else if (!terminfo_insert_newline(control))
		return (0);
	return (1);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
cmpb $0xa, %bl
jne 0x4aba
callq 0x4afa
testl %eax, %eax
jne 0x4aec
jmp 0x4af1
leaq 0x686f(%rip), %rsi      # 0xb330
pushq $0x1
popq %rdx
callq 0x4198
testq %rax, %rax
je 0x4af1
leaq 0x5507(%rip), %rdx      # 0x9fdc
pushq $0x1
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x2030
movsbl %bl, %edi
movl %ebp, %esi
callq 0x95b4
pushq $0x1
popq %rax
jmp 0x4af3
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq