// File: /workspace/github_cpp_makefile_star2_O1/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 0x7256
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 0x72db
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(%r14), %r13
cmpq %r13, 0x8(%r12)
jne 0x7360
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%r15,%rax)
je 0x7420
movq 0x39e18(%rip), %rdi     # 0x40ff0
leaq 0x2be7b(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x39df9(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2bfa3(%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 0x73e0
movq 0x39d93(%rip), %rdi     # 0x40ff0
leaq 0x2bdf6(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x39d74(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2be3c(%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 0x73e0
movq 0x39d0e(%rip), %rdi     # 0x40ff0
leaq 0x2bd71(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x39cef(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2bdfd(%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 0x73e0
movq 0x39c89(%rip), %rdi     # 0x40ff0
leaq 0x2bcec(%rip), %rsi     # 0x3305a
movl $0x7, %edx
callq 0x5420
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0x39c6a(%rip), %rdi     # 0x40ff0
callq 0x5420
movq %rax, %rbx
leaq 0x2bdc1(%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 0x740f
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 %r13, %r13
je 0x7445
movq (%r14), %r14
xorl %ebx, %ebx
xorl %r15d, %r15d
movsbl (%r14,%r15), %edi
callq 0x56d0
movb %al, (%r14,%r15)
incq %r15
cmpq %r15, %r13
jne 0x742d
jmp 0x73f8
xorl %ebx, %ebx
jmp 0x73f8
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7463
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x56a0