// File: ridgelab[P]Kmer-SSR/src/Arguments.cpp
// Function: Arguments::split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char)
vector<string> Arguments::split(string str, char sep)
{
	vector<string> v;
	vector<uint32_t> starts = {0};
	vector<uint32_t> ends;

	for (uint32_t i = 0; i < str.size(); ++i)
	{
		if (str[i] == sep)
		{
			ends.push_back(i);

			if (starts[starts.size() - 1] == ends[ends.size() - 1])
			{
				starts.pop_back();
				ends.pop_back();
			}

			starts.push_back(i + 1);
		}
	}

	ends.push_back(str.size());

	if (starts[starts.size() - 1] >= str.size())
	{
		starts.pop_back();
		ends.pop_back();
	}

	if (starts.size() != ends.size())
	{
		throw "ERROR: You should never see this, but starts and ends had different lengths in Arguments::split.";
	}

	for (uint32_t i = 0; i < starts.size(); ++i)
	{
		v.push_back(str.substr(starts[i], ends[i] - starts[i]));
	}

	return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdx, -0xc8(%rbp)
movq %rdi, -0xc0(%rbp)
movb %cl, %al
movq %rdi, %rcx
movq %rcx, -0xb8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movb $0x0, -0x1a(%rbp)
callq 0x1ba10
movl $0x0, -0x4c(%rbp)
leaq -0x4c(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x1, -0x40(%rbp)
leaq -0x4d(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0xb3a0
movq -0xb0(%rbp), %rcx
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x13550
jmp 0x1b1ce
leaq -0x4d(%rbp), %rdi
callq 0xb540
leaq -0x78(%rbp), %rdi
callq 0x135d0
movl $0x0, -0x7c(%rbp)
movq -0xc8(%rbp), %rdi
movl -0x7c(%rbp), %eax
movq %rax, -0xd0(%rbp)
callq 0x4260
movq %rax, %rcx
movq -0xd0(%rbp), %rax
cmpq %rcx, %rax
jae 0x1b2fe
movq -0xc8(%rbp), %rdi
movl -0x7c(%rbp), %eax
movl %eax, %esi
callq 0x4770
movq %rax, -0xd8(%rbp)
jmp 0x1b22a
movq -0xd8(%rbp), %rax
movsbl (%rax), %eax
movsbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
jne 0x1b2ee
leaq -0x78(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0x1ba30
jmp 0x1b24f
leaq -0x38(%rbp), %rdi
callq 0x134d0
movq %rax, %rsi
subq $0x1, %rsi
leaq -0x38(%rbp), %rdi
callq 0x134b0
movl (%rax), %eax
movl %eax, -0xdc(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x134d0
movq %rax, %rsi
subq $0x1, %rsi
leaq -0x78(%rbp), %rdi
callq 0x134b0
movq %rax, %rcx
movl -0xdc(%rbp), %eax
cmpl (%rcx), %eax
jne 0x1b2d5
leaq -0x38(%rbp), %rdi
callq 0x134f0
leaq -0x78(%rbp), %rdi
callq 0x134f0
jmp 0x1b2d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x4d(%rbp), %rdi
callq 0xb540
jmp 0x1b50e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1b4de
movl -0x7c(%rbp), %eax
incl %eax
movl %eax, -0x80(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x13480
jmp 0x1b2ec
jmp 0x1b2ee
jmp 0x1b2f0
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1b1e7
movq -0xc8(%rbp), %rdi
callq 0x4260
movl %eax, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x84(%rbp), %rsi
callq 0x13480
jmp 0x1b322
leaq -0x38(%rbp), %rdi
callq 0x134d0
movq %rax, %rsi
subq $0x1, %rsi
leaq -0x38(%rbp), %rdi
callq 0x134b0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movq %rax, -0xe8(%rbp)
callq 0x4260
movq %rax, %rcx
movq -0xe8(%rbp), %rax
cmpq %rcx, %rax
jb 0x1b371
leaq -0x38(%rbp), %rdi
callq 0x134f0
leaq -0x78(%rbp), %rdi
callq 0x134f0
leaq -0x38(%rbp), %rdi
callq 0x134d0
movq %rax, -0xf0(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x134d0
movq %rax, %rcx
movq -0xf0(%rbp), %rax
cmpq %rcx, %rax
je 0x1b3c5
movl $0x8, %edi
callq 0x41a0
movq %rax, %rdi
leaq 0x7125(%rip), %rax      # 0x224d2
movq %rax, (%rdi)
movq 0x16be9(%rip), %rsi     # 0x31fa0
xorl %eax, %eax
movl %eax, %edx
callq 0x46a0
jmp 0x1b523
movl $0x0, -0x88(%rbp)
movl -0x88(%rbp), %eax
movq %rax, -0xf8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x134d0
movq %rax, %rcx
movq -0xf8(%rbp), %rax
cmpq %rcx, %rax
jae 0x1b4c0
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x134b0
movl (%rax), %eax
movq %rax, -0x108(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %esi
leaq -0x78(%rbp), %rdi
callq 0x134b0
movq -0x110(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xfc(%rbp)
movl -0x88(%rbp), %eax
movl %eax, %esi
callq 0x134b0
movq -0xc8(%rbp), %rsi
movq -0x108(%rbp), %rdx
movq %rax, %rcx
movl -0xfc(%rbp), %eax
movl (%rcx), %ecx
subl %ecx, %eax
movl %eax, %ecx
leaq -0xa8(%rbp), %rdi
callq 0x43c0
jmp 0x1b471
movq -0xc0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x1baa0
jmp 0x1b486
leaq -0xa8(%rbp), %rdi
callq 0x4788
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x1b3cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x4788
jmp 0x1b4de
movb $0x1, -0x1a(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x135f0
leaq -0x38(%rbp), %rdi
callq 0x135f0
testb $0x1, -0x1a(%rbp)
jne 0x1b4fe
jmp 0x1b4f2
leaq -0x78(%rbp), %rdi
callq 0x135f0
leaq -0x38(%rbp), %rdi
callq 0x135f0
jmp 0x1b50e
movq -0xc0(%rbp), %rdi
callq 0x1bad0
movq -0xb8(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0xc0(%rbp), %rdi
callq 0x1bad0
movq -0x58(%rbp), %rdi
callq 0x46e0
nopw %cs:(%rax,%rax)
nopl (%rax)