// File: /workspace/github_c_makefile_star2_O1/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
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x231c
movq %rsi, %r14
movl %edi, %r15d
cmpq $0x0, 0x7f97(%rip)      # 0xa068
jne 0x20eb
movl %r15d, %edi
callq 0x2330
movq %rax, 0x7f86(%rip)      # 0xa068
testq %rax, %rax
je 0x231c
movq 0x7f76(%rip), %rbx      # 0xa068
testq %rbx, %rbx
je 0x22d9
movq (%rbx), %r12
cmpl %r15d, (%r12)
je 0x2126
cmpq $0x0, 0x10(%rbx)
jne 0x2120
movl %r15d, %edi
callq 0x2330
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x231c
movq 0x10(%rbx), %rbx
jmp 0x20f2
movl $0x0, 0x4(%r12)
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x21e9
movl $0xa, %esi
callq 0x53bc
movq %rax, %r15
testq %rax, %rax
je 0x219e
cmpb $0x0, 0x1(%r15)
je 0x219e
leaq 0x1(%r15), %r13
movq 0x8(%r12), %rdi
subq %rdi, %r15
xorl %esi, %esi
movq %r15, %rdx
callq 0x5550
movq %rax, 0x10(%r12)
movq 0x8(%r12), %rax
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movq %r13, %rdi
callq 0x543c
movq %rax, 0x8(%r12)
movq %r15, %rdi
callq 0x1d5c
movl $0x1, 0x4(%r12)
jmp 0x21e9
leaq 0x8(%r12), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%r12), %rdi
callq 0x543c
movq %rax, 0x10(%r12)
testq %r15, %r15
je 0x21df
cmpb $0x0, 0x1(%r15)
jne 0x21df
movq %rax, %r13
movq 0x8(%r12), %rdi
callq 0x5594
movb $0x0, -0x1(%r13,%rax)
movl $0x1, 0x4(%r12)
movq 0x8(%rsp), %rdi
callq 0x1d5c
movq (%rbx), %r12
cmpl $0x1, 0x4(%r12)
je 0x22d9
movl (%r12), %edi
leaq 0x10(%rsp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x1060
testl %eax, %eax
jle 0x2268
leaq 0x10(%rsp), %r15
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, 0x10(%rsp,%rax)
movq 0x10(%r12), %rax
movq %rax, (%rsp)
movq %r15, %rdi
movl $0xa, %esi
callq 0x53bc
testq %rax, %rax
jne 0x2296
movq 0x10(%r12), %rdi
movq %r15, %rsi
callq 0x54c0
movq %rax, 0x10(%r12)
movq %rsp, %rdi
callq 0x1d5c
movl (%r12), %edi
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
jg 0x2214
movq 0x10(%r12), %rcx
testq %rcx, %rcx
je 0x2280
cmpb $0x0, (%rcx)
je 0x2280
movl $0x1, 0x4(%r12)
cmpl $-0x1, %eax
je 0x231c
cmpl $-0x1, 0x4(%r12)
jne 0x22d9
jmp 0x231c
movq %rax, %r13
movl $0x1, 0x4(%r12)
cmpb $0x0, 0x1(%rax)
je 0x22b8
movq %r13, %rdi
incq %rdi
callq 0x543c
movq %rax, 0x8(%r12)
movb $0x0, (%r13)
movq 0x10(%r12), %rdi
leaq 0x10(%rsp), %rsi
callq 0x54c0
movq %rax, 0x10(%r12)
movq %rsp, %rdi
callq 0x1d5c
movq (%rbx), %r15
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x22fb
addq $0x10, %r15
callq 0x543c
movq %rax, (%r14)
movq %r15, %rdi
callq 0x1d5c
jmp 0x230d
movq %r15, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x231a
movq (%rbx), %rax
movl 0x4(%rax), %ebp
jmp 0x231c
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq