// File: /workspace/github_c_makefile_star2_O0/OpenGene[P]pecheck/src/fastqreader.cpp
// Function: FastqReader::getLine[abi:cxx11]()
string FastqReader::getLine(){
	int copied = 0;

	int start = mBufUsedLen;
	int end = start;

	while(end < mBufDataLen) {
		if(mBuf[end] != '\r' && mBuf[end] != '\n')
			end++;
		else
			break;
	}

	// this line well contained in this buf, or this is the last buf
	if(end < mBufDataLen || mBufDataLen < FQ_BUF_SIZE) {
		int len = end - start;
		string line(mBuf+start, len);

		// skip \n or \r
		end++;
		// handle \r\n
		if(end < mBufDataLen-1 && mBuf[end] == '\n')
			end++;

		mBufUsedLen = end;

		return line;
	}

	// this line is not contained in this buf, we need to read new buf
	string str(mBuf+start, mBufDataLen - start);

	while(true) {
		readToBuf();
		start = 0;
		end = 0;
		while(end < mBufDataLen) {
			if(mBuf[end] != '\r' && mBuf[end] != '\n')
				end++;
			else
				break;
		}
		// this line well contained in this buf, we need to read new buf
		if(end < mBufDataLen || mBufDataLen < FQ_BUF_SIZE) {
			int len = end - start;
			str.append(mBuf+start, len);

			// skip \n or \r
			end++;
			// handle \r\n
			if(end < mBufDataLen-1 && mBuf[end] == '\n')
				end++;

			mBufUsedLen = end;

			return str;
		}
		// even this new buf is not enough, although impossible
		str.append(mBuf+start, mBufDataLen);
	}

	return string();
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x30(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x40(%rsp)
movl $0x0, 0x94(%rsp)
movl 0x44(%rax), %eax
movl %eax, 0x90(%rsp)
movl 0x90(%rsp), %eax
movl %eax, 0x8c(%rsp)
movq 0x40(%rsp), %rcx
movl 0x8c(%rsp), %eax
cmpl 0x40(%rcx), %eax
jge 0x5080
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x8c(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xd, %eax
je 0x507c
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x8c(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
je 0x507c
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x507e
jmp 0x5080
jmp 0x5024
movq 0x40(%rsp), %rcx
movl 0x8c(%rsp), %eax
cmpl 0x40(%rcx), %eax
jl 0x50a3
movq 0x40(%rsp), %rax
cmpl $0x100000, 0x40(%rax)   # imm = 0x100000
jge 0x51c6
movq 0x40(%rsp), %rax
movl 0x8c(%rsp), %ecx
movl 0x90(%rsp), %edx
subl %edx, %ecx
movl %ecx, 0x88(%rsp)
movb $0x0, 0x87(%rsp)
movq 0x38(%rax), %rax
movslq 0x90(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movslq 0x88(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x86(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x46b0
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x4420
jmp 0x5115
leaq 0x86(%rsp), %rdi
callq 0x43e0
movq 0x40(%rsp), %rcx
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
movl 0x8c(%rsp), %eax
movl 0x40(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x5196
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x8c(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x5196
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x5196
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x86(%rsp), %rdi
callq 0x43e0
jmp 0x53ee
movq 0x40(%rsp), %rax
movl 0x8c(%rsp), %ecx
movl %ecx, 0x44(%rax)
movb $0x1, 0x87(%rsp)
testb $0x1, 0x87(%rsp)
jne 0x51c1
movq 0x30(%rsp), %rdi
callq 0x4758
jmp 0x53e1
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rdx
movslq 0x90(%rsp), %rsi
movl %esi, %ecx
addq %rsi, %rdx
movq %rdx, (%rsp)
movl 0x40(%rax), %eax
subl %ecx, %eax
cltq
movq %rax, 0x8(%rsp)
leaq 0x4f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x46b0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rcx
leaq 0x50(%rsp), %rdi
callq 0x4420
jmp 0x5215
leaq 0x4f(%rsp), %rdi
callq 0x43e0
jmp 0x5221
movq 0x40(%rsp), %rdi
callq 0x4d70
jmp 0x522d
movl $0x0, 0x90(%rsp)
movl $0x0, 0x8c(%rsp)
movq 0x40(%rsp), %rcx
movl 0x8c(%rsp), %eax
cmpl 0x40(%rcx), %eax
jge 0x52e0
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x8c(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xd, %eax
je 0x52d9
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x8c(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
je 0x52d9
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x52db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x4f(%rsp), %rdi
callq 0x43e0
jmp 0x53ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x4758
jmp 0x53ee
jmp 0x52e0
jmp 0x5243
movq 0x40(%rsp), %rcx
movl 0x8c(%rsp), %eax
cmpl 0x40(%rcx), %eax
jl 0x5303
movq 0x40(%rsp), %rax
cmpl $0x100000, 0x40(%rax)   # imm = 0x100000
jge 0x53b8
movq 0x40(%rsp), %rax
movl 0x8c(%rsp), %ecx
movl 0x90(%rsp), %edx
subl %edx, %ecx
movl %ecx, 0x48(%rsp)
movq 0x38(%rax), %rsi
movslq 0x90(%rsp), %rax
addq %rax, %rsi
movslq 0x48(%rsp), %rdx
leaq 0x50(%rsp), %rdi
callq 0x40a0
jmp 0x533c
movq 0x40(%rsp), %rcx
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
movl 0x8c(%rsp), %eax
movl 0x40(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x538e
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x8c(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x538e
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rax
movl 0x8c(%rsp), %ecx
movl %ecx, 0x44(%rax)
leaq 0x50(%rsp), %rsi
callq 0x4200
leaq 0x50(%rsp), %rdi
callq 0x4758
jmp 0x53e1
movq 0x40(%rsp), %rax
movq 0x38(%rax), %rsi
movslq 0x90(%rsp), %rcx
addq %rcx, %rsi
movslq 0x40(%rax), %rdx
leaq 0x50(%rsp), %rdi
callq 0x40a0
jmp 0x53dc
jmp 0x521f
movq 0x38(%rsp), %rax
addq $0xa8, %rsp
retq
movq 0x78(%rsp), %rdi
callq 0x46a0
nopl (%rax,%rax)