// File: /workspace/github_cpp_makefile_star2_O1/ridgelab[P]Kmer-SSR/src/Arguments.cpp
// Function: Arguments::addToPeriods(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Arguments::addToPeriods(string period_s)
{
	for (uint32_t i = 0; i < period_s.size(); ++i)
	{
		if (period_s[i])
		{
			if ( !(isdigit(period_s[i]) or period_s[i] == ',' or period_s[i] == '-') )
			{
				throw string("ERROR: '") + period_s[i] + "' is not a valid character for the -p option.";
			}

			period_s[i] = toupper(period_s[i]);
		}
	}

	vector<string> pers = split(period_s, ',');

	for (uint32_t i = 0; i < pers.size(); ++i)
	{
		if (!pers.empty())
		{
			vector<string> per = split(pers[i], '-');

			if (per.size() == 2)
			{
				for (uint32_t j = strtol(per[0].c_str(), NULL, 10); j <= strtol(per[1].c_str(), NULL, 10); ++j)
				{
					this->periods->insert(j);
				}
			}
			else if (per.size() == 1)
			{
				this->periods->insert(strtol(per[0].c_str(), NULL, 10));
			}
			else
			{
				throw "ERROR: A range can only contain 2 numbers separated by a hyphen.";
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rsi), %rdx
testq %rdx, %rdx
je 0xbe41
movl $0x1, %ebp
xorl %r13d, %r13d
movq (%r15), %r14
movb (%r14,%r13), %al
testb %al, %al
je 0xbe33
movsbl %al, %edi
leal -0x30(%rdi), %ecx
cmpl $0xa, %ecx
setb %cl
andb $-0x2, %al
cmpb $0x2c, %al
sete %al
orb %cl, %al
je 0xbfde
callq 0x3590
movb %al, (%r14,%r13)
movl %ebp, %r13d
movq 0x8(%r15), %rdx
incl %ebp
cmpq %r13, %rdx
ja 0xbe04
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
addq %rsi, %rdx
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x3ada
leaq 0x28(%rsp), %rdi
movq %r14, %rdx
movl $0x2c, %ecx
callq 0xc418
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0xbe87
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3300
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq %rax, %rcx
je 0xbfc2
xorl %edx, %edx
leaq 0x58(%rsp), %r13
leaq 0x48(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x4(%rsp), %r12
xorl %ebp, %ebp
cmpq %rcx, %rax
je 0xbfa0
shlq $0x5, %rdx
movq %r13, 0x48(%rsp)
movq (%rax,%rdx), %rsi
movq 0x8(%rax,%rdx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x3ada
movq %r15, %rdi
movq %r14, %rdx
movl $0x2d, %ecx
callq 0xc418
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xbeff
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3300
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq $0x1, %rcx
je 0xbf6e
cmpq $0x2, %rcx
jne 0xc055
movq (%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x33f0
movl %eax, 0x4(%rsp)
movl %eax, %r13d
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x33f0
cmpq %r13, %rax
jl 0xbf93
movq 0xa8(%rbx), %rdi
movq %r12, %rsi
callq 0xd4ee
movl 0x4(%rsp), %r13d
incl %r13d
movl %r13d, 0x4(%rsp)
jmp 0xbf36
movq 0xa8(%rbx), %r13
movq (%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x33f0
movl %eax, 0x4(%rsp)
movq %r13, %rdi
movq %r12, %rsi
callq 0xd618
leaq 0x58(%rsp), %r13
movq %r15, %rdi
callq 0xc842
incl %ebp
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x5, %rsi
movq %rbp, %rdx
cmpq %rbp, %rsi
ja 0xbeb2
leaq 0x28(%rsp), %rdi
callq 0xc842
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3160
movq %rax, %r14
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x34ec(%rip), %rsi      # 0xf4e8
leaq 0x34ed(%rip), %rdx      # 0xf4f0
leaq 0x8(%rsp), %rdi
callq 0x552e
movq (%r15), %rax
movsbl (%rax,%r13), %edx
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc7e1
movb $0x1, %bpl
leaq 0x3577(%rip), %rdx      # 0xf5a5
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0xc6c8
xorl %ebp, %ebp
leaq 0x8d1c(%rip), %rsi      # 0x14d60
movq 0x8f45(%rip), %rdx      # 0x14f90
movq %r14, %rdi
callq 0x3510
jmp 0xc07a
movl $0x8, %edi
callq 0x3160
leaq 0x356d(%rip), %rcx      # 0xf5d3
movq %rcx, (%rax)
movq 0x8f30(%rip), %rsi      # 0x14fa0
movq %rax, %rdi
xorl %edx, %edx
callq 0x3510
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0xc12d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0xc12d
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc0c3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0xc0c3
movq %rax, %rbx
movb $0x1, %bpl
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc0e6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0xc0e6
jmp 0xc116
jmp 0xc116
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0xc12d
movq %r14, %rdi
callq 0x3230
jmp 0xc12d
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xc123
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0xc123
movq %rax, %rbx
jmp 0xc123
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xc842
leaq 0x28(%rsp), %rdi
callq 0xc842
movq %rbx, %rdi
callq 0x3540
nop