// File: CK7[P]abawaca/src/SeqIORead.h
// Function: Bio::SeqIORead<Bio::Sequence<Bio::DNAString>>::getline(bool)
char* SeqIORead<S>::getline(bool skip_empty/*=false*/)
{
	if(feof(this->m_fp))
		return NULL;

	do {
		this->m_next_line[0] = 0;
		// We do the following because we don't know whether the size of next_line is sufficient for storing the next line.
		// If not we will increase the size of next_line until we have enough space. Eventually next_line will be able to
		// store the longest line in the file.
		char    *p = this->m_next_line;
		size_t  s = this->m_next_line_size;
		while(fgets(p, s, this->m_fp)) {
			if((*(p+strlen(p)-1) == '\n') || feof(this->m_fp))
				break;
			if(strlen(p) != s-1) {
				// This is weird!
			}
			// Else - we did not read the whole line, need to increase next_line's size and continue reading
			this->m_next_line_size *= 2;
			this->m_next_line = (char*)realloc(this->m_next_line, this->m_next_line_size);
			p = this->m_next_line+strlen(this->m_next_line);
			s = this->m_next_line_size - strlen(this->m_next_line);
		}
		p = this->m_next_line;
		while(*p && isspace(*p))
			p++;
		// If we reached the end of the line and everything we saw is just spaces...
		if(!(*p) && skip_empty)
			this->m_next_line[0] = 0;
		this->m_line_num++;
	} while((this->m_next_line[0] == 0) && !feof(this->m_fp));

	if(m_next_line[0] == 0)
		return NULL;
	return m_next_line;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq 0x38(%rax), %rdi
callq 0x5660
cmpl $0x0, %eax
je 0x1bf97
movq $0x0, -0x8(%rbp)
jmp 0x1c162
jmp 0x1bf99
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rcx
movb $0x0, (%rcx)
movq 0x40(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rcx
movl %ecx, %esi
movq 0x38(%rax), %rdx
callq 0x5690
cmpq $0x0, %rax
je 0x1c094
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x51b0
movq %rax, %rcx
movq -0x38(%rbp), %rax
movsbl -0x1(%rax,%rcx), %eax
cmpl $0xa, %eax
je 0x1c009
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x5660
cmpl $0x0, %eax
je 0x1c00e
jmp 0x1c094
movq -0x20(%rbp), %rdi
callq 0x51b0
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
je 0x1c026
jmp 0x1c026
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rcx
shlq %rcx
movq %rcx, 0x48(%rax)
movq 0x40(%rax), %rdi
movq 0x48(%rax), %rsi
callq 0x56d0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movq 0x40(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x40(%rax), %rdi
callq 0x51b0
movq -0x48(%rbp), %rcx
movq %rax, %rdx
movq -0x30(%rbp), %rax
addq %rdx, %rcx
movq %rcx, -0x20(%rbp)
movq 0x48(%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x40(%rax), %rdi
callq 0x51b0
movq %rax, %rcx
movq -0x40(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x28(%rbp)
jmp 0x1bfb4
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x49(%rbp)
je 0x1c0c3
movq -0x20(%rbp), %rax
movsbl (%rax), %edi
callq 0x5090
cmpl $0x0, %eax
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x1c0cc
jmp 0x1c0da
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1c0a0
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x1c0f4
testb $0x1, -0x11(%rbp)
je 0x1c0f4
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movb $0x0, (%rax)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x4a(%rbp)
jne 0x1c131
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x5660
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
testb $0x1, %al
jne 0x1bf99
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1c156
movq $0x0, -0x8(%rbp)
jmp 0x1c162
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)