// File: chuckwolber[P]Cube/order/cli.cpp
// Function: setFindOrders(char*)
void setFindOrders(char* orderList) {
    std::string temp = "";
    skipFoundOrders = true;
    numSkipFoundOrders = 0;

    bool foundDefault = true;
    if (orderList == NULL || strlen(orderList) == 0) {
        foundDefault = false;
        numSkipFoundOrders = ORDER_MAX;
    }
    for (int i = 0; i < ORDER_MAX; i++)
        foundOrders.push_back(foundDefault);

    unsigned int currOrder = 0;
    if (orderList == NULL)
        goto nolist;

    for (char c : std::string(orderList)) {
        temp += c;
        if (c == ',' && currOrder > 0 && currOrder < ORDER_MAX) {
            foundOrders[currOrder] = false;
            currOrder = 0;
            ++numSkipFoundOrders;
            findOrders += temp;
            temp = "";
        } else if (c == ',') {
            currOrder = 0;
            temp = "";
        } else if (c >= '0' && c <= '9') {
            currOrder = currOrder*10 + (unsigned int)(c - '0');
        } else {
            temp.pop_back();
        }
    }

    nolist:
    if (currOrder < ORDER_MAX) {
        foundOrders[currOrder] = false;
        ++numSkipFoundOrders;
        findOrders += temp;
    }

    if (findOrders.back() == ',')
        findOrders.pop_back();

    if (findOrders == "")
        findOrders = "1 - " + std::to_string(ORDER_MAX - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x45f0
movq -0xf8(%rbp), %rdx
leaq 0xfb3c(%rip), %rsi      # 0x1cab9
leaq -0x28(%rbp), %rdi
callq 0x7410
jmp 0xcf88
leaq -0x29(%rbp), %rdi
callq 0x43d0
movb $0x1, 0x1e789(%rip)     # 0x2b721
movq $0x0, 0x1e765(%rip) # 0x2b708
movb $0x1, -0x3d(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xcfbd
movq -0x8(%rbp), %rdi
callq 0x4150
cmpq $0x0, %rax
jne 0xcfe8
movb $0x0, -0x3d(%rbp)
movq $0x4ed, 0x1e73c(%rip) # imm = 0x4ED
jmp 0xcfe8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x43d0
jmp 0xd38d
movl $0x0, -0x44(%rbp)
cmpl $0x4ed, -0x44(%rbp)     # imm = 0x4ED
jge 0xd02b
movzbl -0x3d(%rbp), %esi
andl $0x1, %esi
leaq 0x1e6ca(%rip), %rdi     # 0x2b6d0
callq 0xf040
jmp 0xd00d
jmp 0xd00f
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xcfef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xd384
movl $0x0, -0x48(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xd03e
jmp 0xd23c
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x45f0
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0x7410
jmp 0xd072
leaq -0x71(%rbp), %rdi
callq 0x43d0
leaq -0x70(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x42e0
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rdi
callq 0x41d0
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xf330
testb $0x1, %al
jne 0xd0dc
leaq -0x70(%rbp), %rdi
callq 0x4678
jmp 0xd23a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x71(%rbp), %rdi
callq 0x43d0
jmp 0xd384
leaq -0x80(%rbp), %rdi
callq 0xf370
movb (%rax), %al
movb %al, -0x89(%rbp)
movsbl -0x89(%rbp), %esi
leaq -0x28(%rbp), %rdi
callq 0x4210
jmp 0xd0ff
movsbl -0x89(%rbp), %eax
cmpl $0x2c, %eax
jne 0xd1c9
cmpl $0x0, -0x48(%rbp)
jbe 0xd1c9
cmpl $0x4ed, -0x48(%rbp)     # imm = 0x4ED
jae 0xd1c9
movl -0x48(%rbp), %eax
movl %eax, %esi
leaq 0x1e59e(%rip), %rdi     # 0x2b6d0
callq 0xf110
movq %rdx, -0x118(%rbp)
movq %rax, -0x110(%rbp)
jmp 0xd147
movq -0x118(%rbp), %rax
movq -0x110(%rbp), %rcx
movq %rcx, -0xa0(%rbp)
movq %rax, -0x98(%rbp)
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
callq 0xf170
movl $0x0, -0x48(%rbp)
movq 0x1e589(%rip), %rax     # 0x2b708
incq %rax
movq %rax, 0x1e57f(%rip)     # 0x2b708
leaq 0x1e520(%rip), %rdi     # 0x2b6b0
leaq -0x28(%rbp), %rsi
callq 0x4490
jmp 0xd19b
leaq 0xf917(%rip), %rsi      # 0x1cab9
leaq -0x28(%rbp), %rdi
callq 0x44e0
jmp 0xd1ad
jmp 0xd22a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x4678
jmp 0xd384
movsbl -0x89(%rbp), %eax
cmpl $0x2c, %eax
jne 0xd1f0
movl $0x0, -0x48(%rbp)
leaq 0xf8d6(%rip), %rsi      # 0x1cab9
leaq -0x28(%rbp), %rdi
callq 0x44e0
jmp 0xd1ee
jmp 0xd228
movsbl -0x89(%rbp), %eax
cmpl $0x30, %eax
jl 0xd21d
movsbl -0x89(%rbp), %eax
cmpl $0x39, %eax
jg 0xd21d
imull $0xa, -0x48(%rbp), %eax
movsbl -0x89(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x48(%rbp)
jmp 0xd226
leaq -0x28(%rbp), %rdi
callq 0x4450
jmp 0xd228
jmp 0xd22a
jmp 0xd22c
leaq -0x80(%rbp), %rdi
callq 0xf390
jmp 0xd0a0
jmp 0xd23c
cmpl $0x4ed, -0x48(%rbp)     # imm = 0x4ED
jae 0xd2b5
movl -0x48(%rbp), %eax
movl %eax, %esi
leaq 0x1e47f(%rip), %rdi     # 0x2b6d0
callq 0xf110
movq %rdx, -0x128(%rbp)
movq %rax, -0x120(%rbp)
jmp 0xd266
movq -0x128(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, -0xb0(%rbp)
movq %rax, -0xa8(%rbp)
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
callq 0xf170
movq 0x1e471(%rip), %rax     # 0x2b708
incq %rax
movq %rax, 0x1e467(%rip)     # 0x2b708
leaq 0x1e408(%rip), %rdi     # 0x2b6b0
leaq -0x28(%rbp), %rsi
callq 0x4490
jmp 0xd2b3
jmp 0xd2b5
leaq 0x1e3f4(%rip), %rdi     # 0x2b6b0
callq 0x4260
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0xd2d5
leaq 0x1e3e0(%rip), %rdi     # 0x2b6b0
callq 0x4450
leaq 0x1e3d4(%rip), %rdi     # 0x2b6b0
leaq 0xf7d6(%rip), %rsi      # 0x1cab9
callq 0xf3b0
movb %al, -0x129(%rbp)
jmp 0xd2f0
movb -0x129(%rbp), %al
testb $0x1, %al
jne 0xd2fc
jmp 0xd372
leaq -0xf0(%rbp), %rdi
movl $0x4ec, %esi            # imm = 0x4EC
callq 0xf210
jmp 0xd30f
leaq 0xf0ea(%rip), %rsi      # 0x1c400
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0xf3e0
jmp 0xd32b
leaq 0x1e37e(%rip), %rdi     # 0x2b6b0
leaq -0xd0(%rbp), %rsi
callq 0x4460
leaq -0xd0(%rbp), %rdi
callq 0x4678
leaq -0xf0(%rbp), %rdi
callq 0x4678
jmp 0xd372
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x4678
jmp 0xd384
leaq -0x28(%rbp), %rdi
callq 0x4678
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x4678
movq -0x38(%rbp), %rdi
callq 0x45e0
nopw %cs:(%rax,%rax)