// File: /workspace/github_c_makefile_star2_O2/ffoissey[P]filler_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_file	file;

	if (fd < 0 || !line)
		return (FAILURE);
	ft_fill_line_with_rest(&file);
	if (file.state != 1 && ft_read(&file) == FAILURE)
		return (FAILURE);
	if (file.cur != NULL)
	{
		*line = ft_strdup(file.cur);
		ft_strdel(&file.cur);
	}
	return ((*line == NULL && file.state != 0) ? FAILURE : file.state);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
testl %edi, %edi
sets %al
testq %rsi, %rsi
sete %cl
pushq $-0x1
popq %rbp
orb %al, %cl
jne 0x2952
movq %rsi, %rbx
andl $0x0, 0x88eb(%rip)      # 0xb054
movq 0x88e8(%rip), %rdi      # 0xb058
testq %rdi, %rdi
je 0x283b
pushq $0xa
popq %rsi
callq 0x58a8
movq %rax, %r14
testq %rax, %rax
je 0x27e4
cmpb $0x0, 0x1(%r14)
je 0x27e4
leaq 0x1(%r14), %r15
movq 0x88bd(%rip), %rdi      # 0xb058
subq %rdi, %r14
xorl %esi, %esi
movq %r14, %rdx
callq 0x59d8
movq %rax, 0x88b1(%rip)      # 0xb060
movq 0x88a2(%rip), %rax      # 0xb058
leaq 0x10(%rsp), %r14
movq %rax, (%r14)
movq %r15, %rdi
callq 0x58c8
movq %rax, 0x888b(%rip)      # 0xb058
movq %r14, %rdi
callq 0x2650
movl $0x1, 0x8875(%rip)      # 0xb054
jmp 0x291b
movq 0x886d(%rip), %rdi      # 0xb058
callq 0x58c8
movq %rax, 0x8869(%rip)      # 0xb060
testq %r14, %r14
je 0x2822
cmpb $0x0, 0x1(%r14)
jne 0x2822
movq %rax, %r15
movq 0x884b(%rip), %rdi      # 0xb058
callq 0x2638
movb $0x0, -0x1(%r15,%rax)
movl $0x1, 0x8832(%rip)      # 0xb054
leaq 0x882f(%rip), %rdi      # 0xb058
callq 0x2650
cmpl $0x1, 0x881f(%rip)      # 0xb054
je 0x291b
leaq 0x10(%rsp), %r14
pushq $0xa
popq %r15
leaq 0x8(%rsp), %r12
movl 0x8801(%rip), %edi      # 0xb050
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rsi
callq 0x1050
testl %eax, %eax
jle 0x28a6
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, 0x10(%rsp,%rax)
movq 0x87ef(%rip), %rax      # 0xb060
movq %rax, 0x8(%rsp)
movq %r14, %rdi
movl %r15d, %esi
callq 0x58a8
testq %rax, %rax
jne 0x28d5
movq 0x87d3(%rip), %rdi      # 0xb060
movq %r14, %rsi
callq 0x5948
movq %rax, 0x87c4(%rip)      # 0xb060
movq %r12, %rdi
callq 0x2650
jmp 0x2849
movq 0x87b3(%rip), %rcx      # 0xb060
testq %rcx, %rcx
je 0x28c1
cmpb $0x0, (%rcx)
je 0x28c1
movl $0x1, 0x8793(%rip)      # 0xb054
cmpl $-0x1, %eax
je 0x2952
cmpl $-0x1, 0x8783(%rip)     # 0xb054
jne 0x291b
jmp 0x2952
movq %rax, %r13
movl $0x1, 0x8772(%rip)      # 0xb054
movq %rax, %rdi
incq %rdi
callq 0x58c8
movq %rax, 0x8764(%rip)      # 0xb058
movb $0x0, (%r13)
movq 0x8760(%rip), %rdi      # 0xb060
leaq 0x10(%rsp), %rsi
callq 0x5948
movq %rax, 0x874f(%rip)      # 0xb060
leaq 0x8(%rsp), %rdi
callq 0x2650
movq 0x873e(%rip), %rdi      # 0xb060
testq %rdi, %rdi
je 0x293b
callq 0x58c8
movq %rax, (%rbx)
leaq 0x872a(%rip), %rdi      # 0xb060
callq 0x2650
movl 0x8713(%rip), %eax      # 0xb054
xorl %ebp, %ebp
movl %eax, %ecx
negl %ecx
sbbl %ebp, %ebp
orl %eax, %ebp
cmpq $0x0, (%rbx)
cmovnel %eax, %ebp
movl %ebp, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop