// File: /workspace/github_cpp_makefile_star2_O3/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 0xbd61
movl $0x1, %ebp
xorl %r13d, %r13d
movq (%r15), %r14
movb (%r14,%r13), %al
testb %al, %al
je 0xbd55
movsbl %al, %edi
leal -0x30(%rdi), %ecx
cmpl $0xa, %ecx
setb %cl
andb $-0x2, %al
cmpb $0x2c, %al
sete %al
orb %cl, %al
je 0xbf05
callq 0x3590
movb %al, (%r14,%r13)
movq 0x8(%r15), %rdx
movl %ebp, %r13d
incl %ebp
cmpq %r13, %rdx
ja 0xbd22
jmp 0xbd63
xorl %edx, %edx
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
addq %rsi, %rdx
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x3aba
leaq 0x28(%rsp), %rdi
movq %r14, %rdx
movl $0x2c, %ecx
callq 0xc306
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0xbda9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3300
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq %rax, %rcx
je 0xbee9
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 0xbe90
shlq $0x5, %rdx
movq %r13, 0x48(%rsp)
movq (%rax,%rdx), %rsi
movq 0x8(%rax,%rdx), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x3aba
movq %r15, %rdi
movq %r14, %rdx
movl $0x2d, %ecx
callq 0xc306
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xbe21
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 0xbe95
cmpq $0x2, %rcx
jne 0xbf7c
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 0xbeba
movq 0xa8(%rbx), %rdi
movq %r12, %rsi
callq 0xd3e0
movl 0x4(%rsp), %r13d
incl %r13d
movl %r13d, 0x4(%rsp)
jmp 0xbe58
movq %rax, %rcx
jmp 0xbed1
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 0xd50c
leaq 0x58(%rsp), %r13
movq %r15, %rdi
callq 0xc73a
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
incl %ebp
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x5, %rsi
movq %rbp, %rdx
cmpq %rbp, %rsi
ja 0xbdd4
leaq 0x28(%rsp), %rdi
callq 0xc73a
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 0x35c5(%rip), %rsi      # 0xf4e8
leaq 0x35c6(%rip), %rdx      # 0xf4f0
leaq 0x8(%rsp), %rdi
callq 0x54f4
movq (%r15), %rax
movsbl (%rax,%r13), %edx
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xc6d9
movb $0x1, %bpl
leaq 0x3650(%rip), %rdx      # 0xf5a5
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0xc5c1
xorl %ebp, %ebp
leaq 0x8df5(%rip), %rsi      # 0x14d60
movq 0x901e(%rip), %rdx      # 0x14f90
movq %r14, %rdi
callq 0x3510
jmp 0xbfa1
movl $0x8, %edi
callq 0x3160
leaq 0x3646(%rip), %rcx      # 0xf5d3
movq %rcx, (%rax)
movq 0x9009(%rip), %rsi      # 0x14fa0
movq %rax, %rdi
xorl %edx, %edx
callq 0x3510
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0xc065
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0xc065
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbfe2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3300
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xbff9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3300
testb %bpl, %bpl
jne 0xc023
jmp 0xc065
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc023
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0xc023
jmp 0xc04e
jmp 0xc04e
movq %rax, %rbx
movq %r14, %rdi
callq 0x3230
jmp 0xc065
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xc05b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3300
jmp 0xc05b
movq %rax, %rbx
jmp 0xc05b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xc73a
leaq 0x28(%rsp), %rdi
callq 0xc73a
movq %rbx, %rdi
callq 0x3540
nop