// File: hanhwi[P]SimPoint/analysiscode/SimpointOptions.cpp
// Function: NumClustersCmdLineOption::parseArgumentSub(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool NumClustersCmdLineOption::parseArgumentSub(const string &argument) {
    *searchTarget = (argument == "search");

    if (! *searchTarget) {
        kValuesTarget->clear();
        int k;
        vector<string> ranges = split(argument, ',');
        for (unsigned int i = 0; i < ranges.size(); i++) {
            vector<string> kRange = split(ranges[i], ':');
            if (kRange.size() == 1) {
                k = atoi(kRange[0].c_str());
                if (k < 1) {
                    setParseError("k value cannot be less than 1");
                    return false;
                }
                kValuesTarget->push_back(k);
            } else if (kRange.size() == 2) {
                int start = atoi(kRange[0].c_str()), end = atoi(kRange[1].c_str());
                if ((start < 1) || (end < 1)) {
                    setParseError("k values cannot be less than 1");
                }
                if (start < end) {
                    for (k = start; k <= end; k++) { kValuesTarget->push_back(k); }
                } else {
                    for (k = start; k >= end; k--) { kValuesTarget->push_back(k); }
                }
            } else if (kRange.size() == 3) {
                int start = atoi(kRange[0].c_str()), step = atoi(kRange[1].c_str()),
                    end = atoi(kRange[2].c_str());
                if ((start < 1) || (end < 1)) {
                    setParseError("k values cannot be less than 1");
                    return false;
                } else if (step == 0) {
                    setParseError("step value cannot be 0");
                    return false;
                } else if (((start < end) && (step < 0)) ||
                           ((end < start) && (step > 0))) {
                    step = -step; // silently fix for the user
                }
                if (start < end) {
                    for (k = start; k <= end; k += step) { kValuesTarget->push_back(k); }
                } else {
                    for (k = start; k >= end; k += step) { kValuesTarget->push_back(k); }
                }
            } else {
                setParseError("invalid range specification");
                return false;
            }
        }
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x18(%rbp), %rdi
leaq 0xb68d(%rip), %rsi      # 0x361a6
callq 0x7b40
movb %al, %dl
movq -0x148(%rbp), %rax
movq 0x90(%rax), %rcx
andb $0x1, %dl
movb %dl, (%rcx)
movq 0x90(%rax), %rax
testb $0x1, (%rax)
jne 0x2b233
movq -0x148(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x1ad40
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movl $0x2c, %edx
callq 0x2a960
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq %rax, -0x150(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x8880
movq %rax, %rcx
movq -0x150(%rbp), %rax
cmpq %rcx, %rax
jae 0x2b205
movl -0x3c(%rbp), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x2c280
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
movl $0x3a, %edx
callq 0x2a960
jmp 0x2abb6
leaq -0x58(%rbp), %rdi
callq 0x8880
cmpq $0x1, %rax
jne 0x2acd9
leaq -0x58(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2c280
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x55e0
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jge 0x2acaa
leaq -0x89(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x56a0
movq -0x158(%rbp), %rdx
leaq 0xb599(%rip), %rsi      # 0x361ad
leaq -0x88(%rbp), %rdi
callq 0x74e0
jmp 0x2ac22
movq -0x148(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x2c2a0
jmp 0x2ac37
leaq -0x88(%rbp), %rdi
callq 0x5788
leaq -0x89(%rbp), %rdi
callq 0x53e0
movb $0x0, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x2b1d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2b228
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2ac99
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5788
leaq -0x89(%rbp), %rdi
callq 0x53e0
jmp 0x2b1fa
movq -0x148(%rbp), %rax
movq 0x98(%rax), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x1ad60
jmp 0x2acc3
jmp 0x2b1cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2b1fa
leaq -0x58(%rbp), %rdi
callq 0x8880
cmpq $0x2, %rax
jne 0x2ae69
leaq -0x58(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2c280
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x55e0
movl %eax, -0x94(%rbp)
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x2c280
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x55e0
movl %eax, -0x98(%rbp)
cmpl $0x1, -0x94(%rbp)
jl 0x2ad49
cmpl $0x1, -0x98(%rbp)
jge 0x2adde
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x56a0
movq -0x160(%rbp), %rdx
leaq 0xb461(%rip), %rsi      # 0x361cb
leaq -0xb8(%rbp), %rdi
callq 0x74e0
jmp 0x2ad78
movq -0x148(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2c2a0
jmp 0x2ad8d
leaq -0xb8(%rbp), %rdi
callq 0x5788
leaq -0xb9(%rbp), %rdi
callq 0x53e0
jmp 0x2adde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2adcd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x5788
leaq -0xb9(%rbp), %rdi
callq 0x53e0
jmp 0x2b1fa
movl -0x94(%rbp), %eax
cmpl -0x98(%rbp), %eax
jge 0x2ae28
movl -0x94(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x98(%rbp), %eax
jg 0x2ae26
movq -0x148(%rbp), %rax
movq 0x98(%rax), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x1ad60
jmp 0x2ae19
jmp 0x2ae1b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2adf5
jmp 0x2ae64
movl -0x94(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x98(%rbp), %eax
jl 0x2ae62
movq -0x148(%rbp), %rax
movq 0x98(%rax), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x1ad60
jmp 0x2ae55
jmp 0x2ae57
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2ae31
jmp 0x2ae64
jmp 0x2b1c9
leaq -0x58(%rbp), %rdi
callq 0x8880
cmpq $0x3, %rax
jne 0x2b127
leaq -0x58(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2c280
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x55e0
movl %eax, -0xc0(%rbp)
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x2c280
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x55e0
movl %eax, -0xc4(%rbp)
leaq -0x58(%rbp), %rdi
movl $0x2, %esi
callq 0x2c280
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x55e0
movl %eax, -0xc8(%rbp)
cmpl $0x1, -0xc0(%rbp)
jl 0x2aefd
cmpl $0x1, -0xc8(%rbp)
jge 0x2afa3
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x56a0
movq -0x168(%rbp), %rdx
leaq 0xb2ad(%rip), %rsi      # 0x361cb
leaq -0xe8(%rbp), %rdi
callq 0x74e0
jmp 0x2af2c
movq -0x148(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x2c2a0
jmp 0x2af41
leaq -0xe8(%rbp), %rdi
callq 0x5788
leaq -0xe9(%rbp), %rdi
callq 0x53e0
movb $0x0, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x2b1d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2af92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x5788
leaq -0xe9(%rbp), %rdi
callq 0x53e0
jmp 0x2b1fa
cmpl $0x0, -0xc4(%rbp)
jne 0x2b056
leaq -0x111(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x56a0
movq -0x170(%rbp), %rdx
leaq 0xb219(%rip), %rsi      # 0x361ea
leaq -0x110(%rbp), %rdi
callq 0x74e0
jmp 0x2afdf
movq -0x148(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x2c2a0
jmp 0x2aff4
leaq -0x110(%rbp), %rdi
callq 0x5788
leaq -0x111(%rbp), %rdi
callq 0x53e0
movb $0x0, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x2b1d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2b045
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x5788
leaq -0x111(%rbp), %rdi
callq 0x53e0
jmp 0x2b1fa
movl -0xc0(%rbp), %eax
cmpl -0xc8(%rbp), %eax
jge 0x2b06d
cmpl $0x0, -0xc4(%rbp)
jl 0x2b084
movl -0xc8(%rbp), %eax
cmpl -0xc0(%rbp), %eax
jge 0x2b092
cmpl $0x0, -0xc4(%rbp)
jle 0x2b092
xorl %eax, %eax
subl -0xc4(%rbp), %eax
movl %eax, -0xc4(%rbp)
jmp 0x2b094
jmp 0x2b096
movl -0xc0(%rbp), %eax
cmpl -0xc8(%rbp), %eax
jge 0x2b0e3
movl -0xc0(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc8(%rbp), %eax
jg 0x2b0e1
movq -0x148(%rbp), %rax
movq 0x98(%rax), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x1ad60
jmp 0x2b0d1
jmp 0x2b0d3
movl -0xc4(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x2b0ad
jmp 0x2b122
movl -0xc0(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc8(%rbp), %eax
jl 0x2b120
movq -0x148(%rbp), %rax
movq 0x98(%rax), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x1ad60
jmp 0x2b110
jmp 0x2b112
movl -0xc4(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x2b0ec
jmp 0x2b122
jmp 0x2b1c7
leaq -0x139(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x56a0
movq -0x178(%rbp), %rdx
leaq 0xb0b9(%rip), %rsi      # 0x36201
leaq -0x138(%rbp), %rdi
callq 0x74e0
jmp 0x2b156
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x2c2a0
jmp 0x2b16b
leaq -0x138(%rbp), %rdi
callq 0x5788
leaq -0x139(%rbp), %rdi
callq 0x53e0
movb $0x0, -0x1(%rbp)
movl $0x1, -0x90(%rbp)
jmp 0x2b1d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2b1b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x5788
leaq -0x139(%rbp), %rdi
callq 0x53e0
jmp 0x2b1fa
jmp 0x2b1c9
jmp 0x2b1cb
movl $0x0, -0x90(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x1ba40
movl -0x90(%rbp), %eax
testl %eax, %eax
jne 0x2b20f
jmp 0x2b1ea
jmp 0x2b1ec
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x2ab6f
leaq -0x58(%rbp), %rdi
callq 0x1ba40
jmp 0x2b228
movl $0x0, -0x90(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x1ba40
movl -0x90(%rbp), %eax
testl %eax, %eax
je 0x2b226
jmp 0x2b224
jmp 0x2b237
jmp 0x2b233
leaq -0x38(%rbp), %rdi
callq 0x1ba40
jmp 0x2b245
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x5690
nop