_ZN4args14ArgumentParserC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
 3271|    948|            {
 3272|    948|                Description(description_);
 3273|    948|                Epilog(epilog_);
 3274|    948|                LongPrefix("--");
 3275|    948|                ShortPrefix("-");
 3276|    948|                LongSeparator("=");
 3277|    948|                Terminator("--");
 3278|    948|                SetArgumentSeparations(true, true, true, true);
 3279|    948|                matched = true;
 3280|    948|            }
_ZN4args7CommandC2Ev:
 2093|    948|            Command() = default;
_ZN4args5GroupC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_8functionIFbRKS0_EEENS_7OptionsE:
 1681|    948|            Group(const std::string &help_ = std::string(), const std::function<bool(const Group &)> &validator_ = Validators::DontCare, Options options_ = {}) : Base(help_, options_), validator(validator_) {}
_ZN4args4BaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_7OptionsE:
 1030|  3.79k|            Base(const std::string &help_, Options options_ = {}) : options(options_), help(help_) {}
_ZNK4args4Base7MatchedEv:
 1044|  24.2k|            {
 1045|  24.2k|                return matched;
 1046|  24.2k|            }
_ZN4args4Base11GetCommandsEv:
 1066|  2.84k|            {
 1067|  2.84k|                return {};
 1068|  2.84k|            }
_ZNK4args4Base7IsGroupEv:
 1071|     78|            {
 1072|     78|                return false;
 1073|     78|            }
_ZN4args4Base17GetNextPositionalEv:
 1081|    708|            {
 1082|    708|                return nullptr;
 1083|    708|            }
_ZNK4args4Base10HasCommandEv:
 1101|     78|            {
 1102|     78|                return false;
 1103|     78|            }
_ZN4args4Base5ResetEv:
 1130|  3.79k|            {
 1131|  3.79k|                matched = false;
 1132|       |#ifdef ARGS_NOEXCEPT
 1133|       |                error = Error::None;
 1134|       |                errorMsg.clear();
 1135|       |#endif
 1136|  3.79k|            }
_ZN4args4BaseD2Ev:
 1031|  3.79k|            virtual ~Base() {}
_ZN4args5GroupD2Ev:
 1687|    948|            virtual ~Group() {}
_ZNK4args5Group8ChildrenEv:
 1699|  25.2k|            {
 1700|  25.2k|                return children;
 1701|  25.2k|            }
_ZN4argsanENS_7OptionsES0_:
  815|  44.6k|    {
  816|  44.6k|        return static_cast<Options>(static_cast<int>(lhs) & static_cast<int>(rhs));
  817|  44.6k|    }
_ZNK4args4Base10GetOptionsEv:
 1034|  22.3k|            {
 1035|  22.3k|                return options;
 1036|  22.3k|            }
_ZN4args5Group11GetCommandsEv:
 1892|    948|            {
 1893|    948|                std::vector<Command*> res;
 1894|    948|                for (const auto &child : Children())
  ------------------
  |  Branch (1894:40): [True: 2.84k, False: 948]
  ------------------
 1895|  2.84k|                {
 1896|  2.84k|                    auto subparsers = child->GetCommands();
 1897|  2.84k|                    res.insert(std::end(res), std::begin(subparsers), std::end(subparsers));
 1898|  2.84k|                }
 1899|    948|                return res;
 1900|    948|            }
_ZN4args5Group5MatchERKNS_10EitherFlagE:
 1709|  22.9k|            {
 1710|  22.9k|                for (Base *child: Children())
  ------------------
  |  Branch (1710:33): [True: 66.8k, False: 653]
  ------------------
 1711|  66.8k|                {
 1712|  66.8k|                    if (FlagBase *match = child->Match(flag))
  ------------------
  |  Branch (1712:35): [True: 22.3k, False: 44.5k]
  ------------------
 1713|  22.3k|                    {
 1714|  22.3k|                        return match;
 1715|  22.3k|                    }
 1716|  66.8k|                }
 1717|    653|                return nullptr;
 1718|  22.9k|            }
_ZN4args5Group17GetNextPositionalEv:
 1744|    236|            {
 1745|    236|                for (Base *child: Children())
  ------------------
  |  Branch (1745:33): [True: 708, False: 236]
  ------------------
 1746|    708|                {
 1747|    708|                    if (auto next = child->GetNextPositional())
  ------------------
  |  Branch (1747:30): [True: 0, False: 708]
  ------------------
 1748|      0|                    {
 1749|      0|                        return next;
 1750|      0|                    }
 1751|    708|                }
 1752|    236|                return nullptr;
 1753|    236|            }
_ZNK4args5Group10HasCommandEv:
 1778|     26|            {
 1779|     26|                return std::any_of(Children().begin(), Children().end(), [](Base *child) { return child->HasCommand(); });
 1780|     26|            }
_ZZNK4args5Group10HasCommandEvENKUlPNS_4BaseEE_clES2_:
 1779|     78|                return std::any_of(Children().begin(), Children().end(), [](Base *child) { return child->HasCommand(); });
_ZN4args5Group5ResetEv:
 1908|    948|            {
 1909|    948|                Base::Reset();
 1910|       |
 1911|    948|                for (auto &child: Children())
  ------------------
  |  Branch (1911:33): [True: 2.84k, False: 948]
  ------------------
 1912|  2.84k|                {
 1913|  2.84k|                    child->Reset();
 1914|  2.84k|                }
 1915|       |#ifdef ARGS_NOEXCEPT
 1916|       |                error = Error::None;
 1917|       |                errorMsg.clear();
 1918|       |#endif
 1919|    948|            }
_ZN4args7Command5ResetEv:
 2545|    948|            {
 2546|    948|                Group::Reset();
 2547|    948|                selectedCommand = nullptr;
 2548|    948|                subparserProgramLine.clear();
 2549|    948|                subparserDescription.clear();
 2550|    948|                subparserHasFlag = false;
 2551|    948|                subparserHasPositional = false;
 2552|    948|                subparserHasCommand = false;
 2553|       |#ifdef ARGS_NOEXCEPT
 2554|       |                subparserError = Error::None;
 2555|       |#endif
 2556|    948|            }
_ZN4args7Command11DescriptionERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2166|    948|            { this->description = description_; }
_ZN4args7Command6EpilogERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2176|    948|            { this->epilog = epilog_; }
_ZN4args14ArgumentParser10LongPrefixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3304|    948|            {
 3305|    948|                this->longprefix = longprefix_;
 3306|    948|                this->helpParams.longPrefix = longprefix_;
 3307|    948|            }
_ZN4args14ArgumentParser11ShortPrefixERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3316|    948|            {
 3317|    948|                this->shortprefix = shortprefix_;
 3318|    948|                this->helpParams.shortPrefix = shortprefix_;
 3319|    948|            }
_ZN4args14ArgumentParser13LongSeparatorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3328|    948|            {
 3329|    948|                if (longseparator_.empty())
  ------------------
  |  Branch (3329:21): [True: 0, False: 948]
  ------------------
 3330|      0|                {
 3331|      0|                    const std::string errorMessage("longseparator can not be set to empty");
 3332|       |#ifdef ARGS_NOEXCEPT
 3333|       |                    error = Error::Usage;
 3334|       |                    errorMsg = errorMessage;
 3335|       |#else
 3336|      0|                    throw UsageError(errorMessage);
 3337|      0|#endif
 3338|      0|                } else
 3339|    948|                {
 3340|    948|                    this->longseparator = longseparator_;
 3341|    948|                    this->helpParams.longSeparator = allowJoinedLongValue ? longseparator : " ";
  ------------------
  |  Branch (3341:54): [True: 948, False: 0]
  ------------------
 3342|    948|                }
 3343|    948|            }
_ZN4args5ErrorC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  486|    922|            Error(const std::string &problem) : std::runtime_error(problem) {}
_ZN4args14ArgumentParser10TerminatorERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 3352|    948|            { this->terminator = terminator_; }
_ZN4args14ArgumentParser22SetArgumentSeparationsEbbbb:
 3382|    948|            {
 3383|    948|                this->allowJoinedShortValue = allowJoinedShortValue_;
 3384|    948|                this->allowJoinedLongValue = allowJoinedLongValue_;
 3385|    948|                this->allowSeparateShortValue = allowSeparateShortValue_;
 3386|    948|                this->allowSeparateLongValue = allowSeparateLongValue_;
 3387|       |
 3388|    948|                this->helpParams.longSeparator = allowJoinedLongValue ? longseparator : " ";
  ------------------
  |  Branch (3388:50): [True: 948, False: 0]
  ------------------
 3389|    948|                this->helpParams.shortSeparator = allowJoinedShortValue ? "" : " ";
  ------------------
  |  Branch (3389:51): [True: 948, False: 0]
  ------------------
 3390|    948|            }
_ZNK4args7Command7MatchedEv:
 2199|  24.2k|            { return Base::Matched(); }
_ZNK4args7Command8ValidateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
 2494|     26|            {
 2495|     26|                if (!Matched())
  ------------------
  |  Branch (2495:21): [True: 0, False: 26]
  ------------------
 2496|      0|                {
 2497|      0|                    return;
 2498|      0|                }
 2499|       |
 2500|     26|                auto onValidationError = [&]
 2501|     26|                {
 2502|     26|                    std::ostringstream problem;
 2503|     26|                    problem << "Group validation failed somewhere!";
 2504|       |#ifdef ARGS_NOEXCEPT
 2505|       |                    error = Error::Validation;
 2506|       |                    errorMsg = problem.str();
 2507|       |#else
 2508|     26|                    throw ValidationError(problem.str());
 2509|     26|#endif
 2510|     26|                };
 2511|       |
 2512|     26|                for (Base *child: Children())
  ------------------
  |  Branch (2512:33): [True: 78, False: 26]
  ------------------
 2513|     78|                {
 2514|     78|                    if (child->IsGroup() && !child->Matched())
  ------------------
  |  Branch (2514:25): [True: 0, False: 78]
  |  Branch (2514:45): [True: 0, False: 0]
  ------------------
 2515|      0|                    {
 2516|      0|                        onValidationError();
 2517|      0|                    }
 2518|       |
 2519|     78|                    child->Validate(shortprefix, longprefix);
 2520|     78|                }
 2521|       |
 2522|     26|                if (subparser != nullptr)
  ------------------
  |  Branch (2522:21): [True: 0, False: 26]
  ------------------
 2523|      0|                {
 2524|      0|                    subparser->Validate(shortprefix, longprefix);
 2525|      0|                    if (!subparser->Matched())
  ------------------
  |  Branch (2525:25): [True: 0, False: 0]
  ------------------
 2526|      0|                    {
 2527|      0|                        onValidationError();
 2528|      0|                    }
 2529|      0|                }
 2530|       |
 2531|     26|                if (selectedCommand == nullptr && commandIsRequired && (Group::HasCommand() || subparserHasCommand))
  ------------------
  |  Branch (2531:21): [True: 26, False: 0]
  |  Branch (2531:51): [True: 26, False: 0]
  |  Branch (2531:73): [True: 0, False: 26]
  |  Branch (2531:96): [True: 0, False: 26]
  ------------------
 2532|      0|                {
 2533|      0|                    std::ostringstream problem;
 2534|      0|                    problem << "Command is required";
 2535|       |#ifdef ARGS_NOEXCEPT
 2536|       |                    error = Error::Validation;
 2537|       |                    errorMsg = problem.str();
 2538|       |#else
 2539|      0|                    throw ValidationError(problem.str());
 2540|      0|#endif
 2541|      0|                }
 2542|     26|            }
_ZN4args7Command11GetCommandsEv:
 2397|    948|            {
 2398|    948|                if (selectedCommand != nullptr)
  ------------------
  |  Branch (2398:21): [True: 0, False: 948]
  ------------------
 2399|      0|                {
 2400|      0|                    return selectedCommand->GetCommands();
 2401|      0|                }
 2402|       |
 2403|    948|                if (Matched())
  ------------------
  |  Branch (2403:21): [True: 948, False: 0]
  ------------------
 2404|    948|                {
 2405|    948|                    return Group::GetCommands();
 2406|    948|                }
 2407|       |
 2408|      0|                return { this };
 2409|    948|            }
_ZN4args7Command5MatchERKNS_10EitherFlagE:
 2218|  22.9k|            {
 2219|  22.9k|                if (selectedCommand != nullptr)
  ------------------
  |  Branch (2219:21): [True: 0, False: 22.9k]
  ------------------
 2220|      0|                {
 2221|      0|                    if (auto *res = selectedCommand->Match(flag))
  ------------------
  |  Branch (2221:31): [True: 0, False: 0]
  ------------------
 2222|      0|                    {
 2223|      0|                        return res;
 2224|      0|                    }
 2225|       |
 2226|      0|                    for (auto *child: Children())
  ------------------
  |  Branch (2226:37): [True: 0, False: 0]
  ------------------
 2227|      0|                    {
 2228|      0|                        if ((child->GetOptions() & Options::Global) != Options::None)
  ------------------
  |  Branch (2228:29): [True: 0, False: 0]
  ------------------
 2229|      0|                        {
 2230|      0|                            if (auto *res = child->Match(flag))
  ------------------
  |  Branch (2230:39): [True: 0, False: 0]
  ------------------
 2231|      0|                            {
 2232|      0|                                return res;
 2233|      0|                            }
 2234|      0|                        }
 2235|      0|                    }
 2236|       |
 2237|      0|                    return nullptr;
 2238|      0|                }
 2239|       |
 2240|  22.9k|                if (subparser != nullptr)
  ------------------
  |  Branch (2240:21): [True: 0, False: 22.9k]
  ------------------
 2241|      0|                {
 2242|      0|                    return subparser->Match(flag);
 2243|      0|                }
 2244|       |
 2245|  22.9k|                return Matched() ? Group::Match(flag) : nullptr;
  ------------------
  |  Branch (2245:24): [True: 22.9k, False: 0]
  ------------------
 2246|  22.9k|            }
_ZN4args7Command17GetNextPositionalEv:
 2282|    236|            {
 2283|    236|                if (selectedCommand != nullptr)
  ------------------
  |  Branch (2283:21): [True: 0, False: 236]
  ------------------
 2284|      0|                {
 2285|      0|                    if (auto *res = selectedCommand->GetNextPositional())
  ------------------
  |  Branch (2285:31): [True: 0, False: 0]
  ------------------
 2286|      0|                    {
 2287|      0|                        return res;
 2288|      0|                    }
 2289|       |
 2290|      0|                    for (auto *child: Children())
  ------------------
  |  Branch (2290:37): [True: 0, False: 0]
  ------------------
 2291|      0|                    {
 2292|      0|                        if ((child->GetOptions() & Options::Global) != Options::None)
  ------------------
  |  Branch (2292:29): [True: 0, False: 0]
  ------------------
 2293|      0|                        {
 2294|      0|                            if (auto *res = child->GetNextPositional())
  ------------------
  |  Branch (2294:39): [True: 0, False: 0]
  ------------------
 2295|      0|                            {
 2296|      0|                                return res;
 2297|      0|                            }
 2298|      0|                        }
 2299|      0|                    }
 2300|       |
 2301|      0|                    return nullptr;
 2302|      0|                }
 2303|       |
 2304|    236|                if (subparser != nullptr)
  ------------------
  |  Branch (2304:21): [True: 0, False: 236]
  ------------------
 2305|      0|                {
 2306|      0|                    return subparser->GetNextPositional();
 2307|      0|                }
 2308|       |
 2309|    236|                return Matched() ? Group::GetNextPositional() : nullptr;
  ------------------
  |  Branch (2309:24): [True: 236, False: 0]
  ------------------
 2310|    236|            }
_ZN4args14ArgumentParser5ResetEv:
 3520|    948|            {
 3521|    948|                Command::Reset();
 3522|    948|                matched = true;
 3523|    948|                readCompletion = false;
 3524|    948|            }
_ZN4args10EitherFlagC2Ec:
  581|  25.3k|        EitherFlag(const char flag) : isShort(true), shortFlag(flag), longFlag() {}
_ZN4args10EitherFlagC2EPKc:
  580|  2.84k|        EitherFlag(const char *flag) : isShort(false), shortFlag(), longFlag(flag) {}
_ZN4args7MatcherC2ESt16initializer_listINS_10EitherFlagEE:
  686|  2.84k|                Matcher(EitherFlag::GetShort(in), EitherFlag::GetLong(in)) {}
_ZN4args10EitherFlag8GetShortESt16initializer_listIS0_E:
  601|  2.84k|        {
  602|  2.84k|            std::unordered_set<char>  shortFlags;
  603|  2.84k|            for (const EitherFlag &flag: flags)
  ------------------
  |  Branch (603:40): [True: 5.68k, False: 2.84k]
  ------------------
  604|  5.68k|            {
  605|  5.68k|                if (flag.isShort)
  ------------------
  |  Branch (605:21): [True: 2.84k, False: 2.84k]
  ------------------
  606|  2.84k|                {
  607|  2.84k|                    shortFlags.insert(flag.shortFlag);
  608|  2.84k|                }
  609|  5.68k|            }
  610|  2.84k|            return shortFlags;
  611|  2.84k|        }
_ZN4args10EitherFlag7GetLongESt16initializer_listIS0_E:
  586|  2.84k|        {
  587|  2.84k|            std::unordered_set<std::string>  longFlags;
  588|  2.84k|            for (const EitherFlag &flag: flags)
  ------------------
  |  Branch (588:40): [True: 5.68k, False: 2.84k]
  ------------------
  589|  5.68k|            {
  590|  5.68k|                if (!flag.isShort)
  ------------------
  |  Branch (590:21): [True: 2.84k, False: 2.84k]
  ------------------
  591|  2.84k|                {
  592|  2.84k|                    longFlags.insert(flag.longFlag);
  593|  2.84k|                }
  594|  5.68k|            }
  595|  2.84k|            return longFlags;
  596|  2.84k|        }
_ZN4args7MatcherC2INSt3__113unordered_setIcNS2_4hashIcEENS2_8equal_toIcEENS2_9allocatorIcEEEENS3_INS2_12basic_stringIcNS2_11char_traitsIcEES9_EENS4_ISE_EENS6_ISE_EENS8_ISE_EEEEEEOT_OT0_:
  670|  2.84k|                Matcher(std::begin(shortIn), std::end(shortIn), std::begin(longIn), std::end(longIn))
  671|  2.84k|            {}
_ZN4args7MatcherC2INSt3__121__hash_const_iteratorIPNS2_11__hash_nodeIcPvEEEENS3_IPNS4_INS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES5_EEEEEET_SI_T0_SJ_:
  645|  2.84k|                shortFlags(shortFlagsStart, shortFlagsEnd),
  646|  2.84k|                longFlags(longFlagsStart, longFlagsEnd)
  647|  2.84k|            {
  648|  2.84k|                if (shortFlags.empty() && longFlags.empty())
  ------------------
  |  Branch (648:21): [True: 0, False: 2.84k]
  |  Branch (648:43): [True: 0, False: 0]
  ------------------
  649|      0|                {
  650|      0|#ifndef ARGS_NOEXCEPT
  651|      0|                    throw UsageError("empty Matcher");
  652|      0|#endif
  653|      0|                }
  654|  2.84k|            }
_ZN4args8HelpFlagC2ERNS_5GroupERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_ONS_7MatcherENS_7OptionsE:
 3672|    948|            HelpFlag(Group &group_, const std::string &name_, const std::string &help_, Matcher &&matcher_, Options options_ = {}): Flag(group_, name_, help_, std::move(matcher_), options_) {}
_ZN4args4FlagC2ERNS_5GroupERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_ONS_7MatcherENS_7OptionsE:
 3637|  2.84k|            Flag(Group &group_, const std::string &name_, const std::string &help_, Matcher &&matcher_, Options options_): FlagBase(name_, help_, std::move(matcher_), options_)
 3638|  2.84k|            {
 3639|  2.84k|                group_.Add(*this);
 3640|  2.84k|            }
_ZN4args8FlagBaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_ONS_7MatcherENS_7OptionsE:
 1337|  2.84k|            FlagBase(const std::string &name_, const std::string &help_, Matcher &&matcher_, Options options_) : NamedBase(name_, help_, options_), matcher(std::move(matcher_)) {}
_ZN4args9NamedBaseC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_NS_7OptionsE:
 1186|  2.84k|            NamedBase(const std::string &name_, const std::string &help_, Options options_ = {}) : Base(help_, options_), name(name_) {}
_ZN4args9NamedBaseD2Ev:
 1187|  2.84k|            virtual ~NamedBase() {}
_ZN4args7MatcherC2EOS0_:
  688|  2.84k|            Matcher(Matcher &&other) noexcept : shortFlags(std::move(other.shortFlags)), longFlags(std::move(other.longFlags))
  689|  2.84k|            {}
_ZN4args5Group3AddERNS_4BaseE:
 1692|  2.84k|            {
 1693|  2.84k|                children.emplace_back(&child);
 1694|  2.84k|            }
_ZN4args8FlagBaseD2Ev:
 1339|  2.84k|            virtual ~FlagBase() {}
_ZN4args4Flag10ParseValueERKNSt3__16vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEE:
 3661|  22.3k|            {
 3662|  22.3k|            }
_ZNK4args8FlagBase8ValidateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
 1373|     78|            {
 1374|     78|                if (!Matched() && IsRequired())
  ------------------
  |  Branch (1374:21): [True: 37, False: 41]
  |  Branch (1374:35): [True: 0, False: 37]
  ------------------
 1375|      0|                {
 1376|      0|                        std::ostringstream problem;
 1377|      0|                        problem << "Flag '" << matcher.GetLongOrAny().str(shortPrefix, longPrefix) << "' is required";
 1378|       |#ifdef ARGS_NOEXCEPT
 1379|       |                        error = Error::Required;
 1380|       |                        errorMsg = problem.str();
 1381|       |#else
 1382|      0|                        throw RequiredError(problem.str());
 1383|      0|#endif
 1384|      0|                }
 1385|     78|            }
_ZNK4args4Base10IsRequiredEv:
 1039|     37|            {
 1040|     37|                return (GetOptions() & Options::Required) != Options::None;
 1041|     37|            }
_ZN4args10EitherFlagC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  579|    504|        EitherFlag(const std::string &flag) : isShort(false), shortFlag(), longFlag(flag) {}
_ZN4args8FlagBase5MatchERKNS_10EitherFlagE:
 1342|  66.8k|            {
 1343|  66.8k|                if (matcher.Match(flag))
  ------------------
  |  Branch (1343:21): [True: 22.3k, False: 44.5k]
  ------------------
 1344|  22.3k|                {
 1345|  22.3k|                    if ((GetOptions() & Options::Single) != Options::None && matched)
  ------------------
  |  Branch (1345:25): [True: 0, False: 22.3k]
  |  Branch (1345:78): [True: 0, False: 0]
  ------------------
 1346|      0|                    {
 1347|      0|                        std::ostringstream problem;
 1348|      0|                        problem << "Flag '" << flag.str() << "' was passed multiple times, but is only allowed to be passed once";
 1349|       |#ifdef ARGS_NOEXCEPT
 1350|       |                        error = Error::Extra;
 1351|       |                        errorMsg = problem.str();
 1352|       |#else
 1353|      0|                        throw ExtraError(problem.str());
 1354|      0|#endif
 1355|      0|                    }
 1356|  22.3k|                    matched = true;
 1357|  22.3k|                    return this;
 1358|  22.3k|                }
 1359|  44.5k|                return nullptr;
 1360|  66.8k|            }
_ZNK4args7Matcher5MatchERKNS_10EitherFlagE:
  710|  66.8k|            {
  711|  66.8k|                return flag.isShort ? Match(flag.shortFlag) : Match(flag.longFlag);
  ------------------
  |  Branch (711:24): [True: 65.4k, False: 1.41k]
  ------------------
  712|  66.8k|            }
_ZNK4args7Matcher5MatchEc:
  696|  65.4k|            {
  697|  65.4k|                return shortFlags.find(flag) != shortFlags.end();
  698|  65.4k|            }
_ZNK4args7Matcher5MatchERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  703|  1.41k|            {
  704|  1.41k|                return longFlags.find(flag) != longFlags.end();
  705|  1.41k|            }
_ZN4args10ParseErrorC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  504|    907|            ParseError(const std::string &problem) : Error(problem) {}
_ZN4args5NargsC2Em:
  998|  22.3k|        Nargs(size_t num_) : min{num_}, max{num_}
  999|  22.3k|        {
 1000|  22.3k|        }
_ZNK4args9NamedBase4NameEv:
 1235|     15|            {
 1236|     15|                return name;
 1237|     15|            }
_ZNK4args4Flag17NumberOfArgumentsEv:
 3656|  22.3k|            {
 3657|  22.3k|                return 0;
 3658|  22.3k|            }
_ZN4args8HelpFlag10ParseValueERKNSt3__16vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEE:
 3677|     15|            {
 3678|       |#ifdef ARGS_NOEXCEPT
 3679|       |                    error = Error::Help;
 3680|       |                    errorMsg = Name();
 3681|       |#else
 3682|     15|                    throw Help(Name());
 3683|     15|#endif
 3684|     15|            }
_ZN4args4HelpC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  549|     15|            Help(const std::string &flag) : Error(flag) {}
_ZN4args7MatcherD2Ev:
  691|  5.68k|            ~Matcher() {}
_ZN4args4FlagC2ERNS_5GroupERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEESB_ONS_7MatcherEb:
 3642|  1.89k|            Flag(Group &group_, const std::string &name_, const std::string &help_, Matcher &&matcher_, const bool extraError_ = false): Flag(group_, name_, help_, std::move(matcher_), extraError_ ? Options::Single : Options::None)
  ------------------
  |  Branch (3642:186): [True: 0, False: 1.89k]
  ------------------
 3643|  1.89k|            {
 3644|  1.89k|            }
_ZN4args14ArgumentParser9ParseArgsINSt3__111__wrap_iterIPNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEET_SC_SC_:
 3534|    948|            {
 3535|       |                // Reset all Matched statuses and errors
 3536|    948|                Reset();
 3537|       |#ifdef ARGS_NOEXCEPT
 3538|       |                error = GetError();
 3539|       |                if (error != Error::None)
 3540|       |                {
 3541|       |                    return end;
 3542|       |                }
 3543|       |#endif
 3544|    948|                return Parse(begin, end);
 3545|    948|            }
_ZN4args14ArgumentParser5ParseINSt3__111__wrap_iterIPNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEET_SC_SC_:
 3057|    948|            {
 3058|    948|                bool terminated = false;
 3059|    948|                std::vector<Command *> commands = GetCommands();
 3060|       |
 3061|       |                // Check all arg chunks
 3062|  2.03k|                for (auto it = begin; it != end; ++it)
  ------------------
  |  Branch (3062:39): [True: 1.31k, False: 712]
  ------------------
 3063|  1.31k|                {
 3064|  1.31k|                    if (Complete(it, end, terminated))
  ------------------
  |  Branch (3064:25): [True: 0, False: 1.31k]
  ------------------
 3065|      0|                    {
 3066|      0|                        return end;
 3067|      0|                    }
 3068|       |
 3069|  1.31k|                    const auto &chunk = *it;
 3070|       |
 3071|  1.31k|                    if (!terminated && chunk == terminator)
  ------------------
  |  Branch (3071:25): [True: 1.31k, False: 3]
  |  Branch (3071:40): [True: 6, False: 1.30k]
  ------------------
 3072|      6|                    {
 3073|      6|                        terminated = true;
 3074|  1.31k|                    } else if (!terminated && ParseOption(chunk) == OptionType::LongFlag)
  ------------------
  |  Branch (3074:32): [True: 1.30k, False: 3]
  |  Branch (3074:47): [True: 504, False: 805]
  ------------------
 3075|    504|                    {
 3076|    504|                        if (!ParseLong(it, end))
  ------------------
  |  Branch (3076:29): [True: 0, False: 504]
  ------------------
 3077|      0|                        {
 3078|      0|                            return it;
 3079|      0|                        }
 3080|    808|                    } else if (!terminated && ParseOption(chunk) == OptionType::ShortFlag)
  ------------------
  |  Branch (3080:32): [True: 805, False: 3]
  |  Branch (3080:47): [True: 572, False: 233]
  ------------------
 3081|    572|                    {
 3082|    572|                        if (!ParseShort(it, end))
  ------------------
  |  Branch (3082:29): [True: 0, False: 572]
  ------------------
 3083|      0|                        {
 3084|      0|                            return it;
 3085|      0|                        }
 3086|    572|                    } else if (!terminated && !commands.empty())
  ------------------
  |  Branch (3086:32): [True: 233, False: 3]
  |  Branch (3086:47): [True: 0, False: 233]
  ------------------
 3087|      0|                    {
 3088|      0|                        auto itCommand = std::find_if(commands.begin(), commands.end(), [&chunk](Command *c) { return c->Name() == chunk; });
 3089|      0|                        if (itCommand == commands.end())
  ------------------
  |  Branch (3089:29): [True: 0, False: 0]
  ------------------
 3090|      0|                        {
 3091|      0|                            const std::string errorMessage("Unknown command: " + chunk);
 3092|      0|#ifndef ARGS_NOEXCEPT
 3093|      0|                            throw ParseError(errorMessage);
 3094|       |#else
 3095|       |                            error = Error::Parse;
 3096|       |                            errorMsg = errorMessage;
 3097|       |                            return it;
 3098|       |#endif
 3099|      0|                        }
 3100|       |
 3101|      0|                        SelectCommand(*itCommand);
 3102|       |
 3103|      0|                        if (const auto &coroutine = GetCoroutine())
  ------------------
  |  Branch (3103:41): [True: 0, False: 0]
  ------------------
 3104|      0|                        {
 3105|      0|                            ++it;
 3106|      0|                            RaiiSubparser coro(*this, std::vector<std::string>(it, end));
 3107|      0|                            coroutine(coro.Parser());
 3108|       |#ifdef ARGS_NOEXCEPT
 3109|       |                            error = GetError();
 3110|       |                            if (error != Error::None)
 3111|       |                            {
 3112|       |                                return end;
 3113|       |                            }
 3114|       |
 3115|       |                            if (!coro.Parser().IsParsed())
 3116|       |                            {
 3117|       |                                error = Error::Usage;
 3118|       |                                return end;
 3119|       |                            }
 3120|       |#else
 3121|      0|                            if (!coro.Parser().IsParsed())
  ------------------
  |  Branch (3121:33): [True: 0, False: 0]
  ------------------
 3122|      0|                            {
 3123|      0|                                throw UsageError("Subparser::Parse was not called");
 3124|      0|                            }
 3125|      0|#endif
 3126|       |
 3127|      0|                            break;
 3128|      0|                        }
 3129|       |
 3130|      0|                        commands = GetCommands();
 3131|      0|                    } else
 3132|    236|                    {
 3133|    236|                        auto pos = GetNextPositional();
 3134|    236|                        if (pos)
  ------------------
  |  Branch (3134:29): [True: 0, False: 236]
  ------------------
 3135|      0|                        {
 3136|      0|                            pos->ParseValue(chunk);
 3137|       |#ifdef ARGS_NOEXCEPT
 3138|       |                            if (pos->GetError() != Error::None)
 3139|       |                            {
 3140|       |                                return it;
 3141|       |                            }
 3142|       |#endif
 3143|       |
 3144|      0|                            if (pos->KickOut())
  ------------------
  |  Branch (3144:33): [True: 0, False: 0]
  ------------------
 3145|      0|                            {
 3146|      0|                                return ++it;
 3147|      0|                            }
 3148|      0|                        } else
 3149|    236|                        {
 3150|    236|                            const std::string errorMessage("Passed in argument, but no positional arguments were ready to receive it: " + chunk);
 3151|    236|#ifndef ARGS_NOEXCEPT
 3152|    236|                            throw ParseError(errorMessage);
 3153|       |#else
 3154|       |                            error = Error::Parse;
 3155|       |                            errorMsg = errorMessage;
 3156|       |                            return it;
 3157|       |#endif
 3158|    236|                        }
 3159|    236|                    }
 3160|       |
 3161|  1.08k|                    if (!readCompletion && completion != nullptr && completion->Matched())
  ------------------
  |  Branch (3161:25): [True: 396, False: 686]
  |  Branch (3161:44): [True: 0, False: 396]
  |  Branch (3161:69): [True: 0, False: 0]
  ------------------
 3162|      0|                    {
 3163|       |#ifdef ARGS_NOEXCEPT
 3164|       |                        if (completion->GetError() != Error::None)
 3165|       |                        {
 3166|       |                            error = completion->GetError();
 3167|       |                            if (errorMsg.empty())
 3168|       |                            {
 3169|       |                                errorMsg = completion->GetErrorMsg();
 3170|       |                            }
 3171|       |                            return it;
 3172|       |                        }
 3173|       |
 3174|       |                        error = Error::Completion;
 3175|       |#endif
 3176|      0|                        readCompletion = true;
 3177|      0|                        ++it;
 3178|      0|                        const auto argsLeft = static_cast<size_t>(std::distance(it, end));
 3179|      0|                        if (completion->cword == 0 || argsLeft <= 1 || completion->cword >= argsLeft)
  ------------------
  |  Branch (3179:29): [True: 0, False: 0]
  |  Branch (3179:55): [True: 0, False: 0]
  |  Branch (3179:72): [True: 0, False: 0]
  ------------------
 3180|      0|                        {
 3181|      0|#ifndef ARGS_NOEXCEPT
 3182|      0|                            throw Completion("");
 3183|       |#else
 3184|       |                            return end;
 3185|       |#endif
 3186|      0|                        }
 3187|       |
 3188|      0|                        ++it;
 3189|      0|                        std::vector<std::string> curArgs;
 3190|      0|                        curArgs.reserve(completion->cword);
 3191|      0|                        auto curIt = it;
 3192|      0|                        for (size_t idx = 0; idx < completion->cword && curIt != end; ++idx, ++curIt)
  ------------------
  |  Branch (3192:46): [True: 0, False: 0]
  |  Branch (3192:73): [True: 0, False: 0]
  ------------------
 3193|      0|                        {
 3194|      0|                            curArgs.push_back(*curIt);
 3195|      0|                        }
 3196|       |
 3197|      0|                        if (completion->syntax == "bash")
  ------------------
  |  Branch (3197:29): [True: 0, False: 0]
  ------------------
 3198|      0|                        {
 3199|       |                            // bash tokenizes --flag=value as --flag=value
 3200|       |                            // Security fix: Use size_t arithmetic throughout to avoid conversion issues
 3201|      0|                            for (size_t idx = 0; idx < curArgs.size(); )
  ------------------
  |  Branch (3201:50): [True: 0, False: 0]
  ------------------
 3202|      0|                            {
 3203|      0|                                if (idx > 0 && curArgs[idx] == "=")
  ------------------
  |  Branch (3203:37): [True: 0, False: 0]
  |  Branch (3203:48): [True: 0, False: 0]
  ------------------
 3204|      0|                                {
 3205|      0|                                    size_t prev_idx = idx - 1;  // Safe since we checked idx > 0
 3206|      0|                                    curArgs[prev_idx] += "=";
 3207|      0|                                    size_t next_idx = 0;
 3208|      0|                                    if (SafeAdd<size_t>(idx, static_cast<size_t>(1), next_idx) && next_idx < curArgs.size())
  ------------------
  |  Branch (3208:41): [True: 0, False: 0]
  |  Branch (3208:99): [True: 0, False: 0]
  ------------------
 3209|      0|                                    {
 3210|      0|                                        curArgs[prev_idx] += curArgs[next_idx];
 3211|       |                                        // Erase the '=' token and the following value token.
 3212|      0|                                        size_t erase_end = 0;
 3213|      0|                                        if (SafeAdd<size_t>(next_idx, static_cast<size_t>(1), erase_end))
  ------------------
  |  Branch (3213:45): [True: 0, False: 0]
  ------------------
 3214|      0|                                        {
 3215|      0|                                            typedef std::vector<std::string>::difference_type diff_t;
 3216|      0|                                            curArgs.erase(curArgs.begin() + static_cast<diff_t>(idx),
 3217|      0|                                                         curArgs.begin() + static_cast<diff_t>(erase_end));
 3218|      0|                                        }
 3219|      0|                                    } else
 3220|      0|                                    {
 3221|       |                                        // Safe erase of single '=' token at the end
 3222|      0|                                        typedef std::vector<std::string>::difference_type diff_t;
 3223|      0|                                        curArgs.erase(curArgs.begin() + static_cast<diff_t>(idx));
 3224|      0|                                    }
 3225|       |                                    // Do not increment idx - next element slides into current position
 3226|      0|                                } else
 3227|      0|                                {
 3228|      0|                                    ++idx;
 3229|      0|                                }
 3230|      0|                            }
 3231|       |
 3232|      0|                        }
 3233|      0|#ifndef ARGS_NOEXCEPT
 3234|      0|                        try
 3235|      0|                        {
 3236|      0|                            Parse(curArgs.begin(), curArgs.end());
 3237|      0|                            throw Completion("");
 3238|      0|                        }
 3239|      0|                        catch (Completion &)
 3240|      0|                        {
 3241|      0|                            throw;
 3242|      0|                        }
 3243|      0|                        catch (args::Error&)
 3244|      0|                        {
 3245|      0|                            throw Completion("");
 3246|      0|                        }
 3247|       |#else
 3248|       |                        // Discard the nested Parse's return value: it points
 3249|       |                        // into the local curArgs vector, which is destroyed
 3250|       |                        // when this function returns, leaving the caller with
 3251|       |                        // a dangling iterator that would be compared against
 3252|       |                        // the outer `end` in ParseCLI. Return the outer
 3253|       |                        // `end` instead so the iterator stays in the caller's
 3254|       |                        // container.
 3255|       |                        Parse(curArgs.begin(), curArgs.end());
 3256|       |                        error = Error::Completion;
 3257|       |                        errorMsg.clear();
 3258|       |                        return end;
 3259|       |#endif
 3260|      0|                    }
 3261|  1.08k|                }
 3262|       |
 3263|    712|                Validate(shortprefix, longprefix);
 3264|    712|                return end;
 3265|    948|            }
_ZN4args14ArgumentParser8CompleteINSt3__111__wrap_iterIPNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEEbT_SC_b:
 2929|  1.31k|            {
 2930|  1.31k|                auto nextIt = it;
 2931|  1.31k|                if (!readCompletion || (++nextIt != end))
  ------------------
  |  Branch (2931:21): [True: 1.31k, False: 0]
  |  Branch (2931:40): [True: 0, False: 0]
  ------------------
 2932|  1.31k|                {
 2933|  1.31k|                    return false;
 2934|  1.31k|                }
 2935|       |
 2936|      0|                const auto &chunk = *it;
 2937|      0|                auto pos = GetNextPositional();
 2938|      0|                std::vector<Command *> commands = GetCommands();
 2939|      0|                const auto optionType = ParseOption(chunk, true);
 2940|       |
 2941|       |                // Once the terminator has been seen the parser treats every
 2942|       |                // following chunk as positional, so only positional choices are
 2943|       |                // valid completions here. Suggesting flags or commands past the
 2944|       |                // terminator offers candidates the parser would then reject.
 2945|      0|                if (!terminated && !commands.empty() && (chunk.empty() || optionType == OptionType::Positional))
  ------------------
  |  Branch (2945:21): [True: 0, False: 0]
  |  Branch (2945:36): [True: 0, False: 0]
  |  Branch (2945:58): [True: 0, False: 0]
  |  Branch (2945:75): [True: 0, False: 0]
  ------------------
 2946|      0|                {
 2947|      0|                    for (auto &cmd : commands)
  ------------------
  |  Branch (2947:36): [True: 0, False: 0]
  ------------------
 2948|      0|                    {
 2949|      0|                        if ((cmd->GetOptions() & Options::HiddenFromCompletion) == Options::None)
  ------------------
  |  Branch (2949:29): [True: 0, False: 0]
  ------------------
 2950|      0|                        {
 2951|      0|                            AddCompletionReply(chunk, cmd->Name());
 2952|      0|                        }
 2953|      0|                    }
 2954|      0|                } else
 2955|      0|                {
 2956|      0|                    bool hasPositionalCompletion = true;
 2957|       |
 2958|      0|                    if (!terminated && !commands.empty())
  ------------------
  |  Branch (2958:25): [True: 0, False: 0]
  |  Branch (2958:40): [True: 0, False: 0]
  ------------------
 2959|      0|                    {
 2960|      0|                        for (auto &cmd : commands)
  ------------------
  |  Branch (2960:40): [True: 0, False: 0]
  ------------------
 2961|      0|                        {
 2962|      0|                            if ((cmd->GetOptions() & Options::HiddenFromCompletion) == Options::None)
  ------------------
  |  Branch (2962:33): [True: 0, False: 0]
  ------------------
 2963|      0|                            {
 2964|      0|                                AddCompletionReply(chunk, cmd->Name());
 2965|      0|                            }
 2966|      0|                        }
 2967|      0|                    } else if (pos)
  ------------------
  |  Branch (2967:32): [True: 0, False: 0]
  ------------------
 2968|      0|                    {
 2969|      0|                        if ((pos->GetOptions() & Options::HiddenFromCompletion) == Options::None)
  ------------------
  |  Branch (2969:29): [True: 0, False: 0]
  ------------------
 2970|      0|                        {
 2971|      0|                            auto choices = pos->HelpChoices(helpParams);
 2972|      0|                            hasPositionalCompletion = !choices.empty() || optionType != OptionType::Positional;
  ------------------
  |  Branch (2972:55): [True: 0, False: 0]
  |  Branch (2972:75): [True: 0, False: 0]
  ------------------
 2973|      0|                            for (auto &choice : choices)
  ------------------
  |  Branch (2973:47): [True: 0, False: 0]
  ------------------
 2974|      0|                            {
 2975|      0|                                AddCompletionReply(chunk, choice);
 2976|      0|                            }
 2977|      0|                        }
 2978|      0|                    }
 2979|       |
 2980|      0|                    if (!terminated && hasPositionalCompletion)
  ------------------
  |  Branch (2980:25): [True: 0, False: 0]
  |  Branch (2980:40): [True: 0, False: 0]
  ------------------
 2981|      0|                    {
 2982|      0|                        auto flags = GetAllFlags();
 2983|      0|                        for (auto flag : flags)
  ------------------
  |  Branch (2983:40): [True: 0, False: 0]
  ------------------
 2984|      0|                        {
 2985|      0|                            if ((flag->GetOptions() & Options::HiddenFromCompletion) != Options::None)
  ------------------
  |  Branch (2985:33): [True: 0, False: 0]
  ------------------
 2986|      0|                            {
 2987|      0|                                continue;
 2988|      0|                            }
 2989|       |
 2990|      0|                            auto &matcher = flag->GetMatcher();
 2991|      0|                            if (!AddCompletionReply(chunk, matcher.GetShortOrAny().str(shortprefix, longprefix)))
  ------------------
  |  Branch (2991:33): [True: 0, False: 0]
  ------------------
 2992|      0|                            {
 2993|      0|                                for (auto &flagName : matcher.GetFlagStrings())
  ------------------
  |  Branch (2993:53): [True: 0, False: 0]
  ------------------
 2994|      0|                                {
 2995|      0|                                    if (AddCompletionReply(chunk, flagName.str(shortprefix, longprefix)))
  ------------------
  |  Branch (2995:41): [True: 0, False: 0]
  ------------------
 2996|      0|                                    {
 2997|      0|                                        break;
 2998|      0|                                    }
 2999|      0|                                }
 3000|      0|                            }
 3001|      0|                        }
 3002|       |
 3003|      0|                        if (optionType == OptionType::LongFlag && allowJoinedLongValue)
  ------------------
  |  Branch (3003:29): [True: 0, False: 0]
  |  Branch (3003:67): [True: 0, False: 0]
  ------------------
 3004|      0|                        {
 3005|      0|                            const auto separator = longseparator.empty() ? chunk.npos : chunk.find(longseparator);
  ------------------
  |  Branch (3005:52): [True: 0, False: 0]
  ------------------
 3006|       |                            // Only attempt joined-value completion when the
 3007|       |                            // separator lies at or past the long prefix, so
 3008|       |                            // there is a (possibly empty) flag name between
 3009|       |                            // them. With a custom longseparator that overlaps
 3010|       |                            // the prefix (e.g. LongSeparator("-") under the
 3011|       |                            // default "--" prefix), an attacker-controlled
 3012|       |                            // completion word like "--x" puts the separator
 3013|       |                            // inside the prefix, making `arg` shorter than
 3014|       |                            // longprefix. arg.substr(longprefix.size()) would
 3015|       |                            // then throw std::out_of_range, which escapes the
 3016|       |                            // parser as a non-args exception (bypassing the
 3017|       |                            // documented catch(args::Error) idiom) and is
 3018|       |                            // thrown even under ARGS_NOEXCEPT.
 3019|      0|                            if (separator != chunk.npos && separator >= longprefix.size())
  ------------------
  |  Branch (3019:33): [True: 0, False: 0]
  |  Branch (3019:60): [True: 0, False: 0]
  ------------------
 3020|      0|                            {
 3021|      0|                                std::string arg(chunk, 0, separator);
 3022|      0|                                if (auto flag = this->Match(arg.substr(longprefix.size())))
  ------------------
  |  Branch (3022:42): [True: 0, False: 0]
  ------------------
 3023|      0|                                {
 3024|      0|                                    for (auto &choice : flag->HelpChoices(helpParams))
  ------------------
  |  Branch (3024:55): [True: 0, False: 0]
  ------------------
 3025|      0|                                    {
 3026|      0|                                        AddCompletionReply(chunk, arg + longseparator + choice);
 3027|      0|                                    }
 3028|      0|                                }
 3029|      0|                            }
 3030|      0|                        } else if (optionType == OptionType::ShortFlag && allowJoinedShortValue)
  ------------------
  |  Branch (3030:36): [True: 0, False: 0]
  |  Branch (3030:75): [True: 0, False: 0]
  ------------------
 3031|      0|                        {
 3032|      0|                            if (chunk.size() > shortprefix.size() + 1)
  ------------------
  |  Branch (3032:33): [True: 0, False: 0]
  ------------------
 3033|      0|                            {
 3034|      0|                                auto arg = chunk.at(shortprefix.size());
 3035|       |                                //TODO: support -abcVALUE where a and b take no value
 3036|      0|                                if (auto flag = this->Match(arg))
  ------------------
  |  Branch (3036:42): [True: 0, False: 0]
  ------------------
 3037|      0|                                {
 3038|      0|                                    for (auto &choice : flag->HelpChoices(helpParams))
  ------------------
  |  Branch (3038:55): [True: 0, False: 0]
  ------------------
 3039|      0|                                    {
 3040|      0|                                        AddCompletionReply(chunk, shortprefix + arg + choice);
 3041|      0|                                    }
 3042|      0|                                }
 3043|      0|                            }
 3044|      0|                        }
 3045|      0|                    }
 3046|      0|                }
 3047|       |
 3048|      0|#ifndef ARGS_NOEXCEPT
 3049|      0|                throw Completion(completion->Get());
 3050|       |#else
 3051|       |                return true;
 3052|       |#endif
 3053|  1.31k|            }
_ZN4args14ArgumentParser11ParseOptionERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
 2613|  2.11k|            {
 2614|  2.11k|                const bool matchesLong = s.find(longprefix) == 0 && (allowEmpty || s.length() > longprefix.length());
  ------------------
  |  Branch (2614:42): [True: 504, False: 1.61k]
  |  Branch (2614:70): [True: 0, False: 504]
  |  Branch (2614:84): [True: 504, False: 0]
  ------------------
 2615|  2.11k|                const bool matchesShort = s.find(shortprefix) == 0 && (allowEmpty || s.length() > shortprefix.length());
  ------------------
  |  Branch (2615:43): [True: 1.65k, False: 458]
  |  Branch (2615:72): [True: 0, False: 1.65k]
  |  Branch (2615:86): [True: 1.64k, False: 8]
  ------------------
 2616|       |
 2617|       |                // A chunk can start with both prefixes when one is a prefix of
 2618|       |                // the other, or when the long prefix is empty (every string
 2619|       |                // starts with it). Resolve to the longer, more specific prefix:
 2620|       |                // this keeps the default "--"/"-" preference for long flags
 2621|       |                // while letting a short flag be recognised under an empty long
 2622|       |                // prefix instead of being swallowed as a nameless long flag.
 2623|  2.11k|                if (matchesLong && matchesShort)
  ------------------
  |  Branch (2623:21): [True: 504, False: 1.61k]
  |  Branch (2623:36): [True: 504, False: 0]
  ------------------
 2624|    504|                {
 2625|    504|                    return longprefix.length() >= shortprefix.length() ? OptionType::LongFlag : OptionType::ShortFlag;
  ------------------
  |  Branch (2625:28): [True: 504, False: 0]
  ------------------
 2626|    504|                }
 2627|       |
 2628|  1.61k|                if (matchesLong)
  ------------------
  |  Branch (2628:21): [True: 0, False: 1.61k]
  ------------------
 2629|      0|                {
 2630|      0|                    return OptionType::LongFlag;
 2631|      0|                }
 2632|       |
 2633|  1.61k|                if (matchesShort)
  ------------------
  |  Branch (2633:21): [True: 1.14k, False: 466]
  ------------------
 2634|  1.14k|                {
 2635|  1.14k|                    return OptionType::ShortFlag;
 2636|  1.14k|                }
 2637|       |
 2638|    466|                return OptionType::Positional;
 2639|  1.61k|            }
_ZN4args14ArgumentParser9ParseLongINSt3__111__wrap_iterIPNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEEbRT_SC_:
 2757|    504|            {
 2758|    504|                const auto &chunk = *it;
 2759|    504|                const auto argchunk = chunk.substr(longprefix.size());
 2760|       |                // Try to separate it, in case of a separator:
 2761|    504|                const auto separator = longseparator.empty() ? argchunk.npos : argchunk.find(longseparator);
  ------------------
  |  Branch (2761:40): [True: 0, False: 504]
  ------------------
 2762|       |                // If the separator is in the argument, separate it.
 2763|    504|                const auto arg = (separator != argchunk.npos ?
  ------------------
  |  Branch (2763:35): [True: 262, False: 242]
  ------------------
 2764|    262|                    std::string(argchunk, 0, separator)
 2765|    504|                    : argchunk);
 2766|    504|                const auto joined = (separator != argchunk.npos ?
  ------------------
  |  Branch (2766:38): [True: 262, False: 242]
  ------------------
 2767|    262|                    argchunk.substr(separator + longseparator.size())
 2768|    504|                    : std::string());
 2769|       |
 2770|    504|                if (auto flag = Match(arg))
  ------------------
  |  Branch (2770:26): [True: 82, False: 422]
  ------------------
 2771|     82|                {
 2772|       |#ifdef ARGS_NOEXCEPT
 2773|       |                    // Match() may set the flag's error (e.g. Error::Extra when
 2774|       |                    // Options::Single is violated). In non-noexcept mode that
 2775|       |                    // path throws and parsing stops before the value is read;
 2776|       |                    // in noexcept mode we must mirror that and skip the value
 2777|       |                    // parsing so the previously-stored value is preserved.
 2778|       |                    if (flag->GetError() != Error::None)
 2779|       |                    {
 2780|       |                        return false;
 2781|       |                    }
 2782|       |#endif
 2783|     82|                    std::vector<std::string> values;
 2784|     82|                    const std::string errorMessage = ParseArgsValues(*flag, arg, it, end, allowSeparateLongValue, allowJoinedLongValue,
 2785|     82|                                                                     separator != argchunk.npos, joined, false, values);
 2786|     82|                    if (!errorMessage.empty())
  ------------------
  |  Branch (2786:25): [True: 18, False: 64]
  ------------------
 2787|     18|                    {
 2788|     18|#ifndef ARGS_NOEXCEPT
 2789|     18|                        throw ParseError(errorMessage);
 2790|       |#else
 2791|       |                        error = Error::Parse;
 2792|       |                        errorMsg = errorMessage;
 2793|       |                        return false;
 2794|       |#endif
 2795|     18|                    }
 2796|       |
 2797|     64|                    if (!readCompletion)
  ------------------
  |  Branch (2797:25): [True: 64, False: 0]
  ------------------
 2798|     64|                    {
 2799|     64|                        flag->ParseValue(values);
 2800|       |#ifdef ARGS_NOEXCEPT
 2801|       |                        // Non-noexcept ParseValue paths throw on Help, reader
 2802|       |                        // failure, or Map miss, which halts parsing. Mirror
 2803|       |                        // that here so a later parser-level error (e.g. an
 2804|       |                        // unknown flag) cannot shadow the flag's error in
 2805|       |                        // ArgumentParser::GetError().
 2806|       |                        if (flag->GetError() != Error::None)
 2807|       |                        {
 2808|       |                            return false;
 2809|       |                        }
 2810|       |#endif
 2811|     64|                    }
 2812|       |
 2813|     64|                    if (flag->KickOut())
  ------------------
  |  Branch (2813:25): [True: 0, False: 64]
  ------------------
 2814|      0|                    {
 2815|      0|                        ++it;
 2816|      0|                        return false;
 2817|      0|                    }
 2818|     64|                } else
 2819|    422|                {
 2820|    422|                    const std::string errorMessage("Flag could not be matched: " + arg);
 2821|    422|#ifndef ARGS_NOEXCEPT
 2822|    422|                    throw ParseError(errorMessage);
 2823|       |#else
 2824|       |                    error = Error::Parse;
 2825|       |                    errorMsg = errorMessage;
 2826|       |                    return false;
 2827|       |#endif
 2828|    422|                }
 2829|       |
 2830|     64|                return true;
 2831|    504|            }
_ZN4args14ArgumentParser15ParseArgsValuesINSt3__111__wrap_iterIPNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEES9_RNS_8FlagBaseERKS9_RT_SG_bbbSF_bRNS2_6vectorIS9_NS7_IS9_EEEE:
 2677|  22.3k|            {
 2678|  22.3k|                values.clear();
 2679|       |
 2680|  22.3k|                Nargs nargs = flag.NumberOfArguments();
 2681|       |
 2682|  22.3k|                if (hasJoined && !allowJoined && nargs.min != 0)
  ------------------
  |  Branch (2682:21): [True: 21.9k, False: 393]
  |  Branch (2682:34): [True: 0, False: 21.9k]
  |  Branch (2682:50): [True: 0, False: 0]
  ------------------
 2683|      0|                {
 2684|      0|                    return "Flag '" + arg + "' was passed a joined argument, but these are disallowed";
 2685|      0|                }
 2686|       |
 2687|  22.3k|                if (hasJoined)
  ------------------
  |  Branch (2687:21): [True: 21.9k, False: 393]
  ------------------
 2688|  21.9k|                {
 2689|  21.9k|                    if (!canDiscardJoined || nargs.max != 0)
  ------------------
  |  Branch (2689:25): [True: 18, False: 21.9k]
  |  Branch (2689:46): [True: 0, False: 21.9k]
  ------------------
 2690|     18|                    {
 2691|     18|                        values.push_back(joinedArg);
 2692|     18|                    }
 2693|  21.9k|                } else if (!allowSeparate)
  ------------------
  |  Branch (2693:28): [True: 0, False: 393]
  ------------------
 2694|      0|                {
 2695|      0|                    if (nargs.min != 0)
  ------------------
  |  Branch (2695:25): [True: 0, False: 0]
  ------------------
 2696|      0|                    {
 2697|      0|                        return "Flag '" + arg + "' was passed a separate argument, but these are disallowed";
 2698|      0|                    }
 2699|      0|                } else
 2700|    393|                {
 2701|    393|                    auto valueIt = it;
 2702|    393|                    ++valueIt;
 2703|       |
 2704|    393|                    while (valueIt != end &&
  ------------------
  |  Branch (2704:28): [True: 369, False: 24]
  ------------------
 2705|    369|                           *valueIt != terminator &&
  ------------------
  |  Branch (2705:28): [True: 365, False: 4]
  ------------------
 2706|    365|                           values.size() < nargs.max &&
  ------------------
  |  Branch (2706:28): [True: 0, False: 365]
  ------------------
 2707|      0|                           (values.size() < nargs.min || ParseOption(*valueIt) == OptionType::Positional))
  ------------------
  |  Branch (2707:29): [True: 0, False: 0]
  |  Branch (2707:58): [True: 0, False: 0]
  ------------------
 2708|      0|                    {
 2709|      0|                        if (Complete(flag, valueIt, end))
  ------------------
  |  Branch (2709:29): [True: 0, False: 0]
  ------------------
 2710|      0|                        {
 2711|       |                            // Park `it` on the completion position rather than
 2712|       |                            // `end`. In ARGS_NOEXCEPT mode Complete returns
 2713|       |                            // true (no throw), so the caller's for-loop will
 2714|       |                            // run its ++it after we return; advancing an
 2715|       |                            // already-end iterator is undefined behavior and
 2716|       |                            // causes a subsequent out-of-bounds read of the
 2717|       |                            // arg vector. Since Complete only fires when
 2718|       |                            // ++nextIt == end, valueIt is the last element,
 2719|       |                            // and ++(it=valueIt) safely lands on end.
 2720|      0|                            it = valueIt;
 2721|      0|                            return "";
 2722|      0|                        }
 2723|       |
 2724|      0|                        values.push_back(*valueIt);
 2725|      0|                        ++it;
 2726|      0|                        ++valueIt;
 2727|      0|                    }
 2728|    393|                }
 2729|       |
 2730|  22.3k|                if (values.size() > nargs.max)
  ------------------
  |  Branch (2730:21): [True: 18, False: 22.3k]
  ------------------
 2731|     18|                {
 2732|     18|                    return "Passed an argument into a non-argument flag: " + arg;
 2733|  22.3k|                } else if (values.size() < nargs.min)
  ------------------
  |  Branch (2733:28): [True: 0, False: 22.3k]
  ------------------
 2734|      0|                {
 2735|      0|                    if (nargs.min == 1 && nargs.max == 1)
  ------------------
  |  Branch (2735:25): [True: 0, False: 0]
  |  Branch (2735:43): [True: 0, False: 0]
  ------------------
 2736|      0|                    {
 2737|      0|                        return "Flag '" + arg + "' requires an argument but received none";
 2738|      0|                    } else if (nargs.min == 1)
  ------------------
  |  Branch (2738:32): [True: 0, False: 0]
  ------------------
 2739|      0|                    {
 2740|      0|                        return "Flag '" + arg + "' requires at least one argument but received none";
 2741|      0|                    } else if (nargs.min != nargs.max)
  ------------------
  |  Branch (2741:32): [True: 0, False: 0]
  ------------------
 2742|      0|                    {
 2743|      0|                        return "Flag '" + arg + "' requires at least " + std::to_string(nargs.min) +
 2744|      0|                               " arguments but received " + std::to_string(values.size());
 2745|      0|                    } else
 2746|      0|                    {
 2747|      0|                        return "Flag '" + arg + "' requires " + std::to_string(nargs.min) +
 2748|      0|                               " arguments but received " + std::to_string(values.size());
 2749|      0|                    }
 2750|      0|                }
 2751|       |
 2752|  22.3k|                return {};
 2753|  22.3k|            }
_ZN4args14ArgumentParser10ParseShortINSt3__111__wrap_iterIPNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEEbRT_SC_:
 2835|    572|            {
 2836|    572|                const auto &chunk = *it;
 2837|    572|                const auto argchunk = chunk.substr(shortprefix.size());
 2838|  22.8k|                for (auto argit = std::begin(argchunk); argit != std::end(argchunk); ++argit)
  ------------------
  |  Branch (2838:57): [True: 22.4k, False: 341]
  ------------------
 2839|  22.4k|                {
 2840|  22.4k|                    const auto arg = *argit;
 2841|       |
 2842|  22.4k|                    if (auto flag = Match(arg))
  ------------------
  |  Branch (2842:30): [True: 22.2k, False: 231]
  ------------------
 2843|  22.2k|                    {
 2844|       |#ifdef ARGS_NOEXCEPT
 2845|       |                        // See ParseLong: if Match recorded an error
 2846|       |                        // (e.g. Options::Single violation), bail before the
 2847|       |                        // value is parsed so the prior value is preserved.
 2848|       |                        if (flag->GetError() != Error::None)
 2849|       |                        {
 2850|       |                            return false;
 2851|       |                        }
 2852|       |#endif
 2853|  22.2k|                        const std::string value(argit + 1, std::end(argchunk));
 2854|  22.2k|                        std::vector<std::string> values;
 2855|  22.2k|                        const std::string errorMessage = ParseArgsValues(*flag, std::string(1, arg), it, end,
 2856|  22.2k|                                                                         allowSeparateShortValue, allowJoinedShortValue,
 2857|  22.2k|                                                                         !value.empty(), value, !value.empty(), values);
 2858|       |
 2859|  22.2k|                        if (!errorMessage.empty())
  ------------------
  |  Branch (2859:29): [True: 0, False: 22.2k]
  ------------------
 2860|      0|                        {
 2861|      0|#ifndef ARGS_NOEXCEPT
 2862|      0|                            throw ParseError(errorMessage);
 2863|       |#else
 2864|       |                            error = Error::Parse;
 2865|       |                            errorMsg = errorMessage;
 2866|       |                            return false;
 2867|       |#endif
 2868|      0|                        }
 2869|       |
 2870|  22.2k|                        if (!readCompletion)
  ------------------
  |  Branch (2870:29): [True: 22.2k, False: 0]
  ------------------
 2871|  22.2k|                        {
 2872|  22.2k|                            flag->ParseValue(values);
 2873|       |#ifdef ARGS_NOEXCEPT
 2874|       |                            // See ParseLong: ensure a flag-level error from
 2875|       |                            // ParseValue (Help, Parse, Map) halts parsing so
 2876|       |                            // it cannot be shadowed by a later parser error.
 2877|       |                            if (flag->GetError() != Error::None)
 2878|       |                            {
 2879|       |                                return false;
 2880|       |                            }
 2881|       |#endif
 2882|  22.2k|                        }
 2883|       |
 2884|  22.2k|                        if (flag->KickOut())
  ------------------
  |  Branch (2884:29): [True: 0, False: 22.2k]
  ------------------
 2885|      0|                        {
 2886|      0|                            ++it;
 2887|      0|                            return false;
 2888|      0|                        }
 2889|       |
 2890|  22.2k|                        if (!values.empty())
  ------------------
  |  Branch (2890:29): [True: 0, False: 22.2k]
  ------------------
 2891|      0|                        {
 2892|      0|                            break;
 2893|      0|                        }
 2894|  22.2k|                    } else
 2895|    231|                    {
 2896|    231|                        const std::string errorMessage("Flag could not be matched: '" + std::string(1, arg) + "'");
 2897|    231|#ifndef ARGS_NOEXCEPT
 2898|    231|                        throw ParseError(errorMessage);
 2899|       |#else
 2900|       |                        error = Error::Parse;
 2901|       |                        errorMsg = errorMessage;
 2902|       |                        return false;
 2903|       |#endif
 2904|    231|                    }
 2905|  22.4k|                }
 2906|       |
 2907|    341|                return true;
 2908|    572|            }
_ZNK4args4Base7KickOutEv:
 1125|  22.3k|            {
 1126|  22.3k|                return (options & Options::KickOut) != Options::None;
 1127|  22.3k|            }

LLVMFuzzerTestOneInput:
    7|    948|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    8|    948|    auto fdp = FuzzedDataProvider(data, size);
    9|       |
   10|    948|    auto parser = args::ArgumentParser("parse_args_fuzzer");
   11|       |
   12|    948|    auto help = args::HelpFlag(parser, "help", "Displays this help menu", {'h', "help"});
   13|    948|    auto test = args::Flag(parser, "test", "Test flag", {'t', "test"});
   14|    948|    auto param = args::Flag(parser, "param", "Param flag", {'p', "param"});
   15|       |
   16|    948|    auto count = fdp.ConsumeIntegralInRange(1, 10);
   17|    948|    auto arguments = std::vector<std::string>();
   18|    948|    arguments.reserve(count);
   19|  5.38k|    for (int i = 0; i < count; ++i) {
  ------------------
  |  Branch (19:21): [True: 4.43k, False: 948]
  ------------------
   20|  4.43k|        arguments.emplace_back(fdp.ConsumeRandomLengthString());
   21|  4.43k|    }
   22|       |
   23|    948|    try {
   24|    948|        parser.ParseArgs(arguments.begin(), arguments.end());
   25|    948|    } catch (...) {
   26|    922|    }
   27|       |
   28|    948|    return 0;
   29|    948|}

