// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rsi, %r13
movl %edi, %ebp
movq 0x606e(%rip), %rax      # 0xa398
movq %rax, 0x10(%rsp)
testl %edi, %edi
sets %cl
testq %rax, %rax
sete %al
orb %cl, %al
pushq $-0x1
popq %rbx
je 0x434a
testl %ebp, %ebp
jns 0x43ab
jmp 0x4579
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0x45ac
testl %eax, %eax
je 0x43ab
movl %ebx, %r14d
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x45ac
testl %eax, %eax
setne %al
movq (%rbx), %r15
movq 0x8(%r15), %r12
testq %r12, %r12
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x43fb
movl $0x800, %edi            # imm = 0x800
callq 0x486c
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x4576
movq %rax, %r12
movq %r13, 0x8(%rsp)
andl $0x0, 0x10(%r15)
jmp 0x4400
pushq $0x20
popq %rdi
callq 0x486c
testq %rax, %rax
je 0x4579
movq %rax, %r15
movl $0x800, %edi            # imm = 0x800
callq 0x486c
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x4579
movq %rax, %r12
andl $0x0, 0x10(%r15)
movl %ebp, (%r15)
andq $0x0, 0x18(%r15)
movq 0x10(%rsp), %rax
testq %rax, %rax
movq %r13, 0x8(%rsp)
je 0x4400
movq %r15, 0x18(%rax)
jmp 0x4400
movq %r13, 0x8(%rsp)
movq 0x5f91(%rip), %rax      # 0xa398
testq %rax, %rax
cmoveq %r15, %rax
movq %rax, 0x5f83(%rip)      # 0xa398
movl 0x10(%r15), %r13d
movq %r12, %rdi
movl %r13d, %esi
callq 0x458a
orl %r13d, %eax
jne 0x4440
movl (%r15), %edi
movl $0x800, %edx            # imm = 0x800
movq %r12, %rsi
callq 0x1050
movq %rax, %r13
movl %r13d, 0x10(%r15)
leaq 0x8(%r15), %r12
testl %r13d, %r13d
jle 0x454c
pushq $0x1
popq %rbx
movq (%r12), %r14
movq %r14, %rdi
movl %r13d, %esi
callq 0x458a
movl %eax, %ebp
testl %ebx, %ebx
jle 0x44c3
cmpl %r13d, %ebp
jl 0x44c3
leal 0x800(%r13), %eax
movslq %eax, %rdi
callq 0x1060
testq %rax, %rax
je 0x4547
movq %rax, %rbx
movslq %r13d, %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x4814
movq %r12, %rdi
callq 0x48a0
movq %rbx, 0x8(%r15)
movslq 0x10(%r15), %rsi
addq %rbx, %rsi
movl (%r15), %edi
movl $0x800, %edx            # imm = 0x800
callq 0x1050
movq %rax, %rbx
movl 0x10(%r15), %r13d
addl %ebx, %r13d
movl %r13d, 0x10(%r15)
jmp 0x4450
leal 0x1(%rbp), %eax
movslq %eax, %r13
movq %r13, %rdi
callq 0x1060
testq %rax, %rax
je 0x4547
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
callq 0x3ed0
movq 0x8(%r15), %rsi
movslq %ebp, %rdx
movq %rbx, %rdi
callq 0x4814
movq 0x8(%rsp), %rax
movq %rbx, (%rax)
notl %ebp
addl 0x10(%r15), %ebp
testl %ebp, %ebp
movl $0x800, %eax            # imm = 0x800
cmovgl %ebp, %eax
movslq %eax, %rdi
callq 0x1060
testq %rax, %rax
pushq $-0x1
popq %rbx
je 0x4579
movq %rax, %r14
testl %ebp, %ebp
jle 0x4533
addq (%r12), %r13
movl %ebp, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x4814
movq %r12, %rdi
callq 0x48a0
movl %ebp, 0x10(%r15)
movq %r14, 0x8(%r15)
pushq $0x1
jmp 0x4549
pushq $-0x1
popq %rbx
jmp 0x4579
cmpq $0x0, (%r12)
je 0x4568
movq %r12, %rdi
callq 0x48a0
movl 0x10(%r15), %r13d
testl %r13d, %r13d
jg 0x444d
andq $0x0, (%r12)
xorl %ebx, %ebx
negl %r13d
sbbl %ebx, %ebx
jmp 0x4579
movl %r14d, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq