// File: /workspace/github_c_makefile_star2_O3/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, %r12d
callq 0x1040
movl $0x0, (%rax)
testl %r12d, %r12d
sets %dl
testq %rbx, %rbx
sete %cl
orb %dl, %cl
jne 0x1701
movq %rax, -0x48(%rbp)
movq $0x0, (%rbx)
leaq -0x30(%rbp), %r13
movl %r12d, -0x34(%rbp)
movl $0xb, %edi
callq 0x1120
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x1701
movq %rax, %r15
movl $0xa, %edx
movl %r12d, %edi
movq %rax, %rsi
callq 0x10d0
testl %eax, %eax
js 0x1701
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, (%r15,%rax)
movq 0x7ad8(%rip), %rdi      # 0x90e0
testq %rdi, %rdi
je 0x163a
movq %r15, %rsi
callq 0x184d
movq %rax, %r15
movq %r13, %rdi
callq 0x17b0
leaq 0x7ab9(%rip), %rdi      # 0x90e0
callq 0x17b0
movq %r15, -0x40(%rbp)
testq %r15, %r15
jne 0x163e
jmp 0x1701
movq %r15, -0x40(%rbp)
movq %r15, %rdi
callq 0x17de
testl %eax, %eax
je 0x1781
movq %r15, -0x30(%rbp)
jle 0x1760
movl %eax, %r14d
xorl %r13d, %r13d
movslq %r13d, %r12
cmpb $0xa, (%r15,%r12)
je 0x16bf
cmpb $0x0, 0x1(%r15,%r12)
je 0x16bf
leaq 0x7a69(%rip), %rdi      # 0x90e0
callq 0x17b0
testl %eax, %eax
je 0x1696
movq (%rbx), %rdi
movsbl (%r15,%r12), %esi
incq %r12
callq 0x1905
movq %rax, (%rbx)
movl %r12d, %r13d
cmpl %r14d, %r13d
jl 0x165e
leaq -0x30(%rbp), %r13
movq %r13, %rdi
callq 0x17b0
movl $0x1, %r15d
testl %r14d, %r14d
movl -0x34(%rbp), %r12d
jg 0x15c5
jmp 0x176f
subl %r13d, %r14d
movslq %r14d, %rdi
callq 0x1120
testq %rax, %rax
je 0x16f6
movb 0x1(%r15,%r12), %cl
testb %cl, %cl
je 0x1709
leaq 0x1(%r12), %rdx
addq %r15, %rdx
incq %rdx
xorl %esi, %esi
movb %cl, (%rax,%rsi)
movb (%rdx,%rsi), %cl
incq %rsi
testb %cl, %cl
jne 0x16e5
movl %esi, %ecx
jmp 0x170b
movq $0x0, 0x79df(%rip) # 0x90e0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x176f
xorl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq %rax, 0x79ca(%rip)      # 0x90e0
movq (%rbx), %rax
testq %rax, %rax
jne 0x1737
movl $0x1, %edi
callq 0x1120
movq %rax, (%rbx)
testq %rax, %rax
je 0x1735
movb $0x0, (%rax)
jmp 0x1737
xorl %eax, %eax
cmpb $0xa, (%r15,%r12)
je 0x1760
cmpb $0x0, 0x1(%r15,%r12)
jne 0x1760
movq -0x48(%rbp), %rcx
movl $0x2, (%rcx)
movsbl (%r15,%r12), %esi
movq %rax, %rdi
callq 0x1905
movq %rax, (%rbx)
leaq -0x30(%rbp), %rdi
callq 0x17b0
movl $0x1, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7958(%rip), %rdi      # 0x90e0
callq 0x17b0
leaq -0x40(%rbp), %rdi
callq 0x17b0
xorl %r15d, %r15d
cmpq $0x0, (%rbx)
jne 0x176f
leaq 0x4862(%rip), %rdi      # 0x6008
callq 0x17f4
movq %rax, (%rbx)
jmp 0x176f