// File: /workspace/github_cpp_makefile_star2_O3/simonrharris[P]SKA/src/DNA.cpp
// Function: readNextFastqSequence(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 readNextFastqSequence(igzstream & gzfileStream, const std::string & filename, std::string & sequence, std::string & quality){
	std::string line;
	line.reserve(1000);
	if (gzfileStream.peek()!='@'){
		std::cerr << "Error: " << filename << " is not in the correct format. Expecting header line to start with @." << std::endl << std::endl;
		return 1;
	}
  	getline(gzfileStream, line);
  	getline(gzfileStream, sequence);
  	if (gzfileStream.peek()!='+'){
		std::cerr << "Error: " << filename << " is not in the correct format. Expecting separator line to start with +." << std::endl << std::endl;
		return 1;
	}
  	getline(gzfileStream, line);
  	getline(gzfileStream, quality);
  	if (quality.length()!=sequence.length()){
  		std::cerr << "Error: " << filename << " is not in the correct format. Sequence and quality lines must be of equal length." << std::endl << std::endl;
		return 1;
  	}
	if (gzfileStream.fail()){
		std::cerr << "Error: " << filename << " is not in the correct format. Expecting a multiple of 4 lines." << std::endl << std::endl;
		return 1;
	}
	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 $0x28, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
leaq 0x8(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x55f0
leaq 0x188(%r15), %r13
movq %r13, %rdi
callq 0x5140
cmpl $0x40, %eax
jne 0x7224
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %edx
leaq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x56c0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x56c0
movq %r13, %rdi
callq 0x5140
cmpl $0x2b, %eax
jne 0x72a9
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %edx
leaq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x56c0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x56c0
movq 0x8(%r12), %r12
cmpq 0x8(%r14), %r12
jne 0x732e
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r15,%rax)
je 0x73ee
movq 0x39e4a(%rip), %rdi     # 0x40ff0
leaq 0x2bead(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x39e2b(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2bfd5(%rip), %rsi     # 0x331a9
movl $0x3f, %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
jmp 0x73ae
movq 0x39dc5(%rip), %rdi     # 0x40ff0
leaq 0x2be28(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x39da6(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2be6e(%rip), %rsi     # 0x330c7
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
jmp 0x73ae
movq 0x39d40(%rip), %rdi     # 0x40ff0
leaq 0x2bda3(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x39d21(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2be2f(%rip), %rsi     # 0x3310d
movl $0x48, %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
jmp 0x73ae
movq 0x39cbb(%rip), %rdi     # 0x40ff0
leaq 0x2bd1e(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x39c9c(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2bdf3(%rip), %rsi     # 0x33156
movl $0x52, %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
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x73dd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53c0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r12, %r12
je 0x7413
movq (%r14), %r14
xorl %ebx, %ebx
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x56d0
movb %al, (%r14,%r15)
incq %r15
cmpq %r15, %r12
jne 0x73fb
jmp 0x73c6
xorl %ebx, %ebx
jmp 0x73c6
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7431
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x56a0