// File: /workspace/github_c_makefile_star2_O2/ffoissey[P]push_swap_42/libft/srcs/get_next_line/get_next_line.c
// Function: get_next_line
int				get_next_line(const int fd, char **line)
{
	static	t_list	*lst = NULL;
	t_list			*tmp;

	if (!line || (!lst && !(lst = init_new_file(fd, line))))
		return (-1);
	tmp = lst;
	while (tmp)
	{
		if (FILEL->fd == fd)
		{
			ft_fill_line_with_rest(FILEL);
			if (FILEL->state != 1 && ft_read(FILEL) == -1)
				return (-1);
			break ;
		}
		if (!tmp->next && !(tmp->next = init_new_file(fd, line)))
			return (-1);
		tmp = tmp->next;
	}
	free_cp_lst(&tmp, FILEL, line);
	return (tmp ? FILEL->state : 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
pushq $-0x1
popq %r12
testq %rsi, %rsi
je 0x21be
movq %rsi, %rbx
movl %edi, %r15d
movq 0x8099(%rip), %rax      # 0xa058
testq %rax, %rax
jne 0x1fdc
movl %r15d, %edi
callq 0x21d3
movq %rax, 0x8085(%rip)      # 0xa058
testq %rax, %rax
je 0x21be
movq %rax, %r14
movq (%rax), %r13
cmpl %r15d, (%r13)
je 0x1fff
movq 0x10(%r14), %rax
testq %rax, %rax
jne 0x1fdc
movl %r15d, %edi
callq 0x21d3
movq %rax, 0x10(%r14)
jmp 0x1fd3
movq %rbx, 0x8(%rsp)
andl $0x0, 0x4(%r13)
movq 0x8(%r13), %rdi
testq %rdi, %rdi
je 0x20ae
pushq $0xa
popq %rsi
callq 0x503c
movq %rax, %r15
testq %rax, %rax
je 0x2070
cmpb $0x0, 0x1(%r15)
je 0x2070
leaq 0x1(%r15), %rbx
movq 0x8(%r13), %rdi
subq %rdi, %r15
xorl %esi, %esi
movq %r15, %rdx
callq 0x5198
movq %rax, 0x10(%r13)
movq 0x8(%r13), %rax
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movq %rbx, %rdi
callq 0x5088
movq %rax, 0x8(%r13)
movq %r15, %rdi
callq 0x1c38
movl $0x1, 0x4(%r13)
jmp 0x20ae
leaq 0x8(%r13), %r12
movq 0x8(%r13), %rdi
callq 0x5088
movq %rax, 0x10(%r13)
testq %r15, %r15
je 0x20a6
cmpb $0x0, 0x1(%r15)
jne 0x20a6
movq %rax, %rbx
movq 0x8(%r13), %rdi
callq 0x51dc
movb $0x0, -0x1(%rbx,%rax)
movl $0x1, 0x4(%r13)
movq %r12, %rdi
callq 0x1c38
movq (%r14), %rbp
cmpl $0x1, 0x4(%rbp)
je 0x217d
leaq 0x10(%rsp), %r15
pushq $0xa
popq %r12
movq %rsp, %r13
movl (%rbp), %edi
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rsi
callq 0x1050
testl %eax, %eax
jle 0x2117
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, 0x10(%rsp,%rax)
movq 0x10(%rbp), %rax
movq %rax, (%rsp)
movq %r15, %rdi
movl %r12d, %esi
callq 0x503c
testq %rax, %rax
jne 0x2141
movq 0x10(%rbp), %rdi
movq %r15, %rsi
callq 0x5108
movq %rax, 0x10(%rbp)
movq %r13, %rdi
callq 0x1c38
jmp 0x20c7
movq 0x10(%rbp), %rcx
testq %rcx, %rcx
je 0x212c
cmpb $0x0, (%rcx)
je 0x212c
movl $0x1, 0x4(%rbp)
cmpl $-0x1, %eax
pushq $-0x1
popq %r12
je 0x21be
cmpl $-0x1, 0x4(%rbp)
jne 0x217d
jmp 0x21be
movq %rax, %rbx
movl $0x1, 0x4(%rbp)
cmpb $0x0, 0x1(%rax)
je 0x2160
movq %rbx, %rdi
incq %rdi
callq 0x5088
movq %rax, 0x8(%rbp)
movb $0x0, (%rbx)
movq 0x10(%rbp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x5108
movq %rax, 0x10(%rbp)
movq %rsp, %rdi
callq 0x1c38
movq (%r14), %rbx
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x21ab
addq $0x10, %rbx
callq 0x5088
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq %rbx, %rdi
callq 0x1c38
movq (%r14), %rax
movl 0x4(%rax), %r12d
jmp 0x21be
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq