// File: /workspace/github_cpp_makefile_star2_O2/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 $0x58, %rsp
movl %r8d, 0xc(%rsp)
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x3242b(%rip), %r14     # 0x4b43f
movq %r14, %rsi
xorl %edx, %edx
callq 0x9280
movq %rax, %r13
movq %r12, 0x10(%rsp)
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x9230
movq %rax, %rcx
movslq %ebp, %r14
leaq 0x18(%rsp), %rbp
leaq 0x38(%rsp), %r12
cmpq $0x0, (%rbx)
jle 0x19198
movq %rcx, %rax
andq %r13, %rax
cmpq $-0x1, %rax
je 0x19198
movq %rcx, (%rsp)
subq %r13, %rcx
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
movq %r13, %rdx
callq 0x9520
movq (%rbx), %rcx
movq %rcx, %rax
subq 0x20(%rsp), %rax
jg 0x190a4
movq %r12, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x9520
movq %rbp, %rdi
movq %r12, %rsi
callq 0x95e0
movq %r12, %rdi
callq 0x9a68
xorl %eax, %eax
movq %rax, (%rbx)
cmpb $0x0, 0xc(%rsp)
je 0x190e5
movq 0x20(%rsp), %rax
movq %rax, %rcx
shrq %rcx
decq %rax
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x190ff
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
jmp 0x190be
movq 0x18(%rsp), %rsi
movq %r12, %rdi
callq 0x191d2
movq %r15, %rdi
movq %r12, %rsi
callq 0x1890e
jmp 0x19117
movq 0x18(%rsp), %rsi
movq %r12, %rdi
callq 0x191d2
movq %r15, %rdi
movq %r12, %rsi
callq 0x1890e
movq %r12, %rdi
callq 0x15f54
cmpl $-0x1, %r14d
sete %al
movq %r15, %r12
cmpq %r14, 0x18(%r15)
setb %r15b
orb %al, %r15b
cmpb $0x1, %r15b
jne 0x1917b
movq %rbx, %r13
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rbp
leaq 0x322f0(%rip), %r14     # 0x4b43f
movq %r14, %rsi
movq (%rsp), %rdx
callq 0x9280
movq %rbx, %rdi
movq %r13, %rbx
movq %rax, %r13
movq %r14, %rsi
movq %rbp, %r14
leaq 0x18(%rsp), %rbp
movq %rax, %rdx
callq 0x9230
movq %rax, (%rsp)
movq %rbp, %rdi
callq 0x9a68
testb %r15b, %r15b
movq %r12, %r15
leaq 0x38(%rsp), %r12
movq (%rsp), %rcx
jne 0x19044
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x191ab
jmp 0x191bc
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x15f54
jmp 0x191bf
jmp 0x191bc
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x9a68
movq %rbx, %rdi
callq 0x9950
nop