// File: /workspace/github_c_makefile_star2_O1/pvineet44[P]minishell/src/get_next_line.c
// Function: get_next_line
int					get_next_line(int fd, char **line)
{
	static char		*p;
	char			*buffer;
	int				value;
	int				ret;

	value = 1;
	errno = 0;
	if (validate(fd, line))
		return (-1);
	while (value > 0)
	{
		if (!(buffer = init(buffer, &p, fd)))
			return (-1);
		if ((!(value = ft_strlen(buffer))))
		{
			ft_free(&p);
			ft_free(&buffer);
			if (!(*line))
				*line = ft_strdup("");
			return (0);
		}
		if ((ret = ft_some(&p, value, buffer, line)) == 1 || ret == -1)
			return (ret);
	}
	return (1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl %edi, %r14d
callq 0x1040
movl $0x0, (%rax)
movl %r14d, -0x3c(%rbp)
testl %r14d, %r14d
sets %dl
testq %rbx, %rbx
sete %cl
orb %dl, %cl
jne 0x1785
movq %rax, -0x48(%rbp)
movq $0x0, (%rbx)
movl $0x1, %r13d
testl %r13d, %r13d
jle 0x179d
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0xb, %edi
callq 0x1120
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x1643
movl $0xa, %edx
movl -0x3c(%rbp), %edi
movq %rax, %rsi
callq 0x10d0
testl %eax, %eax
js 0x1643
movq -0x30(%rbp), %rcx
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, (%rcx,%rax)
movq 0x7acd(%rip), %rdi      # 0x90e0
testq %rdi, %rdi
je 0x163d
movq -0x30(%rbp), %rsi
callq 0x1875
movq %rax, %r15
leaq -0x30(%rbp), %rdi
callq 0x17d4
leaq 0x7aac(%rip), %rdi      # 0x90e0
callq 0x17d4
movq %r15, -0x30(%rbp)
movq -0x30(%rbp), %rdi
jmp 0x1645
xorl %edi, %edi
movq %rdi, -0x38(%rbp)
testq %rdi, %rdi
je 0x1785
callq 0x1802
testl %eax, %eax
je 0x17a5
movl %eax, %r13d
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x2, %r15d
jle 0x1762
xorl %r15d, %r15d
movq -0x30(%rbp), %r12
movslq %r15d, %r14
cmpb $0xa, (%r12,%r14)
je 0x16c9
cmpb $0x0, 0x1(%r12,%r14)
je 0x16c9
leaq 0x7a4a(%rip), %rdi      # 0x90e0
callq 0x17d4
testl %eax, %eax
je 0x16b9
movq (%rbx), %rdi
movq -0x30(%rbp), %rax
movsbl (%rax,%r14), %esi
incq %r14
callq 0x192d
movq %rax, (%rbx)
movl %r14d, %r15d
cmpl %r13d, %r15d
jl 0x1679
movl $0x2, %r15d
jmp 0x1762
movl %r13d, %eax
subl %r15d, %eax
movslq %eax, %rdi
callq 0x1120
testq %rax, %rax
je 0x1702
movb 0x1(%r12,%r14), %cl
testb %cl, %cl
je 0x1706
leaq 0x1(%r14), %rdx
addq %r12, %rdx
incq %rdx
xorl %esi, %esi
movb %cl, (%rax,%rsi)
movb (%rdx,%rsi), %cl
incq %rsi
testb %cl, %cl
jne 0x16f1
movl %esi, %ecx
jmp 0x1708
xorl %eax, %eax
jmp 0x170c
xorl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq %rax, 0x79cd(%rip)      # 0x90e0
testq %rax, %rax
je 0x177d
cmpq $0x0, (%rbx)
jne 0x1733
movl $0x1, %edi
callq 0x1120
movq %rax, (%rbx)
testq %rax, %rax
je 0x1733
movb $0x0, (%rax)
movl $0x1, %r15d
cmpb $0xa, (%r12,%r14)
je 0x1762
cmpb $0x0, 0x1(%r12,%r14)
jne 0x1762
movq -0x48(%rbp), %rax
movl $0x2, (%rax)
movq (%rbx), %rdi
movsbl (%r12,%r14), %esi
callq 0x192d
movq %rax, (%rbx)
leaq -0x30(%rbp), %rdi
callq 0x17d4
cmpl $0x1, %r15d
je 0x178b
cmpl $-0x1, %r15d
jne 0x15c7
jmp 0x178b
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x176b
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %r15d
jmp 0x178b
leaq 0x7934(%rip), %rdi      # 0x90e0
callq 0x17d4
leaq -0x38(%rbp), %rdi
callq 0x17d4
xorl %r15d, %r15d
cmpq $0x0, (%rbx)
jne 0x178b
leaq 0x483e(%rip), %rdi      # 0x6008
callq 0x1818
movq %rax, (%rbx)
jmp 0x178b