// File: /workspace/github_c_makefile_star2_O2/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, %r13d
callq 0x1040
andl $0x0, (%rax)
testl %r13d, %r13d
sets %dl
testq %rbx, %rbx
sete %cl
orb %dl, %cl
pushq $-0x1
popq %r15
je 0x15a3
movl %r15d, %r14d
jmp 0x174a
movq %rax, -0x50(%rbp)
movq %rbx, -0x30(%rbp)
andq $0x0, (%rbx)
pushq $0x1
popq %r14
pushq $0xb
popq %rdi
pushq $0xa
popq %rbx
movl %r13d, -0x3c(%rbp)
testl %r14d, %r14d
jle 0x1746
callq 0x1110
movq %rax, -0x38(%rbp)
testq %rax, %rax
je 0x159b
movq %rax, %r12
movl %r13d, %edi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x10c0
testl %eax, %eax
js 0x159b
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, (%r12,%rax)
movq 0x6ade(%rip), %rdi      # 0x80d8
testq %rdi, %rdi
je 0x162d
movq %r12, %rsi
callq 0x180a
movq %rax, %r12
leaq -0x38(%rbp), %rdi
callq 0x1790
leaq 0x6abe(%rip), %rdi      # 0x80d8
callq 0x1790
movq %r12, -0x48(%rbp)
testq %r12, %r12
jne 0x1631
jmp 0x159b
movq %r12, -0x48(%rbp)
movq %r12, %rdi
callq 0x17b9
testl %eax, %eax
je 0x175c
movl %eax, %r14d
movq %r12, -0x38(%rbp)
leaq 0x1(%r12), %r13
xorl %r15d, %r15d
movl %r15d, %ebx
leaq 0x1(%rbx), %r15
cmpl %r14d, %ebx
jge 0x1697
cmpb $0xa, (%r12,%rbx)
je 0x16b3
cmpb $0x0, (%r12,%r15)
je 0x16b3
leaq 0x6a67(%rip), %rdi      # 0x80d8
callq 0x1790
testl %eax, %eax
je 0x1657
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movsbl (%r12,%rbx), %esi
callq 0x18b1
movq -0x30(%rbp), %rcx
movq %rax, (%rcx)
incq %r13
jmp 0x1650
leaq -0x38(%rbp), %rdi
callq 0x1790
pushq $-0x1
popq %r15
movl -0x3c(%rbp), %r13d
pushq $0xb
popq %rdi
pushq $0xa
popq %rbx
jmp 0x15bd
subl %ebx, %r14d
movslq %r14d, %rdi
callq 0x1110
testq %rax, %rax
je 0x1706
xorl %ecx, %ecx
movq -0x30(%rbp), %r14
movb (%r13), %dl
testb %dl, %dl
je 0x16dc
movb %dl, (%rax,%rcx)
incq %rcx
incq %r13
jmp 0x16c9
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movq %rax, 0x69ef(%rip)      # 0x80d8
movq (%r14), %rax
testq %rax, %rax
jne 0x1714
pushq $0x1
popq %rdi
callq 0x1110
movq %rax, (%r14)
testq %rax, %rax
je 0x1712
movb $0x0, (%rax)
jmp 0x1714
andq $0x0, 0x69ca(%rip)      # 0x80d8
pushq $-0x1
jmp 0x1748
xorl %eax, %eax
cmpb $0xa, (%r12,%rbx)
je 0x173d
cmpb $0x0, 0x1(%r12,%rbx)
jne 0x173d
movq -0x50(%rbp), %rcx
movl $0x2, (%rcx)
movsbl (%r12,%rbx), %esi
movq %rax, %rdi
callq 0x18b1
movq %rax, (%r14)
leaq -0x38(%rbp), %rdi
callq 0x1790
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6975(%rip), %rdi      # 0x80d8
callq 0x1790
leaq -0x48(%rbp), %rdi
callq 0x1790
xorl %r14d, %r14d
movq -0x30(%rbp), %rbx
cmpq $0x0, (%rbx)
jne 0x174a
leaq 0x3883(%rip), %rdi      # 0x5008
callq 0x17cf
movq %rax, (%rbx)
jmp 0x174a
nop