// File: /workspace/github_cpp_makefile_star2_O2/adamiaonr[P]rid-analytics/src/argvparser.cpp
// Function: CommandLineProcessing::expandRangeStringToUInt(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<unsigned int, std::allocator<unsigned int>>&)
bool CommandLineProcessing::expandRangeStringToUInt( const std::string & _string,
        std::vector< unsigned int > & _expanded )
{
    list<string> tokens;
    // split string by delimiter
    splitString(tokens, _string, ",");

    // loop over all entries
    for(list<string>::const_iterator it = tokens.begin(); it != tokens.end(); it++)
    {
        const string& entry = *it; // convenience reference

#ifdef ARGVPARSER_DEBUG

        cout << "TOKEN: " << entry << endl;
#endif

        // if range was given
        if (entry.find("-") != string::npos)
        {
            // split into upper and lower border
            list<string> range_borders;
            splitString(range_borders, entry, "-");

            // fail if insane range spec
            if (range_borders.size() != 2)
                return(false);

            int first = atoi(range_borders.begin()->c_str());
            int second = atoi((++range_borders.begin())->c_str());

            // write id in increasing order
            if (first <= second)

            {
                for (int j=first; j<=second; ++j)
                {
                    _expanded.push_back(j);
                }
            }
            else // write id in decreasing order
            {
                for (int k=first; k>=second; k--)
                {
                    _expanded.push_back(k);
                }
            }
        }
        else // single number was given
            _expanded.push_back(atoi(entry.c_str())); // store id
    }

    return(true);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x20(%rsp), %rbp
movq %rbp, 0x8(%rbp)
movq %rbp, (%rbp)
andq $0x0, 0x10(%rbp)
leaq 0xe8b5(%rip), %rdx      # 0x2af27
movq %rbp, %rdi
callq 0x1caf0
leaq 0xe59f(%rip), %r12      # 0x2ac20
leaq 0x4(%rsp), %r13
movq %rbp, %r15
movq (%r15), %r15
cmpq %rbp, %r15
je 0x1c773
leaq 0x10(%r15), %r14
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x47a0
cmpq $-0x1, %rax
je 0x1c74b
leaq 0x8(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
andq $0x0, 0x18(%rsp)
movq %r14, %rsi
movq %r12, %rdx
callq 0x1caf0
cmpq $0x2, 0x18(%rsp)
jne 0x1c769
movq %rbp, %r12
movq 0x8(%rsp), %r14
movq 0x10(%r14), %rdi
callq 0x45f0
movl %eax, %ebp
movq (%r14), %rax
movq 0x10(%rax), %rdi
callq 0x45f0
movl %eax, %r14d
cmpl %eax, %ebp
jle 0x1c71a
cmpl %r14d, %ebp
jl 0x1c732
movl %ebp, 0x4(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1dfd6
decl %ebp
jmp 0x1c702
cmpl %r14d, %ebp
jg 0x1c732
movl %ebp, 0x4(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1dfd6
incl %ebp
jmp 0x1c71a
leaq 0x8(%rsp), %rdi
callq 0x1cd4e
movq %r12, %rbp
leaq 0xe4da(%rip), %r12      # 0x2ac20
jmp 0x1c689
movq (%r14), %rdi
callq 0x45f0
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x1dfd6
jmp 0x1c689
leaq 0x8(%rsp), %rdi
callq 0x1cd4e
leaq 0x20(%rsp), %rdi
cmpq %rdi, %r15
sete %bl
callq 0x1cd4e
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1c796
movq %rax, %rbx
jmp 0x1c7ac
jmp 0x1c79f
jmp 0x1c79f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1cd4e
leaq 0x20(%rsp), %rdi
callq 0x1cd4e
movq %rbx, %rdi
callq 0x4700