LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_insert_character.c
// Function: terminfo_insert_newline
int		terminfo_insert_newline(t_control *control)
{
	char		*caps;
	t_int_pair	cursor_end;

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x43be
shrq $0x20, %rax
movq 0x18(%rbx), %rcx
cmpl %eax, 0x2c(%rcx)
jg 0x4b5e
leaq 0x680e(%rip), %rsi      # 0xb327
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x4198
xorl %ebp, %ebp
testq %rax, %rax
je 0x4b8a
leaq 0x54aa(%rip), %rdx      # 0x9fdc
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2030
movq 0x18(%rbx), %rax
movl 0x10(%rax), %esi
movl 0x14(%rax), %edx
decl %edx
movl %edx, 0x14(%rax)
decl 0x1c(%rax)
decl 0x24(%rax)
movq %rbx, %rdi
callq 0x45b2
testl %eax, %eax
je 0x4b8a
leaq 0x67cf(%rip), %rdi      # 0xb334
movq %rbx, %rsi
callq 0x41b9
testq %rax, %rax
je 0x4b88
pushq $0x1
popq %rbp
leaq 0x5460(%rip), %rdx      # 0x9fdc
movq %rax, %rdi
movl %ebp, %esi
callq 0x2030
jmp 0x4b8a
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_predict_size.c
// Function: terminfo_predict_current_line_len
int			terminfo_predict_current_line_len(t_control *control)
{
	int		i;
	int		j;
	char	*str;

	i = control->term->cursor.x;
	j = control->term->inline_position + 1;
	str = control->term->line;
	if (!str)
		return (control->term->prompt_len);
	while (i < control->term->size_window.x && str[j] && str[j] != '\n')
	{
		i++;
		j++;
	}
	if (str[j] == '\n' && i != control->term->size_window.x)
		return (++i);
	return (i);
}

// Assembly:
movq 0x18(%rdi), %rsi
movq (%rsi), %rcx
testq %rcx, %rcx
je 0x4be8
movabsq $0x100000000, %rdi      # imm = 0x100000000
movl 0x10(%rsi), %eax
movl 0x28(%rsi), %edx
cmpl %edx, %eax
movl %edx, %r8d
cmovgl %eax, %r8d
movslq 0xc(%rsi), %rsi
leaq (%rsi,%rcx), %r9
incq %r9
shlq $0x20, %rsi
addq %rdi, %rsi
cmpl %edx, %eax
jge 0x4bec
movzbl (%r9), %r10d
testl %r10d, %r10d
je 0x4bef
cmpl $0xa, %r10d
je 0x4bef
incl %eax
addq %rdi, %rsi
incq %r9
jmp 0x4bcb
movl 0x48(%rsi), %eax
retq
movl %r8d, %eax
sarq $0x20, %rsi
cmpb $0xa, (%rcx,%rsi)
jne 0x4c02
xorl %ecx, %ecx
cmpl %edx, %eax
setne %cl
addl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_predict_size.c
// Function: terminfo_predict_current_line_end_index
int			terminfo_predict_current_line_end_index(t_control *control)
{
	int		i;
	int		j;
	char	*str;

	i = control->term->cursor.x;
	j = control->term->inline_position + 1;
	str = control->term->line;
	if (!str)
		return (0);
	while (i + 1 < control->term->size_window.x && str[j] && str[j] != '\n')
	{
		i++;
		j++;
	}
	return (j);
}

// Assembly:
movq 0x18(%rdi), %rdx
movq (%rdx), %rax
testq %rax, %rax
je 0x4c42
movslq 0xc(%rdx), %rsi
movl 0x10(%rdx), %ecx
movl 0x28(%rdx), %edx
leal 0x1(%rsi), %edi
addq %rax, %rsi
incq %rsi
incl %ecx
movl %edi, %eax
cmpl %edx, %ecx
jge 0x4c41
movzbl (%rsi), %r8d
cmpl $0xa, %r8d
je 0x4c41
leal 0x1(%rax), %edi
incq %rsi
incl %ecx
testl %r8d, %r8d
jne 0x4c24
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_predict_size.c
// Function: terminfo_predict_current_line_start_index
int			terminfo_predict_current_line_start_index(t_control *control)
{
	int		i;
	int		j;
	char	*str;

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

// Assembly:
movq 0x18(%rdi), %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x4c90
movslq 0xc(%rax), %rsi
movl 0x10(%rax), %edx
leaq 0x1(%rsi), %rax
cmpb $0xa, 0x1(%rcx,%rsi)
sete %dil
testl %edx, %edx
setne %r8b
andb %dil, %r8b
movzbl %r8b, %edi
subl %edi, %edx
testb %dil, %dil
cmovnel %esi, %eax
testl %edx, %edx
jle 0x4c92
testl %eax, %eax
jle 0x4c92
movl %eax, %esi
cmpb $0xa, (%rcx,%rsi)
je 0x4c92
decl %edx
decl %eax
jmp 0x4c7a
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_predict_size.c
// Function: terminfo_predict_previous_line_cursor_end
t_int_pair	terminfo_predict_previous_line_cursor_end(t_control *control)
{
	t_int_pair	end_previous;
	int			end_index_prev;
	int			i;
	char		*str;

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x18(%rdi), %r14
movl 0x20(%r14), %ebp
movl 0x24(%r14), %ebx
callq 0x4c45
movq (%r14), %rcx
cmpl $0x2, %eax
pushq $0x1
popq %rdx
cmovgel %eax, %edx
decl %edx
xorl %eax, %eax
cmpq %rax, %rdx
je 0x4cd4
cmpb $0xa, (%rcx,%rax)
je 0x4ccb
incl %ebp
cmpl 0x28(%r14), %ebp
jne 0x4ccf
incl %ebx
xorl %ebp, %ebp
incq %rax
jmp 0x4cb8
shlq $0x20, %rbx
movl %ebp, %eax
orq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_predict_size.c
// Function: terminfo_predict_next_line_len
int			terminfo_predict_next_line_len(t_control *control)
{
	int		i;
	int		j;
	char	*str;

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x4c03
movl %eax, %ecx
movq 0x18(%rbx), %rdi
movq (%rdi), %rdx
xorl %eax, %eax
testq %rdx, %rdx
je 0x4d60
movslq %ecx, %r10
cmpb $0x0, (%rdx,%r10)
je 0x4d60
movabsq $0x100000000, %rsi      # imm = 0x100000000
movl 0x28(%rdi), %edi
cmpl $0x2, %edi
pushq $0x1
popq %rcx
cmovgel %edi, %ecx
leaq (%r10,%rdx), %r9
incq %r9
shlq $0x20, %r10
addq %rsi, %r10
xorl %r11d, %r11d
movq %r10, %r8
movq %r11, %rax
leal 0x1(%r11), %r10d
cmpl %edi, %r10d
jge 0x4d54
movzbl (%r9,%rax), %ebx
leaq 0x1(%rax), %r11
cmpl $0xa, %ebx
je 0x4d51
leaq (%r8,%rsi), %r10
testl %ebx, %ebx
jne 0x4d2c
movl %r11d, %ecx
sarq $0x20, %r8
cmpb $0xa, (%rdx,%r8)
cmovel %ecx, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_clipboard_root.c
// Function: terminfo_clipboard_copy_start
int	terminfo_clipboard_copy_start(t_control *control, t_clipboard *clipboard)
{
	char *caps;

	if (!control->term->line)
		return (1);
	if (control->term->inline_position + 1 == control->term->line_len)
		return (1);
	ft_free((void**)&clipboard->paste_me);
	if (!(caps = terminfo_get_caps("smso", control)))
		return (0);
	tputs(caps, 1, ft_putchar);
	clipboard->start = control->term->inline_position + 1;
	clipboard->end = control->term->inline_position + 1;
	clipboard->highlight = 1;
	clipboard->swaped_end = 0;
	if (!terminfo_clipboard_highlight_cur(control, 1))
		return (0);
	return (1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x18(%rdi), %rcx
pushq $0x1
popq %rax
cmpq $0x0, (%rcx)
je 0x4de3
movl 0xc(%rcx), %edx
incl %edx
cmpl 0x8(%rcx), %edx
je 0x4de3
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsi), %rdi
callq 0xa018
leaq 0x65a3(%rip), %rdi      # 0xb338
movq %rbx, %rsi
callq 0x41b9
testq %rax, %rax
je 0x4de1
leaq 0x5233(%rip), %rdx      # 0x9fdc
pushq $0x1
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x2030
movq 0x18(%rbx), %rax
movl 0xc(%rax), %eax
incl %eax
movl %eax, 0x4(%r14)
movl %eax, 0x8(%r14)
movl $0x1, (%r14)
andl $0x0, 0xc(%r14)
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x4de8
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_clipboard_root.c
// Function: terminfo_clipboard_highlight_cur
int	terminfo_clipboard_highlight_cur(t_control *control, int on)
{
	char c;
	char *caps;

	if (!on)
	{
		if (!(caps = terminfo_get_caps("rmso", control)))
			return (0);
		tputs(caps, 1, ft_putchar);
	}
	c = control->term->line[control->term->inline_position + 1];
	ft_putchar_fd(c, 1);
	if (!terminfo_cursor_move(control, control->term->cursor.x, \
				control->term->cursor.y))
		return (0);
	if (!on)
	{
		if (!(caps = terminfo_get_caps("smso", control)))
			return (0);
		tputs(caps, 1, ft_putchar);
	}
	return (1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
testl %esi, %esi
jne 0x4e1b
leaq 0x6541(%rip), %rdi      # 0xb33d
movq %rbx, %rsi
callq 0x41b9
testq %rax, %rax
je 0x4e85
leaq 0x51cc(%rip), %rdx      # 0x9fdc
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2030
movq 0x18(%rbx), %rax
movq (%rax), %rcx
movslq 0xc(%rax), %rax
movsbl 0x1(%rcx,%rax), %edi
pushq $0x1
popq %r14
movl %r14d, %esi
callq 0x95b4
movq 0x18(%rbx), %rax
movl 0x10(%rax), %esi
movl 0x14(%rax), %edx
movq %rbx, %rdi
callq 0x45b2
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
testl %ebp, %ebp
jne 0x4e87
testl %ecx, %ecx
je 0x4e87
leaq 0x64d7(%rip), %rdi      # 0xb338
movq %rbx, %rsi
callq 0x41b9
testq %rax, %rax
je 0x4e85
leaq 0x5167(%rip), %rdx      # 0x9fdc
movq %rax, %rdi
movl %r14d, %esi
callq 0x2030
movl %r14d, %eax
jmp 0x4e87
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_clipboard_root.c
// Function: terminfo_clipboard_copy_end
int	terminfo_clipboard_copy_end(t_control *control, t_clipboard *clipboard)
{
	if (!terminfo_clipboard_disable_highlight(control))
		return (0);
	if (!terminfo_refresh_screen_from_start(control))
		return (0);
	if (clipboard->start > clipboard->end)
	{
		clipboard->start ^= clipboard->end;
		clipboard->end ^= clipboard->start;
		clipboard->start ^= clipboard->end;
		clipboard->swaped_end = 1;
	}
	if (!(clipboard->paste_me = ft_substr(control->term->line, \
				clipboard->start, clipboard->end - clipboard->start + 1)))
	{
		control->quit = 1;
		return (0);
	}
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x4eff
xorl %ebx, %ebx
testl %eax, %eax
je 0x4ef7
movq %r14, %rdi
callq 0x41be
testl %eax, %eax
je 0x4ef7
movl 0x4(%r15), %ecx
movl 0x8(%r15), %esi
cmpl %esi, %ecx
jle 0x4ece
movl %ecx, 0x8(%r15)
movl %esi, 0x4(%r15)
movl $0x1, 0xc(%r15)
movl %ecx, %eax
jmp 0x4ed2
movl %esi, %eax
movl %ecx, %esi
movq 0x18(%r14), %rcx
movq (%rcx), %rdi
subl %esi, %eax
incl %eax
movslq %eax, %rdx
callq 0x9d48
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0x4ef3
pushq $0x1
popq %rbx
jmp 0x4ef7
orb $0x1, (%r14)
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_clipboard_root.c
// Function: terminfo_clipboard_dispatch_action
int	terminfo_clipboard_dispatch_action(t_control *control, int c)
{
	if (c == KEY_RIGHT_ID)
	{
		if (!terminfo_clipboard_right_move(control, &control->term->clipboard))
			return (0);
	}
	else if (c == KEY_LEFT_ID)
	{
		if (!terminfo_clipboard_left_move(control, &control->term->clipboard))
			return (0);
	}
	else if (c == CTRL_K_COMBO)
	{
		if (!terminfo_clipboard_copy_end(control, &control->term->clipboard))
			return (0);
		control->term->clipboard.highlight = 0;
	}
	else if (c == CTRL_L_COMBO)
	{
		if (!terminfo_clipboard_copy_end(control, &control->term->clipboard))
			return (0);
		if (!terminfo_clipboard_cut(control, &control->term->clipboard))
			return (0);
		control->term->clipboard.highlight = 0;
	}
	return (1);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0xb, %esi
je 0x4fac
cmpl $0xc, %esi
je 0x4f6a
cmpl $0x83, %esi
je 0x4f96
cmpl $0x82, %esi
jne 0x4fcb
movq 0x18(%rbx), %rsi
addq $0x60, %rsi
movq %rbx, %rdi
callq 0x4fdc
jmp 0x4fa6
movq 0x18(%rbx), %rsi
addq $0x60, %rsi
movq %rbx, %rdi
callq 0x4e8c
xorl %ebp, %ebp
testl %eax, %eax
je 0x4fd2
movq 0x18(%rbx), %rsi
addq $0x60, %rsi
movq %rbx, %rdi
callq 0x50ab
testl %eax, %eax
jne 0x4fc0
jmp 0x4fd2
movq 0x18(%rbx), %rsi
addq $0x60, %rsi
movq %rbx, %rdi
callq 0x504d
testl %eax, %eax
jne 0x4fcb
jmp 0x4fd0
movq 0x18(%rbx), %rsi
addq $0x60, %rsi
movq %rbx, %rdi
callq 0x4e8c
testl %eax, %eax
je 0x4fd0
addq $0x18, %rbx
movq (%rbx), %rax
andl $0x0, 0x60(%rax)
pushq $0x1
popq %rbp
jmp 0x4fd2
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_clipboard_action.c
// Function: terminfo_clipboard_right_move
int	terminfo_clipboard_right_move(t_control *control, t_clipboard *clipboard)
{
	if (control->term->inline_position + 2 == control->term->line_len)
		return (1);
	if (control->term->inline_position + 1 < clipboard->start)
	{
		if (!terminfo_clipboard_highlight_cur(control, 0))
			return (0);
		if (!terminfo_cursor_move_right(control))
			return (0);
	}
	else
	{
		if (!terminfo_cursor_move_right(control))
			return (0);
		if (!terminfo_clipboard_highlight_cur(control, 1))
			return (0);
	}
	clipboard->end++;
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x18(%rdi), %rcx
movl 0xc(%rcx), %eax
leal 0x2(%rax), %edx
pushq $0x1
popq %r15
cmpl 0x8(%rcx), %edx
je 0x503d
movq %rsi, %rbx
movq %rdi, %r14
incl %eax
cmpl 0x4(%rsi), %eax
jge 0x501d
xorl %ebp, %ebp
movq %r14, %rdi
xorl %esi, %esi
callq 0x4de8
testl %eax, %eax
je 0x5040
movq %r14, %rdi
callq 0x4404
jmp 0x5036
movq %r14, %rdi
callq 0x4404
xorl %ebp, %ebp
testl %eax, %eax
je 0x5040
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x4de8
testl %eax, %eax
je 0x5040
incl 0x8(%rbx)
movl %r15d, %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_clipboard_action.c
// Function: terminfo_clipboard_left_move
int	terminfo_clipboard_left_move(t_control *control, t_clipboard *clipboard)
{
	if (control->term->inline_position >= 0)
		clipboard->end--;
	if (control->term->inline_position + 1 > clipboard->start)
	{
		if (!terminfo_clipboard_highlight_cur(control, 0))
			return (0);
		if (!terminfo_cursor_move_left(control))
			return (0);
	}
	else
	{
		if (!terminfo_cursor_move_left(control))
			return (0);
		if (!terminfo_clipboard_highlight_cur(control, 1))
			return (0);
	}
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x18(%rdi), %rax
movl 0xc(%rax), %eax
testl %eax, %eax
js 0x5062
decl 0x8(%rsi)
cmpl 0x4(%rsi), %eax
jge 0x5082
movq %r14, %rdi
callq 0x44ef
xorl %ebx, %ebx
testl %eax, %eax
je 0x50a1
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x4de8
jmp 0x509a
xorl %ebx, %ebx
movq %r14, %rdi
xorl %esi, %esi
callq 0x4de8
testl %eax, %eax
je 0x50a1
movq %r14, %rdi
callq 0x44ef
testl %eax, %eax
je 0x50a1
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/terminfo_clipboard_action.c
// Function: terminfo_clipboard_cut
int	terminfo_clipboard_cut(t_control *control, t_clipboard *clipboard)
{
	char	*str;
	int		len_rest;
	int		len_cut;
	int		i;

	str = control->term->line;
	len_rest = control->term->line_len - clipboard->end - 1;
	len_cut = clipboard->end - clipboard->start + 1;
	i = 1;
	if (!clipboard->swaped_end)
	{
		while (i < len_cut)
		{
			terminfo_cursor_track_position(control, 0);
			i++;
			control->term->inline_position--;
		}
	}
	ft_memmove(str + clipboard->start, str + clipboard->end + 1, len_rest + 1);
	control->term->line_len -= len_cut;
	if (!terminfo_refresh_screen_from_start(control))
		return (0);
	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), %rdx
movslq 0x8(%rax), %r14
movl 0x4(%rsi), %ecx
movl 0x8(%rsi), %eax
movslq %eax, %r13
movl %r13d, %ebp
subl %ecx, %ebp
cmpl $0x0, 0xc(%rsi)
jne 0x510d
movq %rsi, %r15
movq %rdx, (%rsp)
xorl %r12d, %r12d
testl %ebp, %ebp
cmovgl %ebp, %r12d
subl $0x1, %r12d
jb 0x5101
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4748
movq 0x18(%rbx), %rax
decl 0xc(%rax)
jmp 0x50e8
movl 0x4(%r15), %ecx
movl 0x8(%r15), %eax
movq (%rsp), %rdx
notl %ebp
subq %r13, %r14
movslq %ecx, %rdi
addq %rdx, %rdi
cltq
leaq (%rdx,%rax), %rsi
incq %rsi
movq %r14, %rdx
callq 0x9568
movq 0x18(%rbx), %rax
addl %ebp, 0x8(%rax)
movq %rbx, %rdi
callq 0x41be
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %ecx, %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_clipboard_action.c
// Function: terminfo_clipboard_paste
int	terminfo_clipboard_paste(t_control *control, t_clipboard *clipboard)
{
	int			len_paste_me;
	int			i;
	t_int_pair	cursor_end;

	if (!clipboard->paste_me)
		return (1);
	len_paste_me = ft_strlen(clipboard->paste_me);
	i = -1;
	if (!(ft_strstradd(&control->term->line, \
					control->term->inline_position + 1, clipboard->paste_me)))
		return (0);
	control->term->line_len += len_paste_me;
	cursor_end = terminfo_cursor_get_endl(control);
	while (clipboard->paste_me[++i] \
			&& cursor_end.y >= control->term->size_window.y)
	{
		if (clipboard->paste_me[i] == '\n' && (control->term->cursor.y--))
			cursor_end.y--;
	}
	control->term->clipboard.highlight = 0;
	if (!terminfo_refresh_screen_from_start(control))
		return (0);
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rsi), %rdi
testq %rdi, %rdi
je 0x51d9
movq %rsi, %r14
callq 0x9be0
movq %rax, %r15
movq 0x18(%rbx), %rdi
movl 0xc(%rdi), %esi
incl %esi
movq 0x10(%r14), %rdx
callq 0xa100
testl %eax, %eax
je 0x51de
movq 0x18(%rbx), %rax
addl %r15d, 0x8(%rax)
movq %rbx, %rdi
callq 0x43be
shrq $0x20, %rax
movq 0x10(%r14), %rdx
movq 0x18(%rbx), %rcx
pushq $-0x1
popq %rsi
movb 0x1(%rdx,%rsi), %dil
testb %dil, %dil
je 0x51c2
cmpl 0x2c(%rcx), %eax
jl 0x51c2
incq %rsi
cmpb $0xa, %dil
jne 0x51a1
addl $-0x1, 0x14(%rcx)
sbbl $0x0, %eax
jmp 0x51a1
andl $0x0, 0x60(%rcx)
movq %rbx, %rdi
callq 0x41be
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0x51e0
pushq $0x1
popq %rax
jmp 0x51e0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/read_root.c
// Function: read_root
void	read_root(t_control *control, int read_res, char c)
{
	while (1)
	{
		read_res = read(STDIN_FILENO, &c, 1);
		if (!read_res)
			continue;
		if (c == '\n')
			break ;
		if (read_need_to_stop(control, c, read_res))
			return ;
		read_dispatch_for_processing(control, c);
		if (read_need_to_stop(control, c, read_res))
			return ;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xf(%rsp), %r14
movb %dl, (%r14)
pushq $0x1
popq %r15
xorl %edi, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2130
movq %rax, %r12
testl %r12d, %r12d
je 0x5203
movsbl 0xf(%rsp), %ebp
cmpl $0xa, %ebp
je 0x524e
movq %rbx, %rdi
movl %ebp, %esi
movl %r12d, %edx
callq 0x525b
testl %eax, %eax
jne 0x524e
movq %rbx, %rdi
movl %ebp, %esi
callq 0x52b0
movq %rbx, %rdi
movl %ebp, %esi
movl %r12d, %edx
callq 0x525b
testl %eax, %eax
je 0x5203
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/read_root.c
// Function: read_need_to_stop
int		read_need_to_stop(t_control *control, char c, int res)
{
	if (control->quit)
		;
	else if (res == -1)
	{
		control->quit = 1;
		//maybe display message for a read failure
		//maybe set control->exit_status...
	}
	else if (c == 4 && !control->term->line_len)
	{
		control->quit = 1;
		ft_putstr_fd("exit", 2);
	}
	else if (c == 3)
	{
		control->exit_status = (IS_APPLE ? 1 : 130);
		control->ctrl_c = 1;
	}
	else
		return (0);
	return (1);
}

// Assembly:
pushq %rbx
movb (%rdi), %cl
pushq $0x1
popq %rbx
testb $0x1, %cl
jne 0x52ac
cmpl $-0x1, %edx
je 0x529b
movsbl %sil, %edx
cmpl $0x3, %edx
je 0x52a0
xorl %eax, %eax
cmpl $0x4, %edx
jne 0x52ae
movq 0x18(%rdi), %rdx
cmpl $0x0, 0x8(%rdx)
jne 0x52ae
orb $0x1, %cl
movb %cl, (%rdi)
leaq 0x5f4b(%rip), %rdi      # 0xb1dc
pushq $0x2
popq %rsi
callq 0x9668
jmp 0x52ac
orb $0x1, %cl
jmp 0x52aa
movl $0x82, 0x4(%rdi)
orb $0x2, %cl
movb %cl, (%rdi)
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/read_root.c
// Function: read_dispatch_for_processing
void	read_dispatch_for_processing(t_control *control, int c)
{
	if (c == 27 && !(c = read_remap_esc_sequence_from_128(control, c)))
		return ;
	if (control->term->clipboard.highlight)
	{
		if (c != KEY_LEFT_ID && c != KEY_RIGHT_ID && c != CTRL_K_COMBO \
				&& c != CTRL_L_COMBO)
			terminfo_clipboard_copy_end(control, &control->term->clipboard);
		else
		{
			terminfo_clipboard_dispatch_action(control, c);
			return ;
		}
	}
	if (c == CTRL_K_COMBO)
		terminfo_clipboard_copy_start(control, &control->term->clipboard);
	else if (c >= 128)
		read_process_special_key(control, c);
	else if (c == 127)
		read_process_del_char(control);
	else if (!ft_isprint(c))
		read_process_control_combo(control, c);
	else
		read_process_add_char(control, c);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0x1b, %esi
jne 0x52d1
pushq $0x1b
popq %rsi
movq %rbx, %rdi
callq 0x538a
movl %eax, %r14d
testl %eax, %eax
je 0x5302
movq 0x18(%rbx), %rsi
cmpl $0x0, 0x60(%rsi)
je 0x5316
leal -0xb(%r14), %eax
cmpl $0x2, %eax
jb 0x52f0
leal -0x82(%r14), %eax
cmpl $0x2, %eax
jae 0x530a
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4f38
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq $0x60, %rsi
movq %rbx, %rdi
callq 0x4e8c
cmpl $0xb, %r14d
jne 0x5333
movq 0x18(%rbx), %rsi
addq $0x60, %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4d64
cmpl $0x80, %r14d
jl 0x534e
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x54f2
cmpl $0x7f, %r14d
jne 0x5363
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x54b4
movl %r14d, %edi
callq 0x9418
movsbl %r14b, %esi
movq %rbx, %rdi
addq $0x8, %rsp
testl %eax, %eax
je 0x5382
popq %rbx
popq %r14
jmp 0x5468
popq %rbx
popq %r14
jmp 0x5557
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/read_root.c
// Function: read_get_esc_seq_id
int		read_get_esc_seq_id(t_term *term, int c)
{
	int		res_read;
	char	*str;
	int		i;

	str = NULL;
	if (!ft_strappend(&str, c))
		return (-1);
	while ((res_read = read(STDIN_FILENO, &c, 1)) && (i = -1))
	{
		if (res_read == -1 || !ft_strappend(&str, c))
		{
			free(str);
			return (-1);
		}
		while (++i < NUMBER_SPECIAL_KEYS)
		{
			if (!ft_strncmp(str, term->array_esc_seq[i], ft_strlen(str) + 1))
			{
				free(str);
				return (i);
			}
		}
	}
	free(str);
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
leaq 0x10(%rsp), %rdi
andq $0x0, (%rdi)
movsbl %sil, %esi
callq 0x9f68
testl %eax, %eax
je 0x5447
leaq 0xc(%rsp), %r14
pushq $0x1
popq %r15
xorl %edi, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2130
movq %rax, %r13
incl %eax
cmpl $0x2, %eax
jb 0x543b
movsbl 0xc(%rsp), %esi
leaq 0x10(%rsp), %rdi
callq 0x9f68
testl %eax, %eax
je 0x545d
xorl %r13d, %r13d
cmpq $0xe, %r13
je 0x53da
movq 0x10(%rsp), %rbp
movq 0x50(%rbx), %rax
movq (%rax,%r13,8), %r12
movq %rbp, %rdi
callq 0x9be0
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x9bf8
incq %r13
testl %eax, %eax
jne 0x5407
decl %r13d
movq 0x10(%rsp), %rdi
callq 0x2230
jmp 0x544b
pushq $-0x1
popq %r13
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rax
movl %eax, %r13d
jmp 0x543b
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/read_process_char.c
// Function: read_process_add_char
void	read_process_add_char(t_control *control, char c)
{
	if (!(ft_strcadd(&(control->term->line), c, \
					control->term->inline_position + 1)))
	{
		control->quit = 1;
		return ;
	}
	control->term->inline_position++;
	control->term->line_len++;
	if (!terminfo_insert_char(control, c))
	{
		control->quit = 1;
		return ;
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movslq 0xc(%rdi), %rdx
incq %rdx
callq 0xa02c
testl %eax, %eax
je 0x54aa
movq 0x18(%rbx), %rax
movq 0x8(%rax), %xmm0
pcmpeqd %xmm1, %xmm1
psubd %xmm1, %xmm0
movq %xmm0, 0x8(%rax)
movsbl %bpl, %esi
movq %rbx, %rdi
callq 0x499c
testl %eax, %eax
jne 0x54ad
orb $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/read_process_char.c
// Function: read_process_del_char
void	read_process_del_char(t_control *control)
{
	if (control->term->inline_position == -1)
		return ;
	ft_strcdel(control->term->line, control->term->inline_position);
	if (!terminfo_del_char(control))
		return ;
	control->term->inline_position--;
	control->term->line_len--;
}

// Assembly:
pushq %rbx
movq 0x18(%rdi), %rax
movslq 0xc(%rax), %rsi
cmpq $-0x1, %rsi
je 0x54f0
movq %rdi, %rbx
movq (%rax), %rdi
callq 0xa0b8
movq %rbx, %rdi
callq 0x496c
testl %eax, %eax
je 0x54f0
movq 0x18(%rbx), %rax
movq 0x8(%rax), %xmm0
pcmpeqd %xmm1, %xmm1
paddd %xmm0, %xmm1
movq %xmm1, 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/read_process_char.c
// Function: read_process_special_key
void	read_process_special_key(t_control *control, int i)
{
	if (i == KEY_RIGHT_ID)
		terminfo_cursor_move_right(control);
	else if (i == KEY_LEFT_ID)
		terminfo_cursor_move_left(control);
	else if (i == KEY_HOME_ID)
		read_process_control_combo(control, CTRL_A_COMBO);
	else if (i == KEY_END_ID)
		read_process_control_combo(control, CTRL_E_COMBO);
	else if (i == KEY_UP_CTRL_ID)
		terminfo_cursor_move_up(control, &control->term->cursor);
	else if (i == KEY_DOWN_CTRL_ID)
		terminfo_cursor_move_down(control, &control->term->cursor);
	else if (i == KEY_RIGHT_CTRL_ID)
		terminfo_cursor_move_next_word(control);
	else if (i == KEY_LEFT_CTRL_ID)
		terminfo_cursor_move_previous_word(control);
	else if (i == KEY_UP_ID)
		history_search(control, 1);
	else if (i == KEY_DOWN_ID)
		history_search(control, 0);
}

// Assembly:
addl $0xffffff7f, %esi       # imm = 0xFFFFFF7F
cmpl $0xc, %esi
ja 0x553d
leaq 0x5e40(%rip), %rax      # 0xb344
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
pushq $0x1
popq %rsi
jmp 0x57ec
jmp 0x44ef
pushq $0x5
jmp 0x5547
jmp 0x4404
movq 0x18(%rdi), %rsi
addq $0x10, %rsi
jmp 0x45fc
movq 0x18(%rdi), %rsi
addq $0x10, %rsi
jmp 0x46a1
retq
xorl %esi, %esi
jmp 0x57ec
pushq $0x1
popq %rsi
jmp 0x5557
jmp 0x48c0
jmp 0x47ec
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/read_process_char.c
// Function: read_process_control_combo
void	read_process_control_combo(t_control *control, char c)
{
	if (c == CTRL_A_COMBO)
	{
		if (!terminfo_cursor_move_endl(control, 1))
			return ;
		control->term->inline_position = -1;
		control->term->cursor = control->term->cursor_start;
	}
	else if (c == CTRL_E_COMBO)
	{
		if (!terminfo_cursor_move_endl(control, 0))
			return ;
		control->term->inline_position = control->term->line_len - 1;
	}
	else if (c == CTRL_P_COMBO)
	{
		terminfo_clipboard_paste(control, &control->term->clipboard);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x10, %esi
je 0x55a7
cmpl $0x5, %esi
je 0x558b
cmpl $0x1, %esi
jne 0x55a5
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x477f
testl %eax, %eax
je 0x55a5
movq 0x18(%rbx), %rax
orl $-0x1, 0xc(%rax)
movq 0x20(%rax), %rcx
movq %rcx, 0x10(%rax)
jmp 0x55a5
movq %rbx, %rdi
xorl %esi, %esi
callq 0x477f
testl %eax, %eax
je 0x55a5
movq 0x18(%rbx), %rax
movl 0x8(%rax), %ecx
decl %ecx
movl %ecx, 0xc(%rax)
popq %rbx
retq
movq 0x18(%rbx), %rsi
addq $0x60, %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x5150
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/historic_root.c
// Function: history_root
int			history_root(t_control *control, t_history *history)
{
	if (!control->term->line)
	{
		if (!(control->term->line = ft_strdup("")))
		{
			control->quit = 1;
			return (0);
		}
	}
	if (!history_update_line(control, history))
		return (0);
	if (history_decide_discard_new_link(control))
		return (0);
//	debug_history_list(control->history)
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rax
cmpq $0x0, (%rax)
jne 0x55e4
leaq 0x5c08(%rip), %rdi      # 0xb1db
callq 0x9aec
movq 0x18(%rbx), %rcx
movq %rax, (%rcx)
testq %rax, %rax
je 0x5606
movq %rbx, %rdi
movq %r14, %rsi
callq 0x56b0
testl %eax, %eax
je 0x5609
movq %rbx, %rdi
callq 0x5787
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
jmp 0x560b
orb $0x1, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/historic_root.c
// Function: history_init_struct
t_history	*history_init_struct(void)
{
	t_history *hist;

	if (!(hist = (t_history*)malloc(sizeof(t_history))))
		return (NULL);
	hist->size = 0;
	hist->max_size = 255;
	hist->head = NULL;
	return (hist);
}

// Assembly:
pushq %rax
pushq $0x18
popq %rdi
callq 0x2180
testq %rax, %rax
je 0x5630
andl $0x0, (%rax)
movl $0xff, 0x10(%rax)
andq $0x0, 0x8(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/historic_root.c
// Function: history_add_new_link
int			history_add_new_link(t_control *control)
{
	t_dlist	*history_new;
	char	*str;

	if (!(str = ft_strdup("")))
	{
		control->quit = 1;
		return (0);
	}
	if (!(history_new = ft_dlstnew(str)))
	{
		free(str);
		control->quit = 1;
		return (0);
	}
	ft_dlstadd_front(&(control->history->head), history_new);
	control->history->size++;
	if (control->history->size > control->history->max_size)
	{
		control->history->size--;
		ft_dlstpop_back(&control->history->head, history_del_content);
	}
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5b96(%rip), %rdi      # 0xb1db
callq 0x9aec
testq %rax, %rax
je 0x569e
movq %rax, %r14
movq %rax, %rdi
callq 0xa1b8
testq %rax, %rax
je 0x5696
movq 0x10(%rbx), %rdi
addq $0x8, %rdi
movq %rax, %rsi
callq 0xa1d8
movq 0x10(%rbx), %rdi
movl (%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rdi)
pushq $0x1
popq %rbx
cmpl 0x10(%rdi), %eax
jl 0x56a3
movl %eax, (%rdi)
addq $0x8, %rdi
leaq -0x5d(%rip), %rsi       # 0x5632
callq 0xa2ac
jmp 0x56a3
movq %r14, %rdi
callq 0x2230
orb $0x1, (%rbx)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/historic_update.c
// Function: history_update_line
int	history_update_line(t_control *control, t_history *history)
{
	char *current_hist;
	char *str;

	current_hist = (char *)(history->head->content);
	if (control->lexer_end.backslash)
		current_hist[ft_strlen(current_hist) - 1] = '\0';
	if (control->lexer_end.quote || control->lexer_end.add_semi)
	{
		if (!history_update_line_insert_sep(control, history))
			return (0);
	}
	else
	{
		if (!(str = ft_strjoin_free(current_hist, control->term->line, 1)))
		{
			control->quit = 1;
			return (0);
		}
		history->head->content = str;
	}
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rax
movq (%rax), %r15
movb 0x28(%rdi), %al
testb $0x4, %al
je 0x56db
movq %r15, %rdi
callq 0x9be0
movb $0x0, -0x1(%r15,%rax)
movb 0x28(%r14), %al
testb $0x12, %al
je 0x56f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x571f
testl %eax, %eax
jne 0x570e
jmp 0x5717
movq 0x18(%r14), %rax
movq (%rax), %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x9b9c
testq %rax, %rax
je 0x5713
movq 0x8(%rbx), %rcx
movq %rax, (%rcx)
pushq $0x1
popq %rax
jmp 0x5719
orb $0x1, (%r14)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/historic_update.c
// Function: history_update_line_insert_sep
int	history_update_line_insert_sep(t_control *control, t_history *history)
{
	char *str;
	char c;

	if (control->lexer_end.quote)
		c = '\n';
	else
		c = ';';
	str = (char *)(history->head->content);
	if (!ft_strappend(&str, c))
	{
		control->quit = 1;
		return (0);
	}
	if (!(str = ft_strjoin_free(str, control->term->line, 1)))
	{
		control->quit = 1;
		free(str);
		return (0);
	}
	history->head->content = str;
	return (1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
testb $0x2, 0x28(%rdi)
movq 0x8(%rsi), %rax
movq (%rax), %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
pushq $0x3b
popq %rax
pushq $0xa
popq %rsi
cmovel %eax, %esi
callq 0x9f68
testl %eax, %eax
je 0x5776
movq 0x8(%rsp), %rdi
movq 0x18(%r14), %rax
movq (%rax), %rsi
pushq $0x1
popq %rbp
movl %ebp, %edx
callq 0x9b9c
testq %rax, %rax
je 0x5776
movq 0x8(%rbx), %rcx
movq %rax, (%rcx)
jmp 0x577c
orb $0x1, (%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/historic_update.c
// Function: history_decide_discard_new_link
int	history_decide_discard_new_link(t_control *control)
{
	char	*str;
	int		i;
	int		len;

	str = (char *)(control->history->head->content);
	if (!str || !(len = ft_strlen(str)) || control->ctrl_c)
	{
		control->history->size--;
		ft_dlstpop_front(&control->history->head, history_del_content);
		control->ctrl_c = 1;
		return (1);
	}
	i = 0;
	while (str[i] && str[i] == ' ')
		i++;
	if (i == len)
	{
		control->history->size--;
		ft_dlstpop_front(&control->history->head, history_del_content);
		control->ctrl_c = 1;
		return (1);
	}
	return (0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq 0x8(%rax), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x57c4
movq %r14, %rdi
callq 0x9be0
testl %eax, %eax
je 0x57c4
testb $0x2, (%rbx)
jne 0x57c4
xorl %edx, %edx
cmpb $0x20, (%r14,%rdx)
leaq 0x1(%rdx), %rdx
je 0x57b1
incl %eax
xorl %ecx, %ecx
cmpl %edx, %eax
jne 0x57e0
movq 0x10(%rbx), %rdi
decl (%rdi)
addq $0x8, %rdi
leaq -0x1a3(%rip), %rsi      # 0x5632
callq 0xa278
orb $0x2, (%rbx)
pushq $0x1
popq %rcx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/historic_search.c
// Function: history_search
void	history_search(t_control *control, int direction)
{
	t_int_pair cursor_end;

	if (!history_swap_line_in_term_struct(control, direction))
		return ;
	if (!terminfo_refresh_screen_from_start(control))
		return ;
	cursor_end = terminfo_cursor_get_endl(control);
	control->term->cursor = cursor_end;
	terminfo_cursor_move(control, cursor_end.x, cursor_end.y);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x5829
testl %eax, %eax
je 0x5827
movq %rbx, %rdi
callq 0x41be
testl %eax, %eax
je 0x5827
movq %rbx, %rdi
callq 0x43be
movq 0x18(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq %rax, %rdx
shrq $0x20, %rdx
movl %eax, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x45b2
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/historic_search.c
// Function: history_swap_line_in_term_struct
int		history_swap_line_in_term_struct(t_control *control, int up)
{
	t_dlist	*new_link;
	char	*old_str;

	if (up == 1)
		new_link = control->term->current_history_link->next;
	else
		new_link = control->term->current_history_link->previous;
	if (!new_link)
		return (0);
	old_str = control->term->line;
	if (!(control->term->line = ft_strdup((char *)(new_link->content))))
	{
		control->quit = 1;
		return (0);
	}
	ft_free((void **)&old_str);
	control->term->current_history_link = new_link;
	control->term->line_len = ft_strlen((char*)(new_link->content));
	control->term->inline_position = control->term->line_len - 1;
	return (1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
xorl %ecx, %ecx
cmpl $0x1, %esi
setne %cl
movq 0x18(%rdi), %rax
movq 0x58(%rax), %rdx
movq 0x8(%rdx,%rcx,8), %r14
xorl %ebp, %ebp
testq %r14, %r14
je 0x589a
movq %rdi, %rbx
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movq (%r14), %rdi
callq 0x9aec
movq 0x18(%rbx), %rcx
movq %rax, (%rcx)
testq %rax, %rax
je 0x5897
leaq 0x8(%rsp), %rdi
callq 0xa018
movq 0x18(%rbx), %rax
movq %r14, 0x58(%rax)
movq (%r14), %rdi
callq 0x9be0
movq 0x18(%rbx), %rcx
movl %eax, 0x8(%rcx)
decl %eax
movl %eax, 0xc(%rcx)
pushq $0x1
popq %rbp
jmp 0x589a
orb $0x1, (%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/control_structure.c
// Function: control_init_struct
int		control_init_struct(t_control *control)
{
	extern char **environ;

	ft_bzero(control, sizeof(*control));
	control->parent_pid = getpid();
	if (!(control->history = history_init_struct()) ||
		!(control->term = terminfo_init_database()) ||
		!(control->env = env_build_linked_list(environ)))
		return (0);
	if (!control_load_start_prompts(&control->env, \
				"\033[93m⚡\033[5;92m mli_&_charmstr \033[0;93m⚡\033[m ", \
				"🍝 > "))
		return (0);
	if (!env_shlvl_update(&control->env, control))
		return (0);
	if (!(control->cwd = getcwd(NULL, 0)))
		return (0);
	if ((control->truefd[STDIN_FILENO] = dup(STDIN_FILENO)) == -1 ||
		(control->truefd[STDOUT_FILENO] = dup(STDOUT_FILENO)) == -1 ||
		(control->truefd[STDERR_FILENO] = dup(STDERR_FILENO)) == -1)
		return (0);
	if (tcgetattr(STDIN_FILENO, &control->termios_default) == -1)
		return (0);
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x80, %esi
callq 0x93c8
callq 0x2070
movl %eax, 0x8(%rbx)
callq 0x5613
movq %rax, 0x10(%rbx)
xorl %r14d, %r14d
testq %rax, %rax
je 0x5991
callq 0x4004
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x5991
movq 0xd6f8(%rip), %rax      # 0x12fe8
movq (%rax), %rdi
callq 0x3171
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x5991
leaq 0x20(%rbx), %r15
leaq 0x5a68(%rip), %rsi      # 0xb378
leaq 0x5a8f(%rip), %rdx      # 0xb3a6
movq %r15, %rdi
callq 0x599a
testl %eax, %eax
je 0x5991
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3341
testl %eax, %eax
je 0x5991
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
callq 0x20f0
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x5991
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x20d0
movl %eax, 0x30(%rbx)
cmpl $-0x1, %eax
je 0x5991
pushq $0x1
popq %rdi
callq 0x20d0
movl %eax, 0x34(%rbx)
cmpl $-0x1, %eax
je 0x5991
pushq $0x2
popq %rdi
callq 0x20d0
movl %eax, 0x38(%rbx)
cmpl $-0x1, %eax
je 0x5991
addq $0x3c, %rbx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x21c0
xorl %r14d, %r14d
cmpl $-0x1, %eax
setne %r14b
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/control_structure.c
// Function: control_load_start_prompts
int	control_load_start_prompts(t_list **env, char *ps1, char *ps2)
{
	unset_in_env_list(env, "PS1");
	unset_in_env_list(env, "PS2");
	 if (!export_builtin_new_env("PS1", ps1, env))
			return (0);
	 if (!export_builtin_new_env("PS2", ps2, env))
			return (0);
	return (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x58d8(%rip), %r12      # 0xb28a
movq %r12, %rsi
callq 0x3478
leaq 0x58c5(%rip), %rsi      # 0xb286
movq %r14, %rdi
callq 0x3478
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x367a
testl %eax, %eax
je 0x59f8
leaq 0x58a4(%rip), %rdi      # 0xb286
movq %rbx, %rsi
movq %r14, %rdx
callq 0x367a
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
setne %al
jmp 0x59fa
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/control_structure.c
// Function: control_free_struct
void	control_free_struct(t_control *control)
{
	terminfo_free_struct(control->term);
	ft_dlstclear(&(control->history->head), history_del_content);
	ft_free((void **)&control->history);
	ft_free((void **)&control->cwd);
	ft_lstclear(&control->env, env_del_struct);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x40b3
leaq 0x10(%rbx), %r14
movq 0x10(%rbx), %rdi
addq $0x8, %rdi
leaq -0x3f7(%rip), %rsi      # 0x5632
callq 0xa200
movq %r14, %rdi
callq 0xa018
leaq 0x78(%rbx), %rdi
callq 0xa018
addq $0x20, %rbx
leaq -0x27eb(%rip), %rsi     # 0x325f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9de8
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/parser_root.c
// Function: ast_add
void		ast_add(t_btree **ast, t_btree *add)
{
	if (add == NULL)
		return ;
	if (*ast == NULL)
		*ast = add;
	else if ((*ast)->left == NULL)
		(*ast)->left = add;
	else if ((*ast)->item == NULL)
	{
		(*ast)->item = add->item;
		ft_free((void **)&add);
	}
	else if ((*ast)->right == NULL)
		(*ast)->right = add;
	else
	{
		add->left = *ast;
		*ast = add;
	}
}

// Assembly:
pushq %rax
movq %rsi, (%rsp)
testq %rsi, %rsi
je 0x5aac
movq (%rdi), %rax
testq %rax, %rax
je 0x5a8c
cmpq $0x0, (%rax)
je 0x5a91
cmpq $0x0, 0x10(%rax)
je 0x5a96
cmpq $0x0, 0x8(%rax)
je 0x5aa8
movq %rax, (%rsi)
movq %rsi, (%rdi)
jmp 0x5aac
movq %rsi, (%rax)
jmp 0x5aac
movq 0x10(%rsi), %rcx
movq %rcx, 0x10(%rax)
movq %rsp, %rdi
callq 0xa018
jmp 0x5aac
movq %rsi, 0x8(%rax)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/parser_root.c
// Function: parser_be_subshell
int			parser_be_subshell(t_btree **new)
{
	t_btree *tmp;
	t_token *token;

	tmp = NULL;
	if (!(token = ft_memalloc(sizeof(t_token))))
		return (-1);
	token->id = SUBSHELL;
	if ((*new)->item != NULL)
	{
		if (!(tmp = btree_new(token)))
		{
			ft_free((void **)&token);
			return (-1);
		}
		tmp->left = *new;
		*new = tmp;
	}
	else
		(*new)->item = token;
	return (1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x20
popq %rdi
callq 0x9fb0
movq %rax, (%rsp)
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x5b0c
movl $0xe, 0x8(%rax)
movq (%r14), %rcx
cmpq $0x0, 0x10(%rcx)
je 0x5afb
movq %rax, %rdi
callq 0xa3f8
testq %rax, %rax
je 0x5b04
movq (%r14), %rcx
movq %rcx, (%rax)
movq %rax, (%r14)
jmp 0x5aff
movq %rax, 0x10(%rcx)
pushq $0x1
popq %rbx
jmp 0x5b0c
movq %rsp, %rdi
callq 0xa018
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/parser_root.c
// Function: parser_next_child
int			parser_next_child(t_dlist **dlst, t_list **tklst, t_btree **new)
{
//	printf("ENTER WITH : [%d]\t'%s'\n",
//		token_id((*tklst)->content), ((t_token *)(*tklst)->content)->str);
	if (parser_is_cmd_start(tklst_id(*tklst)))
		return (parser_cmd(tklst, new));
	if (parser_do_subtree(token_id((*tklst)->content)))
	{
		*tklst = (*tklst)->next;
		if (!*tklst)
			return (0);
		if (!((*dlst)->next = ft_dlstnew(NULL)))
			return (-1);
		(*dlst)->next->previous = *dlst;
		if (!(*new = parser_create_ast((*dlst)->next, tklst)))
			return (-1);
		if (parser_be_subshell(new) == -1)
			return (-1);
		ft_free((void **)&((*dlst)->next));
//	printf("\nNEW CONTAINS\n");
//		btree_debug(*new, parser_disp);
	}
	else
	{
		if (!(*new = btree_new((*tklst)->content)))
			return (-1);
	}
	if (*tklst)
		*tklst = (*tklst)->next;
//	if ((*new)->item)
//		printf("New is : [%d]\t'%s'\n", token_id((*new)->item), ((t_token *)(*new)->item)->str);
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq (%rsi), %rdi
callq 0x5fd5
movl %eax, %edi
callq 0x5ecd
testl %eax, %eax
je 0x5b4e
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5f5c
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x5fc8
movq (%rbx), %rcx
cmpl $0x6, %eax
jne 0x5bb9
movq 0x8(%rcx), %rax
movq %rax, (%rbx)
testq %rax, %rax
je 0x5bdd
xorl %edi, %edi
callq 0xa1b8
movq (%r15), %rcx
movq %rax, 0x8(%rcx)
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x5be4
movq (%r15), %rax
movq 0x8(%rax), %rdi
movq %rax, 0x10(%rdi)
movq %rbx, %rsi
callq 0x5bf1
movq %rax, (%r14)
testq %rax, %rax
je 0x5be4
movq %r14, %rdi
callq 0x5ab7
cmpl $-0x1, %eax
je 0x5be4
movq (%r15), %rdi
addq $0x8, %rdi
callq 0xa018
jmp 0x5bc9
movq (%rcx), %rdi
callq 0xa3f8
movq %rax, (%r14)
testq %rax, %rax
je 0x5be1
movq (%rbx), %rax
pushq $0x1
popq %rbp
testq %rax, %rax
je 0x5be4
movq 0x8(%rax), %rax
movq %rax, (%rbx)
jmp 0x5be4
xorl %ebp, %ebp
jmp 0x5be4
pushq $-0x1
popq %rbp
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/parser_root.c
// Function: parser_create_ast
t_btree		*parser_create_ast(t_dlist *dlst, t_list **tklst)
{
	t_btree		*new;
	int			state;

	if (!(dlst->content = btree_new(NULL)))
		return (NULL);
	while (*tklst && token_id((*tklst)->content) != RBRACE)
	{
//		printf("%d\n", token_id(tklst->content));
		if ((state = parser_next_child(&dlst, tklst, &new)) == 1)
			ast_add((t_btree **)&dlst->content, new);
		else if (state == -1)
			return (NULL);
		else if (parser_handle_semi(&dlst, tklst) == -1)
			return (NULL);
	}
	return (dlst->content);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq %rdi, 0x8(%rsp)
xorl %ebx, %ebx
xorl %edi, %edi
callq 0xa3f8
movq %rax, (%r14)
testq %rax, %rax
je 0x5c74
leaq 0x8(%rsp), %r12
movq %rsp, %r13
xorl %ebx, %ebx
movq (%r15), %rax
testq %rax, %rax
je 0x5c71
movq (%rax), %rdi
callq 0x5fc8
cmpl $0x7, %eax
je 0x5c71
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x5b16
cmpl $0x1, %eax
je 0x5c63
cmpl $-0x1, %eax
je 0x5c74
movq %r12, %rdi
movq %r15, %rsi
callq 0x5c85
cmpl $-0x1, %eax
jne 0x5c24
jmp 0x5c74
movq (%rsp), %rsi
movq %r14, %rdi
callq 0x5a63
jmp 0x5c24
movq (%r14), %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/parser_root.c
// Function: parser_handle_semi
int			parser_handle_semi(t_dlist **dlst, t_list **tklst)
{
	t_btree		*new;

	if (!(*tklst && token_id((*tklst)->content) == SEMI &&
		(tklst_id((*tklst)->next) != RBRACE) && (*tklst = (*tklst)->next)))
		return (0);
	if (!((*dlst)->next = ft_dlstnew(NULL)))
		return (-1);
	(*dlst)->next->previous = *dlst;
	if (!(new = parser_create_ast((*dlst)->next, tklst)))
		return (-1);
	ft_free((void **)&((*dlst)->next));
	ast_add((t_btree **)&(*dlst)->content, new);
	return (1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq (%rsi), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0x5d11
movq %rsi, %r14
movq %rdi, %rbx
movq (%rax), %rdi
callq 0x5fc8
cmpl $0x1, %eax
jne 0x5d11
movq (%r14), %rax
movq 0x8(%rax), %rdi
callq 0x5fd5
cmpl $0x7, %eax
je 0x5d11
movq (%r14), %rax
movq 0x8(%rax), %rax
movq %rax, (%r14)
testq %rax, %rax
je 0x5d11
xorl %edi, %edi
callq 0xa1b8
movq (%rbx), %rcx
movq %rax, 0x8(%rcx)
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x5d11
movq (%rbx), %rax
movq 0x8(%rax), %rdi
movq %rax, 0x10(%rdi)
movq %r14, %rsi
callq 0x5bf1
testq %rax, %rax
je 0x5d11
movq %rax, %r14
movq (%rbx), %rdi
addq $0x8, %rdi
callq 0xa018
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x5a63
pushq $0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/charMstr[P]minishell/sources/parser_root.c
// Function: parser_btree_reverse_pipe
void		parser_btree_reverse_pipe(t_btree **ast)
{
	int		id;
	t_btree	*lchild;

	lchild = (*ast)->left;
	while (btree_id(lchild) == PIPE)
		lchild = lchild->left;
	if ((id = btree_id(lchild)) == -1)
		return ;
	if (id == LIST || id == SUBSHELL)
		return ;
	(*ast)->left = lchild->right;
	lchild->right = *ast;
	*ast = lchild;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
movq (%r14), %r14
movq %r14, %rdi
callq 0x5fe9
cmpl $0x2, %eax
je 0x5d37
movq %r14, %rdi
callq 0x5fe9
incl %eax
cmpl $0x10, %eax
ja 0x5d60
movl $0x18001, %ecx          # imm = 0x18001
btl %eax, %ecx
jb 0x5d74
movq 0x8(%r14), %rax
movq (%rbx), %rcx
movq %rax, (%rcx)
movq (%rbx), %rax
movq %rax, 0x8(%r14)
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq