// File: /workspace/github_cpp_makefile_star2_O1/simonrharris[P]SKA/src/DNA.cpp
// Function: readNextFastaSequence(igzstream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int readNextFastaSequence(igzstream & gzfileStream, const std::string & filename, std::string & name, std::string & sequence){
	std::string line;
	line.reserve(10000);
	if (gzfileStream.get()!='>'){//check the fist character is a > and remove it
		std::cerr << "Error: " << filename << " is not in the correct format. Expecting header line to start with >." << std::endl << std::endl;
		return 1;
	}
  	std::getline(gzfileStream, line);//read the rest of the headerline
  	std::stringstream headerstream;
	headerstream << line;//convert the sequence to stringstream
	std::getline(headerstream, name, ' ');
  	while (gzfileStream.peek()!=EOF && gzfileStream.peek()!='>'){//read the sequence
  		std::getline(gzfileStream, line);
  		sequence.append(line);
  	}
	if (gzfileStream.fail()){
		std::cerr << filename << " is not in the correct format." << std::endl << std::endl;
		return 1;
	}
	sequence.erase(std::remove_if( sequence.begin(), sequence.end(), ::isspace ), sequence.end() );//remove any gaps from the sequence
	std::transform(sequence.begin(), sequence.end(), sequence.begin(), ::toupper);//change all letters in the string to upper case
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
movq %rsp, %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x55f0
leaq 0x188(%r15), %r12
movq %r12, %rdi
callq 0x5460
cmpl $0x3e, %eax
jne 0x6da5
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %edx
movq %rsp, %rsi
movq %r12, %rdi
callq 0x56c0
leaq 0x20(%rsp), %rdi
callq 0x5280
leaq 0x30(%rsp), %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x5420
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movl $0x20, %edx
callq 0x56c0
movq %rsp, %r13
movq %r12, %rdi
callq 0x5140
cmpl $-0x1, %eax
je 0x6e42
movq %r12, %rdi
callq 0x5140
cmpl $0x3e, %eax
je 0x6e42
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x56c0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x5110
jmp 0x6d4d
movq 0x3a244(%rip), %rdi     # 0x40ff0
leaq 0x2c2a7(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x3a225(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2c288(%rip), %rsi     # 0x33062
movl $0x45, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movl $0x1, %ebx
movq %rax, %rdi
callq 0x5250
jmp 0x7046
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r15,%rax)
je 0x6eda
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x3a18d(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2c236(%rip), %rsi     # 0x330a8
movl $0x1e, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movl $0x1, %ebx
movq %rax, %rdi
callq 0x5250
jmp 0x7028
movq (%rbx), %r12
movq 0x8(%rbx), %rbp
leaq (%r12,%rbp), %r14
movq %rbp, %r13
sarq $0x2, %r13
testq %r13, %r13
jle 0x6f51
andq $-0x4, %rbp
addq %r12, %rbp
incq %r13
addq $0x3, %r12
movq %r12, %r15
movsbl -0x3(%r15), %edi
callq 0x5070
testl %eax, %eax
jne 0x6fa3
movsbl -0x2(%r15), %edi
callq 0x5070
testl %eax, %eax
jne 0x6fa9
movsbl -0x1(%r15), %edi
callq 0x5070
testl %eax, %eax
jne 0x6faf
movsbl (%r15), %edi
callq 0x5070
testl %eax, %eax
jne 0x6fb2
decq %r13
addq $0x4, %r15
cmpq $0x1, %r13
jg 0x6f02
movq %rbp, %r12
movq %r14, %rax
subq %r12, %rax
cmpq $0x1, %rax
je 0x6f8e
cmpq $0x2, %rax
je 0x6f7d
movq %r14, %r15
cmpq $0x3, %rax
jne 0x6fb2
movsbl (%r12), %edi
callq 0x5070
testl %eax, %eax
jne 0x6f9e
incq %r12
movsbl (%r12), %edi
callq 0x5070
testl %eax, %eax
jne 0x6f9e
incq %r12
movsbl (%r12), %edi
callq 0x5070
testl %eax, %eax
cmoveq %r14, %r12
movq %r12, %r15
jmp 0x6fb2
addq $-0x3, %r15
jmp 0x6fb2
addq $-0x2, %r15
jmp 0x6fb2
decq %r15
cmpq %r14, %r15
sete %al
leaq 0x1(%r15), %r12
cmpq %r14, %r12
sete %cl
orb %al, %cl
jne 0x6fe5
movb (%r12), %bpl
movsbl %bpl, %edi
callq 0x5070
testl %eax, %eax
jne 0x6fdd
movb %bpl, (%r15)
incq %r15
incq %r12
cmpq %r14, %r12
jne 0x6fc6
movq %r15, %rax
subq (%rbx), %rax
movq %rax, 0x8(%rbx)
movb $0x0, (%r15)
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x7021
movq (%rbx), %r15
xorl %ebx, %ebx
xorl %r12d, %r12d
leaq 0x10(%rsp), %rbp
movsbl (%r15,%r12), %edi
callq 0x56d0
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %r14
jne 0x7009
jmp 0x7028
xorl %ebx, %ebx
leaq 0x10(%rsp), %rbp
movq 0x39f59(%rip), %rsi     # 0x40f88
leaq 0x20(%rsp), %rdi
callq 0x52c0
leaq 0xa0(%rsp), %rdi
callq 0x5120
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x705c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53c0
movl %ebx, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7074
jmp 0x7079
movq %rax, %rbx
jmp 0x709a
movq %rax, %rbx
movq 0x39f05(%rip), %rsi     # 0x40f88
leaq 0x20(%rsp), %rdi
callq 0x52c0
leaq 0xa0(%rsp), %rdi
callq 0x5120
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x70b0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x56a0