// File: /workspace/github_c_makefile_star2_O0/charMstr[P]minishell/sources/lexer_end.c
// Function: lexer_end
int		lexer_end(t_list *token_head, t_control *control)
{
	t_token	*last;

	if (token_head == NULL || (t_token *)(token_head->content) == NULL)
		return (0);
	last = (t_token *)(ft_lstlast(token_head)->content);
	if ((control->lexer_end.unexpected = lexer_forbidden_start(token_head)) ||
	(control->lexer_end.unexpected = lexer_forbidden_combo(token_head)))
		;
	else if (last->open_quote)
		control->lexer_end.quote = 1;
	else if (last->esc_next)
		control->lexer_end.backslash = 1;
	else if (last->id == AND_IF || last->id == PIPE || last->id == OR_IF)
		control->lexer_end.other = 1;
	else if (last->id == LESS || last->id == DLESS ||
			last->id == GREAT || last->id == DGREAT)
		control->lexer_end.unexpected = last->id;
	else if (ft_lstfind(token_head, (int	[]){LBRACE, RBRACE, -1},
			lexer_id_cmp) && !lexer_handle_braces(token_head, control, last))
		;
	else
		return (1);
	if (control->lexer_end.unexpected != 0)
		control->exit_status = (IS_APPLE ? 258 : 2);
	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x36a1
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x36ad
movl $0x0, -0x4(%rbp)
jmp 0x381b
movq -0x10(%rbp), %rdi
callq 0x10140
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3940
movq -0x18(%rbp), %rcx
movl %eax, 0x2c(%rcx)
cmpl $0x0, %eax
jne 0x36e7
movq -0x10(%rbp), %rdi
callq 0x3a50
movq -0x18(%rbp), %rcx
movl %eax, 0x2c(%rcx)
cmpl $0x0, %eax
je 0x36ec
jmp 0x37ff
movq -0x20(%rbp), %rax
movb 0x10(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x3712
movq -0x18(%rbp), %rax
movb 0x28(%rax), %cl
andb $-0x3, %cl
orb $0x2, %cl
movb %cl, 0x28(%rax)
jmp 0x37fd
movq -0x20(%rbp), %rax
movb 0x10(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x373a
movq -0x18(%rbp), %rax
movb 0x28(%rax), %cl
andb $-0x5, %cl
orb $0x4, %cl
movb %cl, 0x28(%rax)
jmp 0x37fb
movq -0x20(%rbp), %rax
cmpl $0x5, 0x8(%rax)
je 0x3758
movq -0x20(%rbp), %rax
cmpl $0x2, 0x8(%rax)
je 0x3758
movq -0x20(%rbp), %rax
cmpl $0x3, 0x8(%rax)
jne 0x376d
movq -0x18(%rbp), %rax
movb 0x28(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x28(%rax)
jmp 0x37f9
movq -0x20(%rbp), %rax
cmpl $0xa, 0x8(%rax)
je 0x3795
movq -0x20(%rbp), %rax
cmpl $0xb, 0x8(%rax)
je 0x3795
movq -0x20(%rbp), %rax
cmpl $0xc, 0x8(%rax)
je 0x3795
movq -0x20(%rbp), %rax
cmpl $0xd, 0x8(%rax)
jne 0x37a5
movq -0x20(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0x37f7
movq -0x10(%rbp), %rdi
movl $0x6, -0x2c(%rbp)
movl $0x7, -0x28(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
leaq -0x2c(%rbp), %rsi
leaq -0x439(%rip), %rdx      # 0x3390
callq 0x10220
cmpq $0x0, %rax
je 0x37ec
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x3620
cmpl $0x0, %eax
jne 0x37ec
jmp 0x37f5
movl $0x1, -0x4(%rbp)
jmp 0x381b
jmp 0x37f7
jmp 0x37f9
jmp 0x37fb
jmp 0x37fd
jmp 0x37ff
movq -0x18(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x3814
movq -0x18(%rbp), %rax
movl $0x2, 0x4(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop