LLVMFuzzerTestOneInput:
   13|  5.84k|{
   14|  5.84k|  if(size < 4)
  ------------------
  |  Branch (14:6): [True: 2, False: 5.84k]
  ------------------
   15|      2|  {
   16|      2|    return 0;
   17|      2|  }
   18|       |
   19|  5.84k|  FuzzedDataProvider fuzz_data(data, size);
   20|       |
   21|  5.84k|  try
   22|  5.84k|  {
   23|  5.84k|    BT::Ast::Environment env;
   24|  5.84k|    env.vars = BT::Blackboard::create();
   25|  5.84k|    env.enums = std::make_shared<BT::EnumsTable>();
   26|       |
   27|       |    // Add some test variables to the blackboard
   28|  5.84k|    env.vars->set("test_int", 42);
   29|  5.84k|    env.vars->set("test_double", 3.14);
   30|  5.84k|    env.vars->set("test_bool", true);
   31|  5.84k|    env.vars->set("test_string", std::string("test"));
   32|       |
   33|       |    // Add some test enums
   34|  5.84k|    (*env.enums)["RUNNING"] = 0;
   35|  5.84k|    (*env.enums)["SUCCESS"] = 1;
   36|  5.84k|    (*env.enums)["FAILURE"] = 2;
   37|       |
   38|  5.84k|    std::string script = fuzz_data.ConsumeRandomLengthString();
   39|       |
   40|  5.84k|    auto validation_result = BT::ValidateScript(script);
   41|       |
   42|  5.84k|    if(!validation_result)
  ------------------
  |  Branch (42:8): [True: 1.62k, False: 4.21k]
  ------------------
   43|  1.62k|    {
   44|  1.62k|      auto parsed_script = BT::ParseScript(script);
   45|  1.62k|      if(parsed_script)
  ------------------
  |  Branch (45:10): [True: 0, False: 1.62k]
  ------------------
   46|      0|      {
   47|      0|        try
   48|      0|        {
   49|      0|          auto result = parsed_script.value()(env);
   50|       |
   51|      0|          if(result.isNumber())
  ------------------
  |  Branch (51:14): [True: 0, False: 0]
  ------------------
   52|      0|          {
   53|      0|            [[maybe_unused]] volatile auto num = result.cast<double>();
   54|      0|          }
   55|       |
   56|      0|          env.vars->set("result", result);
   57|       |
   58|      0|          BT::Any read_back;
   59|      0|          (void)env.vars->get("result", read_back);
   60|      0|        }
   61|      0|        catch(const BT::RuntimeError&)  // NOLINT(bugprone-empty-catch)
   62|      0|        {
   63|       |          // Intentionally empty - fuzzer expects exceptions
   64|      0|        }
   65|      0|      }
   66|  1.62k|    }
   67|       |
   68|  5.84k|    BT::ParseScriptAndExecute(env, script);
   69|  5.84k|  }
   70|  5.84k|  catch(const std::exception&)  // NOLINT(bugprone-empty-catch)
   71|  5.84k|  {
   72|       |    // Intentionally empty - fuzzer expects exceptions
   73|    212|  }
   74|       |
   75|  5.84k|  return 0;
   76|  5.84k|}

_ZN2BT23GetAnyFromStringFunctorIiEESt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEEv:
  234|  5.84k|{
  235|       |  if constexpr(std::is_constructible_v<StringView, T>)
  236|       |  {
  237|       |    return [](StringView str) { return Any(str); };
  238|       |  }
  239|       |  else if constexpr(std::is_same_v<BT::AnyTypeAllowed, T> || std::is_enum_v<T>)
  240|       |  {
  241|       |    return {};
  242|       |  }
  243|       |  else
  244|  5.84k|  {
  245|  5.84k|    return [](StringView str) { return Any(convertFromString<T>(str)); };
  246|  5.84k|  }
  247|  5.84k|}
_ZN2BT8PortInfoC2ENS_13PortDirectionESt10type_indexSt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEE:
  431|  17.5k|    : TypeInfo(type_info, conv), direction_(direction)
  432|  17.5k|  {}
_ZN2BT8TypeInfoC2ESt10type_indexSt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEE:
  389|  17.5k|    : type_info_(type_info), converter_(conv), type_str_(BT::demangle(type_info))
  390|  17.5k|  {}
_ZN2BT23GetAnyFromStringFunctorIdEESt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEEv:
  234|  5.84k|{
  235|       |  if constexpr(std::is_constructible_v<StringView, T>)
  236|       |  {
  237|       |    return [](StringView str) { return Any(str); };
  238|       |  }
  239|       |  else if constexpr(std::is_same_v<BT::AnyTypeAllowed, T> || std::is_enum_v<T>)
  240|       |  {
  241|       |    return {};
  242|       |  }
  243|       |  else
  244|  5.84k|  {
  245|  5.84k|    return [](StringView str) { return Any(convertFromString<T>(str)); };
  246|  5.84k|  }
  247|  5.84k|}
_ZN2BT23GetAnyFromStringFunctorIbEESt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEEv:
  234|  5.84k|{
  235|       |  if constexpr(std::is_constructible_v<StringView, T>)
  236|       |  {
  237|       |    return [](StringView str) { return Any(str); };
  238|       |  }
  239|       |  else if constexpr(std::is_same_v<BT::AnyTypeAllowed, T> || std::is_enum_v<T>)
  240|       |  {
  241|       |    return {};
  242|       |  }
  243|       |  else
  244|  5.84k|  {
  245|  5.84k|    return [](StringView str) { return Any(convertFromString<T>(str)); };
  246|  5.84k|  }
  247|  5.84k|}
_ZN2BT8PortInfoC2ENS_13PortDirectionE:
  427|  14.2k|    : TypeInfo(), direction_(direction)
  428|  14.2k|  {}
_ZN2BT8TypeInfoC2Ev:
  385|  14.2k|  TypeInfo() : type_info_(typeid(AnyTypeAllowed)), type_str_("AnyTypeAllowed")
  386|  14.2k|  {}
_ZNK2BT8TypeInfo9converterEv:
  413|  1.93k|  {
  414|  1.93k|    return converter_;
  415|  1.93k|  }

_ZN2BT10Blackboard6createESt10shared_ptrIS0_E:
   89|  5.84k|  {
   90|  5.84k|    return std::shared_ptr<Blackboard>(new Blackboard(parent));
   91|  5.84k|  }
_ZN2BT10BlackboardC2ESt10shared_ptrIS0_E:
   49|  5.84k|  Blackboard(Blackboard::Ptr parent) : parent_bb_(parent)
   50|  5.84k|  {}
_ZN2BT10BlackboardD2Ev:
   93|  5.84k|  virtual ~Blackboard() = default;
_ZN2BT10Blackboard3setIiEEvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_:
  321|  5.84k|{
  322|  5.84k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (322:6): [True: 0, False: 5.84k]
  ------------------
  323|      0|  {
  324|      0|    rootBlackboard()->set(key.substr(1, key.size() - 1), value);
  325|      0|    return;
  326|      0|  }
  327|       |  // getEntry() follows the remapping to the parent blackboard, exactly like
  328|       |  // the readers do. A key that resolves to an existing entry (local or
  329|       |  // remapped) must go through the type check below: createEntryImpl() would
  330|       |  // follow the same remapping and return the pre-existing entry, and writing
  331|       |  // to it blindly bypasses the type lock and the string conversion.
  332|  5.84k|  auto entry_ptr = getEntry(key);
  333|       |  // copied under entry_mutex, notified after releasing it
  334|  5.84k|  std::shared_ptr<EntryUpdatedSignal> update_signal;
  335|  5.84k|  if(!entry_ptr)
  ------------------
  |  Branch (335:6): [True: 5.84k, False: 0]
  ------------------
  336|  5.84k|  {
  337|       |    // create a new entry
  338|  5.84k|    Any new_value(value);
  339|  5.84k|    std::shared_ptr<Blackboard::Entry> entry;
  340|       |    // if a new generic port is created with a string, it's type should be AnyTypeAllowed
  341|       |    if constexpr(std::is_same_v<std::string, T>)
  342|       |    {
  343|       |      entry = createEntryImpl(key, PortInfo(PortDirection::INOUT));
  344|       |    }
  345|       |    else
  346|  5.84k|    {
  347|  5.84k|      PortInfo new_port(PortDirection::INOUT, new_value.type(),
  348|  5.84k|                        GetAnyFromStringFunctor<T>());
  349|  5.84k|      entry = createEntryImpl(key, new_port);
  350|  5.84k|    }
  351|       |
  352|       |    // Lock entry_mutex before writing to prevent data races with
  353|       |    // concurrent readers (BUG-1/BUG-8 fix).
  354|  5.84k|    std::scoped_lock entry_lock(entry->entry_mutex);
  355|  5.84k|    entry->value = new_value;
  356|  5.84k|    entry->sequence_id++;
  357|  5.84k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  358|  5.84k|    update_signal = entry->update_signal;
  359|  5.84k|  }
  360|      0|  else
  361|      0|  {
  362|       |    // this is not the first time we set this entry, we need to check
  363|       |    // if the type is the same or not.
  364|      0|    Entry& entry = *entry_ptr;
  365|       |
  366|      0|    std::unique_lock scoped_lock(entry.entry_mutex);
  367|       |
  368|      0|    Any& previous_any = entry.value;
  369|      0|    Any new_value(value);
  370|       |
  371|       |    // special case: entry exists but it is not strongly typed... yet
  372|      0|    if(!entry.info.isStronglyTyped())
  ------------------
  |  Branch (372:8): [True: 0, False: 0]
  ------------------
  373|      0|    {
  374|       |      // Use the new type to create a new entry that is strongly typed.
  375|      0|      entry.info = TypeInfo::Create<T>();
  376|      0|      entry.sequence_id++;
  377|      0|      entry.stamp = std::chrono::steady_clock::now().time_since_epoch();
  378|      0|      previous_any = std::move(new_value);
  379|      0|      update_signal = entry.update_signal;
  380|      0|      scoped_lock.unlock();
  381|      0|      if(update_signal)
  ------------------
  |  Branch (381:10): [True: 0, False: 0]
  ------------------
  382|      0|      {
  383|      0|        update_signal->notify();
  384|      0|      }
  385|      0|      return;
  386|      0|    }
  387|       |
  388|      0|    std::type_index previous_type = entry.info.type();
  389|       |
  390|       |    // check type mismatch
  391|      0|    if(previous_type != std::type_index(typeid(T)) && previous_type != new_value.type())
  ------------------
  |  Branch (391:8): [True: 0, False: 0]
  |  Branch (391:8): [True: 0, False: 0]
  |  Branch (391:55): [True: 0, False: 0]
  ------------------
  392|      0|    {
  393|      0|      bool mismatching = true;
  394|      0|      if(std::is_constructible<StringView, T>::value)
  ------------------
  |  Branch (394:10): [Folded, False: 0]
  ------------------
  395|      0|      {
  396|      0|        Any any_from_string = entry.info.parseString(value);
  397|      0|        if(any_from_string.empty() == false)
  ------------------
  |  Branch (397:12): [True: 0, False: 0]
  ------------------
  398|      0|        {
  399|      0|          mismatching = false;
  400|      0|          new_value = std::move(any_from_string);
  401|      0|        }
  402|      0|      }
  403|       |      // check if we are doing a safe cast between numbers
  404|       |      // for instance, it is safe to use int(100) to set
  405|       |      // a uint8_t port, but not int(-42) or int(300)
  406|       |      if constexpr(std::is_arithmetic_v<T>)
  407|      0|      {
  408|      0|        if(mismatching && isCastingSafe(previous_type, value))
  ------------------
  |  Branch (408:12): [True: 0, False: 0]
  |  Branch (408:27): [True: 0, False: 0]
  ------------------
  409|      0|        {
  410|      0|          mismatching = false;
  411|      0|        }
  412|      0|      }
  413|       |
  414|      0|      if(mismatching)
  ------------------
  |  Branch (414:10): [True: 0, False: 0]
  ------------------
  415|      0|      {
  416|      0|        debugMessage();
  417|       |
  418|      0|        auto msg = StrCat("Blackboard::set(", key,
  419|      0|                          "): once declared, "
  420|      0|                          "the type of a port shall not change. "
  421|      0|                          "Previously declared type [",
  422|      0|                          BT::demangle(previous_type), "], current type [",
  423|      0|                          BT::demangle(typeid(T)), "]");
  424|      0|        throw LogicError(msg);
  425|      0|      }
  426|      0|    }
  427|       |    // if doing set<BT::Any>, skip type check
  428|       |    if constexpr(std::is_same_v<Any, T>)
  429|       |    {
  430|       |      previous_any = new_value;
  431|       |    }
  432|       |    else
  433|      0|    {
  434|       |      // copy only if the type is compatible
  435|      0|      new_value.copyInto(previous_any);
  436|      0|    }
  437|      0|    entry.sequence_id++;
  438|      0|    entry.stamp = std::chrono::steady_clock::now().time_since_epoch();
  439|      0|    update_signal = entry.update_signal;
  440|      0|  }
  441|  5.84k|  if(update_signal)
  ------------------
  |  Branch (441:6): [True: 0, False: 5.84k]
  ------------------
  442|      0|  {
  443|      0|    update_signal->notify();
  444|      0|  }
  445|  5.84k|}
_ZN2BT10Blackboard3setIdEEvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_:
  321|  5.84k|{
  322|  5.84k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (322:6): [True: 0, False: 5.84k]
  ------------------
  323|      0|  {
  324|      0|    rootBlackboard()->set(key.substr(1, key.size() - 1), value);
  325|      0|    return;
  326|      0|  }
  327|       |  // getEntry() follows the remapping to the parent blackboard, exactly like
  328|       |  // the readers do. A key that resolves to an existing entry (local or
  329|       |  // remapped) must go through the type check below: createEntryImpl() would
  330|       |  // follow the same remapping and return the pre-existing entry, and writing
  331|       |  // to it blindly bypasses the type lock and the string conversion.
  332|  5.84k|  auto entry_ptr = getEntry(key);
  333|       |  // copied under entry_mutex, notified after releasing it
  334|  5.84k|  std::shared_ptr<EntryUpdatedSignal> update_signal;
  335|  5.84k|  if(!entry_ptr)
  ------------------
  |  Branch (335:6): [True: 5.84k, False: 0]
  ------------------
  336|  5.84k|  {
  337|       |    // create a new entry
  338|  5.84k|    Any new_value(value);
  339|  5.84k|    std::shared_ptr<Blackboard::Entry> entry;
  340|       |    // if a new generic port is created with a string, it's type should be AnyTypeAllowed
  341|       |    if constexpr(std::is_same_v<std::string, T>)
  342|       |    {
  343|       |      entry = createEntryImpl(key, PortInfo(PortDirection::INOUT));
  344|       |    }
  345|       |    else
  346|  5.84k|    {
  347|  5.84k|      PortInfo new_port(PortDirection::INOUT, new_value.type(),
  348|  5.84k|                        GetAnyFromStringFunctor<T>());
  349|  5.84k|      entry = createEntryImpl(key, new_port);
  350|  5.84k|    }
  351|       |
  352|       |    // Lock entry_mutex before writing to prevent data races with
  353|       |    // concurrent readers (BUG-1/BUG-8 fix).
  354|  5.84k|    std::scoped_lock entry_lock(entry->entry_mutex);
  355|  5.84k|    entry->value = new_value;
  356|  5.84k|    entry->sequence_id++;
  357|  5.84k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  358|  5.84k|    update_signal = entry->update_signal;
  359|  5.84k|  }
  360|      0|  else
  361|      0|  {
  362|       |    // this is not the first time we set this entry, we need to check
  363|       |    // if the type is the same or not.
  364|      0|    Entry& entry = *entry_ptr;
  365|       |
  366|      0|    std::unique_lock scoped_lock(entry.entry_mutex);
  367|       |
  368|      0|    Any& previous_any = entry.value;
  369|      0|    Any new_value(value);
  370|       |
  371|       |    // special case: entry exists but it is not strongly typed... yet
  372|      0|    if(!entry.info.isStronglyTyped())
  ------------------
  |  Branch (372:8): [True: 0, False: 0]
  ------------------
  373|      0|    {
  374|       |      // Use the new type to create a new entry that is strongly typed.
  375|      0|      entry.info = TypeInfo::Create<T>();
  376|      0|      entry.sequence_id++;
  377|      0|      entry.stamp = std::chrono::steady_clock::now().time_since_epoch();
  378|      0|      previous_any = std::move(new_value);
  379|      0|      update_signal = entry.update_signal;
  380|      0|      scoped_lock.unlock();
  381|      0|      if(update_signal)
  ------------------
  |  Branch (381:10): [True: 0, False: 0]
  ------------------
  382|      0|      {
  383|      0|        update_signal->notify();
  384|      0|      }
  385|      0|      return;
  386|      0|    }
  387|       |
  388|      0|    std::type_index previous_type = entry.info.type();
  389|       |
  390|       |    // check type mismatch
  391|      0|    if(previous_type != std::type_index(typeid(T)) && previous_type != new_value.type())
  ------------------
  |  Branch (391:8): [True: 0, False: 0]
  |  Branch (391:8): [True: 0, False: 0]
  |  Branch (391:55): [True: 0, False: 0]
  ------------------
  392|      0|    {
  393|      0|      bool mismatching = true;
  394|      0|      if(std::is_constructible<StringView, T>::value)
  ------------------
  |  Branch (394:10): [Folded, False: 0]
  ------------------
  395|      0|      {
  396|      0|        Any any_from_string = entry.info.parseString(value);
  397|      0|        if(any_from_string.empty() == false)
  ------------------
  |  Branch (397:12): [True: 0, False: 0]
  ------------------
  398|      0|        {
  399|      0|          mismatching = false;
  400|      0|          new_value = std::move(any_from_string);
  401|      0|        }
  402|      0|      }
  403|       |      // check if we are doing a safe cast between numbers
  404|       |      // for instance, it is safe to use int(100) to set
  405|       |      // a uint8_t port, but not int(-42) or int(300)
  406|       |      if constexpr(std::is_arithmetic_v<T>)
  407|      0|      {
  408|      0|        if(mismatching && isCastingSafe(previous_type, value))
  ------------------
  |  Branch (408:12): [True: 0, False: 0]
  |  Branch (408:27): [True: 0, False: 0]
  ------------------
  409|      0|        {
  410|      0|          mismatching = false;
  411|      0|        }
  412|      0|      }
  413|       |
  414|      0|      if(mismatching)
  ------------------
  |  Branch (414:10): [True: 0, False: 0]
  ------------------
  415|      0|      {
  416|      0|        debugMessage();
  417|       |
  418|      0|        auto msg = StrCat("Blackboard::set(", key,
  419|      0|                          "): once declared, "
  420|      0|                          "the type of a port shall not change. "
  421|      0|                          "Previously declared type [",
  422|      0|                          BT::demangle(previous_type), "], current type [",
  423|      0|                          BT::demangle(typeid(T)), "]");
  424|      0|        throw LogicError(msg);
  425|      0|      }
  426|      0|    }
  427|       |    // if doing set<BT::Any>, skip type check
  428|       |    if constexpr(std::is_same_v<Any, T>)
  429|       |    {
  430|       |      previous_any = new_value;
  431|       |    }
  432|       |    else
  433|      0|    {
  434|       |      // copy only if the type is compatible
  435|      0|      new_value.copyInto(previous_any);
  436|      0|    }
  437|      0|    entry.sequence_id++;
  438|      0|    entry.stamp = std::chrono::steady_clock::now().time_since_epoch();
  439|      0|    update_signal = entry.update_signal;
  440|      0|  }
  441|  5.84k|  if(update_signal)
  ------------------
  |  Branch (441:6): [True: 0, False: 5.84k]
  ------------------
  442|      0|  {
  443|      0|    update_signal->notify();
  444|      0|  }
  445|  5.84k|}
_ZN2BT10Blackboard3setIbEEvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_:
  321|  5.84k|{
  322|  5.84k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (322:6): [True: 0, False: 5.84k]
  ------------------
  323|      0|  {
  324|      0|    rootBlackboard()->set(key.substr(1, key.size() - 1), value);
  325|      0|    return;
  326|      0|  }
  327|       |  // getEntry() follows the remapping to the parent blackboard, exactly like
  328|       |  // the readers do. A key that resolves to an existing entry (local or
  329|       |  // remapped) must go through the type check below: createEntryImpl() would
  330|       |  // follow the same remapping and return the pre-existing entry, and writing
  331|       |  // to it blindly bypasses the type lock and the string conversion.
  332|  5.84k|  auto entry_ptr = getEntry(key);
  333|       |  // copied under entry_mutex, notified after releasing it
  334|  5.84k|  std::shared_ptr<EntryUpdatedSignal> update_signal;
  335|  5.84k|  if(!entry_ptr)
  ------------------
  |  Branch (335:6): [True: 5.84k, False: 0]
  ------------------
  336|  5.84k|  {
  337|       |    // create a new entry
  338|  5.84k|    Any new_value(value);
  339|  5.84k|    std::shared_ptr<Blackboard::Entry> entry;
  340|       |    // if a new generic port is created with a string, it's type should be AnyTypeAllowed
  341|       |    if constexpr(std::is_same_v<std::string, T>)
  342|       |    {
  343|       |      entry = createEntryImpl(key, PortInfo(PortDirection::INOUT));
  344|       |    }
  345|       |    else
  346|  5.84k|    {
  347|  5.84k|      PortInfo new_port(PortDirection::INOUT, new_value.type(),
  348|  5.84k|                        GetAnyFromStringFunctor<T>());
  349|  5.84k|      entry = createEntryImpl(key, new_port);
  350|  5.84k|    }
  351|       |
  352|       |    // Lock entry_mutex before writing to prevent data races with
  353|       |    // concurrent readers (BUG-1/BUG-8 fix).
  354|  5.84k|    std::scoped_lock entry_lock(entry->entry_mutex);
  355|  5.84k|    entry->value = new_value;
  356|  5.84k|    entry->sequence_id++;
  357|  5.84k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  358|  5.84k|    update_signal = entry->update_signal;
  359|  5.84k|  }
  360|      0|  else
  361|      0|  {
  362|       |    // this is not the first time we set this entry, we need to check
  363|       |    // if the type is the same or not.
  364|      0|    Entry& entry = *entry_ptr;
  365|       |
  366|      0|    std::unique_lock scoped_lock(entry.entry_mutex);
  367|       |
  368|      0|    Any& previous_any = entry.value;
  369|      0|    Any new_value(value);
  370|       |
  371|       |    // special case: entry exists but it is not strongly typed... yet
  372|      0|    if(!entry.info.isStronglyTyped())
  ------------------
  |  Branch (372:8): [True: 0, False: 0]
  ------------------
  373|      0|    {
  374|       |      // Use the new type to create a new entry that is strongly typed.
  375|      0|      entry.info = TypeInfo::Create<T>();
  376|      0|      entry.sequence_id++;
  377|      0|      entry.stamp = std::chrono::steady_clock::now().time_since_epoch();
  378|      0|      previous_any = std::move(new_value);
  379|      0|      update_signal = entry.update_signal;
  380|      0|      scoped_lock.unlock();
  381|      0|      if(update_signal)
  ------------------
  |  Branch (381:10): [True: 0, False: 0]
  ------------------
  382|      0|      {
  383|      0|        update_signal->notify();
  384|      0|      }
  385|      0|      return;
  386|      0|    }
  387|       |
  388|      0|    std::type_index previous_type = entry.info.type();
  389|       |
  390|       |    // check type mismatch
  391|      0|    if(previous_type != std::type_index(typeid(T)) && previous_type != new_value.type())
  ------------------
  |  Branch (391:8): [True: 0, False: 0]
  |  Branch (391:8): [True: 0, False: 0]
  |  Branch (391:55): [True: 0, False: 0]
  ------------------
  392|      0|    {
  393|      0|      bool mismatching = true;
  394|      0|      if(std::is_constructible<StringView, T>::value)
  ------------------
  |  Branch (394:10): [Folded, False: 0]
  ------------------
  395|      0|      {
  396|      0|        Any any_from_string = entry.info.parseString(value);
  397|      0|        if(any_from_string.empty() == false)
  ------------------
  |  Branch (397:12): [True: 0, False: 0]
  ------------------
  398|      0|        {
  399|      0|          mismatching = false;
  400|      0|          new_value = std::move(any_from_string);
  401|      0|        }
  402|      0|      }
  403|       |      // check if we are doing a safe cast between numbers
  404|       |      // for instance, it is safe to use int(100) to set
  405|       |      // a uint8_t port, but not int(-42) or int(300)
  406|       |      if constexpr(std::is_arithmetic_v<T>)
  407|      0|      {
  408|      0|        if(mismatching && isCastingSafe(previous_type, value))
  ------------------
  |  Branch (408:12): [True: 0, False: 0]
  |  Branch (408:27): [True: 0, False: 0]
  ------------------
  409|      0|        {
  410|      0|          mismatching = false;
  411|      0|        }
  412|      0|      }
  413|       |
  414|      0|      if(mismatching)
  ------------------
  |  Branch (414:10): [True: 0, False: 0]
  ------------------
  415|      0|      {
  416|      0|        debugMessage();
  417|       |
  418|      0|        auto msg = StrCat("Blackboard::set(", key,
  419|      0|                          "): once declared, "
  420|      0|                          "the type of a port shall not change. "
  421|      0|                          "Previously declared type [",
  422|      0|                          BT::demangle(previous_type), "], current type [",
  423|      0|                          BT::demangle(typeid(T)), "]");
  424|      0|        throw LogicError(msg);
  425|      0|      }
  426|      0|    }
  427|       |    // if doing set<BT::Any>, skip type check
  428|       |    if constexpr(std::is_same_v<Any, T>)
  429|       |    {
  430|       |      previous_any = new_value;
  431|       |    }
  432|       |    else
  433|      0|    {
  434|       |      // copy only if the type is compatible
  435|      0|      new_value.copyInto(previous_any);
  436|      0|    }
  437|      0|    entry.sequence_id++;
  438|      0|    entry.stamp = std::chrono::steady_clock::now().time_since_epoch();
  439|      0|    update_signal = entry.update_signal;
  440|      0|  }
  441|  5.84k|  if(update_signal)
  ------------------
  |  Branch (441:6): [True: 0, False: 5.84k]
  ------------------
  442|      0|  {
  443|      0|    update_signal->notify();
  444|      0|  }
  445|  5.84k|}
_ZN2BT10Blackboard3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKS7_RKT_:
  321|  5.84k|{
  322|  5.84k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (322:6): [True: 0, False: 5.84k]
  ------------------
  323|      0|  {
  324|      0|    rootBlackboard()->set(key.substr(1, key.size() - 1), value);
  325|      0|    return;
  326|      0|  }
  327|       |  // getEntry() follows the remapping to the parent blackboard, exactly like
  328|       |  // the readers do. A key that resolves to an existing entry (local or
  329|       |  // remapped) must go through the type check below: createEntryImpl() would
  330|       |  // follow the same remapping and return the pre-existing entry, and writing
  331|       |  // to it blindly bypasses the type lock and the string conversion.
  332|  5.84k|  auto entry_ptr = getEntry(key);
  333|       |  // copied under entry_mutex, notified after releasing it
  334|  5.84k|  std::shared_ptr<EntryUpdatedSignal> update_signal;
  335|  5.84k|  if(!entry_ptr)
  ------------------
  |  Branch (335:6): [True: 5.84k, False: 0]
  ------------------
  336|  5.84k|  {
  337|       |    // create a new entry
  338|  5.84k|    Any new_value(value);
  339|  5.84k|    std::shared_ptr<Blackboard::Entry> entry;
  340|       |    // if a new generic port is created with a string, it's type should be AnyTypeAllowed
  341|       |    if constexpr(std::is_same_v<std::string, T>)
  342|  5.84k|    {
  343|  5.84k|      entry = createEntryImpl(key, PortInfo(PortDirection::INOUT));
  344|       |    }
  345|       |    else
  346|       |    {
  347|       |      PortInfo new_port(PortDirection::INOUT, new_value.type(),
  348|       |                        GetAnyFromStringFunctor<T>());
  349|       |      entry = createEntryImpl(key, new_port);
  350|       |    }
  351|       |
  352|       |    // Lock entry_mutex before writing to prevent data races with
  353|       |    // concurrent readers (BUG-1/BUG-8 fix).
  354|  5.84k|    std::scoped_lock entry_lock(entry->entry_mutex);
  355|  5.84k|    entry->value = new_value;
  356|  5.84k|    entry->sequence_id++;
  357|  5.84k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  358|  5.84k|    update_signal = entry->update_signal;
  359|  5.84k|  }
  360|      0|  else
  361|      0|  {
  362|       |    // this is not the first time we set this entry, we need to check
  363|       |    // if the type is the same or not.
  364|      0|    Entry& entry = *entry_ptr;
  365|       |
  366|      0|    std::unique_lock scoped_lock(entry.entry_mutex);
  367|       |
  368|      0|    Any& previous_any = entry.value;
  369|      0|    Any new_value(value);
  370|       |
  371|       |    // special case: entry exists but it is not strongly typed... yet
  372|      0|    if(!entry.info.isStronglyTyped())
  ------------------
  |  Branch (372:8): [True: 0, False: 0]
  ------------------
  373|      0|    {
  374|       |      // Use the new type to create a new entry that is strongly typed.
  375|      0|      entry.info = TypeInfo::Create<T>();
  376|      0|      entry.sequence_id++;
  377|      0|      entry.stamp = std::chrono::steady_clock::now().time_since_epoch();
  378|      0|      previous_any = std::move(new_value);
  379|      0|      update_signal = entry.update_signal;
  380|      0|      scoped_lock.unlock();
  381|      0|      if(update_signal)
  ------------------
  |  Branch (381:10): [True: 0, False: 0]
  ------------------
  382|      0|      {
  383|      0|        update_signal->notify();
  384|      0|      }
  385|      0|      return;
  386|      0|    }
  387|       |
  388|      0|    std::type_index previous_type = entry.info.type();
  389|       |
  390|       |    // check type mismatch
  391|      0|    if(previous_type != std::type_index(typeid(T)) && previous_type != new_value.type())
  ------------------
  |  Branch (391:8): [True: 0, False: 0]
  |  Branch (391:8): [True: 0, False: 0]
  |  Branch (391:55): [True: 0, False: 0]
  ------------------
  392|      0|    {
  393|      0|      bool mismatching = true;
  394|      0|      if(std::is_constructible<StringView, T>::value)
  ------------------
  |  Branch (394:10): [True: 0, Folded]
  ------------------
  395|      0|      {
  396|      0|        Any any_from_string = entry.info.parseString(value);
  397|      0|        if(any_from_string.empty() == false)
  ------------------
  |  Branch (397:12): [True: 0, False: 0]
  ------------------
  398|      0|        {
  399|      0|          mismatching = false;
  400|      0|          new_value = std::move(any_from_string);
  401|      0|        }
  402|      0|      }
  403|       |      // check if we are doing a safe cast between numbers
  404|       |      // for instance, it is safe to use int(100) to set
  405|       |      // a uint8_t port, but not int(-42) or int(300)
  406|       |      if constexpr(std::is_arithmetic_v<T>)
  407|       |      {
  408|       |        if(mismatching && isCastingSafe(previous_type, value))
  409|       |        {
  410|       |          mismatching = false;
  411|       |        }
  412|       |      }
  413|       |
  414|      0|      if(mismatching)
  ------------------
  |  Branch (414:10): [True: 0, False: 0]
  ------------------
  415|      0|      {
  416|      0|        debugMessage();
  417|       |
  418|      0|        auto msg = StrCat("Blackboard::set(", key,
  419|      0|                          "): once declared, "
  420|      0|                          "the type of a port shall not change. "
  421|      0|                          "Previously declared type [",
  422|      0|                          BT::demangle(previous_type), "], current type [",
  423|      0|                          BT::demangle(typeid(T)), "]");
  424|      0|        throw LogicError(msg);
  425|      0|      }
  426|      0|    }
  427|       |    // if doing set<BT::Any>, skip type check
  428|       |    if constexpr(std::is_same_v<Any, T>)
  429|       |    {
  430|       |      previous_any = new_value;
  431|       |    }
  432|       |    else
  433|      0|    {
  434|       |      // copy only if the type is compatible
  435|      0|      new_value.copyInto(previous_any);
  436|      0|    }
  437|      0|    entry.sequence_id++;
  438|      0|    entry.stamp = std::chrono::steady_clock::now().time_since_epoch();
  439|      0|    update_signal = entry.update_signal;
  440|      0|  }
  441|  5.84k|  if(update_signal)
  ------------------
  |  Branch (441:6): [True: 0, False: 5.84k]
  ------------------
  442|      0|  {
  443|      0|    update_signal->notify();
  444|      0|  }
  445|  5.84k|}
_ZN2BT10Blackboard5EntryC2ERKNS_8TypeInfoE:
   75|  31.7k|    Entry(const TypeInfo& _info) : info(_info)
   76|  31.7k|    {}
_ZN2BT10Blackboard5EntryD2Ev:
   78|  31.7k|    ~Entry() = default;

_ZNK4linb3any4typeEv:
  176|  3.43M|    {
  177|  3.43M|        return empty()? typeid(void) : this->vtable->type();
  ------------------
  |  Branch (177:16): [True: 4, False: 3.43M]
  ------------------
  178|  3.43M|    }
_ZNK4linb3any5emptyEv:
  169|  17.3M|    {
  170|  17.3M|        return this->vtable == nullptr;
  171|  17.3M|    }
_ZN4linb3anyC2Ev:
   72|  95.5k|        vtable(nullptr)
   73|  95.5k|    {
   74|  95.5k|    }
_ZN4linb3anyD2Ev:
  100|  7.43M|    {
  101|  7.43M|        this->clear();
  102|  7.43M|    }
_ZN4linb3any5clearEv:
  159|  7.43M|    {
  160|  7.43M|        if(!empty())
  ------------------
  |  Branch (160:12): [True: 5.52M, False: 1.91M]
  ------------------
  161|  5.52M|        {
  162|  5.52M|            this->vtable->destroy(storage);
  163|  5.52M|            this->vtable = nullptr;
  164|  5.52M|        }
  165|  7.43M|    }
_ZN4linb8any_castIdEET_RKNS_3anyE:
  468|  20.7k|{
  469|  20.7k|    auto p = any_cast<typename std::add_const<typename std::remove_reference<ValueType>::type>::type>(&operand);
  470|  20.7k|#ifndef ANY_IMPL_NO_EXCEPTIONS
  471|  20.7k|    if(p == nullptr) throw bad_any_cast();
  ------------------
  |  Branch (471:8): [True: 0, False: 20.7k]
  ------------------
  472|  20.7k|#endif
  473|  20.7k|    return *p;
  474|  20.7k|}
_ZN4linb8any_castIKdEEPKT_PKNS_3anyE:
  510|  20.7k|{
  511|  20.7k|    using T = typename std::decay<ValueType>::type;
  512|       |
  513|  20.7k|#ifndef ANY_IMPL_NO_RTTI
  514|  20.7k|    if (operand && operand->is_typed(typeid(T)))
  ------------------
  |  Branch (514:9): [True: 20.7k, False: 0]
  |  Branch (514:20): [True: 20.7k, False: 0]
  ------------------
  515|       |#else
  516|       |    if (operand && operand->vtable == any::vtable_for_type<T>())
  517|       |#endif
  518|  20.7k|        return operand->cast<ValueType>();
  519|      0|    else
  520|      0|        return nullptr;
  521|  20.7k|}
_ZNK4linb3any8is_typedERKSt9type_info:
  355|   651k|    {
  356|   651k|        return is_same(this->type(), t);
  357|   651k|    }
_ZN4linb3any7is_sameERKSt9type_infoS3_:
  368|   651k|    {
  369|       |#ifdef ANY_IMPL_FAST_TYPE_INFO_COMPARE
  370|       |        return &a == &b;
  371|       |#else
  372|   651k|        return a == b;
  373|   651k|#endif
  374|   651k|    }
_ZNK4linb3any4castIKdEEPKT_v:
  380|  20.7k|    {
  381|  20.7k|        return requires_allocation<typename std::decay<T>::type>::value?
  ------------------
  |  Branch (381:16): [Folded, False: 20.7k]
  ------------------
  382|      0|            reinterpret_cast<const T*>(storage.dynamic) :
  383|  20.7k|            reinterpret_cast<const T*>(&storage.stack);
  384|  20.7k|    }
_ZN4linb8any_castIN7SafeAny12SimpleStringEEET_RKNS_3anyE:
  468|  85.2k|{
  469|  85.2k|    auto p = any_cast<typename std::add_const<typename std::remove_reference<ValueType>::type>::type>(&operand);
  470|  85.2k|#ifndef ANY_IMPL_NO_EXCEPTIONS
  471|  85.2k|    if(p == nullptr) throw bad_any_cast();
  ------------------
  |  Branch (471:8): [True: 0, False: 85.2k]
  ------------------
  472|  85.2k|#endif
  473|  85.2k|    return *p;
  474|  85.2k|}
_ZN4linb8any_castIKN7SafeAny12SimpleStringEEEPKT_PKNS_3anyE:
  510|  85.2k|{
  511|  85.2k|    using T = typename std::decay<ValueType>::type;
  512|       |
  513|  85.2k|#ifndef ANY_IMPL_NO_RTTI
  514|  85.2k|    if (operand && operand->is_typed(typeid(T)))
  ------------------
  |  Branch (514:9): [True: 85.2k, False: 0]
  |  Branch (514:20): [True: 85.2k, False: 0]
  ------------------
  515|       |#else
  516|       |    if (operand && operand->vtable == any::vtable_for_type<T>())
  517|       |#endif
  518|  85.2k|        return operand->cast<ValueType>();
  519|      0|    else
  520|      0|        return nullptr;
  521|  85.2k|}
_ZNK4linb3any4castIKN7SafeAny12SimpleStringEEEPKT_v:
  380|  85.2k|    {
  381|  85.2k|        return requires_allocation<typename std::decay<T>::type>::value?
  ------------------
  |  Branch (381:16): [Folded, False: 85.2k]
  ------------------
  382|      0|            reinterpret_cast<const T*>(storage.dynamic) :
  383|  85.2k|            reinterpret_cast<const T*>(&storage.stack);
  384|  85.2k|    }
_ZN4linb8any_castIlEET_RKNS_3anyE:
  468|   545k|{
  469|   545k|    auto p = any_cast<typename std::add_const<typename std::remove_reference<ValueType>::type>::type>(&operand);
  470|   545k|#ifndef ANY_IMPL_NO_EXCEPTIONS
  471|   545k|    if(p == nullptr) throw bad_any_cast();
  ------------------
  |  Branch (471:8): [True: 0, False: 545k]
  ------------------
  472|   545k|#endif
  473|   545k|    return *p;
  474|   545k|}
_ZN4linb8any_castIKlEEPKT_PKNS_3anyE:
  510|   545k|{
  511|   545k|    using T = typename std::decay<ValueType>::type;
  512|       |
  513|   545k|#ifndef ANY_IMPL_NO_RTTI
  514|   545k|    if (operand && operand->is_typed(typeid(T)))
  ------------------
  |  Branch (514:9): [True: 545k, False: 0]
  |  Branch (514:20): [True: 545k, False: 0]
  ------------------
  515|       |#else
  516|       |    if (operand && operand->vtable == any::vtable_for_type<T>())
  517|       |#endif
  518|   545k|        return operand->cast<ValueType>();
  519|      0|    else
  520|      0|        return nullptr;
  521|   545k|}
_ZNK4linb3any4castIKlEEPKT_v:
  380|   545k|    {
  381|   545k|        return requires_allocation<typename std::decay<T>::type>::value?
  ------------------
  |  Branch (381:16): [Folded, False: 545k]
  ------------------
  382|      0|            reinterpret_cast<const T*>(storage.dynamic) :
  383|   545k|            reinterpret_cast<const T*>(&storage.stack);
  384|   545k|    }
_ZN4linb3anyC2IlvEEOT_:
  110|  1.68M|    {
  111|  1.68M|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  112|  1.68M|            "T shall satisfy the CopyConstructible requirements.");
  113|  1.68M|        this->construct(std::forward<ValueType>(value));
  114|  1.68M|    }
_ZN4linb3any9constructIlEEvOT_:
  439|  1.68M|    {
  440|  1.68M|        using T = typename std::decay<ValueType>::type;
  441|       |
  442|  1.68M|        this->vtable = vtable_for_type<T>();
  443|       |
  444|  1.68M|        do_construct<ValueType,T>(std::forward<ValueType>(value));
  445|  1.68M|    }
_ZN4linb3any15vtable_for_typeIlEEPNS0_11vtable_typeEv:
  333|  1.68M|    {
  334|  1.68M|        using VTableType = typename std::conditional<requires_allocation<T>::value, vtable_dynamic<T>, vtable_stack<T>>::type;
  335|  1.68M|        static vtable_type table = {
  336|  1.68M|#ifndef ANY_IMPL_NO_RTTI
  337|  1.68M|            VTableType::type,
  338|  1.68M|#endif
  339|  1.68M|            VTableType::destroy,
  340|  1.68M|            VTableType::copy, VTableType::move,
  341|  1.68M|            VTableType::swap,
  342|  1.68M|        };
  343|  1.68M|        return &table;
  344|  1.68M|    }
_ZN4linb3any12vtable_stackIlE4typeEv:
  289|  2.76M|        {
  290|  2.76M|            return typeid(T);
  291|  2.76M|        }
_ZN4linb3any12vtable_stackIlE7destroyERNS0_13storage_unionE:
  295|  6.39M|        {
  296|  6.39M|            reinterpret_cast<T*>(&storage.stack)->~T();
  297|  6.39M|        }
_ZN4linb3any12vtable_stackIlE4copyERKNS0_13storage_unionERS3_:
  300|  2.23M|        {
  301|  2.23M|            new (&dest.stack) T(reinterpret_cast<const T&>(src.stack));
  302|  2.23M|        }
_ZN4linb3any12vtable_stackIlE4moveERNS0_13storage_unionES4_:
  305|  2.47M|        {
  306|       |            // one of the conditions for using vtable_stack is a nothrow move constructor,
  307|       |            // so this move constructor will never throw a exception.
  308|  2.47M|            new (&dest.stack) T(std::move(reinterpret_cast<T&>(src.stack)));
  309|  2.47M|            destroy(src);
  310|  2.47M|        }
_ZN4linb3any12vtable_stackIlE4swapERNS0_13storage_unionES4_:
  313|   257k|        {
  314|   257k|            storage_union tmp_storage;
  315|   257k|            move(rhs, tmp_storage);
  316|   257k|            move(lhs, rhs);
  317|   257k|            move(tmp_storage, lhs);
  318|   257k|        }
_ZN4linb3any12do_constructIllEENSt9enable_ifIXntsr19requires_allocationIT0_EE5valueEvE4typeEOT_:
  431|  1.68M|    {
  432|  1.68M|        new (&storage.stack) T(std::forward<ValueType>(value));
  433|  1.68M|    }
_ZN4linb3anyaSERKS0_:
  129|   313k|    {
  130|   313k|        any(rhs).swap(*this);
  131|   313k|        return *this;
  132|   313k|    }
_ZN4linb3anyC2ERKS0_:
   78|  3.40M|        vtable(rhs.vtable)
   79|  3.40M|    {
   80|  3.40M|        if(!rhs.empty())
  ------------------
  |  Branch (80:12): [True: 3.40M, False: 292]
  ------------------
   81|  3.40M|        {
   82|  3.40M|            rhs.vtable->copy(rhs.storage, this->storage);
   83|  3.40M|        }
   84|  3.40M|    }
_ZN4linb3any4swapERS0_:
  183|   358k|    {
  184|   358k|        if(this->vtable != rhs.vtable)
  ------------------
  |  Branch (184:12): [True: 46.3k, False: 312k]
  ------------------
  185|  46.3k|        {
  186|  46.3k|            any tmp(std::move(rhs));
  187|       |
  188|       |            // move from *this to rhs.
  189|  46.3k|            rhs.vtable = this->vtable;
  190|  46.3k|            if(this->vtable != nullptr)
  ------------------
  |  Branch (190:16): [True: 46.3k, False: 0]
  ------------------
  191|  46.3k|            {
  192|  46.3k|                this->vtable->move(this->storage, rhs.storage);
  193|       |                //this->vtable = nullptr; -- unneeded, see below
  194|  46.3k|            }
  195|       |
  196|       |            // move from tmp (previously rhs) to *this.
  197|  46.3k|            this->vtable = tmp.vtable;
  198|  46.3k|            if(tmp.vtable != nullptr)
  ------------------
  |  Branch (198:16): [True: 16.1k, False: 30.1k]
  ------------------
  199|  16.1k|            {
  200|  16.1k|                tmp.vtable->move(tmp.storage, this->storage);
  201|  16.1k|                tmp.vtable = nullptr;
  202|  16.1k|            }
  203|  46.3k|        }
  204|   312k|        else // same types
  205|   312k|        {
  206|   312k|            if(this->vtable != nullptr)
  ------------------
  |  Branch (206:16): [True: 280k, False: 31.7k]
  ------------------
  207|   280k|                this->vtable->swap(this->storage, rhs.storage);
  208|   312k|        }
  209|   358k|    }
_ZN4linb3anyC2EOS0_:
   89|  1.81M|        vtable(rhs.vtable)
   90|  1.81M|    {
   91|  1.81M|        if(!rhs.empty())
  ------------------
  |  Branch (91:12): [True: 1.78M, False: 30.1k]
  ------------------
   92|  1.78M|        {
   93|  1.78M|            rhs.vtable->move(rhs.storage, this->storage);
   94|  1.78M|            rhs.vtable = nullptr;
   95|  1.78M|        }
   96|  1.81M|    }
_ZN4linb3anyaSEOS0_:
  139|  43.6k|    {
  140|  43.6k|        std::move(rhs).swap(*this);
  141|  43.6k|        return *this;
  142|  43.6k|    }
_ZN4linb3anyaSIlvEERS0_OT_:
  150|    901|    {
  151|    901|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  152|    901|            "T shall satisfy the CopyConstructible requirements.");
  153|    901|        any(std::forward<ValueType>(value)).swap(*this);
  154|    901|        return *this;
  155|    901|    }
_ZN4linb3anyaSIdvEERS0_OT_:
  150|    424|    {
  151|    424|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  152|    424|            "T shall satisfy the CopyConstructible requirements.");
  153|    424|        any(std::forward<ValueType>(value)).swap(*this);
  154|    424|        return *this;
  155|    424|    }
_ZN4linb3anyC2IdvEEOT_:
  110|    424|    {
  111|    424|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  112|    424|            "T shall satisfy the CopyConstructible requirements.");
  113|    424|        this->construct(std::forward<ValueType>(value));
  114|    424|    }
_ZN4linb3any9constructIdEEvOT_:
  439|    424|    {
  440|    424|        using T = typename std::decay<ValueType>::type;
  441|       |
  442|    424|        this->vtable = vtable_for_type<T>();
  443|       |
  444|    424|        do_construct<ValueType,T>(std::forward<ValueType>(value));
  445|    424|    }
_ZN4linb3any15vtable_for_typeIdEEPNS0_11vtable_typeEv:
  333|   322k|    {
  334|   322k|        using VTableType = typename std::conditional<requires_allocation<T>::value, vtable_dynamic<T>, vtable_stack<T>>::type;
  335|   322k|        static vtable_type table = {
  336|   322k|#ifndef ANY_IMPL_NO_RTTI
  337|   322k|            VTableType::type,
  338|   322k|#endif
  339|   322k|            VTableType::destroy,
  340|   322k|            VTableType::copy, VTableType::move,
  341|   322k|            VTableType::swap,
  342|   322k|        };
  343|   322k|        return &table;
  344|   322k|    }
_ZN4linb3any12vtable_stackIdE4typeEv:
  289|   141k|        {
  290|   141k|            return typeid(T);
  291|   141k|        }
_ZN4linb3any12vtable_stackIdE7destroyERNS0_13storage_unionE:
  295|   383k|        {
  296|   383k|            reinterpret_cast<T*>(&storage.stack)->~T();
  297|   383k|        }
_ZN4linb3any12vtable_stackIdE4copyERKNS0_13storage_unionERS3_:
  300|  26.1k|        {
  301|  26.1k|            new (&dest.stack) T(reinterpret_cast<const T&>(src.stack));
  302|  26.1k|        }
_ZN4linb3any12vtable_stackIdE4moveERNS0_13storage_unionES4_:
  305|  35.2k|        {
  306|       |            // one of the conditions for using vtable_stack is a nothrow move constructor,
  307|       |            // so this move constructor will never throw a exception.
  308|  35.2k|            new (&dest.stack) T(std::move(reinterpret_cast<T&>(src.stack)));
  309|  35.2k|            destroy(src);
  310|  35.2k|        }
_ZN4linb3any12vtable_stackIdE4swapERNS0_13storage_unionES4_:
  313|  4.91k|        {
  314|  4.91k|            storage_union tmp_storage;
  315|  4.91k|            move(rhs, tmp_storage);
  316|  4.91k|            move(lhs, rhs);
  317|  4.91k|            move(tmp_storage, lhs);
  318|  4.91k|        }
_ZN4linb3any12do_constructIddEENSt9enable_ifIXntsr19requires_allocationIT0_EE5valueEvE4typeEOT_:
  431|    424|    {
  432|    424|        new (&storage.stack) T(std::forward<ValueType>(value));
  433|    424|    }
_ZN4linb3anyC2IRKdvEEOT_:
  110|   321k|    {
  111|   321k|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  112|   321k|            "T shall satisfy the CopyConstructible requirements.");
  113|   321k|        this->construct(std::forward<ValueType>(value));
  114|   321k|    }
_ZN4linb3any9constructIRKdEEvOT_:
  439|   321k|    {
  440|   321k|        using T = typename std::decay<ValueType>::type;
  441|       |
  442|   321k|        this->vtable = vtable_for_type<T>();
  443|       |
  444|   321k|        do_construct<ValueType,T>(std::forward<ValueType>(value));
  445|   321k|    }
_ZN4linb3any12do_constructIRKddEENSt9enable_ifIXntsr19requires_allocationIT0_EE5valueEvE4typeEOT_:
  431|   321k|    {
  432|   321k|        new (&storage.stack) T(std::forward<ValueType>(value));
  433|   321k|    }
_ZN4linb3anyC2IN7SafeAny12SimpleStringEvEEOT_:
  110|   110k|    {
  111|   110k|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  112|   110k|            "T shall satisfy the CopyConstructible requirements.");
  113|   110k|        this->construct(std::forward<ValueType>(value));
  114|   110k|    }
_ZN4linb3any9constructIN7SafeAny12SimpleStringEEEvOT_:
  439|   110k|    {
  440|   110k|        using T = typename std::decay<ValueType>::type;
  441|       |
  442|   110k|        this->vtable = vtable_for_type<T>();
  443|       |
  444|   110k|        do_construct<ValueType,T>(std::forward<ValueType>(value));
  445|   110k|    }
_ZN4linb3any15vtable_for_typeIN7SafeAny12SimpleStringEEEPNS0_11vtable_typeEv:
  333|   110k|    {
  334|   110k|        using VTableType = typename std::conditional<requires_allocation<T>::value, vtable_dynamic<T>, vtable_stack<T>>::type;
  335|   110k|        static vtable_type table = {
  336|   110k|#ifndef ANY_IMPL_NO_RTTI
  337|   110k|            VTableType::type,
  338|   110k|#endif
  339|   110k|            VTableType::destroy,
  340|   110k|            VTableType::copy, VTableType::move,
  341|   110k|            VTableType::swap,
  342|   110k|        };
  343|   110k|        return &table;
  344|   110k|    }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE4typeEv:
  289|   527k|        {
  290|   527k|            return typeid(T);
  291|   527k|        }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE7destroyERNS0_13storage_unionE:
  295|  1.43M|        {
  296|  1.43M|            reinterpret_cast<T*>(&storage.stack)->~T();
  297|  1.43M|        }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE4copyERKNS0_13storage_unionERS5_:
  300|  1.14M|        {
  301|  1.14M|            new (&dest.stack) T(reinterpret_cast<const T&>(src.stack));
  302|  1.14M|        }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE4moveERNS0_13storage_unionES6_:
  305|   179k|        {
  306|       |            // one of the conditions for using vtable_stack is a nothrow move constructor,
  307|       |            // so this move constructor will never throw a exception.
  308|   179k|            new (&dest.stack) T(std::move(reinterpret_cast<T&>(src.stack)));
  309|   179k|            destroy(src);
  310|   179k|        }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE4swapERNS0_13storage_unionES6_:
  313|  17.6k|        {
  314|  17.6k|            storage_union tmp_storage;
  315|  17.6k|            move(rhs, tmp_storage);
  316|  17.6k|            move(lhs, rhs);
  317|  17.6k|            move(tmp_storage, lhs);
  318|  17.6k|        }
_ZN4linb3any12do_constructIN7SafeAny12SimpleStringES3_EENSt9enable_ifIXntsr19requires_allocationIT0_EE5valueEvE4typeEOT_:
  431|   110k|    {
  432|   110k|        new (&storage.stack) T(std::forward<ValueType>(value));
  433|   110k|    }

_ZNK6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  5.84k|    {
 2205|  5.84k|        return has_value();
 2206|  5.84k|    }
_ZNK6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  11.6k|    {
 2210|  11.6k|        return contained.has_value();
 2211|  11.6k|    }
_ZNK6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  11.6k|    {
  788|  11.6k|        return m_has_value;
  789|  11.6k|    }
_ZNK6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  7.46k|    {
 2205|  7.46k|        return has_value();
 2206|  7.46k|    }
_ZNK6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  19.1k|    {
 2210|  19.1k|        return contained.has_value();
 2211|  19.1k|    }
_ZNK6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  19.1k|    {
  788|  19.1k|        return m_has_value;
  789|  19.1k|    }
_ZN6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IdTnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIdOT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISB_E4typeESt10in_place_tEE5valuentsr3std7is_sameIS8_SG_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS7_EESG_EE5valuesr3std14is_convertibleISC_dEE5valueEiE4typeELi0EEESC_:
 1940|  1.11M|    : contained( true )
 1941|  1.11M|    {
 1942|  1.11M|        contained.construct_value( std::forward<U>( value ) );
 1943|  1.11M|    }
_ZN6nonstd13expected_lite6detail9storage_tIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  1.13M|        : storage_t_impl<T, E>( has_value )
  923|  1.13M|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  1.13M|        : m_has_value( has_value )
  675|  1.13M|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOd:
  688|  1.11M|    {
  689|  1.11M|        new( &m_value ) value_type( std::move( e ) );
  690|  1.11M|    }
_ZN6nonstd13expected_lite15make_unexpectedIRA39_KcEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOS7_:
 1567|    161|{
 1568|    161|    return unexpected_type< typename std::decay<E>::type >( std::forward<E>(value) );
 1569|    161|}
_ZN6nonstd13expected_lite15unexpected_typeIPKcEC2IRA39_S2_TnNSt9enable_ifIXaaaasr3std16is_constructibleIS3_T_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefIS9_E4typeESt10in_place_tEE5valuentsr3std7is_sameISD_S4_EE5valueEiE4typeELi0EEEOS9_:
 1238|    161|    : m_error( std::forward<E2>( error ) )
 1239|    161|    {}
_ZN6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS7_OT_EE5valuesr3std14is_convertibleISE_S7_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISD_EE:
 1990|    161|    : contained( false )
 1991|    161|    {
 1992|    161|        contained.construct_error( std::move( error.error() ) );
 1993|    161|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_errorEOS8_:
  715|    322|    {
  716|    322|        new( &m_error ) error_type( std::move( e ) );
  717|    322|    }
_ZNR6nonstd13expected_lite15unexpected_typeIPKcE5errorEv:
 1335|  6.25k|    {
 1336|  6.25k|        return m_error;
 1337|  6.25k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  1.13M|    ~storage_t_impl() {}
_ZN6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IRdTnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIdOT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISC_E4typeESt10in_place_tEE5valuentsr3std7is_sameIS8_SH_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS7_EESH_EE5valuesr3std14is_convertibleISD_dEE5valueEiE4typeELi0EEESD_:
 1940|  17.5k|    : contained( true )
 1941|  17.5k|    {
 1942|  17.5k|        contained.construct_value( std::forward<U>( value ) );
 1943|  17.5k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueERKd:
  683|  17.5k|    {
  684|  17.5k|        new( &m_value ) value_type( e );
  685|  17.5k|    }
_ZN6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2EOS8_:
 1806|    161|    nsel_constexpr14 expected( expected &&      ) = default;
_ZN6nonstd13expected_lite6detail9storage_tIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2EOS9_:
  933|    161|        : storage_t_impl<T, E>( other.has_value() )
  934|    161|    {
  935|    161|        if ( this->has_value() ) this->construct_value( std::move( other.value() ) );
  ------------------
  |  Branch (935:14): [True: 0, False: 161]
  ------------------
  936|    161|        else                     this->construct_error( std::move( other.error() ) );
  937|    161|    }
_ZNK6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  3.39M|    {
  788|  3.39M|        return m_has_value;
  789|  3.39M|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|  1.13M|    {
  743|  1.13M|        return m_value;
  744|  1.13M|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
  772|    322|    {
  773|    322|        return m_error;
  774|    322|    }
_ZNR6nonstd13expected_lite15unexpected_typeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
 1335|  1.62k|    {
 1336|  1.62k|        return m_error;
 1337|  1.62k|    }
_ZNK6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  1.13M|    {
 2205|  1.13M|        return has_value();
 2206|  1.13M|    }
_ZNK6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  3.39M|    {
 2210|  3.39M|        return contained.has_value();
 2211|  3.39M|    }
_ZNR6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|  1.13M|    {
 2224|  1.13M|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 1.13M, False: 0]
  ------------------
 2225|  1.13M|            ? ( contained.value() )
 2226|  1.13M|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|  1.13M|    }
_ZNR6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
 2255|    161|    {
 2256|       |        return assert( ! has_value() ), contained.error();
 2257|    161|    }
_ZN6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  1.13M|    {
 2051|  1.13M|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 1.13M, False: 322]
  ------------------
 2052|    322|        else               contained.destruct_error();
 2053|  1.13M|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  1.13M|    {
  706|  1.13M|        m_value.~value_type();
  707|  1.13M|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_errorEv:
  732|    322|    {
  733|    322|        m_error.~error_type();
  734|    322|    }
_ZN6nonstd13expected_lite8expectedIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IlTnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIlOT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISB_E4typeESt10in_place_tEE5valuentsr3std7is_sameIS8_SG_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS7_EESG_EE5valuesr3std14is_convertibleISC_lEE5valueEiE4typeELi0EEESC_:
 1940|  8.14k|    : contained( true )
 1941|  8.14k|    {
 1942|  8.14k|        contained.construct_value( std::forward<U>( value ) );
 1943|  8.14k|    }
_ZN6nonstd13expected_lite6detail9storage_tIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  8.14k|        : storage_t_impl<T, E>( has_value )
  923|  8.14k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  8.14k|        : m_has_value( has_value )
  675|  8.14k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOl:
  688|  8.14k|    {
  689|  8.14k|        new( &m_value ) value_type( std::move( e ) );
  690|  8.14k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  8.14k|    ~storage_t_impl() {}
_ZNK6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  24.4k|    {
  788|  24.4k|        return m_has_value;
  789|  24.4k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|  8.14k|    {
  743|  8.14k|        return m_value;
  744|  8.14k|    }
_ZNK6nonstd13expected_lite8expectedIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  8.14k|    {
 2205|  8.14k|        return has_value();
 2206|  8.14k|    }
_ZNK6nonstd13expected_lite8expectedIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  24.4k|    {
 2210|  24.4k|        return contained.has_value();
 2211|  24.4k|    }
_ZNR6nonstd13expected_lite8expectedIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|  8.14k|    {
 2224|  8.14k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 8.14k, False: 0]
  ------------------
 2225|  8.14k|            ? ( contained.value() )
 2226|  8.14k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|  8.14k|    }
_ZN6nonstd13expected_lite8expectedIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  8.14k|    {
 2051|  8.14k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 8.14k, False: 0]
  ------------------
 2052|      0|        else               contained.destruct_error();
 2053|  8.14k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  8.14k|    {
  706|  8.14k|        m_value.~value_type();
  707|  8.14k|    }
_ZN6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  5.84k|    {
 2051|  5.84k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 4.21k, False: 1.62k]
  ------------------
 2052|  1.62k|        else               contained.destruct_error();
 2053|  5.84k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  4.21k|    {
  706|  4.21k|        m_value.~value_type();
  707|  4.21k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_errorEv:
  732|  1.62k|    {
  733|  1.62k|        m_error.~error_type();
  734|  1.62k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  5.84k|    ~storage_t_impl() {}
_ZN6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  7.46k|    {
 2051|  7.46k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 4.21k, False: 3.25k]
  ------------------
 2052|  3.25k|        else               contained.destruct_error();
 2053|  7.46k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  4.21k|    {
  706|  4.21k|        m_value.~value_type();
  707|  4.21k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_errorEv:
  732|  3.25k|    {
  733|  3.25k|        m_error.~error_type();
  734|  3.25k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  7.46k|    ~storage_t_impl() {}
_ZNR6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|  4.21k|    {
 2224|  4.21k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 4.21k, False: 0]
  ------------------
 2225|  4.21k|            ? ( contained.value() )
 2226|  4.21k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|  4.21k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|  4.21k|    {
  743|  4.21k|        return m_value;
  744|  4.21k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
  772|  1.62k|    {
  773|  1.62k|        return m_error;
  774|  1.62k|    }
_ZN6nonstd13expected_lite8expectedIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_:
 1940|  2.78k|    : contained( true )
 1941|  2.78k|    {
 1942|  2.78k|        contained.construct_value( std::forward<U>( value ) );
 1943|  2.78k|    }
_ZN6nonstd13expected_lite6detail9storage_tIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  5.62k|        : storage_t_impl<T, E>( has_value )
  923|  5.62k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  5.62k|        : m_has_value( has_value )
  675|  5.62k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOS4_:
  688|  2.78k|    {
  689|  2.78k|        new( &m_value ) value_type( std::move( e ) );
  690|  2.78k|    }
_ZN6nonstd13expected_lite8expectedIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS9_TnNSt9enable_ifIXaasr3std16is_constructibleIS9_OT_EE5valuesr3std14is_convertibleISE_S9_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISD_EE:
 1990|  1.62k|    : contained( false )
 1991|  1.62k|    {
 1992|  1.62k|        contained.construct_error( std::move( error.error() ) );
 1993|  1.62k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_errorEOSA_:
  715|  2.84k|    {
  716|  2.84k|        new( &m_error ) error_type( std::move( e ) );
  717|  2.84k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  5.62k|    ~storage_t_impl() {}
_ZNK6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  5.62k|    {
  788|  5.62k|        return m_has_value;
  789|  5.62k|    }
_ZNK6nonstd13expected_lite8expectedIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  5.62k|    {
 2210|  5.62k|        return contained.has_value();
 2211|  5.62k|    }
_ZN6nonstd13expected_lite15make_unexpectedIRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOSB_:
 1567|  1.62k|{
 1568|  1.62k|    return unexpected_type< typename std::decay<E>::type >( std::forward<E>(value) );
 1569|  1.62k|}
_ZN6nonstd13expected_lite15unexpected_typeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IRS7_TnNSt9enable_ifIXaaaasr3std16is_constructibleIS7_T_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISC_E4typeESt10in_place_tEE5valuentsr3std7is_sameISG_S8_EE5valueEiE4typeELi0EEEOSC_:
 1238|  1.62k|    : m_error( std::forward<E2>( error ) )
 1239|  1.62k|    {}
_ZN6nonstd13expected_lite8expectedIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  5.62k|    {
 2051|  5.62k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 2.78k, False: 2.84k]
  ------------------
 2052|  2.84k|        else               contained.destruct_error();
 2053|  5.62k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  2.78k|    {
  706|  2.78k|        m_value.~value_type();
  707|  2.78k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_errorEv:
  732|  2.84k|    {
  733|  2.84k|        m_error.~error_type();
  734|  2.84k|    }
_ZNK6nonstd13expected_lite8expectedINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_E9has_valueEv:
 2209|   313k|    {
 2210|   313k|        return contained.has_value();
 2211|   313k|    }
_ZNK6nonstd13expected_lite8expectedINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EcvbEv:
 2204|   104k|    {
 2205|   104k|        return has_value();
 2206|   104k|    }
_ZNK6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_E9has_valueEv:
  787|   313k|    {
  788|   313k|        return m_has_value;
  789|   313k|    }
_ZN6nonstd13expected_lite8expectedINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EC2IS7_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS7_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISB_E4typeESt10in_place_tEE5valuentsr3std7is_sameIS8_SG_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS7_EESG_EE5valuesr3std14is_convertibleISC_S7_EE5valueEiE4typeELi0EEESC_:
 1940|   104k|    : contained( true )
 1941|   104k|    {
 1942|   104k|        contained.construct_value( std::forward<U>( value ) );
 1943|   104k|    }
_ZN6nonstd13expected_lite6detail9storage_tINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_Lb1ELb1EEC2Eb:
  922|   104k|        : storage_t_impl<T, E>( has_value )
  923|   104k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_EC2Eb:
  674|   104k|        : m_has_value( has_value )
  675|   104k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_E15construct_valueEOS8_:
  688|   104k|    {
  689|   104k|        new( &m_value ) value_type( std::move( e ) );
  690|   104k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_ED2Ev:
  671|   104k|    ~storage_t_impl() {}
_ZN6nonstd13expected_lite15make_unexpectedIPKcEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOS6_:
 1567|  5.98k|{
 1568|  5.98k|    return unexpected_type< typename std::decay<E>::type >( std::forward<E>(value) );
 1569|  5.98k|}
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEv:
  678|  4.21k|    {
  679|  4.21k|        new( &m_value ) value_type();
  680|  4.21k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_errorEOS9_:
  715|  1.62k|    {
  716|  1.62k|        new( &m_error ) error_type( std::move( e ) );
  717|  1.62k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_E5valueEv:
  742|   104k|    {
  743|   104k|        return m_value;
  744|   104k|    }
_ZNR6nonstd13expected_lite8expectedINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_E5valueEv:
 2223|   104k|    {
 2224|   104k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 104k, False: 0]
  ------------------
 2225|   104k|            ? ( contained.value() )
 2226|   104k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|   104k|    }
_ZN6nonstd13expected_lite8expectedINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_ED2Ev:
 2050|   104k|    {
 2051|   104k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 104k, False: 0]
  ------------------
 2052|      0|        else               contained.destruct_error();
 2053|   104k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_E14destruct_valueEv:
  705|   104k|    {
  706|   104k|        m_value.~value_type();
  707|   104k|    }
_ZN6nonstd13expected_lite8expectedIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_:
 1940|  18.7k|    : contained( true )
 1941|  18.7k|    {
 1942|  18.7k|        contained.construct_value( std::forward<U>( value ) );
 1943|  18.7k|    }
_ZN6nonstd13expected_lite6detail9storage_tIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  18.7k|        : storage_t_impl<T, E>( has_value )
  923|  18.7k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  18.7k|        : m_has_value( has_value )
  675|  18.7k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOS4_:
  688|  18.7k|    {
  689|  18.7k|        new( &m_value ) value_type( std::move( e ) );
  690|  18.7k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  18.7k|    ~storage_t_impl() {}
_ZNK6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  56.3k|    {
  788|  56.3k|        return m_has_value;
  789|  56.3k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|  18.7k|    {
  743|  18.7k|        return m_value;
  744|  18.7k|    }
_ZNK6nonstd13expected_lite8expectedIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  18.7k|    {
 2205|  18.7k|        return has_value();
 2206|  18.7k|    }
_ZNK6nonstd13expected_lite8expectedIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  56.3k|    {
 2210|  56.3k|        return contained.has_value();
 2211|  56.3k|    }
_ZNR6nonstd13expected_lite8expectedIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|  18.7k|    {
 2224|  18.7k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 18.7k, False: 0]
  ------------------
 2225|  18.7k|            ? ( contained.value() )
 2226|  18.7k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|  18.7k|    }
_ZN6nonstd13expected_lite8expectedIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  18.7k|    {
 2051|  18.7k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 18.7k, False: 0]
  ------------------
 2052|      0|        else               contained.destruct_error();
 2053|  18.7k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  18.7k|    {
  706|  18.7k|        m_value.~value_type();
  707|  18.7k|    }
_ZN6nonstd13expected_lite8expectedIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IbTnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIbOT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISB_E4typeESt10in_place_tEE5valuentsr3std7is_sameIS8_SG_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS7_EESG_EE5valuesr3std14is_convertibleISC_bEE5valueEiE4typeELi0EEESC_:
 1940|  4.72k|    : contained( true )
 1941|  4.72k|    {
 1942|  4.72k|        contained.construct_value( std::forward<U>( value ) );
 1943|  4.72k|    }
_ZN6nonstd13expected_lite6detail9storage_tIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  4.72k|        : storage_t_impl<T, E>( has_value )
  923|  4.72k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  4.72k|        : m_has_value( has_value )
  675|  4.72k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOb:
  688|  4.72k|    {
  689|  4.72k|        new( &m_value ) value_type( std::move( e ) );
  690|  4.72k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  4.72k|    ~storage_t_impl() {}
_ZNK6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  14.1k|    {
  788|  14.1k|        return m_has_value;
  789|  14.1k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|  4.72k|    {
  743|  4.72k|        return m_value;
  744|  4.72k|    }
_ZNK6nonstd13expected_lite8expectedIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  4.72k|    {
 2205|  4.72k|        return has_value();
 2206|  4.72k|    }
_ZNK6nonstd13expected_lite8expectedIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  14.1k|    {
 2210|  14.1k|        return contained.has_value();
 2211|  14.1k|    }
_ZNR6nonstd13expected_lite8expectedIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|  4.72k|    {
 2224|  4.72k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 4.72k, False: 0]
  ------------------
 2225|  4.72k|            ? ( contained.value() )
 2226|  4.72k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|  4.72k|    }
_ZN6nonstd13expected_lite8expectedIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  4.72k|    {
 2051|  4.72k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 4.72k, False: 0]
  ------------------
 2052|      0|        else               contained.destruct_error();
 2053|  4.72k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  4.72k|    {
  706|  4.72k|        m_value.~value_type();
  707|  4.72k|    }
_ZN6nonstd13expected_lite15make_unexpectedIRA13_KcEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOS7_:
 1567|    108|{
 1568|    108|    return unexpected_type< typename std::decay<E>::type >( std::forward<E>(value) );
 1569|    108|}
_ZN6nonstd13expected_lite15unexpected_typeIPKcEC2IRA13_S2_TnNSt9enable_ifIXaaaasr3std16is_constructibleIS3_T_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefIS9_E4typeESt10in_place_tEE5valuentsr3std7is_sameISD_S4_EE5valueEiE4typeELi0EEEOS9_:
 1238|    108|    : m_error( std::forward<E2>( error ) )
 1239|    108|    {}
_ZN6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleISF_OT_EE5valuesr3std14is_convertibleISM_SF_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISL_EE:
 1990|  3.25k|    : contained( false )
 1991|  3.25k|    {
 1992|  3.25k|        contained.construct_error( std::move( error.error() ) );
 1993|  3.25k|    }
_ZN6nonstd13expected_lite6detail9storage_tISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  7.46k|        : storage_t_impl<T, E>( has_value )
  923|  7.46k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  7.46k|        : m_has_value( has_value )
  675|  7.46k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_errorEOSG_:
  715|  3.25k|    {
  716|  3.25k|        new( &m_error ) error_type( std::move( e ) );
  717|  3.25k|    }
script_parser.cpp:_ZN6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IZNS3_11ParseScriptERKSF_E3$_0TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS9_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISM_E4typeESt10in_place_tEE5valuentsr3std7is_sameISG_SR_EE5valuentsr3std7is_sameINS0_15unexpected_typeISF_EESR_EE5valuesr3std14is_convertibleISN_S9_EE5valueEiE4typeELi0EEESN_:
 1940|  4.21k|    : contained( true )
 1941|  4.21k|    {
 1942|  4.21k|        contained.construct_value( std::forward<U>( value ) );
 1943|  4.21k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOSA_:
  688|  4.21k|    {
  689|  4.21k|        new( &m_value ) value_type( std::move( e ) );
  690|  4.21k|    }
_ZN6nonstd13expected_lite15unexpected_typeIPKcEC2IS3_TnNSt9enable_ifIXaaaasr3std16is_constructibleIS3_T_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefIS7_E4typeESt10in_place_tEE5valuentsr3std7is_sameISB_S4_EE5valueEiE4typeELi0EEEOS7_:
 1238|  5.98k|    : m_error( std::forward<E2>( error ) )
 1239|  5.98k|    {}
_ZN6nonstd13expected_lite8expectedIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS9_OT_EE5valuesr3std14is_convertibleISG_S9_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISF_EE:
 1990|  1.21k|    : contained( false )
 1991|  1.21k|    {
 1992|  1.21k|        contained.construct_error( std::move( error.error() ) );
 1993|  1.21k|    }
_ZN6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS8_OT_EE5valuesr3std14is_convertibleISF_S8_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISE_EE:
 1990|  1.62k|    : contained( false )
 1991|  1.62k|    {
 1992|  1.62k|        contained.construct_error( std::move( error.error() ) );
 1993|  1.62k|    }
_ZN6nonstd13expected_lite6detail9storage_tISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  5.84k|        : storage_t_impl<T, E>( has_value )
  923|  5.84k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  5.84k|        : m_has_value( has_value )
  675|  5.84k|    {}
_ZN6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2ILb1ETnNSt9enable_ifIXT_EiE4typeELi0EEEv:
 1800|  4.21k|    : contained( true )
 1801|  4.21k|    {
 1802|  4.21k|        contained.construct_value();
 1803|  4.21k|    }
_ZNR6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
 2255|  1.62k|    {
 2256|       |        return assert( ! has_value() ), contained.error();
 2257|  1.62k|    }

_ZN2BT21BehaviorTreeExceptionC2IJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEDpRKT_:
   33|  6.70k|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|  6.70k|  {}
_ZNK2BT21BehaviorTreeException4whatEv:
   37|  7.20k|  {
   38|  7.20k|    return message_.c_str();
   39|  7.20k|  }
_ZN2BT12RuntimeErrorC2IJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEDpRKT_:
   67|  6.70k|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|  6.70k|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA35_cEEEDpRKT_:
   33|      2|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|      2|  {}
_ZN2BT12RuntimeErrorC2IJA42_cEEEDpRKT_:
   67|      1|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|      1|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA42_cEEEDpRKT_:
   33|      1|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|      1|  {}
_ZN2BT12RuntimeErrorC2IJA33_cEEEDpRKT_:
   67|    199|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|    199|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA33_cEEEDpRKT_:
   33|    199|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|    199|  {}
_ZN2BT12RuntimeErrorC2IJA31_cEEEDpRKT_:
   67|      1|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|      1|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA31_cEEEDpRKT_:
   33|      1|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|      1|  {}
_ZN2BT12RuntimeErrorC2IJA47_cEEEDpRKT_:
   67|     24|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|     24|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA47_cEEEDpRKT_:
   33|     24|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|     24|  {}
_ZN2BT12RuntimeErrorC2IJA63_cEEEDpRKT_:
   67|      5|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|      5|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA63_cEEEDpRKT_:
   33|      5|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|      5|  {}
_ZN2BT12RuntimeErrorC2IJA35_cEEEDpRKT_:
   67|      2|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|      2|  {}
_ZN2BT12RuntimeErrorC2IJA74_cEEEDpRKT_:
   67|      5|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|      5|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA74_cEEEDpRKT_:
   33|      5|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|      5|  {}
_ZN2BT12RuntimeErrorC2IJA79_cEEEDpRKT_:
   67|    142|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|    142|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA79_cEEEDpRKT_:
   33|    142|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|    142|  {}
_ZN2BT12RuntimeErrorC2IJA24_cEEEDpRKT_:
   67|    118|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|    118|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA24_cEEEDpRKT_:
   33|    118|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|    118|  {}

_ZN2BT3Ast19ExprUnaryArithmeticC2ENS1_4op_tESt10shared_ptrINS0_8ExprBaseEE:
  138|  28.0k|  explicit ExprUnaryArithmetic(op_t op, expr_ptr e) : op(op), rhs(std::move(e))
  139|  28.0k|  {}
_ZN2BT3Ast8ExprBaseD2Ev:
   77|  11.7M|  virtual ~ExprBase() = default;
_ZNK2BT3Ast19ExprUnaryArithmetic8evaluateERNS0_11EnvironmentE:
  142|  6.79k|  {
  143|  6.79k|    auto rhs_v = rhs->evaluate(env);
  144|  6.79k|    if(rhs_v.isNumber())
  ------------------
  |  Branch (144:8): [True: 4.76k, False: 2.02k]
  ------------------
  145|  4.76k|    {
  146|  4.76k|      const double rv = rhs_v.cast<double>();
  147|  4.76k|      switch(op)
  ------------------
  |  Branch (147:14): [True: 4.74k, False: 21]
  ------------------
  148|  4.76k|      {
  149|  1.55k|        case negate:
  ------------------
  |  Branch (149:9): [True: 1.55k, False: 3.21k]
  ------------------
  150|  1.55k|          return Any(-rv);
  151|  2.03k|        case complement:
  ------------------
  |  Branch (151:9): [True: 2.03k, False: 2.73k]
  ------------------
  152|       |          // Use the checked conversion, like the binary bitwise operators do.
  153|       |          // A plain static_cast is undefined for NaN and for values at or
  154|       |          // beyond the int64_t range: the hand-written comparison used here
  155|       |          // before let NaN (every comparison is false) and 2^63 (not greater
  156|       |          // than double(INT64_MAX), which rounds up to 2^63) through, and
  157|       |          // silently truncated fractional values.
  158|  2.03k|          try
  159|  2.03k|          {
  160|  2.03k|            return Any(static_cast<double>(~rhs_v.cast<int64_t>()));
  161|  2.03k|          }
  162|  2.03k|          catch(const std::exception&)
  163|  2.03k|          {
  164|      1|            throw RuntimeError("Number out of range for bitwise operation");
  165|      1|          }
  166|  1.15k|        case logical_not:
  ------------------
  |  Branch (166:9): [True: 1.15k, False: 3.61k]
  ------------------
  167|  1.15k|          return Any(static_cast<double>(!static_cast<bool>(rv)));
  168|  4.76k|      }
  169|  4.76k|    }
  170|  2.02k|    else if(rhs_v.isString())
  ------------------
  |  Branch (170:13): [True: 1.89k, False: 130]
  ------------------
  171|  1.89k|    {
  172|  1.89k|      if(op == logical_not)
  ------------------
  |  Branch (172:10): [True: 1.89k, False: 2]
  ------------------
  173|  1.89k|      {
  174|  1.89k|        const auto str = rhs_v.cast<std::string>();
  175|  1.89k|        if(str == "true" || str == "True" || str == "TRUE" || str == "1")
  ------------------
  |  Branch (175:12): [True: 196, False: 1.69k]
  |  Branch (175:29): [True: 194, False: 1.50k]
  |  Branch (175:46): [True: 194, False: 1.31k]
  |  Branch (175:63): [True: 195, False: 1.11k]
  ------------------
  176|    779|        {
  177|    779|          return Any(0.0);
  178|    779|        }
  179|  1.11k|        if(str == "false" || str == "False" || str == "FALSE" || str == "0")
  ------------------
  |  Branch (179:12): [True: 198, False: 918]
  |  Branch (179:30): [True: 205, False: 713]
  |  Branch (179:48): [True: 194, False: 519]
  |  Branch (179:66): [True: 322, False: 197]
  ------------------
  180|    919|        {
  181|    919|          return Any(1.0);
  182|    919|        }
  183|  1.11k|      }
  184|    199|      throw RuntimeError("Invalid operator for std::string");
  185|  1.89k|    }
  186|    130|    throw RuntimeError("ExprUnaryArithmetic: undefined");
  187|  6.79k|  }
_ZN2BT3Ast11ExprLiteralC2ENS_3AnyE:
   91|  1.77M|  ExprLiteral(Any v) : value(v)
   92|  1.77M|  {}
_ZNK2BT3Ast11ExprLiteral8evaluateERNS0_11EnvironmentE:
   95|   308k|  {
   96|   308k|    return value;
   97|   308k|  }
_ZN2BT3Ast8ExprNameC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  104|  9.82M|  explicit ExprName(std::string n) : name(std::move(n))
  105|  9.82M|  {}
_ZNK2BT3Ast8ExprName8evaluateERNS0_11EnvironmentE:
  108|   987k|  {
  109|       |    //search first in the enums table
  110|   987k|    if(env.enums)
  ------------------
  |  Branch (110:8): [True: 987k, False: 0]
  ------------------
  111|   987k|    {
  112|   987k|      auto enum_ptr = env.enums->find(name);
  113|   987k|      if(enum_ptr != env.enums->end())
  ------------------
  |  Branch (113:10): [True: 0, False: 987k]
  ------------------
  114|      0|      {
  115|      0|        return Any(double(enum_ptr->second));
  116|      0|      }
  117|   987k|    }
  118|       |    // search now in the variables table
  119|   987k|    auto any_ref = env.vars->getAnyLocked(name);
  120|   987k|    if(!any_ref)
  ------------------
  |  Branch (120:8): [True: 529, False: 987k]
  ------------------
  121|    529|    {
  122|    529|      throw RuntimeError(StrCat("Variable not found: ", name));
  123|    529|    }
  124|   987k|    return *any_ref.get();
  125|   987k|  }
_ZN2BT3Ast14ExprAssignmentC2ESt10shared_ptrINS0_8ExprBaseEENS1_4op_tES4_:
  561|  57.6k|    : op(op), lhs(std::move(_lhs)), rhs(std::move(_rhs))
  562|  57.6k|  {}
_ZNK2BT3Ast14ExprAssignment8evaluateERNS0_11EnvironmentE:
  565|  22.0k|  {
  566|  22.0k|    auto varname = dynamic_cast<ExprName*>(lhs.get());
  567|  22.0k|    if(!varname)
  ------------------
  |  Branch (567:8): [True: 24, False: 21.9k]
  ------------------
  568|     24|    {
  569|     24|      throw RuntimeError("Assignment left operand not a blackboard entry");
  570|     24|    }
  571|  21.9k|    const auto& key = varname->name;
  572|       |
  573|  21.9k|    auto entry = env.vars->getEntry(key);
  574|  21.9k|    if(!entry)
  ------------------
  |  Branch (574:8): [True: 8.47k, False: 13.5k]
  ------------------
  575|  8.47k|    {
  576|       |      // variable doesn't exist, create it if using operator assign_create
  577|  8.47k|      if(op == assign_create)
  ------------------
  |  Branch (577:10): [True: 8.41k, False: 61]
  ------------------
  578|  8.41k|      {
  579|  8.41k|        env.vars->createEntry(key, PortInfo());
  580|  8.41k|        entry = env.vars->getEntry(key);
  581|  8.41k|        if(!entry)
  ------------------
  |  Branch (581:12): [True: 0, False: 8.41k]
  ------------------
  582|      0|        {
  583|      0|          throw LogicError("Bug: report");
  584|      0|        }
  585|  8.41k|      }
  586|     61|      else
  587|     61|      {
  588|       |        // fail otherwise
  589|     61|        auto msg = StrCat("The blackboard entry [", key,
  590|     61|                          "] doesn't exist, yet.\n"
  591|     61|                          "If you want to create a new one, "
  592|     61|                          "use the operator "
  593|     61|                          "[:=] instead of [=]");
  594|     61|        throw RuntimeError(msg);
  595|     61|      }
  596|  8.47k|    }
  597|  21.9k|    auto value = rhs->evaluate(env);
  598|       |
  599|  21.9k|    std::unique_lock lock(entry->entry_mutex);
  600|  21.9k|    auto* dst_ptr = &entry->value;
  601|       |
  602|  21.9k|    auto errorPrefix = [dst_ptr, &key]() {
  603|  21.9k|      return StrCat("Error assigning a value to entry [", key, "] with type [",
  604|  21.9k|                    BT::demangle(dst_ptr->type()), "]. ");
  605|  21.9k|    };
  606|       |
  607|  21.9k|    if(value.empty())
  ------------------
  |  Branch (607:8): [True: 49, False: 21.8k]
  ------------------
  608|     49|    {
  609|     49|      throw RuntimeError(ErrorNotInit("right", opStr()));
  610|     49|    }
  611|       |
  612|  21.8k|    if(op == assign_create || op == assign_existing)
  ------------------
  |  Branch (612:8): [True: 10.3k, False: 11.5k]
  |  Branch (612:31): [True: 3.76k, False: 7.76k]
  ------------------
  613|  11.1k|    {
  614|       |      // the very fist assignment can come from any type.
  615|       |      // In the future, type check will be done by Any::copyInto
  616|  11.1k|      if(dst_ptr->empty() && entry->info.type() == typeid(AnyTypeAllowed))
  ------------------
  |  Branch (616:10): [True: 6.78k, False: 4.35k]
  |  Branch (616:10): [True: 6.78k, False: 4.35k]
  |  Branch (616:30): [True: 6.78k, False: 0]
  ------------------
  617|  6.78k|      {
  618|  6.78k|        *dst_ptr = value;
  619|  6.78k|      }
  620|  4.35k|      else if(value.isString() && !dst_ptr->isString())
  ------------------
  |  Branch (620:15): [True: 2.51k, False: 1.83k]
  |  Branch (620:35): [True: 1.93k, False: 588]
  ------------------
  621|  1.93k|      {
  622|       |        // special case: string to other type.
  623|       |        // Check if we can use the StringConverter
  624|  1.93k|        auto const str = value.cast<std::string>();
  625|       |        // Use the entry locked above. Looking the key up again could return
  626|       |        // nullptr, or a different entry, if it was unset in the meantime.
  627|  1.93k|        if(auto converter = entry->info.converter())
  ------------------
  |  Branch (627:17): [True: 0, False: 1.93k]
  ------------------
  628|      0|        {
  629|      0|          *dst_ptr = converter(str);
  630|      0|        }
  631|  1.93k|        else if(dst_ptr->isNumber())
  ------------------
  |  Branch (631:17): [True: 1.93k, False: 0]
  ------------------
  632|  1.93k|        {
  633|  1.93k|          auto num_value = StringToDouble(value, env);
  634|  1.93k|          *dst_ptr = Any(num_value);
  635|  1.93k|        }
  636|      0|        else
  637|      0|        {
  638|      0|          auto msg = StrCat(errorPrefix(),
  639|      0|                            "\nThe right operand is a string, "
  640|      0|                            "can't convert to ",
  641|      0|                            demangle(dst_ptr->type()));
  642|      0|          throw RuntimeError(msg);
  643|      0|        }
  644|  1.93k|      }
  645|  2.42k|      else
  646|  2.42k|      {
  647|  2.42k|        try
  648|  2.42k|        {
  649|  2.42k|          value.copyInto(*dst_ptr);
  650|  2.42k|        }
  651|  2.42k|        catch(std::exception&)
  652|  2.42k|        {
  653|     51|          auto msg = StrCat(errorPrefix(), "\nThe right operand has type [",
  654|     51|                            BT::demangle(value.type()), "] and can't be converted to [",
  655|     51|                            BT::demangle(dst_ptr->type()), "]");
  656|     51|          throw RuntimeError(msg);
  657|     51|        }
  658|  2.42k|      }
  659|  11.0k|      entry->sequence_id++;
  660|  11.0k|      entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  661|  11.0k|      const Any result = *dst_ptr;
  662|  11.0k|      auto update_signal = entry->update_signal;
  663|  11.0k|      lock.unlock();
  664|  11.0k|      if(update_signal)
  ------------------
  |  Branch (664:10): [True: 0, False: 11.0k]
  ------------------
  665|      0|      {
  666|      0|        update_signal->notify();
  667|      0|      }
  668|  11.0k|      return result;
  669|  11.1k|    }
  670|       |
  671|  10.7k|    if(dst_ptr->empty())
  ------------------
  |  Branch (671:8): [True: 4, False: 10.7k]
  ------------------
  672|      4|    {
  673|      4|      throw RuntimeError(ErrorNotInit("left", opStr()));
  674|      4|    }
  675|       |
  676|       |    // temporary use
  677|  10.7k|    Any temp_variable = *dst_ptr;
  678|       |
  679|  10.7k|    if(value.isNumber())
  ------------------
  |  Branch (679:8): [True: 1.76k, False: 8.96k]
  ------------------
  680|  1.76k|    {
  681|  1.76k|      if(!temp_variable.isNumber())
  ------------------
  |  Branch (681:10): [True: 5, False: 1.76k]
  ------------------
  682|      5|      {
  683|      5|        throw RuntimeError("This Assignment operator can't be used "
  684|      5|                           "with a non-numeric type");
  685|      5|      }
  686|       |
  687|  1.76k|      auto lv = temp_variable.cast<double>();
  688|  1.76k|      auto rv = value.cast<double>();
  689|  1.76k|      switch(op)
  690|  1.76k|      {
  691|    431|        case assign_plus:
  ------------------
  |  Branch (691:9): [True: 431, False: 1.33k]
  ------------------
  692|    431|          temp_variable = Any(lv + rv);
  693|    431|          break;
  694|    446|        case assign_minus:
  ------------------
  |  Branch (694:9): [True: 446, False: 1.31k]
  ------------------
  695|    446|          temp_variable = Any(lv - rv);
  696|    446|          break;
  697|    466|        case assign_times:
  ------------------
  |  Branch (697:9): [True: 466, False: 1.29k]
  ------------------
  698|    466|          temp_variable = Any(lv * rv);
  699|    466|          break;
  700|    418|        case assign_div:
  ------------------
  |  Branch (700:9): [True: 418, False: 1.34k]
  ------------------
  701|    418|          temp_variable = Any(lv / rv);
  702|    418|          break;
  703|      0|        default: {
  ------------------
  |  Branch (703:9): [True: 0, False: 1.76k]
  ------------------
  704|      0|        }
  705|  1.76k|      }
  706|  1.76k|    }
  707|  8.96k|    else if(value.isString())
  ------------------
  |  Branch (707:13): [True: 5.99k, False: 2.97k]
  ------------------
  708|  5.99k|    {
  709|  5.99k|      if(op == assign_plus)
  ------------------
  |  Branch (709:10): [True: 5.99k, False: 2]
  ------------------
  710|  5.99k|      {
  711|  5.99k|        auto lv = temp_variable.cast<std::string>();
  712|  5.99k|        auto rv = value.cast<std::string>();
  713|  5.99k|        temp_variable = Any(lv + rv);
  714|  5.99k|      }
  715|      2|      else
  716|      2|      {
  717|      2|        throw RuntimeError("Operator not supported for strings");
  718|      2|      }
  719|  5.99k|    }
  720|       |
  721|  10.7k|    temp_variable.copyInto(*dst_ptr);
  722|  10.7k|    entry->sequence_id++;
  723|  10.7k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  724|  10.7k|    const Any result = *dst_ptr;
  725|  10.7k|    auto update_signal = entry->update_signal;
  726|  10.7k|    lock.unlock();
  727|  10.7k|    if(update_signal)
  ------------------
  |  Branch (727:8): [True: 0, False: 10.7k]
  ------------------
  728|      0|    {
  729|      0|      update_signal->notify();
  730|      0|    }
  731|  10.7k|    return result;
  732|  10.7k|  }
_ZN2BT3Ast12ErrorNotInitB5cxx11EPKcS2_:
   82|     78|{
   83|     78|  return StrCat("The ", side, " operand of the operator [", op_str,
   84|     78|                "] is not initialized");
   85|     78|}
_ZNK2BT3Ast14ExprAssignment5opStrEv:
  539|     53|  {
  540|     53|    switch(op)
  ------------------
  |  Branch (540:12): [True: 53, False: 0]
  ------------------
  541|     53|    {
  542|     30|      case assign_create:
  ------------------
  |  Branch (542:7): [True: 30, False: 23]
  ------------------
  543|     30|        return ":=";
  544|     18|      case assign_existing:
  ------------------
  |  Branch (544:7): [True: 18, False: 35]
  ------------------
  545|     18|        return "=";
  546|      2|      case assign_plus:
  ------------------
  |  Branch (546:7): [True: 2, False: 51]
  ------------------
  547|      2|        return "+=";
  548|      1|      case assign_minus:
  ------------------
  |  Branch (548:7): [True: 1, False: 52]
  ------------------
  549|      1|        return "-=";
  550|      2|      case assign_times:
  ------------------
  |  Branch (550:7): [True: 2, False: 51]
  ------------------
  551|      2|        return "*=";
  552|      0|      case assign_div:
  ------------------
  |  Branch (552:7): [True: 0, False: 53]
  ------------------
  553|      0|        return "/=";
  554|     53|    }
  555|      0|    return "";
  556|     53|  }
_ZN2BT3Ast14StringToDoubleERKNS_3AnyERKNS0_11EnvironmentE:
   33|  18.1k|{
   34|  18.1k|  const auto str = value.cast<std::string>();
   35|  18.1k|  if(str == "true")
  ------------------
  |  Branch (35:6): [True: 194, False: 17.9k]
  ------------------
   36|    194|  {
   37|    194|    return 1.0;
   38|    194|  }
   39|  17.9k|  if(str == "false")
  ------------------
  |  Branch (39:6): [True: 194, False: 17.7k]
  ------------------
   40|    194|  {
   41|    194|    return 0.0;
   42|    194|  }
   43|  17.7k|  if(env.enums)
  ------------------
  |  Branch (43:6): [True: 17.7k, False: 0]
  ------------------
   44|  17.7k|  {
   45|  17.7k|    auto it = env.enums->find(str);
   46|  17.7k|    if(it != env.enums->end())
  ------------------
  |  Branch (46:8): [True: 0, False: 17.7k]
  ------------------
   47|      0|    {
   48|      0|      return it->second;
   49|      0|    }
   50|  17.7k|  }
   51|  17.7k|  return value.cast<double>();
   52|  17.7k|}
_ZZNK2BT3Ast14ExprAssignment8evaluateERNS0_11EnvironmentEENKUlvE_clB5cxx11Ev:
  602|     51|    auto errorPrefix = [dst_ptr, &key]() {
  603|     51|      return StrCat("Error assigning a value to entry [", key, "] with type [",
  604|     51|                    BT::demangle(dst_ptr->type()), "]. ");
  605|     51|    };
_ZN2BT3Ast6ExprIfC2ESt10shared_ptrINS0_8ExprBaseEES4_S4_:
  507|  4.90k|    : condition(std::move(condition)), then(std::move(then)), else_(std::move(else_))
  508|  4.90k|  {}
_ZNK2BT3Ast6ExprIf8evaluateERNS0_11EnvironmentE:
  511|  1.10k|  {
  512|  1.10k|    const auto& v = condition->evaluate(env);
  513|  1.10k|    bool valid = (v.isType<SimpleString>() && v.cast<SimpleString>().size() > 0) ||
  ------------------
  |  Branch (513:19): [True: 0, False: 1.10k]
  |  Branch (513:47): [True: 0, False: 0]
  ------------------
  514|  1.09k|                 (v.cast<double>() != 0.0);
  ------------------
  |  Branch (514:18): [True: 416, False: 677]
  ------------------
  515|  1.10k|    if(valid)
  ------------------
  |  Branch (515:8): [True: 413, False: 689]
  ------------------
  516|    413|    {
  517|    413|      return then->evaluate(env);
  518|    413|    }
  519|    689|    else
  520|    689|    {
  521|    689|      return else_->evaluate(env);
  522|    689|    }
  523|  1.10k|  }
_ZNK2BT3Ast14ExprComparison8evaluateERNS0_11EnvironmentE:
  406|  14.6k|  {
  407|  14.6k|    auto SwitchImpl = [&](const auto& lv, const auto& rv, op_t op) {
  408|  14.6k|      switch(op)
  409|  14.6k|      {
  410|  14.6k|        case equal:
  411|  14.6k|          if(!IsSame(lv, rv))
  412|  14.6k|            return false;
  413|  14.6k|          break;
  414|  14.6k|        case not_equal:
  415|  14.6k|          if(IsSame(lv, rv))
  416|  14.6k|            return false;
  417|  14.6k|          break;
  418|  14.6k|        case less:
  419|  14.6k|          if(lv >= rv)
  420|  14.6k|            return false;
  421|  14.6k|          break;
  422|  14.6k|        case greater:
  423|  14.6k|          if(lv <= rv)
  424|  14.6k|            return false;
  425|  14.6k|          break;
  426|  14.6k|        case less_equal:
  427|  14.6k|          if(lv > rv)
  428|  14.6k|            return false;
  429|  14.6k|          break;
  430|  14.6k|        case greater_equal:
  431|  14.6k|          if(lv < rv)
  432|  14.6k|            return false;
  433|  14.6k|          break;
  434|  14.6k|      }
  435|  14.6k|      return true;
  436|  14.6k|    };
  437|       |
  438|  14.6k|    auto lhs_v = operands[0]->evaluate(env);
  439|   289k|    for(auto i = 0u; i != ops.size(); ++i)
  ------------------
  |  Branch (439:22): [True: 284k, False: 5.10k]
  ------------------
  440|   284k|    {
  441|   284k|      auto rhs_v = operands[i + 1]->evaluate(env);
  442|       |
  443|   284k|      if(lhs_v.empty())
  ------------------
  |  Branch (443:10): [True: 10, False: 284k]
  ------------------
  444|     10|      {
  445|     10|        throw RuntimeError(ErrorNotInit("left", opStr(ops[i])));
  446|     10|      }
  447|   284k|      if(rhs_v.empty())
  ------------------
  |  Branch (447:10): [True: 3, False: 284k]
  ------------------
  448|      3|      {
  449|      3|        throw RuntimeError(ErrorNotInit("right", opStr(ops[i])));
  450|      3|      }
  451|   284k|      const Any False(0.0);
  452|       |
  453|   284k|      if(lhs_v.isNumber() && rhs_v.isNumber())
  ------------------
  |  Branch (453:10): [True: 266k, False: 18.0k]
  |  Branch (453:30): [True: 258k, False: 7.74k]
  ------------------
  454|   258k|      {
  455|   258k|        auto lv = lhs_v.cast<double>();
  456|   258k|        auto rv = rhs_v.cast<double>();
  457|   258k|        if(!SwitchImpl(lv, rv, ops[i]))
  ------------------
  |  Branch (457:12): [True: 1.77k, False: 256k]
  ------------------
  458|  1.77k|        {
  459|  1.77k|          return False;
  460|  1.77k|        }
  461|   258k|      }
  462|  25.7k|      else if(lhs_v.isString() && rhs_v.isString())
  ------------------
  |  Branch (462:15): [True: 17.8k, False: 7.94k]
  |  Branch (462:35): [True: 9.39k, False: 8.43k]
  ------------------
  463|  9.39k|      {
  464|  9.39k|        auto lv = lhs_v.cast<SimpleString>();
  465|  9.39k|        auto rv = rhs_v.cast<SimpleString>();
  466|  9.39k|        if(!SwitchImpl(lv, rv, ops[i]))
  ------------------
  |  Branch (466:12): [True: 4.29k, False: 5.09k]
  ------------------
  467|  4.29k|        {
  468|  4.29k|          return False;
  469|  4.29k|        }
  470|  9.39k|      }
  471|  16.3k|      else if(lhs_v.isString() && rhs_v.isNumber())
  ------------------
  |  Branch (471:15): [True: 8.43k, False: 7.94k]
  |  Branch (471:35): [True: 8.43k, False: 0]
  ------------------
  472|  8.43k|      {
  473|  8.43k|        auto lv = StringToDouble(lhs_v, env);
  474|  8.43k|        auto rv = rhs_v.cast<double>();
  475|  8.43k|        if(!SwitchImpl(lv, rv, ops[i]))
  ------------------
  |  Branch (475:12): [True: 1.67k, False: 6.76k]
  ------------------
  476|  1.67k|        {
  477|  1.67k|          return False;
  478|  1.67k|        }
  479|  8.43k|      }
  480|  7.94k|      else if(lhs_v.isNumber() && rhs_v.isString())
  ------------------
  |  Branch (480:15): [True: 7.74k, False: 201]
  |  Branch (480:35): [True: 7.74k, False: 0]
  ------------------
  481|  7.74k|      {
  482|  7.74k|        auto lv = lhs_v.cast<double>();
  483|  7.74k|        auto rv = StringToDouble(rhs_v, env);
  484|  7.74k|        if(!SwitchImpl(lv, rv, ops[i]))
  ------------------
  |  Branch (484:12): [True: 1.55k, False: 6.19k]
  ------------------
  485|  1.55k|        {
  486|  1.55k|          return False;
  487|  1.55k|        }
  488|  7.74k|      }
  489|    201|      else
  490|    201|      {
  491|    201|        throw RuntimeError(StrCat("Can't mix different types in Comparison. "
  492|    201|                                  "Left operand [",
  493|    201|                                  BT::demangle(lhs_v.type()), "] right operand [",
  494|    201|                                  BT::demangle(rhs_v.type()), "]"));
  495|    201|      }
  496|   274k|      lhs_v = rhs_v;
  497|   274k|    }
  498|  5.10k|    return Any(1.0);
  499|  14.6k|  }
_ZNK2BT3Ast14ExprComparison5opStrENS1_4op_tE:
  383|     13|  {
  384|     13|    switch(op)
  ------------------
  |  Branch (384:12): [True: 13, False: 0]
  ------------------
  385|     13|    {
  386|      1|      case equal:
  ------------------
  |  Branch (386:7): [True: 1, False: 12]
  ------------------
  387|      1|        return "==";
  388|      1|      case not_equal:
  ------------------
  |  Branch (388:7): [True: 1, False: 12]
  ------------------
  389|      1|        return "!=";
  390|      2|      case less:
  ------------------
  |  Branch (390:7): [True: 2, False: 11]
  ------------------
  391|      2|        return "<";
  392|      8|      case greater:
  ------------------
  |  Branch (392:7): [True: 8, False: 5]
  ------------------
  393|      8|        return ">";
  394|      0|      case less_equal:
  ------------------
  |  Branch (394:7): [True: 0, False: 13]
  ------------------
  395|      0|        return "<=";
  396|      1|      case greater_equal:
  ------------------
  |  Branch (396:7): [True: 1, False: 12]
  ------------------
  397|      1|        return ">=";
  398|     13|    }
  399|      0|    return "";
  400|     13|  }
_ZZNK2BT3Ast14ExprComparison8evaluateERNS0_11EnvironmentEENKUlRKT_RKT0_NS1_4op_tEE_clIddEEDaS6_S9_SA_:
  407|   274k|    auto SwitchImpl = [&](const auto& lv, const auto& rv, op_t op) {
  408|   274k|      switch(op)
  ------------------
  |  Branch (408:14): [True: 274k, False: 0]
  ------------------
  409|   274k|      {
  410|  1.46k|        case equal:
  ------------------
  |  Branch (410:9): [True: 1.46k, False: 273k]
  ------------------
  411|  1.46k|          if(!IsSame(lv, rv))
  ------------------
  |  Branch (411:14): [True: 806, False: 659]
  ------------------
  412|    806|            return false;
  413|    659|          break;
  414|   230k|        case not_equal:
  ------------------
  |  Branch (414:9): [True: 230k, False: 43.6k]
  ------------------
  415|   230k|          if(IsSame(lv, rv))
  ------------------
  |  Branch (415:14): [True: 582, False: 230k]
  ------------------
  416|    582|            return false;
  417|   230k|          break;
  418|   230k|        case less:
  ------------------
  |  Branch (418:9): [True: 20.1k, False: 254k]
  ------------------
  419|  20.1k|          if(lv >= rv)
  ------------------
  |  Branch (419:14): [True: 1.41k, False: 18.7k]
  ------------------
  420|  1.41k|            return false;
  421|  18.7k|          break;
  422|  19.1k|        case greater:
  ------------------
  |  Branch (422:9): [True: 19.1k, False: 255k]
  ------------------
  423|  19.1k|          if(lv <= rv)
  ------------------
  |  Branch (423:14): [True: 731, False: 18.3k]
  ------------------
  424|    731|            return false;
  425|  18.3k|          break;
  426|  18.3k|        case less_equal:
  ------------------
  |  Branch (426:9): [True: 1.33k, False: 273k]
  ------------------
  427|  1.33k|          if(lv > rv)
  ------------------
  |  Branch (427:14): [True: 725, False: 611]
  ------------------
  428|    725|            return false;
  429|    611|          break;
  430|  1.50k|        case greater_equal:
  ------------------
  |  Branch (430:9): [True: 1.50k, False: 273k]
  ------------------
  431|  1.50k|          if(lv < rv)
  ------------------
  |  Branch (431:14): [True: 746, False: 756]
  ------------------
  432|    746|            return false;
  433|    756|          break;
  434|   274k|      }
  435|   269k|      return true;
  436|   274k|    };
_ZN2BT3Ast6IsSameIdEEbRKT_S4_:
  358|   232k|{
  359|       |  if constexpr(std::is_same_v<double, T>)
  360|   232k|  {
  361|   232k|    constexpr double EPS = static_cast<double>(std::numeric_limits<float>::epsilon());
  362|   232k|    return std::abs(lv - rv) <= EPS;
  363|       |  }
  364|       |  else
  365|       |  {
  366|       |    return (lv == rv);
  367|       |  }
  368|   232k|}
_ZZNK2BT3Ast14ExprComparison8evaluateERNS0_11EnvironmentEENKUlRKT_RKT0_NS1_4op_tEE_clIN7SafeAny12SimpleStringESE_EEDaS6_S9_SA_:
  407|  9.39k|    auto SwitchImpl = [&](const auto& lv, const auto& rv, op_t op) {
  408|  9.39k|      switch(op)
  ------------------
  |  Branch (408:14): [True: 9.39k, False: 0]
  ------------------
  409|  9.39k|      {
  410|    969|        case equal:
  ------------------
  |  Branch (410:9): [True: 969, False: 8.42k]
  ------------------
  411|    969|          if(!IsSame(lv, rv))
  ------------------
  |  Branch (411:14): [True: 572, False: 397]
  ------------------
  412|    572|            return false;
  413|    397|          break;
  414|  1.09k|        case not_equal:
  ------------------
  |  Branch (414:9): [True: 1.09k, False: 8.30k]
  ------------------
  415|  1.09k|          if(IsSame(lv, rv))
  ------------------
  |  Branch (415:14): [True: 398, False: 695]
  ------------------
  416|    398|            return false;
  417|    695|          break;
  418|  1.84k|        case less:
  ------------------
  |  Branch (418:9): [True: 1.84k, False: 7.54k]
  ------------------
  419|  1.84k|          if(lv >= rv)
  ------------------
  |  Branch (419:14): [True: 1.28k, False: 555]
  ------------------
  420|  1.28k|            return false;
  421|    555|          break;
  422|  1.96k|        case greater:
  ------------------
  |  Branch (422:9): [True: 1.96k, False: 7.43k]
  ------------------
  423|  1.96k|          if(lv <= rv)
  ------------------
  |  Branch (423:14): [True: 769, False: 1.19k]
  ------------------
  424|    769|            return false;
  425|  1.19k|          break;
  426|  1.59k|        case less_equal:
  ------------------
  |  Branch (426:9): [True: 1.59k, False: 7.80k]
  ------------------
  427|  1.59k|          if(lv > rv)
  ------------------
  |  Branch (427:14): [True: 545, False: 1.04k]
  ------------------
  428|    545|            return false;
  429|  1.04k|          break;
  430|  1.93k|        case greater_equal:
  ------------------
  |  Branch (430:9): [True: 1.93k, False: 7.46k]
  ------------------
  431|  1.93k|          if(lv < rv)
  ------------------
  |  Branch (431:14): [True: 722, False: 1.21k]
  ------------------
  432|    722|            return false;
  433|  1.21k|          break;
  434|  9.39k|      }
  435|  5.09k|      return true;
  436|  9.39k|    };
_ZN2BT3Ast6IsSameIN7SafeAny12SimpleStringEEEbRKT_S6_:
  358|  2.06k|{
  359|       |  if constexpr(std::is_same_v<double, T>)
  360|       |  {
  361|       |    constexpr double EPS = static_cast<double>(std::numeric_limits<float>::epsilon());
  362|       |    return std::abs(lv - rv) <= EPS;
  363|       |  }
  364|       |  else
  365|  2.06k|  {
  366|  2.06k|    return (lv == rv);
  367|  2.06k|  }
  368|  2.06k|}
_ZN2BT3Ast20ExprBinaryArithmeticC2ESt10shared_ptrINS0_8ExprBaseEENS1_4op_tES4_:
  239|  41.9k|    : op(op), lhs(std::move(lhs)), rhs(std::move(rhs))
  240|  41.9k|  {}
_ZNK2BT3Ast20ExprBinaryArithmetic8evaluateERNS0_11EnvironmentE:
  243|  14.7k|  {
  244|  14.7k|    auto lhs_v = lhs->evaluate(env);
  245|  14.7k|    auto rhs_v = rhs->evaluate(env);
  246|       |
  247|  14.7k|    if(lhs_v.empty())
  ------------------
  |  Branch (247:8): [True: 11, False: 14.7k]
  ------------------
  248|     11|    {
  249|     11|      throw RuntimeError(ErrorNotInit("left", opStr()));
  250|     11|    }
  251|  14.7k|    if(rhs_v.empty())
  ------------------
  |  Branch (251:8): [True: 1, False: 14.7k]
  ------------------
  252|      1|    {
  253|      1|      throw RuntimeError(ErrorNotInit("right", opStr()));
  254|      1|    }
  255|       |
  256|       |    // A numeric string mixed with a number is used as that number, e.g. the
  257|       |    // literal SubTree port int_val="42" in "int_val + 1"
  258|  14.7k|    if(op == plus || op == minus || op == times || op == div)
  ------------------
  |  Branch (258:8): [True: 6.38k, False: 8.37k]
  |  Branch (258:22): [True: 832, False: 7.54k]
  |  Branch (258:37): [True: 472, False: 7.07k]
  |  Branch (258:52): [True: 566, False: 6.50k]
  ------------------
  259|  7.93k|    {
  260|  7.93k|      if(lhs_v.isString() && rhs_v.isNumber())
  ------------------
  |  Branch (260:10): [True: 4.76k, False: 3.17k]
  |  Branch (260:30): [True: 604, False: 4.16k]
  ------------------
  261|    604|      {
  262|    604|        NumericStringToNumber(lhs_v);
  263|    604|      }
  264|  7.33k|      else if(lhs_v.isNumber() && rhs_v.isString())
  ------------------
  |  Branch (264:15): [True: 3.17k, False: 4.16k]
  |  Branch (264:35): [True: 1.68k, False: 1.48k]
  ------------------
  265|  1.68k|      {
  266|  1.68k|        NumericStringToNumber(rhs_v);
  267|  1.68k|      }
  268|  7.93k|    }
  269|       |
  270|  14.7k|    if(rhs_v.isNumber() && lhs_v.isNumber())
  ------------------
  |  Branch (270:8): [True: 7.76k, False: 6.99k]
  |  Branch (270:28): [True: 6.26k, False: 1.49k]
  ------------------
  271|  6.26k|    {
  272|  6.26k|      auto lv = lhs_v.cast<double>();
  273|  6.26k|      auto rv = rhs_v.cast<double>();
  274|       |
  275|  6.26k|      switch(op)
  276|  6.26k|      {
  277|  1.85k|        case plus:
  ------------------
  |  Branch (277:9): [True: 1.85k, False: 4.41k]
  ------------------
  278|  1.85k|          return Any(lv + rv);
  279|    799|        case minus:
  ------------------
  |  Branch (279:9): [True: 799, False: 5.46k]
  ------------------
  280|    799|          return Any(lv - rv);
  281|    467|        case times:
  ------------------
  |  Branch (281:9): [True: 467, False: 5.80k]
  ------------------
  282|    467|          return Any(lv * rv);
  283|    555|        case div:
  ------------------
  |  Branch (283:9): [True: 555, False: 5.71k]
  ------------------
  284|    555|          return Any(lv / rv);
  285|  2.59k|        default: {
  ------------------
  |  Branch (285:9): [True: 2.59k, False: 3.67k]
  ------------------
  286|  2.59k|        }
  287|  6.26k|      }
  288|       |
  289|  2.59k|      if(op == bit_and || op == bit_or || op == bit_xor)
  ------------------
  |  Branch (289:10): [True: 343, False: 2.25k]
  |  Branch (289:27): [True: 427, False: 1.82k]
  |  Branch (289:43): [True: 293, False: 1.53k]
  ------------------
  290|  1.06k|      {
  291|  1.06k|        try
  292|  1.06k|        {
  293|  1.06k|          int64_t li = lhs_v.cast<int64_t>();
  294|  1.06k|          int64_t ri = rhs_v.cast<int64_t>();
  295|  1.06k|          switch(op)
  296|  1.06k|          {
  297|    340|            case bit_and:
  ------------------
  |  Branch (297:13): [True: 340, False: 723]
  ------------------
  298|    340|              return Any(static_cast<double>(li & ri));
  299|    427|            case bit_or:
  ------------------
  |  Branch (299:13): [True: 427, False: 636]
  ------------------
  300|    427|              return Any(static_cast<double>(li | ri));
  301|    291|            case bit_xor:
  ------------------
  |  Branch (301:13): [True: 291, False: 772]
  ------------------
  302|    291|              return Any(static_cast<double>(li ^ ri));
  303|      0|            default: {
  ------------------
  |  Branch (303:13): [True: 0, False: 1.06k]
  ------------------
  304|      0|            }
  305|  1.06k|          }
  306|  1.06k|        }
  307|  1.06k|        catch(...)
  308|  1.06k|        {
  309|      5|          throw RuntimeError("Binary operators are not allowed if "
  310|      5|                             "one of the operands is not an integer");
  311|      5|        }
  312|  1.06k|      }
  313|       |
  314|  1.53k|      if(op == logic_or || op == logic_and)
  ------------------
  |  Branch (314:10): [True: 638, False: 892]
  |  Branch (314:28): [True: 676, False: 216]
  ------------------
  315|  1.31k|      {
  316|  1.31k|        try
  317|  1.31k|        {
  318|  1.31k|          auto lb = lhs_v.cast<bool>();
  319|  1.31k|          auto rb = rhs_v.cast<bool>();
  320|  1.31k|          switch(op)
  321|  1.31k|          {
  322|    616|            case logic_or:
  ------------------
  |  Branch (322:13): [True: 616, False: 698]
  ------------------
  323|    616|              return Any(static_cast<double>(lb || rb));
  ------------------
  |  Branch (323:46): [True: 195, False: 421]
  |  Branch (323:52): [True: 10, False: 411]
  ------------------
  324|    556|            case logic_and:
  ------------------
  |  Branch (324:13): [True: 556, False: 758]
  ------------------
  325|    556|              return Any(static_cast<double>(lb && rb));
  ------------------
  |  Branch (325:46): [True: 290, False: 266]
  |  Branch (325:52): [True: 287, False: 3]
  ------------------
  326|      0|            default: {
  ------------------
  |  Branch (326:13): [True: 0, False: 1.31k]
  ------------------
  327|      0|            }
  328|  1.31k|          }
  329|  1.31k|        }
  330|  1.31k|        catch(...)
  331|  1.31k|        {
  332|    142|          throw RuntimeError("Logic operators are not allowed if "
  333|    142|                             "one of the operands is not castable to bool");
  334|    142|        }
  335|  1.31k|      }
  336|  1.53k|    }
  337|  8.48k|    else if(rhs_v.isString() && lhs_v.isString() && op == plus)
  ------------------
  |  Branch (337:13): [True: 6.68k, False: 1.80k]
  |  Branch (337:33): [True: 4.46k, False: 2.21k]
  |  Branch (337:53): [True: 4.16k, False: 308]
  ------------------
  338|  4.16k|    {
  339|  4.16k|      return Any(lhs_v.cast<std::string>() + rhs_v.cast<std::string>());
  340|  4.16k|    }
  341|  4.32k|    else if(op == concat && ((rhs_v.isString() && lhs_v.isString()) ||
  ------------------
  |  Branch (341:13): [True: 3.89k, False: 430]
  |  Branch (341:31): [True: 2.47k, False: 1.42k]
  |  Branch (341:51): [True: 303, False: 2.17k]
  ------------------
  342|  3.59k|                             (rhs_v.isString() && lhs_v.isNumber()) ||
  ------------------
  |  Branch (342:31): [True: 2.17k, False: 1.42k]
  |  Branch (342:51): [True: 2.17k, False: 0]
  ------------------
  343|  1.42k|                             (rhs_v.isNumber() && lhs_v.isString())))
  ------------------
  |  Branch (343:31): [True: 1.42k, False: 0]
  |  Branch (343:51): [True: 1.42k, False: 0]
  ------------------
  344|  3.89k|    {
  345|  3.89k|      return Any(lhs_v.cast<std::string>() + rhs_v.cast<std::string>());
  346|  3.89k|    }
  347|    430|    else
  348|    430|    {
  349|    430|      throw RuntimeError("Operation not permitted");
  350|    430|    }
  351|       |
  352|    216|    return {};  // unreachable
  353|  14.7k|  }
_ZNK2BT3Ast20ExprBinaryArithmetic5opStrEv:
  209|     12|  {
  210|     12|    switch(op)
  ------------------
  |  Branch (210:12): [True: 12, False: 0]
  ------------------
  211|     12|    {
  212|      0|      case plus:
  ------------------
  |  Branch (212:7): [True: 0, False: 12]
  ------------------
  213|      0|        return "+";
  214|      1|      case minus:
  ------------------
  |  Branch (214:7): [True: 1, False: 11]
  ------------------
  215|      1|        return "-";
  216|      7|      case times:
  ------------------
  |  Branch (216:7): [True: 7, False: 5]
  ------------------
  217|      7|        return "*";
  218|      1|      case div:
  ------------------
  |  Branch (218:7): [True: 1, False: 11]
  ------------------
  219|      1|        return "/";
  220|      0|      case concat:
  ------------------
  |  Branch (220:7): [True: 0, False: 12]
  ------------------
  221|      0|        return "..";
  222|      2|      case bit_and:
  ------------------
  |  Branch (222:7): [True: 2, False: 10]
  ------------------
  223|      2|        return "&";
  224|      0|      case bit_or:
  ------------------
  |  Branch (224:7): [True: 0, False: 12]
  ------------------
  225|      0|        return "|";
  226|      1|      case bit_xor:
  ------------------
  |  Branch (226:7): [True: 1, False: 11]
  ------------------
  227|      1|        return "^";
  228|      0|      case logic_and:
  ------------------
  |  Branch (228:7): [True: 0, False: 12]
  ------------------
  229|      0|        return "&&";
  230|      0|      case logic_or:
  ------------------
  |  Branch (230:7): [True: 0, False: 12]
  ------------------
  231|      0|        return "||";
  232|     12|    }
  233|      0|    return "";
  234|     12|  }
_ZN2BT3Ast21NumericStringToNumberERNS_3AnyE:
   57|  2.29k|{
   58|  2.29k|  const auto str = value.cast<std::string>();
   59|  2.29k|  const char* end = str.data() + str.size();
   60|  2.29k|  int64_t int_val = 0;
   61|  2.29k|  const auto [ptr, ec] = std::from_chars(str.data(), end, int_val);
   62|  2.29k|  double dbl_val = 0;
   63|  2.29k|  if(ec == std::errc() && ptr == end)
  ------------------
  |  Branch (63:6): [True: 1.16k, False: 1.12k]
  |  Branch (63:27): [True: 838, False: 327]
  ------------------
   64|    838|  {
   65|    838|    value = Any(int_val);
   66|    838|  }
   67|  1.45k|  else if(parseDouble(str, dbl_val, /*require_full_consumption=*/true))
  ------------------
  |  Branch (67:11): [True: 1.35k, False: 101]
  ------------------
   68|  1.35k|  {
   69|  1.35k|    value = Any(dbl_val);
   70|  1.35k|  }
   71|  2.29k|}

_ZN7SafeAny7details13convertNumberIldEEvRKT_RT0_:
  184|   541k|{
  185|   541k|  static_assert(is_convertible_type<SRC>() && is_convertible_type<DST>(), "Not "
  186|   541k|                                                                          "convertible");
  187|       |
  188|   541k|  constexpr bool both_integers = is_integer<SRC>() && is_integer<DST>();
  ------------------
  |  Branch (188:34): [True: 0, Folded]
  |  Branch (188:55): [Folded, False: 0]
  ------------------
  189|       |
  190|       |  if constexpr(is_signed<SRC>() && !is_signed<DST>())
  191|       |  {
  192|       |    if(source < 0)
  193|       |    {
  194|       |      throw std::runtime_error("Value is negative and can't be converted to unsigned");
  195|       |    }
  196|       |  }
  197|       |  // these conversions are always safe (no check needed):
  198|       |  // - same type
  199|       |  // - float -> double
  200|       |  // - floating point to bool (C-style: any non-zero is true)
  201|       |  if constexpr(is_same<SRC, DST>() || (is_same<SRC, float>() && is_same<DST, double>()) ||
  202|       |               (std::is_floating_point<SRC>::value && is_same<DST, bool>()))
  203|       |  {
  204|       |    target = static_cast<DST>(source);
  205|       |  }
  206|       |  // integer to bool: only 0 and 1 are valid
  207|       |  else if constexpr(is_integer<SRC>() && is_same<DST, bool>())
  208|       |  {
  209|       |    checkLowerLimit<SRC, DST>(source);
  210|       |    target = static_cast<DST>(source);
  211|       |  }
  212|       |  else if constexpr(both_integers)
  213|       |  {
  214|       |    if constexpr(sizeof(SRC) == sizeof(DST) && !is_signed<SRC>() && is_signed<DST>())
  215|       |    {
  216|       |      checkUpperLimit<SRC, DST>(source);
  217|       |    }
  218|       |    // casting to a smaller number need to be check
  219|       |    else if constexpr(sizeof(SRC) > sizeof(DST))
  220|       |    {
  221|       |      if constexpr(is_signed<SRC>())
  222|       |      {
  223|       |        checkLowerLimit<SRC, DST>(source);
  224|       |      }
  225|       |      checkUpperLimit<SRC, DST>(source);
  226|       |    }
  227|       |    target = static_cast<DST>(source);
  228|       |  }
  229|       |  // casting to/from floating points might cause truncation.
  230|       |  else if constexpr(std::is_floating_point<SRC>::value ||
  231|       |                    std::is_floating_point<DST>::value)
  232|   541k|  {
  233|   541k|    checkTruncation<SRC, DST>(source);
  234|   541k|    target = static_cast<DST>(source);
  235|   541k|  }
  236|   541k|}
_ZN7SafeAny7details15checkTruncationIldEEvRKT_:
  115|   541k|{
  116|       |  // Handle integer to floating point
  117|       |  if constexpr(std::is_integral_v<From> && std::is_floating_point_v<To>)
  118|   541k|  {
  119|       |    // Check if value can be represented exactly in the target type
  120|   541k|    constexpr uint64_t max_exact = (1LL << std::numeric_limits<double>::digits) - 1;
  121|   541k|    bool doesnt_fit = false;
  122|       |    if constexpr(!std::is_signed_v<From>)
  123|       |    {
  124|       |      doesnt_fit = static_cast<uint64_t>(from) > max_exact;
  125|       |    }
  126|       |    else
  127|   541k|    {
  128|       |      // Negate in unsigned arithmetic: std::abs(INT64_MIN) overflows.
  129|   541k|      const auto value = static_cast<int64_t>(from);
  130|   541k|      const uint64_t magnitude =
  131|   541k|          value < 0 ? 0 - static_cast<uint64_t>(value) : static_cast<uint64_t>(value);
  ------------------
  |  Branch (131:11): [True: 392, False: 540k]
  ------------------
  132|   541k|      doesnt_fit = magnitude > max_exact;
  133|   541k|    }
  134|   541k|    if(doesnt_fit)
  ------------------
  |  Branch (134:8): [True: 30, False: 541k]
  ------------------
  135|     30|    {
  136|     30|      throw std::runtime_error("Loss of precision when converting a large integer number "
  137|     30|                               "to floating point:" +
  138|     30|                               std::to_string(from));
  139|     30|    }
  140|       |  }
  141|       |  // Handle floating point to integer
  142|       |  else if constexpr(std::is_floating_point_v<From> && std::is_integral_v<To>)
  143|       |  {
  144|       |    // static_cast<From>(To::max) rounds up to an out-of-range value when To has
  145|       |    // more significant bits than From's mantissa (e.g. double -> int64_t). In
  146|       |    // that case a plain `>` lets the rounded boundary through and the cast to To
  147|       |    // below overflows, so use a half-open upper bound to reject it first.
  148|       |    constexpr bool max_rounds_up =
  149|       |        std::numeric_limits<To>::digits > std::numeric_limits<From>::digits;
  150|       |    const From max_limit = static_cast<From>(std::numeric_limits<To>::max());
  151|       |    const bool over = max_rounds_up ? (from >= max_limit) : (from > max_limit);
  152|       |    if(over || from < static_cast<From>(std::numeric_limits<To>::lowest()) ||
  153|       |       from != std::nearbyint(from))
  154|       |    {
  155|       |      throw std::runtime_error("Invalid floating point to integer conversion");
  156|       |    }
  157|       |  }
  158|       |  // Handle floating point to floating point (e.g. double to float)
  159|       |  else if constexpr(std::is_floating_point_v<From> && std::is_floating_point_v<To>)
  160|       |  {
  161|       |    checkFloatingPointRange<From, To>(from);
  162|       |  }
  163|       |  // Handle other conversions
  164|       |  else
  165|       |  {
  166|       |    if(from > static_cast<From>(std::numeric_limits<To>::max()) ||
  167|       |       from < static_cast<From>(std::numeric_limits<To>::lowest()))
  168|       |    {
  169|       |      throw std::runtime_error("Value outside numeric limits");
  170|       |    }
  171|       |    To as_target = static_cast<To>(from);
  172|       |    From back_to_source = static_cast<From>(as_target);
  173|       |    if(from != back_to_source)
  174|       |    {
  175|       |      throw std::runtime_error("Value truncated in conversion");
  176|       |    }
  177|       |  }
  178|   541k|}
_ZN7SafeAny7details13convertNumberIdlEEvRKT_RT0_:
  184|  3.10k|{
  185|  3.10k|  static_assert(is_convertible_type<SRC>() && is_convertible_type<DST>(), "Not "
  186|  3.10k|                                                                          "convertible");
  187|       |
  188|  3.10k|  constexpr bool both_integers = is_integer<SRC>() && is_integer<DST>();
  ------------------
  |  Branch (188:34): [Folded, False: 3.10k]
  |  Branch (188:55): [True: 0, Folded]
  ------------------
  189|       |
  190|       |  if constexpr(is_signed<SRC>() && !is_signed<DST>())
  191|       |  {
  192|       |    if(source < 0)
  193|       |    {
  194|       |      throw std::runtime_error("Value is negative and can't be converted to unsigned");
  195|       |    }
  196|       |  }
  197|       |  // these conversions are always safe (no check needed):
  198|       |  // - same type
  199|       |  // - float -> double
  200|       |  // - floating point to bool (C-style: any non-zero is true)
  201|       |  if constexpr(is_same<SRC, DST>() || (is_same<SRC, float>() && is_same<DST, double>()) ||
  202|       |               (std::is_floating_point<SRC>::value && is_same<DST, bool>()))
  203|       |  {
  204|       |    target = static_cast<DST>(source);
  205|       |  }
  206|       |  // integer to bool: only 0 and 1 are valid
  207|       |  else if constexpr(is_integer<SRC>() && is_same<DST, bool>())
  208|       |  {
  209|       |    checkLowerLimit<SRC, DST>(source);
  210|       |    target = static_cast<DST>(source);
  211|       |  }
  212|       |  else if constexpr(both_integers)
  213|       |  {
  214|       |    if constexpr(sizeof(SRC) == sizeof(DST) && !is_signed<SRC>() && is_signed<DST>())
  215|       |    {
  216|       |      checkUpperLimit<SRC, DST>(source);
  217|       |    }
  218|       |    // casting to a smaller number need to be check
  219|       |    else if constexpr(sizeof(SRC) > sizeof(DST))
  220|       |    {
  221|       |      if constexpr(is_signed<SRC>())
  222|       |      {
  223|       |        checkLowerLimit<SRC, DST>(source);
  224|       |      }
  225|       |      checkUpperLimit<SRC, DST>(source);
  226|       |    }
  227|       |    target = static_cast<DST>(source);
  228|       |  }
  229|       |  // casting to/from floating points might cause truncation.
  230|       |  else if constexpr(std::is_floating_point<SRC>::value ||
  231|       |                    std::is_floating_point<DST>::value)
  232|  3.10k|  {
  233|  3.10k|    checkTruncation<SRC, DST>(source);
  234|  3.10k|    target = static_cast<DST>(source);
  235|  3.10k|  }
  236|  3.10k|}
_ZN7SafeAny7details15checkTruncationIdlEEvRKT_:
  115|  3.10k|{
  116|       |  // Handle integer to floating point
  117|       |  if constexpr(std::is_integral_v<From> && std::is_floating_point_v<To>)
  118|       |  {
  119|       |    // Check if value can be represented exactly in the target type
  120|       |    constexpr uint64_t max_exact = (1LL << std::numeric_limits<double>::digits) - 1;
  121|       |    bool doesnt_fit = false;
  122|       |    if constexpr(!std::is_signed_v<From>)
  123|       |    {
  124|       |      doesnt_fit = static_cast<uint64_t>(from) > max_exact;
  125|       |    }
  126|       |    else
  127|       |    {
  128|       |      // Negate in unsigned arithmetic: std::abs(INT64_MIN) overflows.
  129|       |      const auto value = static_cast<int64_t>(from);
  130|       |      const uint64_t magnitude =
  131|       |          value < 0 ? 0 - static_cast<uint64_t>(value) : static_cast<uint64_t>(value);
  132|       |      doesnt_fit = magnitude > max_exact;
  133|       |    }
  134|       |    if(doesnt_fit)
  135|       |    {
  136|       |      throw std::runtime_error("Loss of precision when converting a large integer number "
  137|       |                               "to floating point:" +
  138|       |                               std::to_string(from));
  139|       |    }
  140|       |  }
  141|       |  // Handle floating point to integer
  142|       |  else if constexpr(std::is_floating_point_v<From> && std::is_integral_v<To>)
  143|  3.10k|  {
  144|       |    // static_cast<From>(To::max) rounds up to an out-of-range value when To has
  145|       |    // more significant bits than From's mantissa (e.g. double -> int64_t). In
  146|       |    // that case a plain `>` lets the rounded boundary through and the cast to To
  147|       |    // below overflows, so use a half-open upper bound to reject it first.
  148|  3.10k|    constexpr bool max_rounds_up =
  149|  3.10k|        std::numeric_limits<To>::digits > std::numeric_limits<From>::digits;
  150|  3.10k|    const From max_limit = static_cast<From>(std::numeric_limits<To>::max());
  151|  3.10k|    const bool over = max_rounds_up ? (from >= max_limit) : (from > max_limit);
  ------------------
  |  Branch (151:23): [True: 3.10k, Folded]
  ------------------
  152|  3.10k|    if(over || from < static_cast<From>(std::numeric_limits<To>::lowest()) ||
  ------------------
  |  Branch (152:8): [True: 2, False: 3.09k]
  |  Branch (152:16): [True: 1, False: 3.09k]
  ------------------
  153|  3.09k|       from != std::nearbyint(from))
  ------------------
  |  Branch (153:8): [True: 8, False: 3.09k]
  ------------------
  154|     11|    {
  155|     11|      throw std::runtime_error("Invalid floating point to integer conversion");
  156|     11|    }
  157|       |  }
  158|       |  // Handle floating point to floating point (e.g. double to float)
  159|       |  else if constexpr(std::is_floating_point_v<From> && std::is_floating_point_v<To>)
  160|       |  {
  161|       |    checkFloatingPointRange<From, To>(from);
  162|       |  }
  163|       |  // Handle other conversions
  164|       |  else
  165|       |  {
  166|       |    if(from > static_cast<From>(std::numeric_limits<To>::max()) ||
  167|       |       from < static_cast<From>(std::numeric_limits<To>::lowest()))
  168|       |    {
  169|       |      throw std::runtime_error("Value outside numeric limits");
  170|       |    }
  171|       |    To as_target = static_cast<To>(from);
  172|       |    From back_to_source = static_cast<From>(as_target);
  173|       |    if(from != back_to_source)
  174|       |    {
  175|       |      throw std::runtime_error("Value truncated in conversion");
  176|       |    }
  177|       |  }
  178|  3.10k|}
_ZN7SafeAny7details13convertNumberIlbEEvRKT_RT0_:
  184|  1.45k|{
  185|  1.45k|  static_assert(is_convertible_type<SRC>() && is_convertible_type<DST>(), "Not "
  186|  1.45k|                                                                          "convertible");
  187|       |
  188|  1.45k|  constexpr bool both_integers = is_integer<SRC>() && is_integer<DST>();
  ------------------
  |  Branch (188:34): [True: 0, Folded]
  |  Branch (188:55): [True: 0, Folded]
  ------------------
  189|       |
  190|       |  if constexpr(is_signed<SRC>() && !is_signed<DST>())
  191|  1.45k|  {
  192|  1.45k|    if(source < 0)
  ------------------
  |  Branch (192:8): [True: 58, False: 1.39k]
  ------------------
  193|     58|    {
  194|     58|      throw std::runtime_error("Value is negative and can't be converted to unsigned");
  195|     58|    }
  196|  1.45k|  }
  197|       |  // these conversions are always safe (no check needed):
  198|       |  // - same type
  199|       |  // - float -> double
  200|       |  // - floating point to bool (C-style: any non-zero is true)
  201|       |  if constexpr(is_same<SRC, DST>() || (is_same<SRC, float>() && is_same<DST, double>()) ||
  202|       |               (std::is_floating_point<SRC>::value && is_same<DST, bool>()))
  203|       |  {
  204|       |    target = static_cast<DST>(source);
  205|       |  }
  206|       |  // integer to bool: only 0 and 1 are valid
  207|       |  else if constexpr(is_integer<SRC>() && is_same<DST, bool>())
  208|  1.45k|  {
  209|  1.45k|    checkLowerLimit<SRC, DST>(source);
  210|  1.45k|    target = static_cast<DST>(source);
  211|       |  }
  212|       |  else if constexpr(both_integers)
  213|       |  {
  214|       |    if constexpr(sizeof(SRC) == sizeof(DST) && !is_signed<SRC>() && is_signed<DST>())
  215|       |    {
  216|       |      checkUpperLimit<SRC, DST>(source);
  217|       |    }
  218|       |    // casting to a smaller number need to be check
  219|       |    else if constexpr(sizeof(SRC) > sizeof(DST))
  220|       |    {
  221|       |      if constexpr(is_signed<SRC>())
  222|       |      {
  223|       |        checkLowerLimit<SRC, DST>(source);
  224|       |      }
  225|       |      checkUpperLimit<SRC, DST>(source);
  226|       |    }
  227|       |    target = static_cast<DST>(source);
  228|       |  }
  229|       |  // casting to/from floating points might cause truncation.
  230|       |  else if constexpr(std::is_floating_point<SRC>::value ||
  231|       |                    std::is_floating_point<DST>::value)
  232|       |  {
  233|       |    checkTruncation<SRC, DST>(source);
  234|       |    target = static_cast<DST>(source);
  235|       |  }
  236|  1.45k|}
_ZN7SafeAny7details15checkLowerLimitIlbEEvRKT_:
   76|  1.39k|{
   77|       |  if constexpr(std::is_same<To, bool>::value)
   78|  1.39k|  {
   79|  1.39k|    if(from != 0 && from != 1)
  ------------------
  |  Branch (79:8): [True: 876, False: 519]
  |  Branch (79:21): [True: 83, False: 793]
  ------------------
   80|     83|    {
   81|     83|      throw std::runtime_error("Implicit casting to bool is not allowed");
   82|     83|    }
   83|       |  }
   84|       |  else if(from < std::numeric_limits<To>::min())
   85|       |  {
   86|       |    throw std::runtime_error("Value outside the lovest numerical limit.");
   87|       |  }
   88|  1.39k|}
_ZN7SafeAny7details13convertNumberIdbEEvRKT_RT0_:
  184|  1.04k|{
  185|  1.04k|  static_assert(is_convertible_type<SRC>() && is_convertible_type<DST>(), "Not "
  186|  1.04k|                                                                          "convertible");
  187|       |
  188|  1.04k|  constexpr bool both_integers = is_integer<SRC>() && is_integer<DST>();
  ------------------
  |  Branch (188:34): [Folded, False: 1.04k]
  |  Branch (188:55): [True: 0, Folded]
  ------------------
  189|       |
  190|       |  if constexpr(is_signed<SRC>() && !is_signed<DST>())
  191|  1.04k|  {
  192|  1.04k|    if(source < 0)
  ------------------
  |  Branch (192:8): [True: 1, False: 1.04k]
  ------------------
  193|      1|    {
  194|      1|      throw std::runtime_error("Value is negative and can't be converted to unsigned");
  195|      1|    }
  196|  1.04k|  }
  197|       |  // these conversions are always safe (no check needed):
  198|       |  // - same type
  199|       |  // - float -> double
  200|       |  // - floating point to bool (C-style: any non-zero is true)
  201|       |  if constexpr(is_same<SRC, DST>() || (is_same<SRC, float>() && is_same<DST, double>()) ||
  202|       |               (std::is_floating_point<SRC>::value && is_same<DST, bool>()))
  203|  1.04k|  {
  204|  1.04k|    target = static_cast<DST>(source);
  205|       |  }
  206|       |  // integer to bool: only 0 and 1 are valid
  207|       |  else if constexpr(is_integer<SRC>() && is_same<DST, bool>())
  208|       |  {
  209|       |    checkLowerLimit<SRC, DST>(source);
  210|       |    target = static_cast<DST>(source);
  211|       |  }
  212|       |  else if constexpr(both_integers)
  213|       |  {
  214|       |    if constexpr(sizeof(SRC) == sizeof(DST) && !is_signed<SRC>() && is_signed<DST>())
  215|       |    {
  216|       |      checkUpperLimit<SRC, DST>(source);
  217|       |    }
  218|       |    // casting to a smaller number need to be check
  219|       |    else if constexpr(sizeof(SRC) > sizeof(DST))
  220|       |    {
  221|       |      if constexpr(is_signed<SRC>())
  222|       |      {
  223|       |        checkLowerLimit<SRC, DST>(source);
  224|       |      }
  225|       |      checkUpperLimit<SRC, DST>(source);
  226|       |    }
  227|       |    target = static_cast<DST>(source);
  228|       |  }
  229|       |  // casting to/from floating points might cause truncation.
  230|       |  else if constexpr(std::is_floating_point<SRC>::value ||
  231|       |                    std::is_floating_point<DST>::value)
  232|       |  {
  233|       |    checkTruncation<SRC, DST>(source);
  234|       |    target = static_cast<DST>(source);
  235|       |  }
  236|  1.04k|}

_ZN2BT8demangleB5cxx11ERKSt10type_index:
   86|  17.6k|{
   87|  17.6k|  if(index == typeid(std::string))
  ------------------
  |  Branch (87:6): [True: 92, False: 17.5k]
  ------------------
   88|     92|  {
   89|     92|    return "std::string";
   90|     92|  }
   91|  17.5k|  if(index == typeid(std::string_view))
  ------------------
  |  Branch (91:6): [True: 0, False: 17.5k]
  ------------------
   92|      0|  {
   93|      0|    return "std::string_view";
   94|      0|  }
   95|  17.5k|  if(index == typeid(std::chrono::seconds))
  ------------------
  |  Branch (95:6): [True: 0, False: 17.5k]
  ------------------
   96|      0|  {
   97|      0|    return "std::chrono::seconds";
   98|      0|  }
   99|  17.5k|  if(index == typeid(std::chrono::milliseconds))
  ------------------
  |  Branch (99:6): [True: 0, False: 17.5k]
  ------------------
  100|      0|  {
  101|      0|    return "std::chrono::milliseconds";
  102|      0|  }
  103|  17.5k|  if(index == typeid(std::chrono::microseconds))
  ------------------
  |  Branch (103:6): [True: 0, False: 17.5k]
  ------------------
  104|      0|  {
  105|      0|    return "std::chrono::microseconds";
  106|      0|  }
  107|       |
  108|  17.5k|  scoped_demangled_name demangled_name(index.name());
  109|  17.5k|  char const* const p = demangled_name.get();
  110|  17.5k|  if(p != nullptr)
  ------------------
  |  Branch (110:6): [True: 17.5k, False: 0]
  ------------------
  111|  17.5k|  {
  112|  17.5k|    return p;
  113|  17.5k|  }
  114|      0|  return index.name();
  115|  17.5k|}
_ZN2BT21scoped_demangled_nameC2EPKc:
   34|  17.5k|  explicit scoped_demangled_name(char const* name) noexcept : m_p(demangle_alloc(name))
   35|  17.5k|  {}
_ZN2BT14demangle_allocEPKc:
   56|  17.5k|{
   57|  17.5k|  int status = 0;
   58|  17.5k|  std::size_t size = 0;
   59|       |  return abi::__cxa_demangle(name, NULL, &size, &status);
   60|  17.5k|}
_ZNK2BT21scoped_demangled_name3getEv:
   43|  17.5k|  {
   44|  17.5k|    return m_p;
   45|  17.5k|  }
_ZN2BT21scoped_demangled_nameD2Ev:
   38|  17.5k|  {
   39|  17.5k|    demangle_free(m_p);
   40|  17.5k|  }
_ZN2BT13demangle_freeEPKc:
   63|  17.5k|{
   64|       |  // NOLINTNEXTLINE(cppcoreguidelines-no-malloc,cppcoreguidelines-owning-memory)
   65|  17.5k|  std::free(const_cast<char*>(name));
   66|  17.5k|}

_ZNK2BT9LockedPtrINS_3AnyEEcvbEv:
   56|   987k|  {
   57|   987k|    return ref_ != nullptr;
   58|   987k|  }
_ZNK2BT9LockedPtrINS_3AnyEE3getEv:
   77|   987k|  {
   78|   987k|    return ref_;
   79|   987k|  }
_ZN2BT9LockedPtrINS_3AnyEED2Ev:
   32|   987k|  {
   33|   987k|    if(mutex_ != nullptr)
  ------------------
  |  Branch (33:8): [True: 987k, False: 529]
  ------------------
   34|   987k|    {
   35|   987k|      mutex_->unlock();
   36|   987k|    }
   37|   987k|  }
_ZN2BT9LockedPtrINS_3AnyEEC2Ev:
   24|    529|  LockedPtr() = default;
_ZN2BT9LockedPtrINS_3AnyEEC2EPS1_PSt5mutex:
   26|   987k|  LockedPtr(T* obj, std::mutex* obj_mutex) : ref_(obj), mutex_(obj_mutex)
   27|   987k|  {
   28|   987k|    mutex_->lock();
   29|   987k|  }

_ZNK2BT3Any8isNumberEv:
  366|   625k|{
  367|   625k|  return _any.type() == typeid(int64_t) || _any.type() == typeid(uint64_t) ||
  ------------------
  |  Branch (367:10): [True: 552k, False: 73.1k]
  |  Branch (367:44): [True: 0, False: 73.1k]
  ------------------
  368|  73.1k|         _any.type() == typeid(double);
  ------------------
  |  Branch (368:10): [True: 23.1k, False: 50.0k]
  ------------------
  369|   625k|}
_ZN2BT3AnyC2Ev:
   85|  63.7k|  Any() : _original_type(UndefinedAnyType)
   86|  63.7k|  {}
_ZN2BT3AnyD2Ev:
   88|  7.07M|  ~Any() = default;
_ZNK2BT3Any4castIdEET_v:
  176|   573k|  {
  177|   573k|    if(auto res = tryCast<T>())
  ------------------
  |  Branch (177:13): [True: 572k, False: 193]
  ------------------
  178|   572k|    {
  179|   572k|      return res.value();
  180|   572k|    }
  181|    193|    else
  182|    193|    {
  183|    193|      throw std::runtime_error(res.error());
  184|    193|    }
  185|   573k|  }
_ZNK2BT3Any7tryCastIdEEN6nonstd13expected_lite8expectedIT_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEv:
  543|   573k|{
  544|   573k|  static_assert(!std::is_reference<T>::value, "Any::cast uses value semantic, "
  545|   573k|                                              "can not cast to reference");
  546|       |
  547|   573k|  if(_any.empty())
  ------------------
  |  Branch (547:6): [True: 2, False: 573k]
  ------------------
  548|      2|  {
  549|      2|    throw std::runtime_error("Any::cast failed because it is empty");
  550|      2|  }
  551|       |
  552|   573k|  if(castedType() == typeid(T))
  ------------------
  |  Branch (552:6): [True: 14.1k, False: 558k]
  ------------------
  553|  14.1k|  {
  554|  14.1k|    return linb::any_cast<T>(_any);
  555|  14.1k|  }
  556|       |
  557|       |  // special case when the output is an enum.
  558|       |  // We will try first a int conversion
  559|       |  if constexpr(std::is_enum_v<T>)
  560|       |  {
  561|       |    if(isNumber())
  562|       |    {
  563|       |      return static_cast<T>(convert<int>().value());
  564|       |    }
  565|       |    if(isString())
  566|       |    {
  567|       |      if(auto out = stringToNumber<int64_t>())
  568|       |      {
  569|       |        return static_cast<T>(out.value());
  570|       |      }
  571|       |    }
  572|       |    return nonstd::make_unexpected("Any::cast failed to cast to enum type");
  573|       |  }
  574|       |
  575|   558k|  if(isString())
  ------------------
  |  Branch (575:6): [True: 17.7k, False: 541k]
  ------------------
  576|  17.7k|  {
  577|       |    if constexpr(std::is_arithmetic_v<T> && !std::is_same_v<T, bool>)
  578|  17.7k|    {
  579|  17.7k|      if(auto out = stringToNumber<T>())
  ------------------
  |  Branch (579:15): [True: 17.5k, False: 161]
  ------------------
  580|  17.5k|      {
  581|  17.5k|        return out.value();
  582|  17.5k|      }
  583|    161|      else
  584|    161|      {
  585|    161|        return out;
  586|    161|      }
  587|  17.7k|    }
  588|  17.7k|  }
  589|       |
  590|   558k|  if(auto res = convert<T>())
  ------------------
  |  Branch (590:11): [True: 541k, False: 17.7k]
  ------------------
  591|   541k|  {
  592|   541k|    return std::move(res.value());
  593|   541k|  }
  594|  17.7k|  else
  595|  17.7k|  {
  596|  17.7k|    return res;
  597|  17.7k|  }
  598|   558k|}
_ZNK2BT3Any10castedTypeEv:
  207|   672k|  {
  208|   672k|    return _any.type();
  209|   672k|  }
_ZNK2BT3Any8isStringEv:
  148|   737k|  {
  149|   737k|    return _any.type() == typeid(SafeAny::SimpleString);
  150|   737k|  }
_ZNK2BT3Any14stringToNumberIdEEN6nonstd13expected_lite8expectedIT_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEv:
  442|  17.7k|{
  443|  17.7k|  static_assert(std::is_arithmetic_v<T> && !std::is_same_v<T, bool>, "Expecting a "
  444|  17.7k|                                                                     "numeric type");
  445|       |
  446|  17.7k|  const auto str = linb::any_cast<SafeAny::SimpleString>(_any);
  447|  17.7k|#if __cpp_lib_to_chars >= 201611L
  448|  17.7k|  T out;
  449|  17.7k|  auto [ptr, err] = std::from_chars(str.data(), str.data() + str.size(), out);
  450|  17.7k|  if(err == std::errc())
  ------------------
  |  Branch (450:6): [True: 17.5k, False: 161]
  ------------------
  451|  17.5k|  {
  452|  17.5k|    return out;
  453|  17.5k|  }
  454|    161|  else
  455|    161|  {
  456|    161|    return nonstd::make_unexpected("Any failed string to number conversion");
  457|    161|  }
  458|       |#else
  459|       |  try
  460|       |  {
  461|       |    if constexpr(std::is_integral_v<T>)
  462|       |    {
  463|       |      // convert<T>() rejects values that don't fit in T, matching the
  464|       |      // std::from_chars branch above.
  465|       |      const int64_t val = std::stol(str.toStdString());
  466|       |      Any temp_any(val);
  467|       |      return temp_any.convert<T>();
  468|       |    }
  469|       |    if constexpr(std::is_floating_point_v<T>)
  470|       |    {
  471|       |      // std::stod honors LC_NUMERIC, so under a locale that uses ',' as decimal
  472|       |      // separator "3.5" would silently parse as 3. parseDouble reproduces the
  473|       |      // std::from_chars semantics of the branch above, on every platform.
  474|       |      double value = 0.0;
  475|       |      if(parseDouble(str.toStdStringView(), value, /*require_full_consumption=*/false))
  476|       |      {
  477|       |        // same range check as the integral branch: a value that does not fit
  478|       |        // in a float is an error, like std::from_chars reports above
  479|       |        Any temp_any(value);
  480|       |        return temp_any.convert<T>();
  481|       |      }
  482|       |      return nonstd::make_unexpected("Any failed string to number conversion");
  483|       |    }
  484|       |  }
  485|       |  catch(...)
  486|       |  {
  487|       |    return nonstd::make_unexpected("Any failed string to number conversion");
  488|       |  }
  489|       |#endif
  490|      0|  return nonstd::make_unexpected("Any conversion from string failed");
  491|  17.7k|}
_ZNK2BT3Any7convertIdEEN6nonstd13expected_lite8expectedIT_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPNSt9enable_ifIXsr3std13is_arithmeticIS5_EE5valueEvE4typeE:
  516|   541k|{
  517|   541k|  using SafeAny::details::convertNumber;
  518|   541k|  DST out;
  519|       |
  520|   541k|  const auto& type = _any.type();
  521|       |
  522|   541k|  if(type == typeid(int64_t))
  ------------------
  |  Branch (522:6): [True: 541k, False: 0]
  ------------------
  523|   541k|  {
  524|   541k|    convertNumber<int64_t, DST>(linb::any_cast<int64_t>(_any), out);
  525|   541k|  }
  526|      0|  else if(type == typeid(uint64_t))
  ------------------
  |  Branch (526:11): [True: 0, False: 0]
  ------------------
  527|      0|  {
  528|      0|    convertNumber<uint64_t, DST>(linb::any_cast<uint64_t>(_any), out);
  529|      0|  }
  530|      0|  else if(type == typeid(double))
  ------------------
  |  Branch (530:11): [True: 0, False: 0]
  ------------------
  531|      0|  {
  532|      0|    convertNumber<double, DST>(linb::any_cast<double>(_any), out);
  533|      0|  }
  534|      0|  else
  535|      0|  {
  536|      0|    return nonstd::make_unexpected(errorMsg<DST>());
  537|      0|  }
  538|   541k|  return out;
  539|   541k|}
_ZNK2BT3Any4typeEv:
  201|  17.6k|  {
  202|  17.6k|    return _original_type;
  203|  17.6k|  }
_ZN2BT3AnyC2IiEERKT_PNSt9enable_ifIXoosr3std11is_integralIS2_EE5valuesr3std7is_enumIS2_EE5valueEvE4typeE:
  125|  5.84k|    : _any(int64_t(value)), _original_type(typeid(T))
  126|  5.84k|  {}
_ZN2BT3AnyaSERKS0_:
  349|   304k|{
  350|   304k|  if(this != &other)
  ------------------
  |  Branch (350:6): [True: 304k, False: 0]
  ------------------
  351|   304k|  {
  352|   304k|    this->_any = other._any;
  353|   304k|    this->_original_type = other._original_type;
  354|   304k|  }
  355|   304k|  return *this;
  356|   304k|}
_ZN2BT3AnyaSEOS0_:
  359|  43.6k|{
  360|  43.6k|  this->_any = std::move(other._any);
  361|  43.6k|  this->_original_type = other._original_type;
  362|  43.6k|  return *this;
  363|  43.6k|}
_ZNK2BT3Any8copyIntoERS0_:
  377|  10.1k|{
  378|  10.1k|  if(dst.empty())
  ------------------
  |  Branch (378:6): [True: 0, False: 10.1k]
  ------------------
  379|      0|  {
  380|      0|    dst = *this;
  381|      0|    return;
  382|      0|  }
  383|       |
  384|  10.1k|  const auto& dst_type = dst.castedType();
  385|       |
  386|  10.1k|  if((castedType() == dst_type) || (isString() && dst.isString()))
  ------------------
  |  Branch (386:6): [True: 8.78k, False: 1.38k]
  |  Branch (386:37): [True: 7, False: 1.37k]
  |  Branch (386:51): [True: 0, False: 7]
  ------------------
  387|  8.78k|  {
  388|  8.78k|    dst._any = _any;
  389|  8.78k|  }
  390|  1.38k|  else if(isNumber() && dst.isNumber())
  ------------------
  |  Branch (390:11): [True: 1.37k, False: 7]
  |  Branch (390:25): [True: 1.33k, False: 46]
  ------------------
  391|  1.33k|  {
  392|  1.33k|    if(dst_type == typeid(int64_t))
  ------------------
  |  Branch (392:8): [True: 906, False: 425]
  ------------------
  393|    906|    {
  394|    906|      dst._any = cast<int64_t>();
  395|    906|    }
  396|    425|    else if(dst_type == typeid(uint64_t))
  ------------------
  |  Branch (396:13): [True: 0, False: 425]
  ------------------
  397|      0|    {
  398|      0|      dst._any = cast<uint64_t>();
  399|      0|    }
  400|    425|    else if(dst_type == typeid(double))
  ------------------
  |  Branch (400:13): [True: 425, False: 0]
  ------------------
  401|    425|    {
  402|    425|      dst._any = cast<double>();
  403|    425|    }
  404|      0|    else
  405|      0|    {
  406|      0|      throw std::runtime_error("Any::copyInto fails");
  407|      0|    }
  408|  1.33k|  }
  409|     53|  else
  410|     53|  {
  411|     53|    throw std::runtime_error("Any::copyInto fails");
  412|     53|  }
  413|  10.1k|}
_ZNK2BT3Any5emptyEv:
  212|   645k|  {
  213|   645k|    return _any.empty();
  214|   645k|  }
_ZNK2BT3Any4castIlEET_v:
  176|  5.06k|  {
  177|  5.06k|    if(auto res = tryCast<T>())
  ------------------
  |  Branch (177:13): [True: 5.05k, False: 11]
  ------------------
  178|  5.05k|    {
  179|  5.05k|      return res.value();
  180|  5.05k|    }
  181|     11|    else
  182|     11|    {
  183|     11|      throw std::runtime_error(res.error());
  184|     11|    }
  185|  5.06k|  }
_ZNK2BT3Any7tryCastIlEEN6nonstd13expected_lite8expectedIT_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEv:
  543|  5.06k|{
  544|  5.06k|  static_assert(!std::is_reference<T>::value, "Any::cast uses value semantic, "
  545|  5.06k|                                              "can not cast to reference");
  546|       |
  547|  5.06k|  if(_any.empty())
  ------------------
  |  Branch (547:6): [True: 0, False: 5.06k]
  ------------------
  548|      0|  {
  549|      0|    throw std::runtime_error("Any::cast failed because it is empty");
  550|      0|  }
  551|       |
  552|  5.06k|  if(castedType() == typeid(T))
  ------------------
  |  Branch (552:6): [True: 1.96k, False: 3.10k]
  ------------------
  553|  1.96k|  {
  554|  1.96k|    return linb::any_cast<T>(_any);
  555|  1.96k|  }
  556|       |
  557|       |  // special case when the output is an enum.
  558|       |  // We will try first a int conversion
  559|       |  if constexpr(std::is_enum_v<T>)
  560|       |  {
  561|       |    if(isNumber())
  562|       |    {
  563|       |      return static_cast<T>(convert<int>().value());
  564|       |    }
  565|       |    if(isString())
  566|       |    {
  567|       |      if(auto out = stringToNumber<int64_t>())
  568|       |      {
  569|       |        return static_cast<T>(out.value());
  570|       |      }
  571|       |    }
  572|       |    return nonstd::make_unexpected("Any::cast failed to cast to enum type");
  573|       |  }
  574|       |
  575|  3.10k|  if(isString())
  ------------------
  |  Branch (575:6): [True: 0, False: 3.10k]
  ------------------
  576|      0|  {
  577|       |    if constexpr(std::is_arithmetic_v<T> && !std::is_same_v<T, bool>)
  578|      0|    {
  579|      0|      if(auto out = stringToNumber<T>())
  ------------------
  |  Branch (579:15): [True: 0, False: 0]
  ------------------
  580|      0|      {
  581|      0|        return out.value();
  582|      0|      }
  583|      0|      else
  584|      0|      {
  585|      0|        return out;
  586|      0|      }
  587|      0|    }
  588|      0|  }
  589|       |
  590|  3.10k|  if(auto res = convert<T>())
  ------------------
  |  Branch (590:11): [True: 3.09k, False: 11]
  ------------------
  591|  3.09k|  {
  592|  3.09k|    return std::move(res.value());
  593|  3.09k|  }
  594|     11|  else
  595|     11|  {
  596|     11|    return res;
  597|     11|  }
  598|  3.10k|}
_ZNK2BT3Any7convertIlEEN6nonstd13expected_lite8expectedIT_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPNSt9enable_ifIXsr3std13is_arithmeticIS5_EE5valueEvE4typeE:
  516|  3.10k|{
  517|  3.10k|  using SafeAny::details::convertNumber;
  518|  3.10k|  DST out;
  519|       |
  520|  3.10k|  const auto& type = _any.type();
  521|       |
  522|  3.10k|  if(type == typeid(int64_t))
  ------------------
  |  Branch (522:6): [True: 0, False: 3.10k]
  ------------------
  523|      0|  {
  524|      0|    convertNumber<int64_t, DST>(linb::any_cast<int64_t>(_any), out);
  525|      0|  }
  526|  3.10k|  else if(type == typeid(uint64_t))
  ------------------
  |  Branch (526:11): [True: 0, False: 3.10k]
  ------------------
  527|      0|  {
  528|      0|    convertNumber<uint64_t, DST>(linb::any_cast<uint64_t>(_any), out);
  529|      0|  }
  530|  3.10k|  else if(type == typeid(double))
  ------------------
  |  Branch (530:11): [True: 3.10k, False: 0]
  ------------------
  531|  3.10k|  {
  532|  3.10k|    convertNumber<double, DST>(linb::any_cast<double>(_any), out);
  533|  3.10k|  }
  534|      0|  else
  535|      0|  {
  536|      0|    return nonstd::make_unexpected(errorMsg<DST>());
  537|      0|  }
  538|  3.10k|  return out;
  539|  3.10k|}
_ZN2BT3AnyC2ERKd:
   97|   321k|  explicit Any(const double& value) : _any(value), _original_type(typeid(double))
   98|   321k|  {}
_ZN2BT3AnyC2IbEERKT_PNSt9enable_ifIXoosr3std11is_integralIS2_EE5valuesr3std7is_enumIS2_EE5valueEvE4typeE:
  125|  5.84k|    : _any(int64_t(value)), _original_type(typeid(T))
  126|  5.84k|  {}
_ZN2BT3AnyC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  107|   110k|    : _any(SafeAny::SimpleString(str)), _original_type(typeid(std::string))
  108|   110k|  {}
_ZN2BT3AnyC2ERKS0_:
   90|  3.09M|  Any(const Any& other) : _any(other._any), _original_type(other._original_type)
   91|  3.09M|  {}
_ZN2BT3AnyC2EOS0_:
   94|  1.77M|    : _any(std::move(other._any)), _original_type(other._original_type)
   95|  1.77M|  {}
_ZN2BT3AnyC2ERKSt10type_index:
  128|  31.7k|  Any(const std::type_index& type) : _original_type(type)
  129|  31.7k|  {}
_ZNK2BT3Any4castINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEET_v:
  176|  52.3k|  {
  177|  52.3k|    if(auto res = tryCast<T>())
  ------------------
  |  Branch (177:13): [True: 52.3k, False: 0]
  ------------------
  178|  52.3k|    {
  179|  52.3k|      return res.value();
  180|  52.3k|    }
  181|      0|    else
  182|      0|    {
  183|      0|      throw std::runtime_error(res.error());
  184|      0|    }
  185|  52.3k|  }
_ZNK2BT3Any7tryCastINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEN6nonstd13expected_lite8expectedIT_S7_EEv:
  543|  52.3k|{
  544|  52.3k|  static_assert(!std::is_reference<T>::value, "Any::cast uses value semantic, "
  545|  52.3k|                                              "can not cast to reference");
  546|       |
  547|  52.3k|  if(_any.empty())
  ------------------
  |  Branch (547:6): [True: 0, False: 52.3k]
  ------------------
  548|      0|  {
  549|      0|    throw std::runtime_error("Any::cast failed because it is empty");
  550|      0|  }
  551|       |
  552|  52.3k|  if(castedType() == typeid(T))
  ------------------
  |  Branch (552:6): [True: 0, False: 52.3k]
  ------------------
  553|      0|  {
  554|      0|    return linb::any_cast<T>(_any);
  555|      0|  }
  556|       |
  557|       |  // special case when the output is an enum.
  558|       |  // We will try first a int conversion
  559|       |  if constexpr(std::is_enum_v<T>)
  560|       |  {
  561|       |    if(isNumber())
  562|       |    {
  563|       |      return static_cast<T>(convert<int>().value());
  564|       |    }
  565|       |    if(isString())
  566|       |    {
  567|       |      if(auto out = stringToNumber<int64_t>())
  568|       |      {
  569|       |        return static_cast<T>(out.value());
  570|       |      }
  571|       |    }
  572|       |    return nonstd::make_unexpected("Any::cast failed to cast to enum type");
  573|       |  }
  574|       |
  575|  52.3k|  if(isString())
  ------------------
  |  Branch (575:6): [True: 48.7k, False: 3.60k]
  ------------------
  576|  48.7k|  {
  577|       |    if constexpr(std::is_arithmetic_v<T> && !std::is_same_v<T, bool>)
  578|       |    {
  579|       |      if(auto out = stringToNumber<T>())
  580|       |      {
  581|       |        return out.value();
  582|       |      }
  583|       |      else
  584|       |      {
  585|       |        return out;
  586|       |      }
  587|       |    }
  588|  48.7k|  }
  589|       |
  590|  52.3k|  if(auto res = convert<T>())
  ------------------
  |  Branch (590:11): [True: 52.3k, False: 0]
  ------------------
  591|  52.3k|  {
  592|  52.3k|    return std::move(res.value());
  593|  52.3k|  }
  594|      0|  else
  595|      0|  {
  596|      0|    return res;
  597|      0|  }
  598|  52.3k|}
_ZNK2BT3Any7convertINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEN6nonstd13expected_lite8expectedIT_S7_EEPNSt9enable_ifIXsr3std7is_sameISB_S7_EE5valueEvE4typeE:
  417|  52.3k|{
  418|  52.3k|  const auto& type = _any.type();
  419|       |
  420|  52.3k|  if(type == typeid(SafeAny::SimpleString))
  ------------------
  |  Branch (420:6): [True: 48.7k, False: 3.60k]
  ------------------
  421|  48.7k|  {
  422|  48.7k|    return linb::any_cast<SafeAny::SimpleString>(_any).toStdString();
  423|  48.7k|  }
  424|  3.60k|  else if(type == typeid(int64_t))
  ------------------
  |  Branch (424:11): [True: 1.13k, False: 2.46k]
  ------------------
  425|  1.13k|  {
  426|  1.13k|    return std::to_string(linb::any_cast<int64_t>(_any));
  427|  1.13k|  }
  428|  2.46k|  else if(type == typeid(uint64_t))
  ------------------
  |  Branch (428:11): [True: 0, False: 2.46k]
  ------------------
  429|      0|  {
  430|      0|    return std::to_string(linb::any_cast<uint64_t>(_any));
  431|      0|  }
  432|  2.46k|  else if(type == typeid(double))
  ------------------
  |  Branch (432:11): [True: 2.46k, False: 0]
  ------------------
  433|  2.46k|  {
  434|  2.46k|    return std::to_string(linb::any_cast<double>(_any));
  435|  2.46k|  }
  436|       |
  437|      0|  return nonstd::make_unexpected(errorMsg<DST>());
  438|  52.3k|}
_ZN2BT3AnyC2IlEERKT_PNSt9enable_ifIXoosr3std11is_integralIS2_EE5valuesr3std7is_enumIS2_EE5valueEvE4typeE:
  125|  1.67M|    : _any(int64_t(value)), _original_type(typeid(T))
  126|  1.67M|  {}
_ZNK2BT3Any6isTypeIN7SafeAny12SimpleStringEEEbv:
  155|  1.09k|  {
  156|  1.09k|    return _original_type == typeid(T);
  157|  1.09k|  }
_ZNK2BT3Any4castIN7SafeAny12SimpleStringEEET_v:
  176|  18.7k|  {
  177|  18.7k|    if(auto res = tryCast<T>())
  ------------------
  |  Branch (177:13): [True: 18.7k, False: 0]
  ------------------
  178|  18.7k|    {
  179|  18.7k|      return res.value();
  180|  18.7k|    }
  181|      0|    else
  182|      0|    {
  183|      0|      throw std::runtime_error(res.error());
  184|      0|    }
  185|  18.7k|  }
_ZNK2BT3Any7tryCastIN7SafeAny12SimpleStringEEEN6nonstd13expected_lite8expectedIT_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEv:
  543|  18.7k|{
  544|  18.7k|  static_assert(!std::is_reference<T>::value, "Any::cast uses value semantic, "
  545|  18.7k|                                              "can not cast to reference");
  546|       |
  547|  18.7k|  if(_any.empty())
  ------------------
  |  Branch (547:6): [True: 0, False: 18.7k]
  ------------------
  548|      0|  {
  549|      0|    throw std::runtime_error("Any::cast failed because it is empty");
  550|      0|  }
  551|       |
  552|  18.7k|  if(castedType() == typeid(T))
  ------------------
  |  Branch (552:6): [True: 18.7k, False: 0]
  ------------------
  553|  18.7k|  {
  554|  18.7k|    return linb::any_cast<T>(_any);
  555|  18.7k|  }
  556|       |
  557|       |  // special case when the output is an enum.
  558|       |  // We will try first a int conversion
  559|       |  if constexpr(std::is_enum_v<T>)
  560|       |  {
  561|       |    if(isNumber())
  562|       |    {
  563|       |      return static_cast<T>(convert<int>().value());
  564|       |    }
  565|       |    if(isString())
  566|       |    {
  567|       |      if(auto out = stringToNumber<int64_t>())
  568|       |      {
  569|       |        return static_cast<T>(out.value());
  570|       |      }
  571|       |    }
  572|       |    return nonstd::make_unexpected("Any::cast failed to cast to enum type");
  573|       |  }
  574|       |
  575|      0|  if(isString())
  ------------------
  |  Branch (575:6): [True: 0, False: 0]
  ------------------
  576|      0|  {
  577|       |    if constexpr(std::is_arithmetic_v<T> && !std::is_same_v<T, bool>)
  578|       |    {
  579|       |      if(auto out = stringToNumber<T>())
  580|       |      {
  581|       |        return out.value();
  582|       |      }
  583|       |      else
  584|       |      {
  585|       |        return out;
  586|       |      }
  587|       |    }
  588|      0|  }
  589|       |
  590|      0|  if(auto res = convert<T>())
  ------------------
  |  Branch (590:11): [True: 0, False: 0]
  ------------------
  591|      0|  {
  592|      0|    return std::move(res.value());
  593|      0|  }
  594|      0|  else
  595|      0|  {
  596|      0|    return res;
  597|      0|  }
  598|      0|}
_ZNK2BT3Any4castIbEET_v:
  176|  2.50k|  {
  177|  2.50k|    if(auto res = tryCast<T>())
  ------------------
  |  Branch (177:13): [True: 2.36k, False: 142]
  ------------------
  178|  2.36k|    {
  179|  2.36k|      return res.value();
  180|  2.36k|    }
  181|    142|    else
  182|    142|    {
  183|    142|      throw std::runtime_error(res.error());
  184|    142|    }
  185|  2.50k|  }
_ZNK2BT3Any7tryCastIbEEN6nonstd13expected_lite8expectedIT_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEv:
  543|  2.50k|{
  544|  2.50k|  static_assert(!std::is_reference<T>::value, "Any::cast uses value semantic, "
  545|  2.50k|                                              "can not cast to reference");
  546|       |
  547|  2.50k|  if(_any.empty())
  ------------------
  |  Branch (547:6): [True: 0, False: 2.50k]
  ------------------
  548|      0|  {
  549|      0|    throw std::runtime_error("Any::cast failed because it is empty");
  550|      0|  }
  551|       |
  552|  2.50k|  if(castedType() == typeid(T))
  ------------------
  |  Branch (552:6): [True: 0, False: 2.50k]
  ------------------
  553|      0|  {
  554|      0|    return linb::any_cast<T>(_any);
  555|      0|  }
  556|       |
  557|       |  // special case when the output is an enum.
  558|       |  // We will try first a int conversion
  559|       |  if constexpr(std::is_enum_v<T>)
  560|       |  {
  561|       |    if(isNumber())
  562|       |    {
  563|       |      return static_cast<T>(convert<int>().value());
  564|       |    }
  565|       |    if(isString())
  566|       |    {
  567|       |      if(auto out = stringToNumber<int64_t>())
  568|       |      {
  569|       |        return static_cast<T>(out.value());
  570|       |      }
  571|       |    }
  572|       |    return nonstd::make_unexpected("Any::cast failed to cast to enum type");
  573|       |  }
  574|       |
  575|  2.50k|  if(isString())
  ------------------
  |  Branch (575:6): [True: 0, False: 2.50k]
  ------------------
  576|      0|  {
  577|       |    if constexpr(std::is_arithmetic_v<T> && !std::is_same_v<T, bool>)
  578|       |    {
  579|       |      if(auto out = stringToNumber<T>())
  580|       |      {
  581|       |        return out.value();
  582|       |      }
  583|       |      else
  584|       |      {
  585|       |        return out;
  586|       |      }
  587|       |    }
  588|      0|  }
  589|       |
  590|  2.50k|  if(auto res = convert<T>())
  ------------------
  |  Branch (590:11): [True: 2.36k, False: 142]
  ------------------
  591|  2.36k|  {
  592|  2.36k|    return std::move(res.value());
  593|  2.36k|  }
  594|    142|  else
  595|    142|  {
  596|    142|    return res;
  597|    142|  }
  598|  2.50k|}
_ZNK2BT3Any7convertIbEEN6nonstd13expected_lite8expectedIT_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEPNSt9enable_ifIXsr3std13is_arithmeticIS5_EE5valueEvE4typeE:
  516|  2.50k|{
  517|  2.50k|  using SafeAny::details::convertNumber;
  518|  2.50k|  DST out;
  519|       |
  520|  2.50k|  const auto& type = _any.type();
  521|       |
  522|  2.50k|  if(type == typeid(int64_t))
  ------------------
  |  Branch (522:6): [True: 1.45k, False: 1.04k]
  ------------------
  523|  1.45k|  {
  524|  1.45k|    convertNumber<int64_t, DST>(linb::any_cast<int64_t>(_any), out);
  525|  1.45k|  }
  526|  1.04k|  else if(type == typeid(uint64_t))
  ------------------
  |  Branch (526:11): [True: 0, False: 1.04k]
  ------------------
  527|      0|  {
  528|      0|    convertNumber<uint64_t, DST>(linb::any_cast<uint64_t>(_any), out);
  529|      0|  }
  530|  1.04k|  else if(type == typeid(double))
  ------------------
  |  Branch (530:11): [True: 1.04k, False: 0]
  ------------------
  531|  1.04k|  {
  532|  1.04k|    convertNumber<double, DST>(linb::any_cast<double>(_any), out);
  533|  1.04k|  }
  534|      0|  else
  535|      0|  {
  536|      0|    return nonstd::make_unexpected(errorMsg<DST>());
  537|      0|  }
  538|  2.50k|  return out;
  539|  2.50k|}

_ZN7SafeAny12SimpleStringC2ERKS0_:
   33|  1.25M|  SimpleString(const SimpleString& other) : SimpleString(other.data(), other.size())
   34|  1.25M|  {}
_ZN7SafeAny12SimpleStringC2EPKcm:
   64|  1.36M|  {
   65|  1.36M|    createImpl(input_data, size);
   66|  1.36M|  }
_ZN7SafeAny12SimpleString10createImplEPKcm:
  187|  1.36M|  {
  188|  1.36M|    if(size > MAX_SIZE)
  ------------------
  |  Branch (188:8): [True: 12, False: 1.36M]
  ------------------
  189|     12|    {
  190|     12|      throw std::invalid_argument("size too large for a simple string");
  191|     12|    }
  192|       |
  193|  1.36M|    if(size > CAPACITY)
  ------------------
  |  Branch (193:8): [True: 109k, False: 1.25M]
  ------------------
  194|   109k|    {
  195|   109k|      _storage.str.size = size;
  196|   109k|      _storage.soo.capacity_left = IS_LONG_BIT;
  197|   109k|      _storage.str.data = new char[size + 1];  // NOLINT(cppcoreguidelines-owning-memory)
  198|   109k|      std::memcpy(_storage.str.data, input_data, size);
  199|   109k|      _storage.str.data[size] = '\0';
  200|   109k|    }
  201|  1.25M|    else
  202|  1.25M|    {
  203|  1.25M|      _storage.soo.capacity_left = uint8_t(CAPACITY - size);
  204|  1.25M|      if(size > 0)
  ------------------
  |  Branch (204:10): [True: 244k, False: 1.00M]
  ------------------
  205|   244k|      {
  206|   244k|        std::memcpy(_storage.soo.data, input_data, size);
  207|   244k|      }
  208|  1.25M|      if(size < CAPACITY)
  ------------------
  |  Branch (208:10): [True: 1.25M, False: 1.54k]
  ------------------
  209|  1.25M|      {
  210|  1.25M|        _storage.soo.data[size] = '\0';
  211|  1.25M|      }
  212|  1.25M|    }
  213|  1.36M|  }
_ZNK7SafeAny12SimpleString4dataEv:
   87|  1.34M|  {
   88|  1.34M|    if(isSOO())
  ------------------
  |  Branch (88:8): [True: 1.23M, False: 110k]
  ------------------
   89|  1.23M|    {
   90|  1.23M|      return _storage.soo.data;
   91|  1.23M|    }
   92|   110k|    else
   93|   110k|    {
   94|   110k|      return _storage.str.data;
   95|   110k|    }
   96|  1.34M|  }
_ZNK7SafeAny12SimpleString5isSOOEv:
  158|  4.41M|  {
  159|  4.41M|    return (_storage.soo.capacity_left & IS_LONG_BIT) == 0;
  160|  4.41M|  }
_ZNK7SafeAny12SimpleString4sizeEv:
   99|  1.38M|  {
  100|  1.38M|    if(isSOO())
  ------------------
  |  Branch (100:8): [True: 1.25M, False: 132k]
  ------------------
  101|  1.25M|    {
  102|  1.25M|      return CAPACITY - _storage.soo.capacity_left;
  103|  1.25M|    }
  104|   132k|    else
  105|   132k|    {
  106|   132k|      return _storage.str.size & LONG_MASK;
  107|   132k|    }
  108|  1.38M|  }
_ZN7SafeAny12SimpleStringD2Ev:
   69|  1.67M|  {
   70|  1.67M|    if(!isSOO())
  ------------------
  |  Branch (70:8): [True: 109k, False: 1.56M]
  ------------------
   71|   109k|    {
   72|   109k|      delete[] _storage.str.data;
   73|   109k|    }
   74|  1.67M|    _storage.soo.capacity_left = CAPACITY;
   75|  1.67M|  }
_ZN7SafeAny12SimpleStringC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
   27|   110k|  SimpleString(const std::string& str) : SimpleString(str.data(), str.size())
   28|   110k|  {}
_ZN7SafeAny12SimpleStringC2EOS0_:
   46|   309k|  SimpleString(SimpleString&& other) noexcept : SimpleString()
   47|   309k|  {
   48|   309k|    std::swap(_storage, other._storage);
   49|   309k|  }
_ZN7SafeAny12SimpleStringC2Ev:
   22|   309k|  {
   23|   309k|    _storage.soo.capacity_left = CAPACITY;
   24|   309k|    _storage.soo.data[0] = '\0';
   25|   309k|  }
_ZNK7SafeAny12SimpleString11toStdStringB5cxx11Ev:
   78|  48.7k|  {
   79|  48.7k|    return size() > 0 ? std::string(data(), size()) : std::string();
  ------------------
  |  Branch (79:12): [True: 44.9k, False: 3.77k]
  ------------------
   80|  48.7k|  }
_ZNK7SafeAny12SimpleStringeqERKS0_:
  111|  2.06k|  {
  112|  2.06k|    const size_t N = size();
  113|       |    // memcmp, not strncmp: the content may hold embedded NUL bytes, and strncmp
  114|       |    // stops at the first one, reporting two different strings of equal length as
  115|       |    // equal. It is also what operator< below compares with.
  116|  2.06k|    return other.size() == N && std::memcmp(data(), other.data(), N) == 0;
  ------------------
  |  Branch (116:12): [True: 1.22k, False: 841]
  |  Branch (116:33): [True: 795, False: 426]
  ------------------
  117|  2.06k|  }
_ZNK7SafeAny12SimpleStringleERKS0_:
  126|  1.96k|  {
  127|  1.96k|    return !(*this > other);
  128|  1.96k|  }
_ZNK7SafeAny12SimpleStringgeERKS0_:
  131|  1.84k|  {
  132|  1.84k|    return !(*this < other);
  133|  1.84k|  }
_ZNK7SafeAny12SimpleStringltERKS0_:
  136|  3.77k|  {
  137|  3.77k|    const size_t min_size = std::min(size(), other.size());
  138|  3.77k|    int cmp = std::memcmp(data(), other.data(), min_size);
  139|  3.77k|    if(cmp != 0)
  ------------------
  |  Branch (139:8): [True: 1.78k, False: 1.99k]
  ------------------
  140|  1.78k|    {
  141|  1.78k|      return cmp < 0;
  142|  1.78k|    }
  143|  1.99k|    return size() < other.size();
  144|  3.77k|  }
_ZNK7SafeAny12SimpleStringgtERKS0_:
  147|  3.55k|  {
  148|  3.55k|    const size_t min_size = std::min(size(), other.size());
  149|  3.55k|    int cmp = std::memcmp(data(), other.data(), min_size);
  150|  3.55k|    if(cmp != 0)
  ------------------
  |  Branch (150:8): [True: 1.81k, False: 1.74k]
  ------------------
  151|  1.81k|    {
  152|  1.81k|      return cmp > 0;
  153|  1.81k|    }
  154|  1.74k|    return size() > other.size();
  155|  3.55k|  }

_ZN2BT6StrCatIJA2_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|     18|{
   73|     18|  return strings_internal::CatPieces(
   74|     18|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|     18|}
_ZN2BT16strings_internal9CatPiecesB5cxx11ESt16initializer_listISt17basic_string_viewIcSt11char_traitsIcEEE:
   38|  6.75k|{
   39|  6.75k|  std::string out;
   40|  6.75k|  AppendPieces(&out, std::move(pieces));
   41|  6.75k|  return out;
   42|  6.75k|}
_ZN2BT16strings_internal12AppendPiecesEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt16initializer_listISt17basic_string_viewIcS4_EE:
   24|  6.75k|{
   25|  6.75k|  size_t size = 0;
   26|  6.75k|  for(const auto& piece : pieces)
  ------------------
  |  Branch (26:25): [True: 29.4k, False: 6.75k]
  ------------------
   27|  29.4k|  {
   28|  29.4k|    size += piece.size();
   29|  29.4k|  }
   30|  6.75k|  dest->reserve(dest->size() + size);
   31|  6.75k|  for(const auto& piece : pieces)
  ------------------
  |  Branch (31:25): [True: 29.4k, False: 6.75k]
  ------------------
   32|  29.4k|  {
   33|  29.4k|    dest->append(piece.data(), piece.size());
   34|  29.4k|  }
   35|  6.75k|}
_ZN2BT6StrCatB5cxx11ERKSt17basic_string_viewIcSt11char_traitsIcEE:
   52|  7.20k|{
   53|  7.20k|  return std::string(a.data(), a.size());
   54|  7.20k|}
_ZN2BT6StrCatB5cxx11ERKSt17basic_string_viewIcSt11char_traitsIcEES5_:
   57|    529|{
   58|    529|  return strings_internal::CatPieces({ a, b });
   59|    529|}
_ZN2BT6StrCatB5cxx11ERKSt17basic_string_viewIcSt11char_traitsIcEES5_S5_:
   63|    118|{
   64|    118|  return strings_internal::CatPieces({ a, b, c });
   65|    118|}
_ZN2BT6StrCatIJEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS4_ESA_SA_SA_DpRKT_:
   72|  3.26k|{
   73|  3.26k|  return strings_internal::CatPieces(
   74|  3.26k|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|  3.26k|}
_ZN2BT6StrCatIJA8_cSt17basic_string_viewIcSt11char_traitsIcEEA3_cEEENSt7__cxx1112basic_stringIcS4_SaIcEEERKS5_SC_SC_SC_DpRKT_:
   72|    339|{
   73|    339|  return strings_internal::CatPieces(
   74|    339|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|    339|}
_ZN2BT6StrCatIJA38_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|    504|{
   73|    504|  return strings_internal::CatPieces(
   74|    504|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|    504|}
_ZN2BT6StrCatIJA3_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|  1.77k|{
   73|  1.77k|  return strings_internal::CatPieces(
   74|  1.77k|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|  1.77k|}
_ZN2BT6StrCatIJA21_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|     78|{
   73|     78|  return strings_internal::CatPieces(
   74|     78|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|     78|}
_ZN2BT6StrCatIJA4_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|     51|{
   73|     51|  return strings_internal::CatPieces(
   74|     51|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|     51|}
_ZN2BT6StrCatIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEA2_cEEES6_RKSt17basic_string_viewIcS4_ESB_SB_SB_DpRKT_:
   72|     51|{
   73|     51|  return strings_internal::CatPieces(
   74|     51|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|     51|}
_ZN2BT6StrCatIJA9_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|     33|{
   73|     33|  return strings_internal::CatPieces(
   74|     33|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|     33|}

_ZN2BT11parseDoubleESt17basic_string_viewIcSt11char_traitsIcEERdb:
  210|  9.13k|{
  211|  9.13k|#if defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L)
  212|       |  // std::from_chars is locale-independent and thread-safe.
  213|  9.13k|  const char* begin = str.data();
  214|  9.13k|  const char* end = begin + str.size();
  215|  9.13k|  const auto [ptr, ec] = std::from_chars(begin, end, out);
  216|  9.13k|  if(ec != std::errc())
  ------------------
  |  Branch (216:6): [True: 113, False: 9.02k]
  ------------------
  217|    113|  {
  218|    113|    return false;
  219|    113|  }
  220|  9.02k|  return !require_full_consumption || ptr == end;
  ------------------
  |  Branch (220:10): [True: 7.63k, False: 1.39k]
  |  Branch (220:39): [True: 1.35k, False: 45]
  ------------------
  221|       |#else
  222|       |  // Apple's libc++ lacks the floating-point std::from_chars overload. Reproduce
  223|       |  // its std::chars_format::general semantics with strtod_l under a "C" locale
  224|       |  // created once (thread-safe, no global setlocale mutation), plus a guard that
  225|       |  // rejects the leading whitespace, leading '+', and hex floats that strtod
  226|       |  // would otherwise accept.
  227|       |  if(str.empty())
  228|       |  {
  229|       |    return false;
  230|       |  }
  231|       |  const char first = str.front();
  232|       |  if(first == '+' || std::isspace(static_cast<unsigned char>(first)) != 0)
  233|       |  {
  234|       |    return false;
  235|       |  }
  236|       |  // std::from_chars(general) does not recognise a "0x"/"0X" hex-float prefix; it
  237|       |  // parses only the leading "0" and stops at the 'x'. strtod would consume the
  238|       |  // whole hex float, so emulate from_chars here: the value is 0, and everything
  239|       |  // from the 'x' onward is unparsed (a failure only in the full-consumption case).
  240|       |  const std::size_t mantissa = (first == '-') ? 1u : 0u;
  241|       |  if(str.size() > mantissa + 1 && str[mantissa] == '0' &&
  242|       |     (str[mantissa + 1] == 'x' || str[mantissa + 1] == 'X'))
  243|       |  {
  244|       |    if(require_full_consumption)
  245|       |    {
  246|       |      return false;
  247|       |    }
  248|       |    out = (first == '-') ? -0.0 : 0.0;
  249|       |    return true;
  250|       |  }
  251|       |  static ::locale_t c_locale =
  252|       |      ::newlocale(LC_NUMERIC_MASK, "C", static_cast<::locale_t>(0));
  253|       |  if(c_locale == static_cast<::locale_t>(0))
  254|       |  {
  255|       |    return false;
  256|       |  }
  257|       |  // strtod_l needs a null-terminated buffer.
  258|       |  const std::string buffer(str.data(), str.size());
  259|       |  errno = 0;
  260|       |  char* parse_end = nullptr;
  261|       |  const double value = ::strtod_l(buffer.c_str(), &parse_end, c_locale);
  262|       |  if(parse_end == buffer.c_str() || errno == ERANGE)
  263|       |  {
  264|       |    return false;
  265|       |  }
  266|       |  if(require_full_consumption && parse_end != buffer.c_str() + buffer.size())
  267|       |  {
  268|       |    return false;
  269|       |  }
  270|       |  out = value;
  271|       |  return true;
  272|       |#endif
  273|  9.13k|}
_ZN2BT17convertFromStringIdEET_St17basic_string_viewIcSt11char_traitsIcEE:
  277|  7.68k|{
  278|  7.68k|  double result = 0;
  279|  7.68k|  if(!parseDouble(str, result, /*require_full_consumption=*/false))
  ------------------
  |  Branch (279:6): [True: 57, False: 7.63k]
  ------------------
  280|     57|  {
  281|     57|    throw RuntimeError(StrCat("Can't convert string [", str, "] to double"));
  282|     57|  }
  283|  7.63k|  return result;
  284|  7.68k|}
_ZNK2BT8TypeInfo4typeEv:
  520|  38.5k|{
  521|  38.5k|  return type_info_;
  522|  38.5k|}
_ZN2BT9StartWithESt17basic_string_viewIcSt11char_traitsIcEEc:
  683|  2.09M|{
  684|  2.09M|  return str.size() >= 1 && str[0] == prefix;
  ------------------
  |  Branch (684:10): [True: 1.10M, False: 986k]
  |  Branch (684:29): [True: 991k, False: 116k]
  ------------------
  685|  2.09M|}

_ZN2BT10Blackboard12getAnyLockedERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  153|   987k|{
  154|   987k|  if(auto entry = getEntry(key))
  ------------------
  |  Branch (154:11): [True: 987k, False: 529]
  ------------------
  155|   987k|  {
  156|   987k|    return AnyPtrLocked(&entry->value, &entry->entry_mutex);
  157|   987k|  }
  158|    529|  return {};
  159|   987k|}
_ZNK2BT10Blackboard8getEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  183|  2.03M|{
  184|       |  // special syntax: "@" will always refer to the root BB
  185|  2.03M|  if(StartWith(key, '@'))
  ------------------
  |  Branch (185:6): [True: 989k, False: 1.04M]
  ------------------
  186|   989k|  {
  187|   989k|    return rootBlackboard()->getEntry(key.substr(1, key.size() - 1));
  188|   989k|  }
  189|       |
  190|  1.04M|  {
  191|  1.04M|    const std::shared_lock<std::shared_mutex> storage_lock(storage_mutex_);
  192|  1.04M|    auto it = storage_.find(key);
  193|  1.04M|    if(it != storage_.end())
  ------------------
  |  Branch (193:8): [True: 1.00M, False: 32.3k]
  ------------------
  194|  1.00M|    {
  195|  1.00M|      return it->second;
  196|  1.00M|    }
  197|  1.04M|  }
  198|       |  // not found. Try autoremapping
  199|  32.3k|  if(auto parent = parent_bb_.lock())
  ------------------
  |  Branch (199:11): [True: 0, False: 32.3k]
  ------------------
  200|      0|  {
  201|      0|    auto remap_it = internal_to_external_.find(key);
  202|      0|    if(remap_it != internal_to_external_.cend())
  ------------------
  |  Branch (202:8): [True: 0, False: 0]
  ------------------
  203|      0|    {
  204|      0|      auto const& new_key = remap_it->second;
  205|      0|      return parent->getEntry(new_key);
  206|      0|    }
  207|      0|    if(autoremapping_ && !IsPrivateKey(key))
  ------------------
  |  Branch (207:8): [True: 0, False: 0]
  |  Branch (207:26): [True: 0, False: 0]
  ------------------
  208|      0|    {
  209|      0|      return parent->getEntry(key);
  210|      0|    }
  211|      0|  }
  212|  32.3k|  return {};
  213|  32.3k|}
_ZN2BT10Blackboard8getEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  216|  1.04M|{
  217|  1.04M|  return static_cast<const Blackboard&>(*this).getEntry(key);
  218|  1.04M|}
_ZN2BT10Blackboard11createEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_8TypeInfoE:
  307|  8.41k|{
  308|  8.41k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (308:6): [True: 2.58k, False: 5.82k]
  ------------------
  309|  2.58k|  {
  310|  2.58k|    if(key.find('@', 1) != std::string::npos)
  ------------------
  |  Branch (310:8): [True: 0, False: 2.58k]
  ------------------
  311|      0|    {
  312|      0|      throw LogicError("Character '@' used multiple times in the key");
  313|      0|    }
  314|  2.58k|    rootBlackboard()->createEntryImpl(key.substr(1, key.size() - 1), info);
  315|  2.58k|  }
  316|  5.82k|  else
  317|  5.82k|  {
  318|  5.82k|    createEntryImpl(key, info);
  319|  5.82k|  }
  320|  8.41k|}
_ZN2BT10Blackboard15createEntryImplERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_8TypeInfoE:
  443|  31.7k|{
  444|       |  // special syntax: "@" always refers to the root blackboard, the same
  445|       |  // redirection getEntry() applies. Without it, a key remapped to a root
  446|       |  // entry (port="{@foo}") is created here as a literal "@foo" entry that
  447|       |  // getEntry() then strips to "foo" and can never find again.
  448|  31.7k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (448:6): [True: 0, False: 31.7k]
  ------------------
  449|      0|  {
  450|      0|    return rootBlackboard()->createEntryImpl(key.substr(1, key.size() - 1), info);
  451|      0|  }
  452|       |
  453|       |  // Bound the lifetime of the entries that were removed while locked
  454|  31.7k|  if(GetRetiredEntries().count != 0)
  ------------------
  |  Branch (454:6): [True: 0, False: 31.7k]
  ------------------
  455|      0|  {
  456|      0|    SweepRetiredEntries();
  457|      0|  }
  458|       |
  459|  31.7k|  const std::unique_lock storage_lock(storage_mutex_);
  460|       |  // This function might be called recursively, when we do remapping, because we move
  461|       |  // to the top scope to find already existing  entries
  462|       |
  463|       |  // search if exists already
  464|  31.7k|  auto storage_it = storage_.find(key);
  465|  31.7k|  if(storage_it != storage_.end())
  ------------------
  |  Branch (465:6): [True: 0, False: 31.7k]
  ------------------
  466|      0|  {
  467|      0|    const auto& prev_info = storage_it->second->info;
  468|      0|    if(prev_info.type() != info.type() && prev_info.isStronglyTyped() &&
  ------------------
  |  Branch (468:8): [True: 0, False: 0]
  |  Branch (468:43): [True: 0, False: 0]
  ------------------
  469|      0|       info.isStronglyTyped())
  ------------------
  |  Branch (469:8): [True: 0, False: 0]
  ------------------
  470|      0|    {
  471|      0|      auto msg = StrCat("Blackboard entry [", key,
  472|      0|                        "]: once declared, the type of a port"
  473|      0|                        " shall not change. Previously declared type [",
  474|      0|                        BT::demangle(prev_info.type()), "], current type [",
  475|      0|                        BT::demangle(info.type()), "]");
  476|       |
  477|      0|      throw LogicError(msg);
  478|      0|    }
  479|      0|    return storage_it->second;
  480|      0|  }
  481|       |
  482|       |  // manual remapping first
  483|  31.7k|  auto remapping_it = internal_to_external_.find(key);
  484|  31.7k|  if(remapping_it != internal_to_external_.end())
  ------------------
  |  Branch (484:6): [True: 0, False: 31.7k]
  ------------------
  485|      0|  {
  486|      0|    const auto& remapped_key = remapping_it->second;
  487|      0|    if(auto parent = parent_bb_.lock())
  ------------------
  |  Branch (487:13): [True: 0, False: 0]
  ------------------
  488|      0|    {
  489|      0|      return parent->createEntryImpl(remapped_key, info);
  490|      0|    }
  491|      0|    throw RuntimeError("Missing parent blackboard");
  492|      0|  }
  493|       |  // autoremapping second (excluding private keys)
  494|  31.7k|  if(autoremapping_ && !IsPrivateKey(key))
  ------------------
  |  Branch (494:6): [True: 0, False: 31.7k]
  |  Branch (494:24): [True: 0, False: 0]
  ------------------
  495|      0|  {
  496|      0|    if(auto parent = parent_bb_.lock())
  ------------------
  |  Branch (496:13): [True: 0, False: 0]
  ------------------
  497|      0|    {
  498|      0|      return parent->createEntryImpl(key, info);
  499|      0|    }
  500|      0|    throw RuntimeError("Missing parent blackboard");
  501|      0|  }
  502|       |  // not remapped, not found. Create locally.
  503|       |
  504|  31.7k|  auto entry = MakeEntry(info);
  505|       |  // even if empty, let's assign to it a default type
  506|  31.7k|  entry->value = Any(info.type());
  507|  31.7k|  storage_.insert({ key, entry });
  508|  31.7k|  return entry;
  509|  31.7k|}
_ZN2BT10Blackboard14rootBlackboardEv:
  559|  2.58k|{
  560|  2.58k|  auto bb = static_cast<const Blackboard&>(*this).rootBlackboard();
  561|       |  // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
  562|  2.58k|  return const_cast<Blackboard*>(bb);
  563|  2.58k|}
_ZNK2BT10Blackboard14rootBlackboardEv:
  566|   991k|{
  567|   991k|  const Blackboard* bb = this;
  568|   991k|  Blackboard::Ptr prev = parent_bb_.lock();
  569|   991k|  while(prev)
  ------------------
  |  Branch (569:9): [True: 0, False: 991k]
  ------------------
  570|      0|  {
  571|      0|    bb = prev.get();
  572|      0|    prev = bb->parent_bb_.lock();
  573|      0|  }
  574|   991k|  return bb;
  575|   991k|}
blackboard.cpp:_ZN2BT12_GLOBAL__N_19MakeEntryERKNS_8TypeInfoE:
  106|  31.7k|{
  107|  31.7k|  return { new Blackboard::Entry(info), &RetireEntry };
  108|  31.7k|}
blackboard.cpp:_ZN2BT12_GLOBAL__N_111RetireEntryEPNS_10Blackboard5EntryE:
   95|  31.7k|{
   96|       |  // Common case: nothing is parked and nobody holds this entry
   97|  31.7k|  if(GetRetiredEntries().count == 0 && IsUnlocked(retired))
  ------------------
  |  Branch (97:6): [True: 31.7k, False: 0]
  |  Branch (97:40): [True: 31.7k, False: 0]
  ------------------
   98|  31.7k|  {
   99|  31.7k|    delete retired;  // NOLINT(cppcoreguidelines-owning-memory)
  100|  31.7k|    return;
  101|  31.7k|  }
  102|      0|  SweepRetiredEntries(retired);
  103|      0|}
blackboard.cpp:_ZN2BT12_GLOBAL__N_110IsUnlockedEPNS_10Blackboard5EntryE:
   51|  31.7k|{
   52|  31.7k|  if(entry->entry_mutex.try_lock())
  ------------------
  |  Branch (52:6): [True: 31.7k, False: 0]
  ------------------
   53|  31.7k|  {
   54|  31.7k|    entry->entry_mutex.unlock();
   55|  31.7k|    return true;
   56|  31.7k|  }
   57|      0|  return false;
   58|  31.7k|}
blackboard.cpp:_ZN2BT12_GLOBAL__N_117GetRetiredEntriesEv:
   37|  63.5k|{
   38|       |  // Never destroyed: a Blackboard with static storage duration may be
   39|       |  // destroyed after this object during program exit.
   40|       |  // NOLINTNEXTLINE(cppcoreguidelines-owning-memory)
   41|  63.5k|  static auto* const instance = new RetiredEntries();
   42|  63.5k|  return *instance;
   43|  63.5k|}

_ZN2BT9Scripting15parseStatementsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  490|  13.3k|{
  491|  13.3k|  auto tokens = tokenize(script);
  492|  13.3k|  ScriptParser parser(std::move(tokens));
  493|  13.3k|  return parser.parseAll();
  494|  13.3k|}
_ZN2BT11ParseScriptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  501|  7.46k|{
  502|  7.46k|  try
  503|  7.46k|  {
  504|  7.46k|    auto exprs = Scripting::parseStatements(script);
  505|  7.46k|    if(exprs.empty())
  ------------------
  |  Branch (505:8): [True: 72, False: 7.39k]
  ------------------
  506|     72|    {
  507|     72|      return nonstd::make_unexpected("Empty Script");
  508|     72|    }
  509|  7.39k|    return [exprs = std::move(exprs), script](Ast::Environment& env) {
  510|  7.39k|      try
  511|  7.39k|      {
  512|  7.39k|        for(size_t i = 0; i < exprs.size() - 1; ++i)
  513|  7.39k|        {
  514|  7.39k|          exprs[i]->evaluate(env);
  515|  7.39k|        }
  516|  7.39k|        return exprs.back()->evaluate(env);
  517|  7.39k|      }
  518|  7.39k|      catch(RuntimeError& err)
  519|  7.39k|      {
  520|  7.39k|        throw RuntimeError(StrCat("Error in script [", script, "]\n", err.what()));
  521|  7.39k|      }
  522|  7.39k|    };
  523|  7.46k|  }
  524|  7.46k|  catch(RuntimeError& err)
  525|  7.46k|  {
  526|  3.18k|    return nonstd::make_unexpected(err.what());
  527|  3.18k|  }
  528|  7.46k|}
_ZN2BT21ParseScriptAndExecuteERNS_3Ast11EnvironmentERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  531|  5.84k|{
  532|  5.84k|  auto executor = ParseScript(script);
  533|  5.84k|  if(executor)
  ------------------
  |  Branch (533:6): [True: 4.21k, False: 1.62k]
  ------------------
  534|  4.21k|  {
  535|  4.21k|    try
  536|  4.21k|    {
  537|  4.21k|      return executor.value()(env);
  538|  4.21k|    }
  539|  4.21k|    catch(RuntimeError& err)
  540|  4.21k|    {
  541|  1.21k|      return nonstd::make_unexpected(err.what());
  542|  1.21k|    }
  543|  4.21k|  }
  544|  1.62k|  return nonstd::make_unexpected(executor.error());
  545|  5.84k|}
_ZN2BT14ValidateScriptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  548|  5.84k|{
  549|  5.84k|  try
  550|  5.84k|  {
  551|  5.84k|    auto exprs = Scripting::parseStatements(script);
  552|  5.84k|    if(exprs.empty())
  ------------------
  |  Branch (552:8): [True: 36, False: 5.80k]
  ------------------
  553|     36|    {
  554|     36|      return nonstd::make_unexpected("Empty Script");
  555|     36|    }
  556|  5.80k|    return {};
  557|  5.84k|  }
  558|  5.84k|  catch(RuntimeError& err)
  559|  5.84k|  {
  560|  1.59k|    return nonstd::make_unexpected(err.what());
  561|  1.59k|  }
  562|  5.84k|}
_ZN2BT9Scripting12ScriptParserC2ESt6vectorINS0_5TokenESaIS3_EE:
   29|  13.3k|  explicit ScriptParser(std::vector<Token> tokens) : tokens_(std::move(tokens))
   30|  13.3k|  {}
_ZN2BT9Scripting12ScriptParser8parseAllEv:
   33|  13.3k|  {
   34|  13.3k|    std::vector<Ast::expr_ptr> stmts;
   35|  9.14M|    while(!atEnd())
  ------------------
  |  Branch (35:11): [True: 9.12M, False: 13.3k]
  ------------------
   36|  9.12M|    {
   37|  9.12M|      stmts.push_back(parseExpr(0));
   38|       |      // consume optional semicolons between statements
   39|  9.13M|      while(check(TokenType::Semicolon))
  ------------------
  |  Branch (39:13): [True: 5.91k, False: 9.12M]
  ------------------
   40|  5.91k|      {
   41|  5.91k|        advance();
   42|  5.91k|      }
   43|  9.12M|    }
   44|  13.3k|    return stmts;
   45|  13.3k|  }
_ZNK2BT9Scripting12ScriptParser5atEndEv:
   92|  23.2M|  {
   93|  23.2M|    return peek().type == TokenType::EndOfInput;
   94|  23.2M|  }
_ZNK2BT9Scripting12ScriptParser4peekEv:
   79|  58.1M|  {
   80|  58.1M|    return tokens_[current_];
   81|  58.1M|  }
_ZN2BT9Scripting12ScriptParser9parseExprEi:
  300|  11.6M|  {
  301|       |    // Bound the recursion so a deeply nested expression can't overflow the
  302|       |    // stack. Every open paren / unary prefix / right-hand operand adds one
  303|       |    // parseExpr frame; depth_ is decremented before the normal return below so
  304|       |    // it tracks the current nesting rather than the total call count. A parse
  305|       |    // failure throws and discards the parser, so the error paths need no reset.
  306|  11.6M|    if(++depth_ > kMaxNestingDepth)
  ------------------
  |  Branch (306:8): [True: 18, False: 11.6M]
  ------------------
  307|     18|    {
  308|     18|      throw RuntimeError(StrCat("Parse error at position ", std::to_string(peek().pos),
  309|     18|                                ": expression nesting is too deep (limit ",
  310|     18|                                std::to_string(kMaxNestingDepth), ")"));
  311|     18|    }
  312|       |
  313|  11.6M|    auto left = parsePrefix();
  314|  11.6M|    int left_height = height_;
  315|       |
  316|  11.7M|    while(true)
  ------------------
  |  Branch (316:11): [True: 11.7M, Folded]
  ------------------
  317|  11.7M|    {
  318|  11.7M|      auto tokType = peek().type;
  319|  11.7M|      int lbp = leftBP(tokType);
  320|  11.7M|      if(lbp < 0 || lbp < minBP)
  ------------------
  |  Branch (320:10): [True: 9.21M, False: 2.49M]
  |  Branch (320:21): [True: 2.33M, False: 165k]
  ------------------
  321|  11.5M|      {
  322|  11.5M|        break;
  323|  11.5M|      }
  324|       |
  325|       |      // Assignment (non-associative: parse once, then break)
  326|   165k|      if(isAssignment(tokType))
  ------------------
  |  Branch (326:10): [True: 65.6k, False: 100k]
  ------------------
  327|  65.6k|      {
  328|  65.6k|        left = parseAssignment(std::move(left));
  329|  65.6k|        left_height = combinedHeight(left_height);
  330|  65.6k|        break;
  331|  65.6k|      }
  332|       |
  333|       |      // Ternary (non-associative: parse once, then break)
  334|   100k|      if(tokType == TokenType::Question)
  ------------------
  |  Branch (334:10): [True: 9.06k, False: 90.9k]
  ------------------
  335|  9.06k|      {
  336|  9.06k|        left = parseTernary(std::move(left));
  337|  9.06k|        left_height = combinedHeight(left_height);
  338|  9.06k|        break;
  339|  9.06k|      }
  340|       |
  341|       |      // Chained comparison
  342|  90.9k|      if(isComparison(tokType))
  ------------------
  |  Branch (342:10): [True: 47.9k, False: 43.0k]
  ------------------
  343|  47.9k|      {
  344|  47.9k|        left = parseChainedComparison(std::move(left));
  345|  47.9k|        left_height = combinedHeight(left_height);
  346|  47.9k|        continue;
  347|  47.9k|      }
  348|       |
  349|       |      // Regular left-associative binary operator
  350|  43.0k|      const auto& opTok = advance();
  351|       |      // Right BP = LBP + 1 for left-associativity
  352|  43.0k|      auto right = parseExpr(lbp + 1);
  353|  43.0k|      left = makeBinary(std::move(left), opTok.type, std::move(right));
  354|  43.0k|      left_height = combinedHeight(left_height);
  355|  43.0k|    }
  356|       |
  357|  11.6M|    --depth_;
  358|  11.6M|    height_ = left_height;
  359|  11.6M|    return left;
  360|  11.6M|  }
_ZN2BT9Scripting12ScriptParser11parsePrefixEv:
  197|  11.6M|  {
  198|  11.6M|    const auto& tok = peek();
  199|       |    // literals and identifiers are leaves; the cases below that parse a
  200|       |    // subexpression overwrite it
  201|  11.6M|    height_ = 1;
  202|       |
  203|       |    // Unary minus
  204|  11.6M|    if(tok.type == TokenType::Minus)
  ------------------
  |  Branch (204:8): [True: 9.68k, False: 11.6M]
  ------------------
  205|  9.68k|    {
  206|  9.68k|      advance();
  207|  9.68k|      auto operand = parseExpr(kPrefixBP);
  208|  9.68k|      height_ = combinedHeight(0);
  209|  9.68k|      return std::make_shared<Ast::ExprUnaryArithmetic>(Ast::ExprUnaryArithmetic::negate,
  210|  9.68k|                                                        std::move(operand));
  211|  9.68k|    }
  212|       |    // Bitwise complement
  213|  11.6M|    if(tok.type == TokenType::Tilde)
  ------------------
  |  Branch (213:8): [True: 17.0k, False: 11.6M]
  ------------------
  214|  17.0k|    {
  215|  17.0k|      advance();
  216|  17.0k|      auto operand = parseExpr(kPrefixBP);
  217|  17.0k|      height_ = combinedHeight(0);
  218|  17.0k|      return std::make_shared<Ast::ExprUnaryArithmetic>(
  219|  17.0k|          Ast::ExprUnaryArithmetic::complement, std::move(operand));
  220|  17.0k|    }
  221|       |    // Logical NOT
  222|  11.6M|    if(tok.type == TokenType::Bang)
  ------------------
  |  Branch (222:8): [True: 12.5k, False: 11.6M]
  ------------------
  223|  12.5k|    {
  224|  12.5k|      advance();
  225|  12.5k|      auto operand = parseExpr(kPrefixBP);
  226|  12.5k|      height_ = combinedHeight(0);
  227|  12.5k|      return std::make_shared<Ast::ExprUnaryArithmetic>(
  228|  12.5k|          Ast::ExprUnaryArithmetic::logical_not, std::move(operand));
  229|  12.5k|    }
  230|       |    // Parenthesized expression
  231|  11.6M|    if(tok.type == TokenType::LeftParen)
  ------------------
  |  Branch (231:8): [True: 16.1k, False: 11.5M]
  ------------------
  232|  16.1k|    {
  233|  16.1k|      advance();
  234|  16.1k|      auto expr = parseExpr(0);
  235|  16.1k|      expect(TokenType::RightParen, "expected ')'");
  236|  16.1k|      return expr;
  237|  16.1k|    }
  238|       |    // Boolean literal
  239|  11.5M|    if(tok.type == TokenType::Boolean)
  ------------------
  |  Branch (239:8): [True: 1.88k, False: 11.5M]
  ------------------
  240|  1.88k|    {
  241|  1.88k|      advance();
  242|  1.88k|      double val = (tok.text == "true") ? 1.0 : 0.0;
  ------------------
  |  Branch (242:20): [True: 1.05k, False: 828]
  ------------------
  243|  1.88k|      return std::make_shared<Ast::ExprLiteral>(Any(val));
  244|  1.88k|    }
  245|       |    // Integer literal
  246|  11.5M|    if(tok.type == TokenType::Integer)
  ------------------
  |  Branch (246:8): [True: 1.67M, False: 9.92M]
  ------------------
  247|  1.67M|    {
  248|  1.67M|      advance();
  249|  1.67M|      int64_t val = 0;
  250|  1.67M|      const char* first = tok.text.data();
  251|  1.67M|      const char* last = first + tok.text.size();
  252|  1.67M|      const bool is_hex = tok.text.size() > 2 && tok.text[0] == '0' &&
  ------------------
  |  Branch (252:27): [True: 21.2k, False: 1.64M]
  |  Branch (252:50): [True: 3.77k, False: 17.4k]
  ------------------
  253|  3.77k|                          (tok.text[1] == 'x' || tok.text[1] == 'X');
  ------------------
  |  Branch (253:28): [True: 1.09k, False: 2.67k]
  |  Branch (253:50): [True: 1.32k, False: 1.35k]
  ------------------
  254|  1.67M|      const auto [ptr, ec] = is_hex ? std::from_chars(first + 2, last, val, 16) :
  ------------------
  |  Branch (254:30): [True: 2.42k, False: 1.66M]
  ------------------
  255|  1.67M|                                      std::from_chars(first, last, val, 10);
  256|       |      // The tokenizer already guarantees the literal is made of (hex) digits, so
  257|       |      // the only remaining failure is result_out_of_range. from_chars leaves val
  258|       |      // untouched in that case, which would otherwise turn a literal like
  259|       |      // 0xFFFFFFFFFFFFFFFF into a silent 0.
  260|  1.67M|      if(ec != std::errc() || ptr != last)
  ------------------
  |  Branch (260:10): [True: 504, False: 1.67M]
  |  Branch (260:31): [True: 0, False: 1.67M]
  ------------------
  261|    504|      {
  262|    504|        throw RuntimeError(StrCat("Integer literal '", tok.text, "' at position ",
  263|    504|                                  std::to_string(tok.pos),
  264|    504|                                  " is out of range for a 64-bit integer"));
  265|    504|      }
  266|  1.67M|      return std::make_shared<Ast::ExprLiteral>(Any(val));
  267|  1.67M|    }
  268|       |    // Real literal
  269|  9.92M|    if(tok.type == TokenType::Real)
  ------------------
  |  Branch (269:8): [True: 7.68k, False: 9.91M]
  ------------------
  270|  7.68k|    {
  271|  7.68k|      advance();
  272|  7.68k|      double val = convertFromString<double>(tok.text);
  273|  7.68k|      return std::make_shared<Ast::ExprLiteral>(Any(val));
  274|  7.68k|    }
  275|       |    // String literal
  276|  9.91M|    if(tok.type == TokenType::String)
  ------------------
  |  Branch (276:8): [True: 90.6k, False: 9.82M]
  ------------------
  277|  90.6k|    {
  278|  90.6k|      advance();
  279|  90.6k|      return std::make_shared<Ast::ExprLiteral>(Any(std::string(tok.text)));
  280|  90.6k|    }
  281|       |    // Identifier
  282|  9.82M|    if(tok.type == TokenType::Identifier)
  ------------------
  |  Branch (282:8): [True: 9.82M, False: 3.81k]
  ------------------
  283|  9.82M|    {
  284|  9.82M|      advance();
  285|  9.82M|      return std::make_shared<Ast::ExprName>(std::string(tok.text));
  286|  9.82M|    }
  287|       |    // Error token from tokenizer
  288|  3.81k|    if(tok.type == TokenType::Error)
  ------------------
  |  Branch (288:8): [True: 2.04k, False: 1.77k]
  ------------------
  289|  2.04k|    {
  290|  2.04k|      throw RuntimeError(
  291|  2.04k|          StrCat("Invalid token '", tok.text, "' at position ", std::to_string(tok.pos)));
  292|  2.04k|    }
  293|       |
  294|  1.77k|    throw RuntimeError(StrCat("Expected operand at position ", std::to_string(tok.pos),
  295|  1.77k|                              " (got '", tok.text, "')"));
  296|  3.81k|  }
_ZN2BT9Scripting12ScriptParser6expectENS0_9TokenTypeEPKc:
  102|  9.08k|  {
  103|  9.08k|    if(!check(type))
  ------------------
  |  Branch (103:8): [True: 339, False: 8.74k]
  ------------------
  104|    339|    {
  105|    339|      throw RuntimeError(StrCat("Parse error at position ", std::to_string(peek().pos),
  106|    339|                                ": ", msg, " (got '", peek().text, "')"));
  107|    339|    }
  108|  8.74k|    return advance();
  109|  9.08k|  }
_ZN2BT9Scripting12ScriptParser6leftBPENS0_9TokenTypeE:
  116|  11.7M|  {
  117|  11.7M|    switch(type)
  118|  11.7M|    {
  119|       |      // Assignment (level 1, non-associative)
  120|  21.5k|      case TokenType::ColonEqual:
  ------------------
  |  Branch (120:7): [True: 21.5k, False: 11.6M]
  ------------------
  121|  47.3k|      case TokenType::Equal:
  ------------------
  |  Branch (121:7): [True: 25.7k, False: 11.6M]
  ------------------
  122|  62.3k|      case TokenType::PlusEqual:
  ------------------
  |  Branch (122:7): [True: 14.9k, False: 11.6M]
  ------------------
  123|  63.9k|      case TokenType::MinusEqual:
  ------------------
  |  Branch (123:7): [True: 1.62k, False: 11.7M]
  ------------------
  124|  65.6k|      case TokenType::StarEqual:
  ------------------
  |  Branch (124:7): [True: 1.72k, False: 11.7M]
  ------------------
  125|  67.2k|      case TokenType::SlashEqual:
  ------------------
  |  Branch (125:7): [True: 1.58k, False: 11.7M]
  ------------------
  126|  67.2k|        return kAssignmentBP;
  127|       |      // Ternary (level 2, non-associative)
  128|  12.4k|      case TokenType::Question:
  ------------------
  |  Branch (128:7): [True: 12.4k, False: 11.6M]
  ------------------
  129|  12.4k|        return kTernaryBP;
  130|       |      // Logical OR (level 3)
  131|  2.55k|      case TokenType::PipePipe:
  ------------------
  |  Branch (131:7): [True: 2.55k, False: 11.7M]
  ------------------
  132|  2.55k|        return 6;
  133|       |      // Logical AND (level 4)
  134|  3.09k|      case TokenType::AmpAmp:
  ------------------
  |  Branch (134:7): [True: 3.09k, False: 11.7M]
  ------------------
  135|  3.09k|        return 8;
  136|       |      // Comparison (level 5, chainable)
  137|  8.49k|      case TokenType::EqualEqual:
  ------------------
  |  Branch (137:7): [True: 8.49k, False: 11.7M]
  ------------------
  138|   474k|      case TokenType::BangEqual:
  ------------------
  |  Branch (138:7): [True: 466k, False: 11.2M]
  ------------------
  139|  1.24M|      case TokenType::Less:
  ------------------
  |  Branch (139:7): [True: 774k, False: 10.9M]
  ------------------
  140|  2.32M|      case TokenType::Greater:
  ------------------
  |  Branch (140:7): [True: 1.07M, False: 10.6M]
  ------------------
  141|  2.33M|      case TokenType::LessEqual:
  ------------------
  |  Branch (141:7): [True: 8.93k, False: 11.7M]
  ------------------
  142|  2.34M|      case TokenType::GreaterEqual:
  ------------------
  |  Branch (142:7): [True: 13.6k, False: 11.6M]
  ------------------
  143|  2.34M|        return kComparisonBP;
  144|       |      // Bitwise OR/XOR (level 6)
  145|  13.4k|      case TokenType::Pipe:
  ------------------
  |  Branch (145:7): [True: 13.4k, False: 11.6M]
  ------------------
  146|  14.8k|      case TokenType::Caret:
  ------------------
  |  Branch (146:7): [True: 1.33k, False: 11.7M]
  ------------------
  147|  14.8k|        return 12;
  148|       |      // Bitwise AND (level 7)
  149|  5.38k|      case TokenType::Ampersand:
  ------------------
  |  Branch (149:7): [True: 5.38k, False: 11.7M]
  ------------------
  150|  5.38k|        return 14;
  151|       |      // Add/Sub/Concat (level 8)
  152|  20.0k|      case TokenType::Plus:
  ------------------
  |  Branch (152:7): [True: 20.0k, False: 11.6M]
  ------------------
  153|  26.4k|      case TokenType::Minus:
  ------------------
  |  Branch (153:7): [True: 6.37k, False: 11.7M]
  ------------------
  154|  40.4k|      case TokenType::DotDot:
  ------------------
  |  Branch (154:7): [True: 14.0k, False: 11.6M]
  ------------------
  155|  40.4k|        return 16;
  156|       |      // Mul/Div (level 9)
  157|  1.91k|      case TokenType::Star:
  ------------------
  |  Branch (157:7): [True: 1.91k, False: 11.7M]
  ------------------
  158|  4.21k|      case TokenType::Slash:
  ------------------
  |  Branch (158:7): [True: 2.29k, False: 11.7M]
  ------------------
  159|  4.21k|        return kMulDivBP;
  160|  9.21M|      default:
  ------------------
  |  Branch (160:7): [True: 9.21M, False: 2.49M]
  ------------------
  161|  9.21M|        return -1;
  162|  11.7M|    }
  163|  11.7M|  }
_ZN2BT9Scripting12ScriptParser12isAssignmentENS0_9TokenTypeE:
  173|   165k|  {
  174|   165k|    return type == TokenType::ColonEqual || type == TokenType::Equal ||
  ------------------
  |  Branch (174:12): [True: 21.5k, False: 144k]
  |  Branch (174:45): [True: 24.2k, False: 119k]
  ------------------
  175|   119k|           type == TokenType::PlusEqual || type == TokenType::MinusEqual ||
  ------------------
  |  Branch (175:12): [True: 14.9k, False: 104k]
  |  Branch (175:44): [True: 1.62k, False: 103k]
  ------------------
  176|   103k|           type == TokenType::StarEqual || type == TokenType::SlashEqual;
  ------------------
  |  Branch (176:12): [True: 1.71k, False: 101k]
  |  Branch (176:44): [True: 1.57k, False: 100k]
  ------------------
  177|   165k|  }
_ZN2BT9Scripting12ScriptParser15parseAssignmentESt10shared_ptrINS_3Ast8ExprBaseEE:
  363|  65.6k|  {
  364|  65.6k|    const auto& opTok = advance();
  365|  65.6k|    Ast::ExprAssignment::op_t op{};
  366|  65.6k|    switch(opTok.type)
  367|  65.6k|    {
  368|  21.5k|      case TokenType::ColonEqual:
  ------------------
  |  Branch (368:7): [True: 21.5k, False: 44.1k]
  ------------------
  369|  21.5k|        op = Ast::ExprAssignment::assign_create;
  370|  21.5k|        break;
  371|  24.2k|      case TokenType::Equal:
  ------------------
  |  Branch (371:7): [True: 24.2k, False: 41.4k]
  ------------------
  372|  24.2k|        op = Ast::ExprAssignment::assign_existing;
  373|  24.2k|        break;
  374|  14.9k|      case TokenType::PlusEqual:
  ------------------
  |  Branch (374:7): [True: 14.9k, False: 50.7k]
  ------------------
  375|  14.9k|        op = Ast::ExprAssignment::assign_plus;
  376|  14.9k|        break;
  377|  1.62k|      case TokenType::MinusEqual:
  ------------------
  |  Branch (377:7): [True: 1.62k, False: 64.0k]
  ------------------
  378|  1.62k|        op = Ast::ExprAssignment::assign_minus;
  379|  1.62k|        break;
  380|  1.71k|      case TokenType::StarEqual:
  ------------------
  |  Branch (380:7): [True: 1.71k, False: 63.9k]
  ------------------
  381|  1.71k|        op = Ast::ExprAssignment::assign_times;
  382|  1.71k|        break;
  383|  1.57k|      case TokenType::SlashEqual:
  ------------------
  |  Branch (383:7): [True: 1.57k, False: 64.1k]
  ------------------
  384|  1.57k|        op = Ast::ExprAssignment::assign_div;
  385|  1.57k|        break;
  386|      0|      default:
  ------------------
  |  Branch (386:7): [True: 0, False: 65.6k]
  ------------------
  387|      0|        throw RuntimeError("Internal error: unexpected assignment op");
  388|  65.6k|    }
  389|       |    // Parse RHS -- use minBP=0 to allow full expression
  390|  65.6k|    auto right = parseExpr(0);
  391|  65.6k|    return std::make_shared<Ast::ExprAssignment>(std::move(left), op, std::move(right));
  392|  65.6k|  }
_ZNK2BT9Scripting12ScriptParser14combinedHeightEi:
  182|   178k|  {
  183|   178k|    const int height = std::max(lhs_height, height_) + 1;
  184|   178k|    if(height > kMaxExpressionHeight)
  ------------------
  |  Branch (184:8): [True: 33, False: 178k]
  ------------------
  185|     33|    {
  186|     33|      throw RuntimeError(StrCat("Parse error at position ", std::to_string(peek().pos),
  187|     33|                                ": expression is too long or too deeply nested (limit ",
  188|     33|                                std::to_string(kMaxExpressionHeight), " levels)"));
  189|     33|    }
  190|   178k|    return height;
  191|   178k|  }
_ZN2BT9Scripting12ScriptParser12parseTernaryESt10shared_ptrINS_3Ast8ExprBaseEE:
  395|  9.06k|  {
  396|  9.06k|    advance();                     // consume '?'
  397|  9.06k|    auto thenExpr = parseExpr(0);  // full expression inside
  398|  9.06k|    const int then_height = height_;
  399|  9.06k|    expect(TokenType::Colon, "expected ':' in ternary expression");
  400|  9.06k|    auto elseExpr = parseExpr(kTernaryBP);
  401|  9.06k|    height_ = std::max(then_height, height_);
  402|  9.06k|    return std::make_shared<Ast::ExprIf>(std::move(condition), std::move(thenExpr),
  403|  9.06k|                                         std::move(elseExpr));
  404|  9.06k|  }
_ZN2BT9Scripting12ScriptParser12isComparisonENS0_9TokenTypeE:
  166|  2.47M|  {
  167|  2.47M|    return type == TokenType::EqualEqual || type == TokenType::BangEqual ||
  ------------------
  |  Branch (167:12): [True: 12.3k, False: 2.46M]
  |  Branch (167:45): [True: 470k, False: 1.99M]
  ------------------
  168|  1.99M|           type == TokenType::Less || type == TokenType::Greater ||
  ------------------
  |  Branch (168:12): [True: 785k, False: 1.21M]
  |  Branch (168:39): [True: 1.08M, False: 124k]
  ------------------
  169|   124k|           type == TokenType::LessEqual || type == TokenType::GreaterEqual;
  ------------------
  |  Branch (169:12): [True: 14.8k, False: 110k]
  |  Branch (169:44): [True: 21.1k, False: 88.8k]
  ------------------
  170|  2.47M|  }
_ZN2BT9Scripting12ScriptParser22parseChainedComparisonESt10shared_ptrINS_3Ast8ExprBaseEE:
  407|  47.9k|  {
  408|  47.9k|    auto node = std::make_shared<Ast::ExprComparison>();
  409|  47.9k|    node->operands.push_back(std::move(first));
  410|       |
  411|  47.9k|    int max_height = 0;
  412|  2.39M|    while(isComparison(peek().type))
  ------------------
  |  Branch (412:11): [True: 2.34M, False: 47.9k]
  ------------------
  413|  2.34M|    {
  414|  2.34M|      node->ops.push_back(mapComparisonOp(advance().type));
  415|       |      // Parse the next operand above comparison level
  416|       |      // so that arithmetic binds tighter
  417|  2.34M|      node->operands.push_back(parseExpr(kComparisonBP + 1));
  418|  2.34M|      max_height = std::max(max_height, height_);
  419|  2.34M|    }
  420|  47.9k|    height_ = max_height;
  421|  47.9k|    return node;
  422|  47.9k|  }
_ZN2BT9Scripting12ScriptParser15mapComparisonOpENS0_9TokenTypeE:
  425|  2.34M|  {
  426|  2.34M|    switch(type)
  427|  2.34M|    {
  428|  7.24k|      case TokenType::EqualEqual:
  ------------------
  |  Branch (428:7): [True: 7.24k, False: 2.33M]
  ------------------
  429|  7.24k|        return Ast::ExprComparison::equal;
  430|   465k|      case TokenType::BangEqual:
  ------------------
  |  Branch (430:7): [True: 465k, False: 1.87M]
  ------------------
  431|   465k|        return Ast::ExprComparison::not_equal;
  432|   773k|      case TokenType::Less:
  ------------------
  |  Branch (432:7): [True: 773k, False: 1.56M]
  ------------------
  433|   773k|        return Ast::ExprComparison::less;
  434|  1.07M|      case TokenType::Greater:
  ------------------
  |  Branch (434:7): [True: 1.07M, False: 1.26M]
  ------------------
  435|  1.07M|        return Ast::ExprComparison::greater;
  436|  8.82k|      case TokenType::LessEqual:
  ------------------
  |  Branch (436:7): [True: 8.82k, False: 2.33M]
  ------------------
  437|  8.82k|        return Ast::ExprComparison::less_equal;
  438|  12.2k|      case TokenType::GreaterEqual:
  ------------------
  |  Branch (438:7): [True: 12.2k, False: 2.33M]
  ------------------
  439|  12.2k|        return Ast::ExprComparison::greater_equal;
  440|      0|      default:
  ------------------
  |  Branch (440:7): [True: 0, False: 2.34M]
  ------------------
  441|      0|        throw RuntimeError("Internal error: not a comparison op");
  442|  2.34M|    }
  443|  2.34M|  }
_ZN2BT9Scripting12ScriptParser10makeBinaryESt10shared_ptrINS_3Ast8ExprBaseEENS0_9TokenTypeES5_:
  447|  41.9k|  {
  448|  41.9k|    Ast::ExprBinaryArithmetic::op_t op{};
  449|  41.9k|    switch(opType)
  450|  41.9k|    {
  451|  12.4k|      case TokenType::Plus:
  ------------------
  |  Branch (451:7): [True: 12.4k, False: 29.4k]
  ------------------
  452|  12.4k|        op = Ast::ExprBinaryArithmetic::plus;
  453|  12.4k|        break;
  454|  3.76k|      case TokenType::Minus:
  ------------------
  |  Branch (454:7): [True: 3.76k, False: 38.1k]
  ------------------
  455|  3.76k|        op = Ast::ExprBinaryArithmetic::minus;
  456|  3.76k|        break;
  457|  1.22k|      case TokenType::Star:
  ------------------
  |  Branch (457:7): [True: 1.22k, False: 40.7k]
  ------------------
  458|  1.22k|        op = Ast::ExprBinaryArithmetic::times;
  459|  1.22k|        break;
  460|  1.57k|      case TokenType::Slash:
  ------------------
  |  Branch (460:7): [True: 1.57k, False: 40.3k]
  ------------------
  461|  1.57k|        op = Ast::ExprBinaryArithmetic::div;
  462|  1.57k|        break;
  463|  9.88k|      case TokenType::DotDot:
  ------------------
  |  Branch (463:7): [True: 9.88k, False: 32.0k]
  ------------------
  464|  9.88k|        op = Ast::ExprBinaryArithmetic::concat;
  465|  9.88k|        break;
  466|  2.72k|      case TokenType::Ampersand:
  ------------------
  |  Branch (466:7): [True: 2.72k, False: 39.2k]
  ------------------
  467|  2.72k|        op = Ast::ExprBinaryArithmetic::bit_and;
  468|  2.72k|        break;
  469|  6.73k|      case TokenType::Pipe:
  ------------------
  |  Branch (469:7): [True: 6.73k, False: 35.1k]
  ------------------
  470|  6.73k|        op = Ast::ExprBinaryArithmetic::bit_or;
  471|  6.73k|        break;
  472|    769|      case TokenType::Caret:
  ------------------
  |  Branch (472:7): [True: 769, False: 41.1k]
  ------------------
  473|    769|        op = Ast::ExprBinaryArithmetic::bit_xor;
  474|    769|        break;
  475|  1.39k|      case TokenType::AmpAmp:
  ------------------
  |  Branch (475:7): [True: 1.39k, False: 40.5k]
  ------------------
  476|  1.39k|        op = Ast::ExprBinaryArithmetic::logic_and;
  477|  1.39k|        break;
  478|  1.41k|      case TokenType::PipePipe:
  ------------------
  |  Branch (478:7): [True: 1.41k, False: 40.5k]
  ------------------
  479|  1.41k|        op = Ast::ExprBinaryArithmetic::logic_or;
  480|  1.41k|        break;
  481|      0|      default:
  ------------------
  |  Branch (481:7): [True: 0, False: 41.9k]
  ------------------
  482|      0|        throw RuntimeError("Internal error: unknown binary operator");
  483|  41.9k|    }
  484|  41.9k|    return std::make_shared<Ast::ExprBinaryArithmetic>(std::move(left), op,
  485|  41.9k|                                                       std::move(right));
  486|  41.9k|  }
_ZNK2BT9Scripting12ScriptParser5checkENS0_9TokenTypeE:
   97|  9.13M|  {
   98|  9.13M|    return peek().type == type;
   99|  9.13M|  }
_ZN2BT9Scripting12ScriptParser7advanceEv:
   84|  14.1M|  {
   85|  14.1M|    const Token& tok = tokens_[current_];
   86|  14.1M|    if(!atEnd())
  ------------------
  |  Branch (86:8): [True: 14.1M, False: 0]
  ------------------
   87|  14.1M|      current_++;
   88|  14.1M|    return tok;
   89|  14.1M|  }
script_parser.cpp:_ZZN2BT11ParseScriptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEENK3$_0clERNS_3Ast11EnvironmentE:
  509|  4.21k|    return [exprs = std::move(exprs), script](Ast::Environment& env) {
  510|  4.21k|      try
  511|  4.21k|      {
  512|   996k|        for(size_t i = 0; i < exprs.size() - 1; ++i)
  ------------------
  |  Branch (512:27): [True: 992k, False: 4.21k]
  ------------------
  513|   992k|        {
  514|   992k|          exprs[i]->evaluate(env);
  515|   992k|        }
  516|  4.21k|        return exprs.back()->evaluate(env);
  517|  4.21k|      }
  518|  4.21k|      catch(RuntimeError& err)
  519|  4.21k|      {
  520|  1.21k|        throw RuntimeError(StrCat("Error in script [", script, "]\n", err.what()));
  521|  1.21k|      }
  522|  4.21k|    };

_ZN2BT9Scripting8tokenizeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  224|  13.3k|{
  225|  13.3k|  std::vector<Token> tokens;
  226|  13.3k|  const size_t len = source.size();
  227|  13.3k|  size_t i = 0;
  228|       |
  229|  45.6M|  while(i < len)
  ------------------
  |  Branch (229:9): [True: 45.6M, False: 13.3k]
  ------------------
  230|  45.6M|  {
  231|  45.6M|    const char c = source[i];
  232|       |
  233|       |    // Skip whitespace (space, tab, newline, carriage return)
  234|  45.6M|    if(c == ' ' || c == '\t' || c == '\n' || c == '\r')
  ------------------
  |  Branch (234:8): [True: 25.6k, False: 45.5M]
  |  Branch (234:20): [True: 13.2k, False: 45.5M]
  |  Branch (234:33): [True: 226k, False: 45.3M]
  |  Branch (234:46): [True: 5.79k, False: 45.3M]
  ------------------
  235|   271k|    {
  236|   271k|      ++i;
  237|   271k|      continue;
  238|   271k|    }
  239|       |
  240|  45.3M|    const size_t start = i;
  241|       |
  242|       |    // Single-quoted string literal
  243|  45.3M|    if(c == '\'')
  ------------------
  |  Branch (243:8): [True: 551k, False: 44.7M]
  ------------------
  244|   551k|    {
  245|   551k|      ++i;
  246|  71.9M|      while(i < len && source[i] != '\'')
  ------------------
  |  Branch (246:13): [True: 71.9M, False: 369]
  |  Branch (246:24): [True: 71.4M, False: 551k]
  ------------------
  247|  71.4M|      {
  248|  71.4M|        ++i;
  249|  71.4M|      }
  250|   551k|      if(i < len)
  ------------------
  |  Branch (250:10): [True: 551k, False: 369]
  ------------------
  251|   551k|      {
  252|       |        // extract content without quotes
  253|   551k|        std::string_view text(&source[start + 1], i - start - 1);
  254|   551k|        tokens.push_back({ TokenType::String, text, start });
  255|   551k|        ++i;  // skip closing quote
  256|   551k|      }
  257|    369|      else
  258|    369|      {
  259|    369|        std::string_view text(&source[start], i - start);
  260|    369|        tokens.push_back({ TokenType::Error, text, start });
  261|    369|      }
  262|   551k|      continue;
  263|   551k|    }
  264|       |
  265|       |    // Number literal (integer or real)
  266|  44.7M|    if(isDigit(c))
  ------------------
  |  Branch (266:8): [True: 3.94M, False: 40.8M]
  ------------------
  267|  3.94M|    {
  268|  3.94M|      NumberResult nr;
  269|  3.94M|      const bool is_hex =
  270|  3.94M|          c == '0' && i + 1 < len && (source[i + 1] == 'x' || source[i + 1] == 'X');
  ------------------
  |  Branch (270:11): [True: 1.06M, False: 2.87M]
  |  Branch (270:23): [True: 1.06M, False: 746]
  |  Branch (270:39): [True: 83.2k, False: 982k]
  |  Branch (270:63): [True: 6.62k, False: 975k]
  ------------------
  271|  3.94M|      if(is_hex)
  ------------------
  |  Branch (271:10): [True: 89.9k, False: 3.85M]
  ------------------
  272|  89.9k|      {
  273|  89.9k|        nr = scanHexNumber(source, len, i);
  274|  89.9k|      }
  275|  3.85M|      else
  276|  3.85M|      {
  277|  3.85M|        nr = scanDecimalNumber(source, len, i);
  278|  3.85M|      }
  279|       |
  280|  3.94M|      std::string_view text(&source[start], i - start);
  281|  3.94M|      if(nr.has_error)
  ------------------
  |  Branch (281:10): [True: 327k, False: 3.61M]
  ------------------
  282|   327k|      {
  283|   327k|        tokens.push_back({ TokenType::Error, text, start });
  284|   327k|      }
  285|  3.61M|      else if(nr.is_real)
  ------------------
  |  Branch (285:15): [True: 609k, False: 3.00M]
  ------------------
  286|   609k|      {
  287|   609k|        tokens.push_back({ TokenType::Real, text, start });
  288|   609k|      }
  289|  3.00M|      else
  290|  3.00M|      {
  291|  3.00M|        tokens.push_back({ TokenType::Integer, text, start });
  292|  3.00M|      }
  293|  3.94M|      continue;
  294|  3.94M|    }
  295|       |
  296|       |    // Identifier or keyword (true/false)
  297|  40.8M|    if(isIdentStart(c))
  ------------------
  |  Branch (297:8): [True: 13.4M, False: 27.3M]
  ------------------
  298|  13.4M|    {
  299|  13.4M|      ++i;  // consume start character (may not be isIdentChar, e.g. '@')
  300|  56.9M|      while(i < len && isIdentChar(source[i]))
  ------------------
  |  Branch (300:13): [True: 56.9M, False: 3.49k]
  |  Branch (300:24): [True: 43.5M, False: 13.4M]
  ------------------
  301|  43.5M|      {
  302|  43.5M|        ++i;
  303|  43.5M|      }
  304|  13.4M|      if(std::string_view text(&source[start], i - start); text == "true" || text == "fal"
  ------------------
  |  Branch (304:60): [True: 2.93k, False: 13.4M]
  |  Branch (304:78): [True: 1.41k, False: 13.4M]
  ------------------
  305|  13.4M|                                                                                     "se")
  306|  4.34k|      {
  307|  4.34k|        tokens.push_back({ TokenType::Boolean, text, start });
  308|  4.34k|      }
  309|  13.4M|      else
  310|  13.4M|      {
  311|  13.4M|        tokens.push_back({ TokenType::Identifier, text, start });
  312|  13.4M|      }
  313|  13.4M|      continue;
  314|  13.4M|    }
  315|       |
  316|       |    // Two-character operators (check before single-char)
  317|  27.3M|    if(i + 1 < len)
  ------------------
  |  Branch (317:8): [True: 27.3M, False: 2.28k]
  ------------------
  318|  27.3M|    {
  319|  27.3M|      TokenType two_char_type = matchTwoCharOp(c, source[i + 1]);
  320|  27.3M|      if(two_char_type != TokenType::Error)
  ------------------
  |  Branch (320:10): [True: 686k, False: 26.6M]
  ------------------
  321|   686k|      {
  322|   686k|        std::string_view text(&source[start], 2);
  323|   686k|        tokens.push_back({ two_char_type, text, start });
  324|   686k|        i += 2;
  325|   686k|        continue;
  326|   686k|      }
  327|  27.3M|    }
  328|       |
  329|       |    // Single-character operators and delimiters
  330|  26.6M|    std::string_view text(&source[start], 1);
  331|  26.6M|    tokens.push_back({ matchSingleCharOp(c), text, start });
  332|  26.6M|    ++i;
  333|  26.6M|  }
  334|       |
  335|       |  // Sentinel
  336|  13.3k|  tokens.push_back({ TokenType::EndOfInput, {}, i });
  337|  13.3k|  return tokens;
  338|  13.3k|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_17isDigitEc:
   34|   126M|{
   35|   126M|  return std::isdigit(static_cast<unsigned char>(c)) != 0;
   36|   126M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_113scanHexNumberERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmRm:
   59|  89.9k|{
   60|  89.9k|  NumberResult result;
   61|  89.9k|  i += 2;  // skip "0x"/"0X"
   62|  89.9k|  if(i >= len || !isHexDigit(source[i]))
  ------------------
  |  Branch (62:6): [True: 48, False: 89.8k]
  |  Branch (62:18): [True: 72.1k, False: 17.6k]
  ------------------
   63|  72.2k|  {
   64|  72.2k|    result.has_error = true;
   65|  72.2k|  }
   66|  17.6k|  else
   67|  17.6k|  {
   68|   910k|    while(i < len && isHexDigit(source[i]))
  ------------------
  |  Branch (68:11): [True: 909k, False: 594]
  |  Branch (68:22): [True: 892k, False: 17.1k]
  ------------------
   69|   892k|    {
   70|   892k|      ++i;
   71|   892k|    }
   72|  17.6k|  }
   73|       |  // Hex numbers don't support dot or exponent
   74|  89.9k|  if(i < len && (source[i] == '.' || isIdentChar(source[i])))
  ------------------
  |  Branch (74:6): [True: 89.2k, False: 642]
  |  Branch (74:18): [True: 3.80k, False: 85.4k]
  |  Branch (74:38): [True: 39.0k, False: 46.3k]
  ------------------
   75|  42.8k|  {
   76|  42.8k|    result.has_error = true;
   77|  42.8k|    consumeTrailingGarbage(source, len, i);
   78|  42.8k|  }
   79|  89.9k|  return result;
   80|  89.9k|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_110isHexDigitEc:
   39|   999k|{
   40|   999k|  return std::isxdigit(static_cast<unsigned char>(c)) != 0;
   41|   999k|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_122consumeTrailingGarbageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmRm:
   45|  47.8k|{
   46|   360k|  while(i < len && (isIdentChar(source[i]) || source[i] == '.'))
  ------------------
  |  Branch (46:9): [True: 360k, False: 216]
  |  Branch (46:21): [True: 305k, False: 55.0k]
  |  Branch (46:47): [True: 7.49k, False: 47.5k]
  ------------------
   47|   312k|  {
   48|   312k|    ++i;
   49|   312k|  }
   50|  47.8k|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_117scanDecimalNumberERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmRm:
   83|  3.85M|{
   84|  3.85M|  NumberResult result;
   85|       |
   86|       |  // Integer part
   87|  70.4M|  while(i < len && isDigit(source[i]))
  ------------------
  |  Branch (87:9): [True: 70.4M, False: 2.69k]
  |  Branch (87:20): [True: 66.5M, False: 3.85M]
  ------------------
   88|  66.5M|  {
   89|  66.5M|    ++i;
   90|  66.5M|  }
   91|       |  // Fractional part
   92|  3.85M|  if(i < len && source[i] == '.')
  ------------------
  |  Branch (92:6): [True: 3.85M, False: 2.69k]
  |  Branch (92:17): [True: 601k, False: 3.25M]
  ------------------
   93|   601k|  {
   94|       |    // Distinguish from ".." (concat operator)
   95|   601k|    if(i + 1 < len && source[i + 1] == '.')
  ------------------
  |  Branch (95:8): [True: 601k, False: 3]
  |  Branch (95:23): [True: 6.80k, False: 594k]
  ------------------
   96|  6.80k|    {
   97|       |      // Stop here: "65.." is Integer("65") + DotDot
   98|  6.80k|    }
   99|   594k|    else if(i + 1 < len && isDigit(source[i + 1]))
  ------------------
  |  Branch (99:13): [True: 594k, False: 3]
  |  Branch (99:28): [True: 589k, False: 4.91k]
  ------------------
  100|   589k|    {
  101|   589k|      result.is_real = true;
  102|   589k|      ++i;  // consume '.'
  103|  10.8M|      while(i < len && isDigit(source[i]))
  ------------------
  |  Branch (103:13): [True: 10.8M, False: 90]
  |  Branch (103:24): [True: 10.3M, False: 589k]
  ------------------
  104|  10.3M|      {
  105|  10.3M|        ++i;
  106|  10.3M|      }
  107|   589k|    }
  108|  4.91k|    else
  109|  4.91k|    {
  110|       |      // "65." or "65.x" -- incomplete real
  111|  4.91k|      result.has_error = true;
  112|  4.91k|      ++i;  // consume the dot
  113|  4.91k|      consumeTrailingGarbage(source, len, i);
  114|  4.91k|    }
  115|   601k|  }
  116|       |  // Exponent (only for decimal numbers)
  117|  3.85M|  if(!result.has_error && i < len && (source[i] == 'e' || source[i] == 'E'))
  ------------------
  |  Branch (117:6): [True: 3.84M, False: 4.91k]
  |  Branch (117:27): [True: 3.84M, False: 2.78k]
  |  Branch (117:39): [True: 5.94k, False: 3.84M]
  |  Branch (117:59): [True: 19.5k, False: 3.82M]
  ------------------
  118|  25.4k|  {
  119|  25.4k|    result.is_real = true;
  120|  25.4k|    ++i;  // consume 'e'/'E'
  121|  25.4k|    if(i < len && (source[i] == '+' || source[i] == '-'))
  ------------------
  |  Branch (121:8): [True: 25.4k, False: 33]
  |  Branch (121:20): [True: 924, False: 24.4k]
  |  Branch (121:40): [True: 760, False: 23.7k]
  ------------------
  122|  1.68k|    {
  123|  1.68k|      ++i;  // consume sign
  124|  1.68k|    }
  125|  25.4k|    if(i >= len || !isDigit(source[i]))
  ------------------
  |  Branch (125:8): [True: 69, False: 25.3k]
  |  Branch (125:20): [True: 5.35k, False: 20.0k]
  ------------------
  126|  5.42k|    {
  127|  5.42k|      result.has_error = true;
  128|  5.42k|    }
  129|  20.0k|    else
  130|  20.0k|    {
  131|  51.9k|      while(i < len && isDigit(source[i]))
  ------------------
  |  Branch (131:13): [True: 51.7k, False: 218]
  |  Branch (131:24): [True: 31.9k, False: 19.8k]
  ------------------
  132|  31.9k|      {
  133|  31.9k|        ++i;
  134|  31.9k|      }
  135|  20.0k|    }
  136|  25.4k|  }
  137|       |  // Trailing alpha (e.g. "3foo", "65.43foo")
  138|  3.85M|  if(!result.has_error && i < len && isIdentStart(source[i]))
  ------------------
  |  Branch (138:6): [True: 3.84M, False: 10.3k]
  |  Branch (138:27): [True: 3.84M, False: 3.00k]
  |  Branch (138:38): [True: 240k, False: 3.60M]
  ------------------
  139|   240k|  {
  140|   240k|    result.has_error = true;
  141|  5.97M|    while(i < len && isIdentChar(source[i]))
  ------------------
  |  Branch (141:11): [True: 5.97M, False: 108]
  |  Branch (141:22): [True: 5.73M, False: 239k]
  ------------------
  142|  5.73M|    {
  143|  5.73M|      ++i;
  144|  5.73M|    }
  145|   240k|  }
  146|  3.85M|  return result;
  147|  3.85M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_112isIdentStartEc:
   24|  44.6M|{
   25|  44.6M|  return std::isalpha(static_cast<unsigned char>(c)) != 0 || c == '_' || c == '@';
  ------------------
  |  Branch (25:10): [True: 2.24M, False: 42.4M]
  |  Branch (25:62): [True: 14.2k, False: 42.4M]
  |  Branch (25:74): [True: 11.4M, False: 30.9M]
  ------------------
   26|  44.6M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_111isIdentCharEc:
   29|  63.3M|{
   30|  63.3M|  return std::isalnum(static_cast<unsigned char>(c)) != 0 || c == '_';
  ------------------
  |  Branch (30:10): [True: 49.2M, False: 14.1M]
  |  Branch (30:62): [True: 332k, False: 13.7M]
  ------------------
   31|  63.3M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_114matchTwoCharOpEcc:
  150|  27.3M|{
  151|  27.3M|  if(c == '.' && next == '.')
  ------------------
  |  Branch (151:6): [True: 643k, False: 26.7M]
  |  Branch (151:18): [True: 37.4k, False: 605k]
  ------------------
  152|  37.4k|    return TokenType::DotDot;
  153|  27.3M|  if(c == '&' && next == '&')
  ------------------
  |  Branch (153:6): [True: 18.8k, False: 27.3M]
  |  Branch (153:18): [True: 8.29k, False: 10.6k]
  ------------------
  154|  8.29k|    return TokenType::AmpAmp;
  155|  27.3M|  if(c == '|' && next == '|')
  ------------------
  |  Branch (155:6): [True: 20.4k, False: 27.3M]
  |  Branch (155:18): [True: 3.87k, False: 16.5k]
  ------------------
  156|  3.87k|    return TokenType::PipePipe;
  157|  27.3M|  if(c == '=' && next == '=')
  ------------------
  |  Branch (157:6): [True: 96.1k, False: 27.2M]
  |  Branch (157:18): [True: 13.2k, False: 82.9k]
  ------------------
  158|  13.2k|    return TokenType::EqualEqual;
  159|  27.3M|  if(c == '!' && next == '=')
  ------------------
  |  Branch (159:6): [True: 558k, False: 26.7M]
  |  Branch (159:18): [True: 478k, False: 80.2k]
  ------------------
  160|   478k|    return TokenType::BangEqual;
  161|  26.8M|  if(c == '<' && next == '=')
  ------------------
  |  Branch (161:6): [True: 1.40M, False: 25.4M]
  |  Branch (161:18): [True: 18.7k, False: 1.38M]
  ------------------
  162|  18.7k|    return TokenType::LessEqual;
  163|  26.8M|  if(c == '>' && next == '=')
  ------------------
  |  Branch (163:6): [True: 1.33M, False: 25.4M]
  |  Branch (163:18): [True: 36.5k, False: 1.30M]
  ------------------
  164|  36.5k|    return TokenType::GreaterEqual;
  165|  26.7M|  if(c == ':' && next == '=')
  ------------------
  |  Branch (165:6): [True: 3.22M, False: 23.5M]
  |  Branch (165:18): [True: 58.0k, False: 3.16M]
  ------------------
  166|  58.0k|    return TokenType::ColonEqual;
  167|  26.7M|  if(c == '+' && next == '=')
  ------------------
  |  Branch (167:6): [True: 57.7k, False: 26.6M]
  |  Branch (167:18): [True: 23.8k, False: 33.9k]
  ------------------
  168|  23.8k|    return TokenType::PlusEqual;
  169|  26.7M|  if(c == '-' && next == '=')
  ------------------
  |  Branch (169:6): [True: 155k, False: 26.5M]
  |  Branch (169:18): [True: 2.48k, False: 152k]
  ------------------
  170|  2.48k|    return TokenType::MinusEqual;
  171|  26.7M|  if(c == '*' && next == '=')
  ------------------
  |  Branch (171:6): [True: 14.2k, False: 26.6M]
  |  Branch (171:18): [True: 2.95k, False: 11.2k]
  ------------------
  172|  2.95k|    return TokenType::StarEqual;
  173|  26.6M|  if(c == '/' && next == '=')
  ------------------
  |  Branch (173:6): [True: 47.5k, False: 26.6M]
  |  Branch (173:18): [True: 2.29k, False: 45.2k]
  ------------------
  174|  2.29k|    return TokenType::SlashEqual;
  175|  26.6M|  return TokenType::Error;
  176|  26.6M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_117matchSingleCharOpEc:
  179|  26.6M|{
  180|  26.6M|  switch(c)
  181|  26.6M|  {
  182|  33.9k|    case '+':
  ------------------
  |  Branch (182:5): [True: 33.9k, False: 26.6M]
  ------------------
  183|  33.9k|      return TokenType::Plus;
  184|   152k|    case '-':
  ------------------
  |  Branch (184:5): [True: 152k, False: 26.5M]
  ------------------
  185|   152k|      return TokenType::Minus;
  186|  11.3k|    case '*':
  ------------------
  |  Branch (186:5): [True: 11.3k, False: 26.6M]
  ------------------
  187|  11.3k|      return TokenType::Star;
  188|  45.2k|    case '/':
  ------------------
  |  Branch (188:5): [True: 45.2k, False: 26.6M]
  ------------------
  189|  45.2k|      return TokenType::Slash;
  190|  10.6k|    case '&':
  ------------------
  |  Branch (190:5): [True: 10.6k, False: 26.6M]
  ------------------
  191|  10.6k|      return TokenType::Ampersand;
  192|  16.6k|    case '|':
  ------------------
  |  Branch (192:5): [True: 16.6k, False: 26.6M]
  ------------------
  193|  16.6k|      return TokenType::Pipe;
  194|  11.4k|    case '^':
  ------------------
  |  Branch (194:5): [True: 11.4k, False: 26.6M]
  ------------------
  195|  11.4k|      return TokenType::Caret;
  196|  66.8k|    case '~':
  ------------------
  |  Branch (196:5): [True: 66.8k, False: 26.6M]
  ------------------
  197|  66.8k|      return TokenType::Tilde;
  198|  80.3k|    case '!':
  ------------------
  |  Branch (198:5): [True: 80.3k, False: 26.6M]
  ------------------
  199|  80.3k|      return TokenType::Bang;
  200|  1.38M|    case '<':
  ------------------
  |  Branch (200:5): [True: 1.38M, False: 25.3M]
  ------------------
  201|  1.38M|      return TokenType::Less;
  202|  1.30M|    case '>':
  ------------------
  |  Branch (202:5): [True: 1.30M, False: 25.3M]
  ------------------
  203|  1.30M|      return TokenType::Greater;
  204|  82.9k|    case '=':
  ------------------
  |  Branch (204:5): [True: 82.9k, False: 26.6M]
  ------------------
  205|  82.9k|      return TokenType::Equal;
  206|  34.6k|    case '?':
  ------------------
  |  Branch (206:5): [True: 34.6k, False: 26.6M]
  ------------------
  207|  34.6k|      return TokenType::Question;
  208|  3.16M|    case ':':
  ------------------
  |  Branch (208:5): [True: 3.16M, False: 23.5M]
  ------------------
  209|  3.16M|      return TokenType::Colon;
  210|  44.5k|    case '(':
  ------------------
  |  Branch (210:5): [True: 44.5k, False: 26.6M]
  ------------------
  211|  44.5k|      return TokenType::LeftParen;
  212|  7.10k|    case ')':
  ------------------
  |  Branch (212:5): [True: 7.10k, False: 26.6M]
  ------------------
  213|  7.10k|      return TokenType::RightParen;
  214|  3.26M|    case ';':
  ------------------
  |  Branch (214:5): [True: 3.26M, False: 23.4M]
  ------------------
  215|  3.26M|      return TokenType::Semicolon;
  216|  16.9M|    default:
  ------------------
  |  Branch (216:5): [True: 16.9M, False: 9.71M]
  ------------------
  217|  16.9M|      return TokenType::Error;
  218|  26.6M|  }
  219|  26.6M|}

