// File: /workspace/github_cpp_makefile_star2_O2/CK7[P]abawaca/src/SeqIORead_fasta.h
// Function: Bio::SeqIORead_fasta<Bio::Sequence<Bio::DNAString>>::next_seq()
S* SeqIORead_fasta<S>::next_seq()
{
	// If reached EOF - return
	if(this->m_next_line[0] == 0)
		return NULL;

	char	*pdisplay_id = this->m_next_line;
	while(*pdisplay_id && isspace(*pdisplay_id))
		pdisplay_id++;
	if((*pdisplay_id != '>') || (*(pdisplay_id+1) == 0) || isspace(*(pdisplay_id+1)))
	{
		char msg[512];
		sprintf(msg, "Was expeecting a header line for the next sequence in a fasta file but got something else, line %u", (unsigned int)this->m_line_num);
		throw Bio::Bad_file(this->file_name(), msg, __PRETTY_FUNCTION__);
	}
	pdisplay_id++;
	char *pdesc = pdisplay_id+1;

	while(*pdesc && !isspace(*pdesc))
		pdesc++;
	if(*pdesc) {
		// Set the end of the sequence name
		*(pdesc++) = 0;
		// Skip the spaces to the beginning of the description (if exists)
		while(*pdesc && isspace(*pdesc))
			pdesc++;
	}

	string	display_id(pdisplay_id), description(pdesc), sequence;
	
	// Now we are ready to read the sequence itself 
	while(this->getline(true)) {
		// Trim before and after
		char *p = this->m_next_line+strlen(this->m_next_line);	// Get p to the \0 at the end of the string
		while(isspace(*(p-1)))
			p--;
		*p = 0;
		p = this->m_next_line;
		while(isspace(*p))
			p++;
		// If this is true - we reached the next entry
		if(*p == '>')
			break;
		sequence += string(p);
	}

	if(sequence.size() == 0) {
		cerr << "Warning: sequence " << display_id << " is empty" << endl;
	}

	this->m_seq_num++;
	return new S(display_id, description, sequence);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq 0x40(%rdi), %r14
movb (%r14), %r15b
testb %r15b, %r15b
je 0x9fd0
movq %rdi, %rbx
incq %r14
testb %r15b, %r15b
je 0xa1ad
movsbl %r15b, %edi
callq 0x4060
testl %eax, %eax
je 0x9f93
movb (%r14), %r15b
jmp 0x9f75
cmpb $0x3e, %r15b
jne 0xa1ad
movsbl (%r14), %edi
testl %edi, %edi
je 0xa1ad
callq 0x4060
testl %eax, %eax
jne 0xa1ad
leaq 0x1(%r14), %r15
movsbl (%r15), %edi
testl %edi, %edi
je 0x9ff9
callq 0x4060
testl %eax, %eax
jne 0x9fd8
incq %r15
jmp 0x9fba
xorl %r14d, %r14d
jmp 0xa198
movb $0x0, (%r15)
incq %r15
movq %r15, %rcx
movq %rcx, %r15
movsbl (%rcx), %edi
testl %edi, %edi
je 0x9ff9
callq 0x4060
leaq 0x1(%r15), %rcx
testl %eax, %eax
jne 0x9fe2
leaq -0x330(%rbp), %rdi
leaq -0x70(%rbp), %rdx
movq %r14, %rsi
callq 0x4140
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
movq %r15, %rsi
callq 0x4140
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
pushq $0x1
popq %r14
leaq -0x130(%rbp), %r15
movq %rbx, %rdi
movl %r14d, %esi
callq 0xbe40
testq %rax, %rax
je 0xa0b7
movq 0x40(%rbx), %r12
movq %r12, %rdi
callq 0x4160
addq %rax, %r12
incq %r12
movsbl -0x2(%r12), %edi
callq 0x4060
decq %r12
testl %eax, %eax
jne 0xa059
movb $0x0, (%r12)
movq 0x40(%rbx), %r12
decq %r12
movb 0x1(%r12), %r13b
incq %r12
movsbl %r13b, %edi
callq 0x4060
testl %eax, %eax
jne 0xa077
cmpb $0x3e, %r13b
je 0xa0b7
movq %r15, %rdi
movq %r12, %rsi
leaq -0x29(%rbp), %rdx
callq 0x4140
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x4730
movq %r15, %rdi
callq 0x4180
jmp 0xa037
cmpq $0x0, -0x48(%rbp)
jne 0xa0f7
movq 0x14f23(%rip), %rdi     # 0x1efe8
leaq 0xbac8(%rip), %rsi      # 0x15b94
callq 0x4340
leaq -0x330(%rbp), %rsi
movq %rax, %rdi
callq 0x42d0
leaq 0xb702(%rip), %rsi      # 0x157e9
movq %rax, %rdi
callq 0x4340
movq %rax, %rdi
callq 0x41a0
incq 0x30(%rbx)
pushq $0x68
popq %rdi
callq 0x4360
movq %rax, %r14
leaq -0xd0(%rbp), %rdi
leaq -0x330(%rbp), %rsi
callq 0x44d0
leaq -0xb0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x44d0
leaq -0x90(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x123fc
leaq -0xd0(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq -0x90(%rbp), %rcx
movq %r14, %rdi
callq 0xbf74
leaq -0x90(%rbp), %rdi
callq 0x4180
leaq -0xb0(%rbp), %rdi
callq 0x4180
leaq -0xd0(%rbp), %rdi
callq 0x4180
leaq -0x50(%rbp), %rdi
callq 0x4180
leaq -0x70(%rbp), %rdi
callq 0x4180
leaq -0x330(%rbp), %rdi
callq 0x4180
movq %r14, %rax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x28(%rbx), %edx
leaq 0xb90b(%rip), %rsi      # 0x15ac2
leaq -0x330(%rbp), %rdi
xorl %eax, %eax
callq 0x4080
pushq $0x28
popq %rdi
callq 0x41b0
movq %rax, %r14
addq $0x8, %rbx
leaq -0x110(%rbp), %rdi
movq %rbx, %rsi
callq 0x44d0
leaq -0xf0(%rbp), %rdi
leaq -0x330(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x4140
movb $0x1, %r15b
leaq 0xb921(%rip), %rcx      # 0x15b25
leaq -0x110(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
movq %r14, %rdi
xorl %r8d, %r8d
callq 0x7c52
xorl %r15d, %r15d
leaq 0x14769(%rip), %rsi     # 0x1e990
leaq -0x215e(%rip), %rdx     # 0x80d0
movq %r14, %rdi
callq 0x4620
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x4180
jmp 0xa24a
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x4180
jmp 0xa25b
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x4180
jmp 0xa26c
movq %rax, %rbx
movq %r14, %rdi
callq 0x4310
jmp 0xa2c2
movq %rax, %rbx
jmp 0xa2d4
movq %rax, %rbx
jmp 0xa2ed
jmp 0xa2bf
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x4180
jmp 0xa299
movq %rax, %rbx
movb $0x1, %r15b
leaq -0x110(%rbp), %rdi
callq 0x4180
testb %r15b, %r15b
jne 0xa2e5
jmp 0xa2ed
jmp 0xa2bf
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
callq 0x4180
jmp 0xa2c2
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x4180
leaq -0x70(%rbp), %rdi
callq 0x4180
leaq -0x330(%rbp), %rdi
callq 0x4180
jmp 0xa2ed
movq %rax, %rbx
movq %r14, %rdi
callq 0x4260
movq %rbx, %rdi
callq 0x4660
nop