// File: /workspace/github_cpp_makefile_star2_O3/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 0x6d5f
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 0x6dfc
movq %r12, %rdi
callq 0x5140
cmpl $0x3e, %eax
je 0x6dfc
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 0x6d07
movq 0x3a28a(%rip), %rdi     # 0x40ff0
leaq 0x2c2ed(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x3a26b(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2c2ce(%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 0x7014
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r15,%rax)
je 0x6e94
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x3a1d3(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2c27c(%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 0x6ff6
movq (%rbx), %r15
movq 0x8(%rbx), %rax
leaq (%r15,%rax), %r14
movq %rax, %rbp
sarq $0x2, %rbp
movq %r15, %r13
testq %rbp, %rbp
jle 0x6f07
andq $-0x4, %rax
movq %rax, %r13
addq %r15, %r13
incq %rbp
leaq 0x3(%r15), %r12
movsbl -0x3(%r12), %edi
callq 0x5070
testl %eax, %eax
jne 0x6f4c
movsbl -0x2(%r12), %edi
callq 0x5070
testl %eax, %eax
jne 0x6f52
movsbl -0x1(%r12), %edi
callq 0x5070
testl %eax, %eax
jne 0x6f58
movsbl (%r12), %edi
callq 0x5070
testl %eax, %eax
jne 0x6f5b
decq %rbp
addq $0x4, %r12
cmpq $0x1, %rbp
jg 0x6ebf
movq %r14, %rax
subq %r13, %rax
cmpq $0x1, %rax
je 0x6f62
cmpq $0x2, %rax
leaq 0x10(%rsp), %rbp
je 0x6f39
cmpq $0x3, %rax
jne 0x6fb9
movsbl (%r13), %edi
callq 0x5070
testl %eax, %eax
jne 0x6f77
incq %r13
movsbl (%r13), %edi
callq 0x5070
testl %eax, %eax
jne 0x6f77
incq %r13
jmp 0x6f67
addq $-0x3, %r12
jmp 0x6f5b
addq $-0x2, %r12
jmp 0x6f5b
decq %r12
leaq 0x10(%rsp), %rbp
jmp 0x6f7a
leaq 0x10(%rsp), %rbp
movsbl (%r13), %edi
callq 0x5070
testl %eax, %eax
cmoveq %r14, %r13
movq %r13, %r12
cmpq %r14, %r12
sete %al
leaq 0x1(%r12), %r13
cmpq %r14, %r13
sete %cl
orb %al, %cl
jne 0x6fbc
movb (%r13), %bpl
movsbl %bpl, %edi
callq 0x5070
testl %eax, %eax
jne 0x6fa7
movb %bpl, (%r12)
incq %r12
incq %r13
cmpq %r14, %r13
jne 0x6f8f
movq (%rbx), %r15
leaq 0x10(%rsp), %rbp
jmp 0x6fbc
movq %r14, %r12
movq %r12, %rax
subq %r15, %rax
movq %rax, 0x8(%rbx)
movb $0x0, (%r12)
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x6ff4
movq (%rbx), %r15
xorl %ebx, %ebx
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x56d0
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %r14
jne 0x6fdc
jmp 0x6ff6
xorl %ebx, %ebx
movq 0x39f8b(%rip), %rsi     # 0x40f88
leaq 0x20(%rsp), %rdi
callq 0x52c0
leaq 0xa0(%rsp), %rdi
callq 0x5120
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x702a
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 0x7042
jmp 0x7047
movq %rax, %rbx
jmp 0x7068
movq %rax, %rbx
movq 0x39f37(%rip), %rsi     # 0x40f88
leaq 0x20(%rsp), %rdi
callq 0x52c0
leaq 0xa0(%rsp), %rdi
callq 0x5120
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x707e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x56a0