// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/util/conf.cc
// Function: conf::Config::parse_aux(std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, bool)
void
Config::parse_aux(std::deque<std::string> &argument_queue, bool override)
{
    bool options_allowed = true; // Have not seen "--" yet.
    std::deque<int> options_pending; // Options waiting for parameter

    while (!argument_queue.empty()) {
        std::string arg(argument_queue.front());
        argument_queue.pop_front();

        // Check if the argument is an option at all
        if (options_allowed && options_pending.empty() &&
                arg.length() > 1 && arg[0] == '-')
        {

            // End of options "--"
            if (arg == "--") {
                options_allowed = false;
                continue;
            }

            // Short option?
            if (arg[1] != '-') {

                // Parse grouped short options
                for (int c = 1; c < (int)arg.length(); c++) {

                    // Check if the option is valid
                    unsigned char short_name = arg[c];
                    ShortMap::iterator it = short_map.find(short_name);
                    if (it == short_map.end()) {
                        fprintf(stderr, "invalid option -%c\n", short_name);
                        exit(1);
                    }

                    Option &option = options[it->second];
                    if (option.needs_argument)
                        options_pending.push_back(it->second);
                    else
                        option.specified = true;
                }
            }

            // Long option?
            else {

                std::string long_name(arg.substr(2));
                std::string parameter;
                int equal_pos = long_name.find('=');
                if (equal_pos >= 0) {
                    parameter = long_name.substr(equal_pos + 1);
                    argument_queue.push_front(parameter);
                    long_name.erase(equal_pos);
                }
                LongMap::iterator it = long_map.find(long_name);
                if (it == long_map.end()) {
                    fprintf(stderr, "invalid option --%s\n", long_name.c_str());
                    exit(1);
                }

                Option &option = options[it->second];
                if (option.needs_argument)
                    options_pending.push_back(it->second);
                else
                    option.specified = true;
            }

        }

        // Otherwise just a parameter (possibly for a previous option)
        else {

            // Just an ordinary command line parameter
            if (options_pending.empty())
                arguments.push_back(arg);

            // Parameter for an option
            else {
                Option &option = options[options_pending.front()];
                options_pending.pop_front();
                if (!option.specified || override)
                    option.value = arg;
                option.specified = true;
            }
        }
    }

    // Check if the last option is missing arguments
    if (!options_pending.empty()) {
        std::string option_name;
        Option &option = options[options_pending.front()];
        if (option.short_name != 0) {
            option_name.append(" -");
            option_name.append(1, option.short_name);
        }
        if (option.long_name != "") {
            option_name.append(" --");
            option_name.append(option.long_name);
        }
        fprintf(stderr, "option%s lacks an argument\n", option_name.c_str());
        exit(1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %edx, -0x34(%rbp)
movq %rsi, %r15
movq %rdi, %rbx
leaq -0x118(%rbp), %rdi
callq 0x774e
leaq 0x98(%rbx), %rax
movq %rax, -0x70(%rbp)
leaq 0x38(%rbx), %rax
movq %rax, -0x88(%rbp)
leaq 0x40(%rbx), %rax
movq %rax, -0x80(%rbp)
leaq 0x68(%rbx), %rax
movq %rax, -0x68(%rbp)
leaq 0x70(%rbx), %rax
movq %rax, -0x60(%rbp)
movb $0x1, %al
movl %eax, -0x30(%rbp)
leaq -0x58(%rbp), %r12
leaq -0xc8(%rbp), %r13
leaq -0x138(%rbp), %r14
movq %r15, -0x78(%rbp)
movq 0x10(%r15), %rsi
cmpq %rsi, 0x30(%r15)
je 0x6694
movq %r12, %rdi
callq 0x4460
movq %r15, %rdi
callq 0x7104
movq -0x108(%rbp), %rax
movq -0xe8(%rbp), %rcx
testb $0x1, -0x30(%rbp)
je 0x649d
cmpq %rax, %rcx
jne 0x649d
cmpq $0x2, -0x50(%rbp)
jb 0x649d
movq -0x58(%rbp), %rdx
cmpb $0x2d, (%rdx)
jne 0x649d
movq %r12, %rdi
leaq 0x1ce63(%rip), %rsi     # 0x232ea
callq 0x6fed
testb %al, %al
je 0x6518
movl $0x0, -0x30(%rbp)
jmp 0x650b
cmpq %rax, %rcx
je 0x64ff
movslq (%rax), %rax
movq %rbx, %r14
movq %r12, %r15
movq 0x20(%rbx), %r12
imulq $0x90, %rax, %rbx
leaq (%r12,%rbx), %r13
leaq -0x118(%rbp), %rdi
callq 0x71da
movb 0x4a(%r12,%rbx), %al
movq %r15, %r12
xorb $0x1, %al
orb -0x34(%rbp), %al
cmpb $0x1, %al
jne 0x64e3
leaq 0x28(%r13), %rdi
movq %r12, %rsi
callq 0x41c0
movb $0x1, 0x4a(%r13)
movq %r14, %rbx
movq -0x78(%rbp), %r15
leaq -0xc8(%rbp), %r13
leaq -0x138(%rbp), %r14
jmp 0x650b
movq -0x70(%rbp), %rdi
movq %r12, %rsi
callq 0x719e
movq %r12, %rdi
callq 0x46b8
jmp 0x6436
movq -0x58(%rbp), %rax
cmpb $0x2d, 0x1(%rax)
jne 0x65fa
movq %r13, %rdi
movq %r12, %rsi
pushq $0x2
popq %rdx
pushq $-0x1
popq %rcx
callq 0x4360
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
andq $0x0, -0xa0(%rbp)
movb $0x0, -0x98(%rbp)
movq %r13, %rdi
pushq $0x3d
popq %rsi
xorl %edx, %edx
callq 0x4430
testl %eax, %eax
js 0x65b5
movq %rax, -0x30(%rbp)
leal 0x1(%rax), %edx
movq %r14, %rdi
movq %r13, %rsi
pushq $-0x1
popq %rcx
callq 0x4360
leaq -0xa8(%rbp), %rdi
movq %r14, %rsi
callq 0x43d0
movq %r14, %rdi
callq 0x46b8
movq %r15, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x7168
movq -0x30(%rbp), %rsi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq %r13, %rdi
pushq $-0x1
popq %rdx
callq 0x40c0
movq -0x68(%rbp), %rdi
movq %r13, %rsi
callq 0x7b5c
cmpq -0x60(%rbp), %rax
je 0x675b
movslq 0x40(%rax), %rdx
movq 0x20(%rbx), %rcx
imulq $0x90, %rdx, %rdx
cmpb $0x1, 0x49(%rcx,%rdx)
jne 0x666f
addq $0x40, %rax
leaq -0x118(%rbp), %rdi
movq %rax, %rsi
callq 0x713e
jmp 0x6676
pushq $0x1
popq %r14
movslq -0x50(%rbp), %rax
cmpq %rax, %r14
jge 0x6665
movq -0x58(%rbp), %rax
movb (%rax,%r14), %al
movb %al, -0xc8(%rbp)
movq -0x88(%rbp), %rdi
movq %r13, %rsi
callq 0x7bfc
cmpq -0x80(%rbp), %rax
je 0x66c2
movslq 0x24(%rax), %rdx
movq 0x20(%rbx), %rcx
imulq $0x90, %rdx, %rdx
cmpb $0x1, 0x49(%rcx,%rdx)
jne 0x6659
addq $0x24, %rax
leaq -0x118(%rbp), %rdi
movq %rax, %rsi
callq 0x713e
jmp 0x6660
addq %rdx, %rcx
movb $0x1, 0x4a(%rcx)
incq %r14
jmp 0x65fe
movb $0x1, %al
movl %eax, -0x30(%rbp)
jmp 0x64f6
addq %rdx, %rcx
movb $0x1, 0x4a(%rcx)
leaq -0xa8(%rbp), %rdi
callq 0x46b8
movq %r13, %rdi
callq 0x46b8
movb $0x1, %al
movl %eax, -0x30(%rbp)
jmp 0x650b
movq -0x108(%rbp), %rax
cmpq %rax, -0xe8(%rbp)
jne 0x66e9
leaq -0x118(%rbp), %rdi
callq 0x85a2
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e8f7(%rip), %rax     # 0x34fc0
movq (%rax), %rdi
movzbl -0xc8(%rbp), %edx
leaq 0x1cc13(%rip), %rsi     # 0x232ed
xorl %eax, %eax
callq 0x4480
pushq $0x1
popq %rdi
callq 0x43c0
leaq -0x48(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
movslq (%rax), %rax
movq 0x20(%rbx), %rcx
imulq $0x90, %rax, %rax
leaq (%rcx,%rax), %rbx
cmpb $0x0, (%rcx,%rax)
jne 0x677f
addq $0x8, %rbx
leaq 0x1ce0b(%rip), %rsi     # 0x23527
movq %rbx, %rdi
callq 0x704f
testb %al, %al
je 0x6744
leaq 0x1cbba(%rip), %rsi     # 0x232e9
leaq -0x58(%rbp), %rdi
callq 0x4630
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x4660
movq 0x2e875(%rip), %rax     # 0x34fc0
movq (%rax), %rdi
movq -0x58(%rbp), %rdx
leaq 0x1cbc0(%rip), %rsi     # 0x23319
jmp 0x6773
movq 0x2e85e(%rip), %rax     # 0x34fc0
movq (%rax), %rdi
movq -0xc8(%rbp), %rdx
leaq 0x1cb8e(%rip), %rsi     # 0x23301
xorl %eax, %eax
callq 0x4480
jmp 0x66e1
leaq 0x1cb90(%rip), %rsi     # 0x23316
leaq -0x58(%rbp), %rdi
callq 0x4630
movsbl (%rbx), %edx
leaq -0x58(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x4380
jmp 0x6711
jmp 0x67ab
jmp 0x67ab
jmp 0x67d0
jmp 0x67ab
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x46b8
leaq -0xc8(%rbp), %rdi
callq 0x46b8
jmp 0x67d3
jmp 0x67d0
jmp 0x67d0
jmp 0x67d0
jmp 0x67d0
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x46b8
jmp 0x67e1
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x85a2
movq %rbx, %rdi
callq 0x45f0
nop