// File: /workspace/github_c_makefile_star2_O3/Orycterope[P]corewar/libft/get_next_line.c
// Function: get_next_line
int			get_next_line(int const fd, char **line)
{
	static t_file	*file = NULL;
	t_file			*fil;
	int				s;
	char			*new;

	if (init(&file, &fil, fd) < 0)
		return (-1);
	file = (file == NULL ? fil : file);
	if ((s = reduce(&fil, 1)) != 1)
		return (s);
	s = size_line(fil->text, fil->size_text);
	if ((new = (char *)malloc(sizeof(char) * (s + 1))) == NULL)
		return (-1);
	ft_bzero(new, s + 1);
	ft_strncpy(new, fil->text, s);
	*line = new;
	s = fil->size_text - s - 1;
	if ((new = (char*)malloc(sizeof(char) * (s > 0 ? s : BUFF_SIZE))) == NULL)
		return (-1);
	if (s > 0)
		ft_strncpy(new, &fil->text[fil->size_text - s], s);
	ft_strdel(&(fil->text));
	fil->size_text = s;
	fil->text = new;
	return (1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
movq 0x5db5(%rip), %r15      # 0xa3a8
testl %edi, %edi
sets %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x465b
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x461c
cmpl %ebp, (%r15)
je 0x461c
movq %rax, %rcx
movq 0x18(%rax), %rax
movq %rcx, %r15
jmp 0x4606
cmpl %ebp, (%r15)
jne 0x465b
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x4649
cmpl %ebp, (%r15)
je 0x4649
movq %rax, %rbx
movq 0x18(%rax), %rax
movq %rbx, %r15
testq %rax, %rax
jne 0x462a
cmpl %ebp, (%rbx)
jne 0x493c
movq %rbx, %r15
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x46be
movq %r14, (%rsp)
jmp 0x46e4
movq %r15, %rbx
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %ebp, %ebp
js 0x492a
movl $0x20, %edi
callq 0x4c60
testq %rax, %rax
je 0x492a
movq %rax, %r15
movl $0x800, %edi            # imm = 0x800
callq 0x4c60
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x492a
movq %rax, %rsi
movl $0x0, 0x10(%r15)
movl %ebp, (%r15)
movq $0x0, 0x18(%r15)
testq %rbx, %rbx
movq %r14, (%rsp)
je 0x46e4
movq %r15, 0x18(%rbx)
jmp 0x46e4
movl $0x800, %edi            # imm = 0x800
callq 0x4c60
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x4826
movq %rax, %rsi
movq %r14, (%rsp)
movl $0x0, 0x10(%r15)
movq 0x5cbd(%rip), %rax      # 0xa3a8
testq %rax, %rax
cmoveq %r15, %rax
movq %rax, 0x5caf(%rip)      # 0xa3a8
leaq 0x8(%r15), %r14
leaq 0x10(%r15), %rbp
movl 0x10(%r15), %eax
movq %r15, %rbx
cmpb $0xa, (%rsi)
movq %rsi, %rcx
je 0x473d
movslq %eax, %rdx
xorl %edi, %edi
testq %rdx, %rdx
movl $0x0, %ecx
cmovgq %rdx, %rcx
addq %rsi, %rcx
cmpq %rdx, %rdi
jge 0x473d
leaq 0x1(%rdi), %r8
cmpb $0xa, 0x1(%rsi,%rdi)
movq %r8, %rdi
jne 0x4724
addq %rsi, %r8
movq %r8, %rcx
cmpl %esi, %ecx
jne 0x4754
testl %eax, %eax
jne 0x4754
movl (%rbx), %edi
movl $0x800, %edx            # imm = 0x800
callq 0x1060
movl %eax, (%rbp)
testl %eax, %eax
jle 0x4831
movl $0x1, %ecx
movq (%r14), %r15
movslq %eax, %r12
testq %r15, %r15
je 0x4783
cmpb $0xa, (%r15)
jne 0x4797
testl %ecx, %ecx
jle 0x4867
testl %eax, %eax
jle 0x47d5
jmp 0x4867
xorl %r13d, %r13d
testl %ecx, %ecx
jle 0x489f
testl %eax, %eax
jle 0x47d5
jmp 0x489f
testq %r12, %r12
movl $0x0, %edx
cmovgq %r12, %rdx
addq %r15, %rdx
xorl %esi, %esi
cmpq %r12, %rsi
jge 0x47c2
leaq 0x1(%rsi), %rdi
cmpb $0xa, 0x1(%r15,%rsi)
movq %rdi, %rsi
jne 0x47a8
addq %r15, %rdi
movq %rdi, %rdx
testl %ecx, %ecx
jle 0x485e
subl %r15d, %edx
cmpl %edx, %eax
jg 0x485e
addl $0x800, %eax            # imm = 0x800
movslq %eax, %rdi
callq 0x1080
testq %rax, %rax
je 0x4826
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4c04
movq %r14, %rdi
callq 0x4c98
movq %r13, (%r14)
movslq (%rbp), %rsi
addq %r13, %rsi
movl (%rbx), %edi
movl $0x800, %edx            # imm = 0x800
callq 0x1060
movq %rax, %rcx
movl (%rbp), %eax
addl %ecx, %eax
movl %eax, (%rbp)
jmp 0x4761
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x492a
cmpq $0x0, (%r14)
je 0x484a
movq %r14, %rdi
callq 0x4c98
movl (%rbp), %eax
testl %eax, %eax
jg 0x475c
movq $0x0, (%r14)
xorl %r12d, %r12d
negl %eax
sbbl %r12d, %r12d
jmp 0x492a
testq %r15, %r15
je 0x497c
cmpb $0xa, (%r15)
movq %r15, %r13
je 0x489c
xorl %eax, %eax
testq %r12, %r12
movl $0x0, %r13d
cmovgq %r12, %r13
addq %r15, %r13
cmpq %r12, %rax
jge 0x489c
leaq 0x1(%rax), %rcx
cmpb $0xa, 0x1(%r15,%rax)
movq %rcx, %rax
jne 0x4882
addq %r15, %rcx
movq %rcx, %r13
subl %r15d, %r13d
leal 0x1(%r13), %eax
movslq %eax, %r15
movq %r15, %rdi
callq 0x1080
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x492a
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4144
movq (%r14), %rsi
movslq %r13d, %rdx
movq %rbx, %rdi
callq 0x4c04
movq (%rsp), %rax
movq %rbx, (%rax)
notl %r13d
addl (%rbp), %r13d
testl %r13d, %r13d
movl $0x800, %eax            # imm = 0x800
cmovgl %r13d, %eax
movslq %eax, %rdi
callq 0x1080
testq %rax, %rax
je 0x492a
movq %rax, %rbx
testl %r13d, %r13d
jle 0x4915
addq (%r14), %r15
movl %r13d, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4c04
movq %r14, %rdi
callq 0x4c98
movl %r13d, (%rbp)
movq %rbx, (%r14)
movl $0x1, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, (%rsp)
leaq 0x8(%rbx), %r14
movq 0x8(%rbx), %rsi
movq 0x5a59(%rip), %rax      # 0xa3a8
testq %rax, %rax
cmoveq %rbx, %rax
movq %rax, 0x5a4b(%rip)      # 0xa3a8
leaq 0x10(%rbx), %rbp
movl 0x10(%rbx), %eax
testq %rsi, %rsi
jne 0x4708
testl %eax, %eax
jne 0x4754
xorl %esi, %esi
jmp 0x4745
xorl %r13d, %r13d
jmp 0x489f