// File: /workspace/github_cpp_makefile_star2_O1/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 0x37d08(%rip), %r14     # 0x573f4
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 0x1f8bd
movq %rcx, %rax
andq %rbp, %rax
cmpq $-0x1, %rax
je 0x1f8bd
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 0x1f7a3
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 0x1f7a1
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x94c0
xorl %eax, %eax
movq %rax, (%r14)
cmpb $0x0, 0x14(%rsp)
je 0x1f802
movq 0x20(%rsp), %rax
cmpq $0x2, %rax
jb 0x1f7e8
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 0x1f7c3
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x1f908
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1efca
jmp 0x1f81a
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x1f908
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1efca
movq %rbx, %rdi
callq 0x1b340
cmpl $-0x1, %r15d
sete %al
cmpq %r15, 0x18(%r12)
setb %r12b
orb %al, %r12b
cmpb $0x1, %r12b
jne 0x1f88e
movl $0x1, %ecx
movq %r15, %rbp
movq 0x38(%rsp), %r15
movq %r15, %rdi
movq %r13, %rbx
movq %r14, %r13
leaq 0x37b9c(%rip), %r14     # 0x573f4
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 0x1f8aa
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x94c0
testb %r12b, %r12b
movq 0x40(%rsp), %r12
movq 0x8(%rsp), %rcx
jne 0x1f72e
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1f8d0
jmp 0x1f8e1
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x1b340
jmp 0x1f8e4
jmp 0x1f8e1
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x1f900
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x94c0
movq %rbx, %rdi
callq 0x9930