// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/./args.hxx
// Function: _gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const*, std::vector<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>>>>> args::ArgumentParser::Parse<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const*, std::vector<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>>>>>>(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const*, std::vector<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>>>>>, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const*, std::vector<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>>>>>)
It Parse(It begin, It end)
            {
                bool terminated = false;
                std::vector<Command *> commands = GetCommands();

                // Check all arg chunks
                for (auto it = begin; it != end; ++it)
                {
                    if (Complete(it, end))
                    {
                        return end;
                    }

                    const auto &chunk = *it;

                    if (!terminated && chunk == terminator)
                    {
                        terminated = true;
                    } else if (!terminated && ParseOption(chunk) == OptionType::LongFlag)
                    {
                        if (!ParseLong(it, end))
                        {
                            return it;
                        }
                    } else if (!terminated && ParseOption(chunk) == OptionType::ShortFlag)
                    {
                        if (!ParseShort(it, end))
                        {
                            return it;
                        }
                    } else if (!terminated && !commands.empty())
                    {
                        auto itCommand = std::find_if(commands.begin(), commands.end(), [&chunk](Command *c) { return c->Name() == chunk; });
                        if (itCommand == commands.end())
                        {
                            const std::string errorMessage("Unknown command: " + chunk);
#ifndef ARGS_NOEXCEPT
                            throw ParseError(errorMessage);
#else
                            error = Error::Parse;
                            errorMsg = errorMessage;
                            return it;
#endif
                        }

                        SelectCommand(*itCommand);

                        if (const auto &coroutine = GetCoroutine())
                        {
                            ++it;
                            RaiiSubparser coro(*this, std::vector<std::string>(it, end));
                            coroutine(coro.Parser());
#ifdef ARGS_NOEXCEPT
                            error = GetError();
                            if (error != Error::None)
                            {
                                return end;
                            }

                            if (!coro.Parser().IsParsed())
                            {
                                error = Error::Usage;
                                return end;
                            }
#else
                            if (!coro.Parser().IsParsed())
                            {
                                throw UsageError("Subparser::Parse was not called");
                            }
#endif

                            break;
                        }

                        commands = GetCommands();
                    } else
                    {
                        auto pos = GetNextPositional();
                        if (pos)
                        {
                            pos->ParseValue(chunk);

                            if (pos->KickOut())
                            {
                                return ++it;
                            }
                        } else
                        {
                            const std::string errorMessage("Passed in argument, but no positional arguments were ready to receive it: " + chunk);
#ifndef ARGS_NOEXCEPT
                            throw ParseError(errorMessage);
#else
                            error = Error::Parse;
                            errorMsg = errorMessage;
                            return it;
#endif
                        }
                    }

                    if (!readCompletion && completion != nullptr && completion->Matched())
                    {
#ifdef ARGS_NOEXCEPT
                        error = Error::Completion;
#endif
                        readCompletion = true;
                        ++it;
                        size_t argsLeft = std::distance(it, end);
                        if (completion->cword == 0 || argsLeft <= 1 || completion->cword >= argsLeft)
                        {
#ifndef ARGS_NOEXCEPT
                            throw Completion("");
#endif
                        }

                        std::vector<std::string> curArgs(++it, end);
                        curArgs.resize(completion->cword);

                        if (completion->syntax == "bash")
                        {
                            // bash tokenizes --flag=value as --flag=value
                            for (size_t idx = 0; idx < curArgs.size(); )
                            {
                                if (idx > 0 && curArgs[idx] == "=")
                                {
                                    curArgs[idx - 1] += "=";
                                    if (idx + 1 < curArgs.size())
                                    {
                                        curArgs[idx - 1] += curArgs[idx + 1];
                                        curArgs.erase(curArgs.begin() + idx, curArgs.begin() + idx + 2);
                                    } else
                                    {
                                        curArgs.erase(curArgs.begin() + idx);
                                    }
                                } else
                                {
                                    ++idx;
                                }
                            }

                        }
#ifndef ARGS_NOEXCEPT
                        try
                        {
                            Parse(curArgs.begin(), curArgs.end());
                            throw Completion("");
                        }
                        catch (Completion &)
                        {
                            throw;
                        }
                        catch (args::Error&)
                        {
                            throw Completion("");
                        }
#else
                        return Parse(curArgs.begin(), curArgs.end());
#endif
                    }
                }

                Validate(shortprefix, longprefix);
                return end;
            }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbp
movq (%rdi), %rax
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq *0x28(%rax)
leaq 0x1d8(%rbp), %rax
movq %rax, 0x38(%rsp)
xorl %r13d, %r13d
movq %r15, 0x10(%rsp)
cmpq %r14, %r15
je 0x181bf
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1852c
testb %al, %al
jne 0x181d7
movq 0x10(%rsp), %r15
testb $0x1, %r13b
je 0x17ed2
movq (%rbp), %rax
movq %rbp, %r12
movq %rbp, %rdi
callq *0x40(%rax)
movq %rax, %rbp
testq %rax, %rax
je 0x181f6
movq (%rbp), %rax
movq %rbp, %rdi
movq %r15, %rsi
callq *0x98(%rax)
testb $0x20, 0x8(%rbp)
movl %r13d, %ebx
movq %r12, %rbp
je 0x17faf
jmp 0x17fdf
movq %r15, %rdi
movq 0x38(%rsp), %rsi
callq 0x15eb2
movb $0x1, %bl
testb %al, %al
jne 0x17faf
movq %rbp, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x18b62
testl %eax, %eax
je 0x17f1e
movq %rbp, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x18b62
cmpl $0x1, %eax
jne 0x17f37
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x18ea0
jmp 0x17f2e
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x18bde
testb %al, %al
jne 0x17fad
jmp 0x18157
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
cmpq %rsi, %rdi
je 0x17e94
movq %r15, %rdx
callq 0x1a299
cmpq 0x48(%rsp), %rax
je 0x1823d
movq (%rax), %rax
movq %rax, 0x130(%rbp)
testq %rax, %rax
je 0x17f70
movb $0x1, 0xc(%rax)
movq %rbp, %rdi
callq 0x191ec
movq %rax, %r15
cmpq $0x0, 0x10(%rax)
jne 0x1815e
movq (%rbp), %rax
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq *0x28(%rax)
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x1a4a6
movq %rbx, %rdi
callq 0x13e40
xorl %ebx, %ebx
cmpb $0x0, 0x208(%rbp)
jne 0x17fce
movq 0x200(%rbp), %rdi
testq %rdi, %rdi
je 0x17fce
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
jne 0x17fed
movq 0x10(%rsp), %r15
addq $0x20, %r15
movl %ebx, %r13d
jmp 0x17e65
movq 0x10(%rsp), %r14
addq $0x20, %r14
jmp 0x181d7
movb $0x1, 0x208(%rbp)
movq 0x10(%rsp), %rsi
leaq 0x20(%rsi), %rcx
movq %rcx, 0x10(%rsp)
movq %r14, %rax
subq %rcx, %rax
sarq $0x5, %rax
movq 0x200(%rbp), %rcx
movq 0x128(%rcx), %rcx
cmpq %rax, %rcx
jae 0x18284
testq %rcx, %rcx
je 0x18284
cmpq $0x1, %rax
jbe 0x18284
addq $0x40, %rsi
movq %rsi, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x70(%rsp), %rcx
movq %r14, %rdx
callq 0xbe28
movq 0x200(%rbp), %rax
movq 0x128(%rax), %rsi
leaq 0x18(%rsp), %rdi
callq 0x192ae
movl $0x130, %edi            # imm = 0x130
movq %rbp, 0x38(%rsp)
addq 0x200(%rbp), %rdi
leaq 0xae65(%rip), %rsi      # 0x22ee6
callq 0x192de
testb %al, %al
je 0x182d2
xorl %r13d, %r13d
leaq 0x9f9b(%rip), %r14      # 0x22033
leaq -0x1(%r13), %rbp
leaq 0x1(%r13), %rbx
movq %r13, %r12
shlq $0x5, %r12
shlq $0x5, %rbp
movq %rbx, %r15
shlq $0x5, %r15
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rdx, %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %r13
jae 0x182dc
testq %r13, %r13
je 0x1814f
addq %r12, %rsi
movq %rsi, %rdi
movq %r14, %rsi
callq 0x192de
testb %al, %al
je 0x1814f
movq 0x18(%rsp), %rdi
addq %rbp, %rdi
movq %r14, %rsi
callq 0x6710
movq 0x18(%rsp), %rax
movq 0x20(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rcx, %rbx
jae 0x1813a
leaq (%rax,%r15), %rsi
addq %rbp, %rax
movq %rax, %rdi
callq 0x6740
movq 0x18(%rsp), %rsi
leaq (%rsi,%r12), %rdx
addq $0x40, %rdx
addq %r12, %rsi
leaq 0x18(%rsp), %rdi
callq 0x192ec
jmp 0x180b2
addq %r12, %rax
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x192f2
jmp 0x180b2
movq %rbx, %r13
jmp 0x18098
movq 0x10(%rsp), %r14
jmp 0x181d7
movq 0x10(%rsp), %rsi
addq $0x20, %rsi
movq %rsi, 0x10(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rcx
movq %r14, %rdx
callq 0xbe28
leaq 0x70(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %rbp, %rsi
callq 0x19202
leaq 0x58(%rsp), %rdi
callq 0x739e
leaq 0x78(%rsp), %rsi
movq %r15, %rdi
callq 0x14aae
cmpb $0x0, 0x128(%rsp)
je 0x18334
leaq 0x70(%rsp), %rdi
callq 0x14ad8
leaq 0x198(%rbp), %rsi
leaq 0x178(%rbp), %rdx
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x18(%rax)
leaq 0x40(%rsp), %rdi
callq 0x13e40
movq %r14, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xac9e(%rip), %rsi      # 0x22e9b
leaq 0x70(%rsp), %rdi
movq %r15, %rdx
callq 0xb2b0
pushq $0x10
popq %rdi
callq 0x6220
movq %rax, %r14
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x191d6
leaq 0x1c177(%rip), %rsi     # 0x343a0
movq 0x1cd90(%rip), %rdx     # 0x34fc0
movq %r14, %rdi
callq 0x6680
jmp 0x184d4
leaq 0xac25(%rip), %rsi      # 0x22e69
leaq 0x70(%rsp), %rdi
movq %r15, %rdx
callq 0xb2b0
pushq $0x10
popq %rdi
callq 0x6220
movq %rax, %r14
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x191d6
leaq 0x1c130(%rip), %rsi     # 0x343a0
movq 0x1cd49(%rip), %rdx     # 0x34fc0
movq %r14, %rdi
callq 0x6680
jmp 0x184d4
pushq $0x10
popq %rdi
callq 0x6220
movq %rax, %r14
leaq 0xa143(%rip), %rsi      # 0x223d9
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x61b0
movb $0x1, %bpl
leaq 0x70(%rsp), %rsi
movq %r14, %rdi
callq 0x19298
xorl %ebp, %ebp
leaq 0x1c802(%rip), %rsi     # 0x34ac0
movq 0x1ccfb(%rip), %rdx     # 0x34fc0
movq %r14, %rdi
callq 0x6680
jmp 0x184d4
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x38(%rsp), %rdi
callq 0x192f8
pushq $0x10
popq %rdi
callq 0x6220
movq %rax, %r14
leaq 0xa0e1(%rip), %rsi      # 0x223d9
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x61b0
movb $0x1, %bpl
leaq 0x70(%rsp), %rsi
movq %r14, %rdi
callq 0x19298
xorl %ebp, %ebp
leaq 0x1c7a0(%rip), %rsi     # 0x34ac0
movq 0x1cc99(%rip), %rdx     # 0x34fc0
movq %r14, %rdi
callq 0x6680
jmp 0x184d4
pushq $0x10
popq %rdi
callq 0x6220
movq %rax, %r14
leaq 0xab35(%rip), %rsi      # 0x22e7b
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x61b0
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x14606
xorl %ebp, %ebp
leaq 0x1c2da(%rip), %rsi     # 0x34648
movq 0x1cc4b(%rip), %rdx     # 0x34fc0
movq %r14, %rdi
callq 0x6680
jmp 0x184d4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x61f0
testb %bpl, %bpl
jne 0x18399
jmp 0x183a6
movq %rax, %rbx
movq %r14, %rdi
callq 0x62f0
jmp 0x183a6
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x14ad8
jmp 0x18519
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x18514
jmp 0x18425
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x61f0
testb %bpl, %bpl
jne 0x183de
jmp 0x18519
movq %rax, %rbx
movq %r14, %rdi
callq 0x62f0
jmp 0x18519
jmp 0x1850c
jmp 0x18425
jmp 0x18400
jmp 0x18405
jmp 0x18425
jmp 0x18425
jmp 0x18425
jmp 0x18425
jmp 0x18425
movq %rax, %rbx
jmp 0x18410
movq %rax, %rbx
movq %r14, %rdi
callq 0x62f0
leaq 0x70(%rsp), %rdi
callq 0x61f0
jmp 0x18519
jmp 0x18425
jmp 0x18425
jmp 0x18425
movq %rax, %rbx
jmp 0x18519
movq %rdx, %r15
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x61f0
testb %bpl, %bpl
jne 0x1844a
jmp 0x18464
movq %rdx, %r15
movq %rax, %rbx
movq %r14, %rdi
callq 0x62f0
jmp 0x18464
jmp 0x1850c
jmp 0x1850c
movq %rdx, %r15
movq %rax, %rbx
cmpl $0x2, %r15d
jne 0x18479
movq %rbx, %rdi
callq 0x61c0
callq 0x65c0
jmp 0x184d4
cmpl $0x1, %r15d
jne 0x1850f
movq %rbx, %rdi
callq 0x61c0
pushq $0x10
popq %rdi
callq 0x6220
movq %rax, %r14
leaq 0x9f3c(%rip), %rsi      # 0x223d9
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x61b0
movb $0x1, %bpl
leaq 0x70(%rsp), %rsi
movq %r14, %rdi
callq 0x19298
xorl %ebp, %ebp
leaq 0x1c5fb(%rip), %rsi     # 0x34ac0
movq 0x1caf4(%rip), %rdx     # 0x34fc0
movq %r14, %rdi
callq 0x6680
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x61f0
testb %bpl, %bpl
jne 0x184eb
jmp 0x184f3
movq %rax, %rbx
movq %r14, %rdi
callq 0x62f0
callq 0x6650
jmp 0x1850f
movq %rax, %rbx
callq 0x6650
jmp 0x1850f
movq %rax, %rdi
callq 0x7511
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x739e
leaq 0x40(%rsp), %rdi
callq 0x13e40
movq %rbx, %rdi
callq 0x66b0
nop