// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x1020, %rsp           # imm = 0x1020
testl %edi, %edi
sets %al
testq %rsi, %rsi
sete %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
orb %al, %cl
jne 0x2b3d
movq %rsi, %rbx
movl $0x0, 0x871c(%rip)      # 0xb05c
movq 0x8719(%rip), %rdi      # 0xb060
testq %rdi, %rdi
je 0x2a04
movl $0xa, %esi
callq 0x5cb4
movq %rax, %r14
testq %rax, %rax
je 0x29ba
cmpb $0x0, 0x1(%r14)
je 0x29ba
leaq 0x1(%r14), %r15
movq 0x86ec(%rip), %rdi      # 0xb060
subq %rdi, %r14
xorl %esi, %esi
movq %r14, %rdx
callq 0x5e00
movq %rax, 0x86e0(%rip)      # 0xb068
movq 0x86d1(%rip), %rax      # 0xb060
leaq 0x10(%rsp), %r14
movq %rax, (%r14)
movq %r15, %rdi
callq 0x5cec
movq %rax, 0x86ba(%rip)      # 0xb060
movq %r14, %rdi
callq 0x2818
movl $0x1, 0x86a4(%rip)      # 0xb05c
jmp 0x2a04
movq 0x869f(%rip), %rdi      # 0xb060
callq 0x5cec
movq %rax, 0x869b(%rip)      # 0xb068
testq %r14, %r14
je 0x29f8
cmpb $0x0, 0x1(%r14)
jne 0x29f8
movq %rax, %r15
movq 0x867d(%rip), %rdi      # 0xb060
callq 0x2804
movb $0x0, -0x1(%r15,%rax)
movl $0x1, 0x8664(%rip)      # 0xb05c
leaq 0x8661(%rip), %rdi      # 0xb060
callq 0x2818
cmpl $0x1, 0x8651(%rip)      # 0xb05c
je 0x2b06
movl 0x8641(%rip), %edi      # 0xb058
leaq 0x10(%rsp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x1060
testl %eax, %eax
jle 0x2a91
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, 0x10(%rsp,%rax)
movq 0x8623(%rip), %rax      # 0xb068
movq %rax, 0x8(%rsp)
movq %r14, %rdi
movl $0xa, %esi
callq 0x5cb4
testq %rax, %rax
jne 0x2ac0
movq 0x8605(%rip), %rdi      # 0xb068
movq %r14, %rsi
callq 0x5d70
movq %rax, 0x85f6(%rip)      # 0xb068
movq %r15, %rdi
callq 0x2818
movl 0x85d8(%rip), %edi      # 0xb058
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
jg 0x2a34
movq 0x85d0(%rip), %rcx      # 0xb068
testq %rcx, %rcx
je 0x2aac
cmpb $0x0, (%rcx)
je 0x2aac
movl $0x1, 0x85b0(%rip)      # 0xb05c
cmpl $-0x1, %eax
je 0x2b3d
cmpl $-0x1, 0x85a0(%rip)     # 0xb05c
jne 0x2b06
jmp 0x2b3d
movq %rax, %r12
movl $0x1, 0x858f(%rip)      # 0xb05c
movq %rax, %rdi
incq %rdi
callq 0x5cec
movq %rax, 0x8581(%rip)      # 0xb060
movb $0x0, (%r12)
movq 0x857d(%rip), %rdi      # 0xb068
leaq 0x10(%rsp), %rsi
callq 0x5d70
movq %rax, 0x856c(%rip)      # 0xb068
leaq 0x8(%rsp), %rdi
callq 0x2818
movq 0x855b(%rip), %rdi      # 0xb068
testq %rdi, %rdi
je 0x2b26
callq 0x5cec
movq %rax, (%rbx)
leaq 0x8547(%rip), %rdi      # 0xb068
callq 0x2818
movl 0x8530(%rip), %eax      # 0xb05c
xorl %ebp, %ebp
movl %eax, %ecx
negl %ecx
sbbl %ebp, %ebp
orl %eax, %ebp
cmpq $0x0, (%rbx)
cmovnel %eax, %ebp
movl %ebp, %eax
addq $0x1020, %rsp           # imm = 0x1020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop