// File: 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
subq $0x410, %rsp            # imm = 0x410
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x390(%rbp)
movq 0x40(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x14943
movq $0x0, -0x8(%rbp)
jmp 0x15088
movq -0x390(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x391(%rbp)
je 0x1497b
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x5090
cmpl $0x0, %eax
setne %al
movb %al, -0x391(%rbp)
movb -0x391(%rbp), %al
testb $0x1, %al
jne 0x14987
jmp 0x14995
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x14952
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x149c4
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x149c4
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %edi
callq 0x5090
cmpl $0x0, %eax
je 0x14b07
movq -0x390(%rbp), %rax
movl 0x28(%rax), %edx
leaq 0x21124(%rip), %rsi     # 0x35af9
xorl %eax, %eax
leaq -0x220(%rbp), %rdi
callq 0x50b0
movb $0x1, -0x272(%rbp)
movl $0x28, %edi
callq 0x51e0
movq -0x390(%rbp), %rsi
movq %rax, -0x3a0(%rbp)
leaq -0x240(%rbp), %rdi
callq 0xef70
jmp 0x14a10
leaq -0x271(%rbp), %rdi
movq %rdi, -0x3a8(%rbp)
callq 0x5760
movq -0x3a8(%rbp), %rdx
leaq -0x270(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x55b0
jmp 0x14a3f
movq -0x3a0(%rbp), %rdi
leaq 0x2110f(%rip), %rcx     # 0x35b5c
xorl %eax, %eax
movl %eax, %r8d
leaq -0x240(%rbp), %rsi
leaq -0x270(%rbp), %rdx
callq 0xe310
jmp 0x14a67
movq -0x3a0(%rbp), %rdi
movb $0x0, -0x272(%rbp)
leaq 0x37ecc(%rip), %rsi     # 0x4c948
leaq -0x5f93(%rip), %rdx     # 0xeaf0
callq 0x5700
jmp 0x150a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x14aeb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x14ad3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x5250
leaq -0x271(%rbp), %rdi
callq 0x5460
leaq -0x240(%rbp), %rdi
callq 0x5250
testb $0x1, -0x272(%rbp)
jne 0x14af6
jmp 0x14b02
movq -0x3a0(%rbp), %rdi
callq 0x52d0
jmp 0x15095
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x3a9(%rbp)
je 0x14b53
movq -0x280(%rbp), %rax
movsbl (%rax), %edi
callq 0x5090
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x3a9(%rbp)
movb -0x3a9(%rbp), %al
testb $0x1, %al
jne 0x14b5f
jmp 0x14b73
movq -0x280(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x280(%rbp)
jmp 0x14b22
movq -0x280(%rbp), %rax
cmpb $0x0, (%rax)
je 0x14be8
movq -0x280(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x280(%rbp)
movb $0x0, (%rax)
movq -0x280(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x3aa(%rbp)
je 0x14bc6
movq -0x280(%rbp), %rax
movsbl (%rax), %edi
callq 0x5090
cmpl $0x0, %eax
setne %al
movb %al, -0x3aa(%rbp)
movb -0x3aa(%rbp), %al
testb $0x1, %al
jne 0x14bd2
jmp 0x14be6
movq -0x280(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x280(%rbp)
jmp 0x14b97
jmp 0x14be8
movq -0x18(%rbp), %rax
movq %rax, -0x3c0(%rbp)
leaq -0x2a1(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x5760
movq -0x3c0(%rbp), %rsi
movq -0x3b8(%rbp), %rdx
leaq -0x2a0(%rbp), %rdi
callq 0x55b0
jmp 0x14c22
leaq -0x2a1(%rbp), %rdi
callq 0x5460
movq -0x280(%rbp), %rax
movq %rax, -0x3d0(%rbp)
leaq -0x2c9(%rbp), %rdi
movq %rdi, -0x3c8(%rbp)
callq 0x5760
movq -0x3d0(%rbp), %rsi
movq -0x3c8(%rbp), %rdx
leaq -0x2c8(%rbp), %rdi
callq 0x55b0
jmp 0x14c6b
leaq -0x2c9(%rbp), %rdi
callq 0x5460
leaq -0x2f0(%rbp), %rdi
callq 0x55d0
movq -0x390(%rbp), %rdi
movl $0x1, %esi
callq 0x1bf60
movq %rax, -0x3d8(%rbp)
jmp 0x14c9d
movq -0x3d8(%rbp), %rax
cmpq $0x0, %rax
je 0x14e6d
movq -0x390(%rbp), %rax
movq 0x40(%rax), %rcx
movq %rcx, -0x3e0(%rbp)
movq 0x40(%rax), %rdi
callq 0x51b0
movq %rax, %rcx
movq -0x3e0(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x2f8(%rbp)
movq -0x2f8(%rbp), %rax
movsbl -0x1(%rax), %edi
callq 0x5090
cmpl $0x0, %eax
je 0x14d63
movq -0x2f8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x2f8(%rbp)
jmp 0x14cdd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x2a1(%rbp), %rdi
callq 0x5460
jmp 0x15095
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x2c9(%rbp), %rdi
callq 0x5460
jmp 0x1507a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x15062
movq -0x390(%rbp), %rax
movq -0x2f8(%rbp), %rcx
movb $0x0, (%rcx)
movq 0x40(%rax), %rax
movq %rax, -0x2f8(%rbp)
movq -0x2f8(%rbp), %rax
movsbl (%rax), %edi
callq 0x5090
cmpl $0x0, %eax
je 0x14da7
movq -0x2f8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2f8(%rbp)
jmp 0x14d7f
movq -0x2f8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
jne 0x14dbb
jmp 0x14e6d
movq -0x2f8(%rbp), %rax
movq %rax, -0x3f0(%rbp)
leaq -0x319(%rbp), %rdi
movq %rdi, -0x3e8(%rbp)
callq 0x5760
movq -0x3f0(%rbp), %rsi
movq -0x3e8(%rbp), %rdx
leaq -0x318(%rbp), %rdi
callq 0x55b0
jmp 0x14df8
leaq -0x2f0(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0x5520
jmp 0x14e0d
leaq -0x318(%rbp), %rdi
callq 0x5250
leaq -0x319(%rbp), %rdi
callq 0x5460
jmp 0x14c83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x14e5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x318(%rbp), %rdi
callq 0x5250
leaq -0x319(%rbp), %rdi
callq 0x5460
jmp 0x15062
leaq -0x2f0(%rbp), %rdi
callq 0x52c0
cmpq $0x0, %rax
jne 0x14eea
movq 0x38162(%rip), %rdi     # 0x4cfe8
leaq 0x20d3e(%rip), %rsi     # 0x35bcb
callq 0x53f0
movq %rax, -0x3f8(%rbp)
jmp 0x14e9b
movq -0x3f8(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x5360
movq %rax, -0x400(%rbp)
jmp 0x14eb7
movq -0x400(%rbp), %rdi
leaq 0x2095b(%rip), %rsi     # 0x35820
callq 0x53f0
movq %rax, -0x408(%rbp)
jmp 0x14ed3
movq -0x408(%rbp), %rdi
movq 0x380af(%rip), %rsi     # 0x4cf90
callq 0x5440
jmp 0x14ee8
jmp 0x14eea
movq -0x390(%rbp), %rax
movq 0x30(%rax), %rcx
incq %rcx
movq %rcx, 0x30(%rax)
movl $0x68, %edi
callq 0x5410
movq %rax, -0x410(%rbp)
jmp 0x14f0f
movb $0x1, -0x381(%rbp)
leaq -0x340(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x51a0
jmp 0x14f2b
leaq -0x360(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x51a0
jmp 0x14f40
leaq -0x380(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x2ee10
jmp 0x14f55
movq -0x410(%rbp), %rdi
leaq -0x340(%rbp), %rsi
leaq -0x360(%rbp), %rdx
leaq -0x380(%rbp), %rcx
callq 0x1c1d0
jmp 0x14f78
movq -0x410(%rbp), %rax
movb $0x0, -0x381(%rbp)
movq %rax, -0x8(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x1c280
leaq -0x360(%rbp), %rdi
callq 0x5250
leaq -0x340(%rbp), %rdi
callq 0x5250
leaq -0x2f0(%rbp), %rdi
callq 0x5250
leaq -0x2c8(%rbp), %rdi
callq 0x5250
leaq -0x2a0(%rbp), %rdi
callq 0x5250
jmp 0x15088
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x15049
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x1503d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
jmp 0x15031
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x248(%rbp)
movl %eax, -0x24c(%rbp)
leaq -0x380(%rbp), %rdi
callq 0x1c280
leaq -0x360(%rbp), %rdi
callq 0x5250
leaq -0x340(%rbp), %rdi
callq 0x5250
testb $0x1, -0x381(%rbp)
jne 0x15054
jmp 0x15060
movq -0x410(%rbp), %rdi
callq 0x53a0
jmp 0x15062
leaq -0x2f0(%rbp), %rdi
callq 0x5250
leaq -0x2c8(%rbp), %rdi
callq 0x5250
leaq -0x2a0(%rbp), %rdi
callq 0x5250
jmp 0x15095
movq -0x8(%rbp), %rax
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
movq -0x248(%rbp), %rdi
callq 0x5750
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)