// File: /workspace/github_cpp_makefile_star2_O3/BenLangmead[P]bowtie/./sequence_io.h
// Function: void readSequenceString<SString<char>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, EList<SString<char>, 128>&, long&, int, bool)
void readSequenceString(const std::string& s,
                        EList<T>& ss,
                        int64_t& baseCutoff,
                        int seqCutoff = -1,
                        bool reverse = false)
{
	// Split string s using comma as a delimiter.  Borrowed from C++
	// Programming HOWTO 7.3
	std::string::size_type lastPos = s.find_first_not_of(",", 0);
	std::string::size_type pos = s.find_first_of(",", lastPos);
	while (baseCutoff > 0 && (std::string::npos != pos || std::string::npos != lastPos)) {
		string stmp = s.substr(lastPos, pos - lastPos);
		if((int64_t)stmp.length() < baseCutoff) {
			baseCutoff -= stmp.length();
		} else {
			stmp = stmp.substr(0, baseCutoff);
			baseCutoff = 0;
		}
		if(reverse) {
			size_t len = stmp.length();
			for(size_t i = 0; i < len/2; i++) {
				char tmp = stmp[i];
				stmp[i] = stmp[len-i-1];
				stmp[len-i-1] = tmp;
			}
			ss.push_back(T(stmp.c_str()));
		} else {
			ss.push_back(T(stmp.c_str()));
		}
		if(seqCutoff != -1 && ss.size() >= (size_t)seqCutoff) {
			return;
		}
	    lastPos = s.find_first_not_of(",", pos);
	    pos = s.find_first_of(",", lastPos);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r8d, 0x14(%rsp)
movl %ecx, %ebx
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r15
leaq 0x37010(%rip), %r14     # 0x564d4
movl $0x1, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0x98a0
movq %rax, %rbp
movl $0x1, %ecx
movq %r15, 0x38(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %r14
movq %rax, %rdx
callq 0x9770
movq %rax, %rcx
movslq %ebx, %r15
leaq 0x18(%rsp), %r13
leaq 0x48(%rsp), %rbx
movq %r12, 0x40(%rsp)
cmpq $0x0, (%r14)
jle 0x1f695
movq %rcx, %rax
andq %rbp, %rax
cmpq $-0x1, %rax
je 0x1f695
movq %rcx, 0x8(%rsp)
subq %rbp, %rcx
movq %r13, %rdi
movq 0x38(%rsp), %rsi
movq %rbp, %rdx
callq 0x94e0
movq (%r14), %rcx
movq %rcx, %rax
subq 0x20(%rsp), %rax
jg 0x1f57b
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x94e0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x95b0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1f579
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x94c0
xorl %eax, %eax
movq %rax, (%r14)
cmpb $0x0, 0x14(%rsp)
je 0x1f5da
movq 0x20(%rsp), %rax
cmpq $0x2, %rax
jb 0x1f5c0
movq %rax, %rcx
shrq %rcx
decq %rax
xorl %edx, %edx
movq 0x18(%rsp), %rsi
movb (%rsi,%rdx), %dil
movb (%rsi,%rax), %r8b
movb %r8b, (%rsi,%rdx)
movq 0x18(%rsp), %rsi
movb %dil, (%rsi,%rax)
incq %rdx
decq %rax
cmpq %rdx, %rcx
jne 0x1f59b
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x1f6e0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1eda6
jmp 0x1f5f2
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x1f6e0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1eda6
movq %rbx, %rdi
callq 0x1b0a8
cmpl $-0x1, %r15d
sete %al
cmpq %r15, 0x18(%r12)
setb %r12b
orb %al, %r12b
cmpb $0x1, %r12b
jne 0x1f666
movl $0x1, %ecx
movq %r15, %rbp
movq 0x38(%rsp), %r15
movq %r15, %rdi
movq %r13, %rbx
movq %r14, %r13
leaq 0x36ea4(%rip), %r14     # 0x564d4
movq %r14, %rsi
movq 0x8(%rsp), %rdx
callq 0x98a0
movl $0x1, %ecx
movq %r15, %rdi
movq %rbp, %r15
movq %rax, %rbp
movq %r14, %rsi
movq %r13, %r14
movq %rbx, %r13
leaq 0x48(%rsp), %rbx
movq %rax, %rdx
callq 0x9770
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x1f682
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x94c0
testb %r12b, %r12b
movq 0x40(%rsp), %r12
movq 0x8(%rsp), %rcx
jne 0x1f506
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1f6a8
jmp 0x1f6b9
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x1b0a8
jmp 0x1f6bc
jmp 0x1f6b9
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x1f6d8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x94c0
movq %rbx, %rdi
callq 0x9930