// File: /workspace/github_cpp_makefile_star2_O1/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), %r14
movq %r14, 0x8(%r14)
movq %r14, (%r14)
movq $0x0, 0x10(%r14)
leaq 0x10484(%rip), %rdx     # 0x31f87
movq %r14, %rdi
callq 0x220e5
movq 0x20(%rsp), %r15
cmpq %r14, %r15
sete %bpl
je 0x21c5c
leaq 0x4(%rsp), %r13
leaq 0x10(%r15), %r14
movl $0x1, %ecx
movq %r14, %rdi
leaq 0x1014b(%rip), %r12     # 0x31c80
movq %r12, %rsi
xorl %edx, %edx
callq 0x46f0
cmpq $-0x1, %rax
je 0x21bcc
leaq 0x8(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movq %r14, %rsi
movq %r12, %rdx
callq 0x220e5
cmpq $0x2, 0x18(%rsp)
jne 0x21c52
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 0x21bee
movl %ebp, 0x4(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x21bb5
movl %ebp, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x21bc0
movq %rbx, %rdi
movq %r13, %rdx
callq 0x234a6
leal -0x1(%rbp), %eax
cmpl %r14d, %ebp
movl %eax, %ebp
jg 0x21b9b
jmp 0x21c1d
movq (%r14), %rdi
callq 0x45f0
movl %eax, 0x8(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x21c3e
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x21c27
incl %r14d
movl %ebp, 0x4(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x21c0b
movl %ebp, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x21c16
movq %rbx, %rdi
movq %r13, %rdx
callq 0x234a6
incl %ebp
cmpl %ebp, %r14d
jne 0x21bf1
leaq 0x8(%rsp), %rdi
callq 0x2246c
leaq 0x20(%rsp), %rax
movq (%r15), %r15
cmpq %rax, %r15
sete %bpl
jne 0x21b22
jmp 0x21c5c
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
callq 0x234a6
leaq 0x20(%rsp), %rax
jmp 0x21c2c
leaq 0x8(%rsp), %rdi
callq 0x2246c
leaq 0x20(%rsp), %rdi
callq 0x2246c
andb $0x1, %bpl
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x21c7d
movq %rax, %rbx
jmp 0x21c93
jmp 0x21c86
jmp 0x21c86
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2246c
leaq 0x20(%rsp), %rdi
callq 0x2246c
movq %rbx, %rdi
callq 0x4700
nop