LLVMFuzzerTestOneInput:
   13|  5.78k|{
   14|  5.78k|  if(size < 4)
  ------------------
  |  Branch (14:6): [True: 2, False: 5.78k]
  ------------------
   15|      2|  {
   16|      2|    return 0;
   17|      2|  }
   18|       |
   19|  5.78k|  FuzzedDataProvider fuzz_data(data, size);
   20|       |
   21|  5.78k|  try
   22|  5.78k|  {
   23|  5.78k|    BT::Ast::Environment env;
   24|  5.78k|    env.vars = BT::Blackboard::create();
   25|  5.78k|    env.enums = std::make_shared<BT::EnumsTable>();
   26|       |
   27|       |    // Add some test variables to the blackboard
   28|  5.78k|    env.vars->set("test_int", 42);
   29|  5.78k|    env.vars->set("test_double", 3.14);
   30|  5.78k|    env.vars->set("test_bool", true);
   31|  5.78k|    env.vars->set("test_string", std::string("test"));
   32|       |
   33|       |    // Add some test enums
   34|  5.78k|    (*env.enums)["RUNNING"] = 0;
   35|  5.78k|    (*env.enums)["SUCCESS"] = 1;
   36|  5.78k|    (*env.enums)["FAILURE"] = 2;
   37|       |
   38|  5.78k|    std::string script = fuzz_data.ConsumeRandomLengthString();
   39|       |
   40|  5.78k|    auto validation_result = BT::ValidateScript(script);
   41|       |
   42|  5.78k|    if(!validation_result)
  ------------------
  |  Branch (42:8): [True: 1.57k, False: 4.20k]
  ------------------
   43|  1.57k|    {
   44|  1.57k|      auto parsed_script = BT::ParseScript(script);
   45|  1.57k|      if(parsed_script)
  ------------------
  |  Branch (45:10): [True: 0, False: 1.57k]
  ------------------
   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|            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.57k|    }
   67|       |
   68|  5.78k|    BT::ParseScriptAndExecute(env, script);
   69|  5.78k|  }
   70|  5.78k|  catch(const std::exception&)  // NOLINT(bugprone-empty-catch)
   71|  5.78k|  {
   72|       |    // Intentionally empty - fuzzer expects exceptions
   73|    214|  }
   74|       |
   75|  5.78k|  return 0;
   76|  5.78k|}

_ZN2BT23GetAnyFromStringFunctorIiEESt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEEv:
  234|  5.78k|{
  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.78k|  {
  245|  5.78k|    return [](StringView str) { return Any(convertFromString<T>(str)); };
  246|  5.78k|  }
  247|  5.78k|}
_ZN2BT8PortInfoC2ENS_13PortDirectionESt10type_indexSt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEE:
  431|  17.3k|    : TypeInfo(type_info, conv), direction_(direction)
  432|  17.3k|  {}
_ZN2BT8TypeInfoC2ESt10type_indexSt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEE:
  389|  17.3k|    : type_info_(type_info), converter_(conv), type_str_(BT::demangle(type_info))
  390|  17.3k|  {}
_ZN2BT23GetAnyFromStringFunctorIdEESt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEEv:
  234|  5.78k|{
  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.78k|  {
  245|  5.78k|    return [](StringView str) { return Any(convertFromString<T>(str)); };
  246|  5.78k|  }
  247|  5.78k|}
_ZN2BT23GetAnyFromStringFunctorIbEESt8functionIFNS_3AnyESt17basic_string_viewIcSt11char_traitsIcEEEEv:
  234|  5.78k|{
  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.78k|  {
  245|  5.78k|    return [](StringView str) { return Any(convertFromString<T>(str)); };
  246|  5.78k|  }
  247|  5.78k|}
_ZN2BT8PortInfoC2ENS_13PortDirectionE:
  427|  14.8k|    : TypeInfo(), direction_(direction)
  428|  14.8k|  {}
_ZN2BT8TypeInfoC2Ev:
  385|  14.8k|  TypeInfo() : type_info_(typeid(AnyTypeAllowed)), type_str_("AnyTypeAllowed")
  386|  14.8k|  {}
_ZNK2BT8TypeInfo9converterEv:
  413|    753|  {
  414|    753|    return converter_;
  415|    753|  }

_ZN2BT10Blackboard6createESt10shared_ptrIS0_E:
   89|  5.78k|  {
   90|  5.78k|    return std::shared_ptr<Blackboard>(new Blackboard(parent));
   91|  5.78k|  }
_ZN2BT10BlackboardC2ESt10shared_ptrIS0_E:
   49|  5.78k|  Blackboard(Blackboard::Ptr parent) : parent_bb_(parent)
   50|  5.78k|  {}
_ZN2BT10BlackboardD2Ev:
   93|  5.78k|  virtual ~Blackboard() = default;
_ZN2BT10Blackboard3setIiEEvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_:
  321|  5.78k|{
  322|  5.78k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (322:6): [True: 0, False: 5.78k]
  ------------------
  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.78k|  auto entry_ptr = getEntry(key);
  333|       |  // copied under entry_mutex, notified after releasing it
  334|  5.78k|  std::shared_ptr<EntryUpdatedSignal> update_signal;
  335|  5.78k|  if(!entry_ptr)
  ------------------
  |  Branch (335:6): [True: 5.78k, False: 0]
  ------------------
  336|  5.78k|  {
  337|       |    // create a new entry
  338|  5.78k|    Any new_value(value);
  339|  5.78k|    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.78k|    {
  347|  5.78k|      PortInfo new_port(PortDirection::INOUT, new_value.type(),
  348|  5.78k|                        GetAnyFromStringFunctor<T>());
  349|  5.78k|      entry = createEntryImpl(key, new_port);
  350|  5.78k|    }
  351|       |
  352|       |    // Lock entry_mutex before writing to prevent data races with
  353|       |    // concurrent readers (BUG-1/BUG-8 fix).
  354|  5.78k|    std::scoped_lock entry_lock(entry->entry_mutex);
  355|  5.78k|    entry->value = new_value;
  356|  5.78k|    entry->sequence_id++;
  357|  5.78k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  358|  5.78k|    update_signal = entry->update_signal;
  359|  5.78k|  }
  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.78k|  if(update_signal)
  ------------------
  |  Branch (441:6): [True: 0, False: 5.78k]
  ------------------
  442|      0|  {
  443|      0|    update_signal->notify();
  444|      0|  }
  445|  5.78k|}
_ZN2BT10Blackboard3setIdEEvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_:
  321|  5.78k|{
  322|  5.78k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (322:6): [True: 0, False: 5.78k]
  ------------------
  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.78k|  auto entry_ptr = getEntry(key);
  333|       |  // copied under entry_mutex, notified after releasing it
  334|  5.78k|  std::shared_ptr<EntryUpdatedSignal> update_signal;
  335|  5.78k|  if(!entry_ptr)
  ------------------
  |  Branch (335:6): [True: 5.78k, False: 0]
  ------------------
  336|  5.78k|  {
  337|       |    // create a new entry
  338|  5.78k|    Any new_value(value);
  339|  5.78k|    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.78k|    {
  347|  5.78k|      PortInfo new_port(PortDirection::INOUT, new_value.type(),
  348|  5.78k|                        GetAnyFromStringFunctor<T>());
  349|  5.78k|      entry = createEntryImpl(key, new_port);
  350|  5.78k|    }
  351|       |
  352|       |    // Lock entry_mutex before writing to prevent data races with
  353|       |    // concurrent readers (BUG-1/BUG-8 fix).
  354|  5.78k|    std::scoped_lock entry_lock(entry->entry_mutex);
  355|  5.78k|    entry->value = new_value;
  356|  5.78k|    entry->sequence_id++;
  357|  5.78k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  358|  5.78k|    update_signal = entry->update_signal;
  359|  5.78k|  }
  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.78k|  if(update_signal)
  ------------------
  |  Branch (441:6): [True: 0, False: 5.78k]
  ------------------
  442|      0|  {
  443|      0|    update_signal->notify();
  444|      0|  }
  445|  5.78k|}
_ZN2BT10Blackboard3setIbEEvRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_:
  321|  5.78k|{
  322|  5.78k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (322:6): [True: 0, False: 5.78k]
  ------------------
  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.78k|  auto entry_ptr = getEntry(key);
  333|       |  // copied under entry_mutex, notified after releasing it
  334|  5.78k|  std::shared_ptr<EntryUpdatedSignal> update_signal;
  335|  5.78k|  if(!entry_ptr)
  ------------------
  |  Branch (335:6): [True: 5.78k, False: 0]
  ------------------
  336|  5.78k|  {
  337|       |    // create a new entry
  338|  5.78k|    Any new_value(value);
  339|  5.78k|    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.78k|    {
  347|  5.78k|      PortInfo new_port(PortDirection::INOUT, new_value.type(),
  348|  5.78k|                        GetAnyFromStringFunctor<T>());
  349|  5.78k|      entry = createEntryImpl(key, new_port);
  350|  5.78k|    }
  351|       |
  352|       |    // Lock entry_mutex before writing to prevent data races with
  353|       |    // concurrent readers (BUG-1/BUG-8 fix).
  354|  5.78k|    std::scoped_lock entry_lock(entry->entry_mutex);
  355|  5.78k|    entry->value = new_value;
  356|  5.78k|    entry->sequence_id++;
  357|  5.78k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  358|  5.78k|    update_signal = entry->update_signal;
  359|  5.78k|  }
  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.78k|  if(update_signal)
  ------------------
  |  Branch (441:6): [True: 0, False: 5.78k]
  ------------------
  442|      0|  {
  443|      0|    update_signal->notify();
  444|      0|  }
  445|  5.78k|}
_ZN2BT10Blackboard3setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvRKS7_RKT_:
  321|  5.78k|{
  322|  5.78k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (322:6): [True: 0, False: 5.78k]
  ------------------
  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.78k|  auto entry_ptr = getEntry(key);
  333|       |  // copied under entry_mutex, notified after releasing it
  334|  5.78k|  std::shared_ptr<EntryUpdatedSignal> update_signal;
  335|  5.78k|  if(!entry_ptr)
  ------------------
  |  Branch (335:6): [True: 5.78k, False: 0]
  ------------------
  336|  5.78k|  {
  337|       |    // create a new entry
  338|  5.78k|    Any new_value(value);
  339|  5.78k|    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.78k|    {
  343|  5.78k|      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.78k|    std::scoped_lock entry_lock(entry->entry_mutex);
  355|  5.78k|    entry->value = new_value;
  356|  5.78k|    entry->sequence_id++;
  357|  5.78k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  358|  5.78k|    update_signal = entry->update_signal;
  359|  5.78k|  }
  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.78k|  if(update_signal)
  ------------------
  |  Branch (441:6): [True: 0, False: 5.78k]
  ------------------
  442|      0|  {
  443|      0|    update_signal->notify();
  444|      0|  }
  445|  5.78k|}
_ZN2BT10Blackboard5EntryC2ERKNS_8TypeInfoE:
   75|  32.1k|    Entry(const TypeInfo& _info) : info(_info)
   76|  32.1k|    {}
_ZN2BT10Blackboard5EntryD2Ev:
   78|  32.1k|    ~Entry() = default;

_ZNK4linb3any4typeEv:
  176|  1.54M|    {
  177|  1.54M|        return empty()? typeid(void) : this->vtable->type();
  ------------------
  |  Branch (177:16): [True: 4, False: 1.54M]
  ------------------
  178|  1.54M|    }
_ZNK4linb3any5emptyEv:
  169|  15.6M|    {
  170|  15.6M|        return this->vtable == nullptr;
  171|  15.6M|    }
_ZN4linb3anyC2Ev:
   72|  96.7k|        vtable(nullptr)
   73|  96.7k|    {
   74|  96.7k|    }
_ZN4linb3anyD2Ev:
  100|  7.81M|    {
  101|  7.81M|        this->clear();
  102|  7.81M|    }
_ZN4linb3any5clearEv:
  159|  7.81M|    {
  160|  7.81M|        if(!empty())
  ------------------
  |  Branch (160:12): [True: 5.87M, False: 1.93M]
  ------------------
  161|  5.87M|        {
  162|  5.87M|            this->vtable->destroy(storage);
  163|  5.87M|            this->vtable = nullptr;
  164|  5.87M|        }
  165|  7.81M|    }
_ZN4linb8any_castIdEET_RKNS_3anyE:
  468|  38.9k|{
  469|  38.9k|    auto p = any_cast<typename std::add_const<typename std::remove_reference<ValueType>::type>::type>(&operand);
  470|  38.9k|#ifndef ANY_IMPL_NO_EXCEPTIONS
  471|  38.9k|    if(p == nullptr) throw bad_any_cast();
  ------------------
  |  Branch (471:8): [True: 0, False: 38.9k]
  ------------------
  472|  38.9k|#endif
  473|  38.9k|    return *p;
  474|  38.9k|}
_ZN4linb8any_castIKdEEPKT_PKNS_3anyE:
  510|  38.9k|{
  511|  38.9k|    using T = typename std::decay<ValueType>::type;
  512|       |
  513|  38.9k|#ifndef ANY_IMPL_NO_RTTI
  514|  38.9k|    if (operand && operand->is_typed(typeid(T)))
  ------------------
  |  Branch (514:9): [True: 38.9k, False: 0]
  |  Branch (514:20): [True: 38.9k, False: 0]
  ------------------
  515|       |#else
  516|       |    if (operand && operand->vtable == any::vtable_for_type<T>())
  517|       |#endif
  518|  38.9k|        return operand->cast<ValueType>();
  519|      0|    else
  520|      0|        return nullptr;
  521|  38.9k|}
_ZNK4linb3any8is_typedERKSt9type_info:
  355|   281k|    {
  356|   281k|        return is_same(this->type(), t);
  357|   281k|    }
_ZN4linb3any7is_sameERKSt9type_infoS3_:
  368|   281k|    {
  369|       |#ifdef ANY_IMPL_FAST_TYPE_INFO_COMPARE
  370|       |        return &a == &b;
  371|       |#else
  372|   281k|        return a == b;
  373|   281k|#endif
  374|   281k|    }
_ZNK4linb3any4castIKdEEPKT_v:
  380|  38.9k|    {
  381|  38.9k|        return requires_allocation<typename std::decay<T>::type>::value?
  ------------------
  |  Branch (381:16): [Folded, False: 38.9k]
  ------------------
  382|      0|            reinterpret_cast<const T*>(storage.dynamic) :
  383|  38.9k|            reinterpret_cast<const T*>(&storage.stack);
  384|  38.9k|    }
_ZN4linb8any_castIN7SafeAny12SimpleStringEEET_RKNS_3anyE:
  468|  82.8k|{
  469|  82.8k|    auto p = any_cast<typename std::add_const<typename std::remove_reference<ValueType>::type>::type>(&operand);
  470|  82.8k|#ifndef ANY_IMPL_NO_EXCEPTIONS
  471|  82.8k|    if(p == nullptr) throw bad_any_cast();
  ------------------
  |  Branch (471:8): [True: 0, False: 82.8k]
  ------------------
  472|  82.8k|#endif
  473|  82.8k|    return *p;
  474|  82.8k|}
_ZN4linb8any_castIKN7SafeAny12SimpleStringEEEPKT_PKNS_3anyE:
  510|  82.8k|{
  511|  82.8k|    using T = typename std::decay<ValueType>::type;
  512|       |
  513|  82.8k|#ifndef ANY_IMPL_NO_RTTI
  514|  82.8k|    if (operand && operand->is_typed(typeid(T)))
  ------------------
  |  Branch (514:9): [True: 82.8k, False: 0]
  |  Branch (514:20): [True: 82.8k, False: 0]
  ------------------
  515|       |#else
  516|       |    if (operand && operand->vtable == any::vtable_for_type<T>())
  517|       |#endif
  518|  82.8k|        return operand->cast<ValueType>();
  519|      0|    else
  520|      0|        return nullptr;
  521|  82.8k|}
_ZNK4linb3any4castIKN7SafeAny12SimpleStringEEEPKT_v:
  380|  82.8k|    {
  381|  82.8k|        return requires_allocation<typename std::decay<T>::type>::value?
  ------------------
  |  Branch (381:16): [Folded, False: 82.8k]
  ------------------
  382|      0|            reinterpret_cast<const T*>(storage.dynamic) :
  383|  82.8k|            reinterpret_cast<const T*>(&storage.stack);
  384|  82.8k|    }
_ZN4linb3anyC2IRKdvEEOT_:
  110|   142k|    {
  111|   142k|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  112|   142k|            "T shall satisfy the CopyConstructible requirements.");
  113|   142k|        this->construct(std::forward<ValueType>(value));
  114|   142k|    }
_ZN4linb3any9constructIRKdEEvOT_:
  439|   142k|    {
  440|   142k|        using T = typename std::decay<ValueType>::type;
  441|       |
  442|   142k|        this->vtable = vtable_for_type<T>();
  443|       |
  444|   142k|        do_construct<ValueType,T>(std::forward<ValueType>(value));
  445|   142k|    }
_ZN4linb3any15vtable_for_typeIdEEPNS0_11vtable_typeEv:
  333|   142k|    {
  334|   142k|        using VTableType = typename std::conditional<requires_allocation<T>::value, vtable_dynamic<T>, vtable_stack<T>>::type;
  335|   142k|        static vtable_type table = {
  336|   142k|#ifndef ANY_IMPL_NO_RTTI
  337|   142k|            VTableType::type,
  338|   142k|#endif
  339|   142k|            VTableType::destroy,
  340|   142k|            VTableType::copy, VTableType::move,
  341|   142k|            VTableType::swap,
  342|   142k|        };
  343|   142k|        return &table;
  344|   142k|    }
_ZN4linb3any12vtable_stackIdE4typeEv:
  289|   180k|        {
  290|   180k|            return typeid(T);
  291|   180k|        }
_ZN4linb3any12vtable_stackIdE7destroyERNS0_13storage_unionE:
  295|   196k|        {
  296|   196k|            reinterpret_cast<T*>(&storage.stack)->~T();
  297|   196k|        }
_ZN4linb3any12vtable_stackIdE4copyERKNS0_13storage_unionERS3_:
  300|  24.0k|        {
  301|  24.0k|            new (&dest.stack) T(reinterpret_cast<const T&>(src.stack));
  302|  24.0k|        }
_ZN4linb3any12vtable_stackIdE4moveERNS0_13storage_unionES4_:
  305|  29.9k|        {
  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|  29.9k|            new (&dest.stack) T(std::move(reinterpret_cast<T&>(src.stack)));
  309|  29.9k|            destroy(src);
  310|  29.9k|        }
_ZN4linb3any12vtable_stackIdE4swapERNS0_13storage_unionES4_:
  313|  3.60k|        {
  314|  3.60k|            storage_union tmp_storage;
  315|  3.60k|            move(rhs, tmp_storage);
  316|  3.60k|            move(lhs, rhs);
  317|  3.60k|            move(tmp_storage, lhs);
  318|  3.60k|        }
_ZN4linb3any12do_constructIRKddEENSt9enable_ifIXntsr19requires_allocationIT0_EE5valueEvE4typeEOT_:
  431|   142k|    {
  432|   142k|        new (&storage.stack) T(std::forward<ValueType>(value));
  433|   142k|    }
_ZN4linb8any_castIlEET_RKNS_3anyE:
  468|   160k|{
  469|   160k|    auto p = any_cast<typename std::add_const<typename std::remove_reference<ValueType>::type>::type>(&operand);
  470|   160k|#ifndef ANY_IMPL_NO_EXCEPTIONS
  471|   160k|    if(p == nullptr) throw bad_any_cast();
  ------------------
  |  Branch (471:8): [True: 0, False: 160k]
  ------------------
  472|   160k|#endif
  473|   160k|    return *p;
  474|   160k|}
_ZN4linb8any_castIKlEEPKT_PKNS_3anyE:
  510|   160k|{
  511|   160k|    using T = typename std::decay<ValueType>::type;
  512|       |
  513|   160k|#ifndef ANY_IMPL_NO_RTTI
  514|   160k|    if (operand && operand->is_typed(typeid(T)))
  ------------------
  |  Branch (514:9): [True: 160k, False: 0]
  |  Branch (514:20): [True: 160k, False: 0]
  ------------------
  515|       |#else
  516|       |    if (operand && operand->vtable == any::vtable_for_type<T>())
  517|       |#endif
  518|   160k|        return operand->cast<ValueType>();
  519|      0|    else
  520|      0|        return nullptr;
  521|   160k|}
_ZNK4linb3any4castIKlEEPKT_v:
  380|   160k|    {
  381|   160k|        return requires_allocation<typename std::decay<T>::type>::value?
  ------------------
  |  Branch (381:16): [Folded, False: 160k]
  ------------------
  382|      0|            reinterpret_cast<const T*>(storage.dynamic) :
  383|   160k|            reinterpret_cast<const T*>(&storage.stack);
  384|   160k|    }
_ZN4linb3anyC2IlvEEOT_:
  110|  1.69M|    {
  111|  1.69M|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  112|  1.69M|            "T shall satisfy the CopyConstructible requirements.");
  113|  1.69M|        this->construct(std::forward<ValueType>(value));
  114|  1.69M|    }
_ZN4linb3any9constructIlEEvOT_:
  439|  1.69M|    {
  440|  1.69M|        using T = typename std::decay<ValueType>::type;
  441|       |
  442|  1.69M|        this->vtable = vtable_for_type<T>();
  443|       |
  444|  1.69M|        do_construct<ValueType,T>(std::forward<ValueType>(value));
  445|  1.69M|    }
_ZN4linb3any15vtable_for_typeIlEEPNS0_11vtable_typeEv:
  333|  1.69M|    {
  334|  1.69M|        using VTableType = typename std::conditional<requires_allocation<T>::value, vtable_dynamic<T>, vtable_stack<T>>::type;
  335|  1.69M|        static vtable_type table = {
  336|  1.69M|#ifndef ANY_IMPL_NO_RTTI
  337|  1.69M|            VTableType::type,
  338|  1.69M|#endif
  339|  1.69M|            VTableType::destroy,
  340|  1.69M|            VTableType::copy, VTableType::move,
  341|  1.69M|            VTableType::swap,
  342|  1.69M|        };
  343|  1.69M|        return &table;
  344|  1.69M|    }
_ZN4linb3any12vtable_stackIlE4typeEv:
  289|   831k|        {
  290|   831k|            return typeid(T);
  291|   831k|        }
_ZN4linb3any12vtable_stackIlE7destroyERNS0_13storage_unionE:
  295|  5.45M|        {
  296|  5.45M|            reinterpret_cast<T*>(&storage.stack)->~T();
  297|  5.45M|        }
_ZN4linb3any12vtable_stackIlE4copyERKNS0_13storage_unionERS3_:
  300|  1.85M|        {
  301|  1.85M|            new (&dest.stack) T(reinterpret_cast<const T&>(src.stack));
  302|  1.85M|        }
_ZN4linb3any12vtable_stackIlE4moveERNS0_13storage_unionES4_:
  305|  1.90M|        {
  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|  1.90M|            new (&dest.stack) T(std::move(reinterpret_cast<T&>(src.stack)));
  309|  1.90M|            destroy(src);
  310|  1.90M|        }
_ZN4linb3any12vtable_stackIlE4swapERNS0_13storage_unionES4_:
  313|  62.8k|        {
  314|  62.8k|            storage_union tmp_storage;
  315|  62.8k|            move(rhs, tmp_storage);
  316|  62.8k|            move(lhs, rhs);
  317|  62.8k|            move(tmp_storage, lhs);
  318|  62.8k|        }
_ZN4linb3any12do_constructIllEENSt9enable_ifIXntsr19requires_allocationIT0_EE5valueEvE4typeEOT_:
  431|  1.69M|    {
  432|  1.69M|        new (&storage.stack) T(std::forward<ValueType>(value));
  433|  1.69M|    }
_ZN4linb3anyaSERKS0_:
  129|   119k|    {
  130|   119k|        any(rhs).swap(*this);
  131|   119k|        return *this;
  132|   119k|    }
_ZN4linb3anyC2ERKS0_:
   78|  3.92M|        vtable(rhs.vtable)
   79|  3.92M|    {
   80|  3.92M|        if(!rhs.empty())
  ------------------
  |  Branch (80:12): [True: 3.92M, False: 216]
  ------------------
   81|  3.92M|        {
   82|  3.92M|            rhs.vtable->copy(rhs.storage, this->storage);
   83|  3.92M|        }
   84|  3.92M|    }
_ZN4linb3any4swapERS0_:
  183|   164k|    {
  184|   164k|        if(this->vtable != rhs.vtable)
  ------------------
  |  Branch (184:12): [True: 46.9k, False: 117k]
  ------------------
  185|  46.9k|        {
  186|  46.9k|            any tmp(std::move(rhs));
  187|       |
  188|       |            // move from *this to rhs.
  189|  46.9k|            rhs.vtable = this->vtable;
  190|  46.9k|            if(this->vtable != nullptr)
  ------------------
  |  Branch (190:16): [True: 46.9k, False: 0]
  ------------------
  191|  46.9k|            {
  192|  46.9k|                this->vtable->move(this->storage, rhs.storage);
  193|       |                //this->vtable = nullptr; -- unneeded, see below
  194|  46.9k|            }
  195|       |
  196|       |            // move from tmp (previously rhs) to *this.
  197|  46.9k|            this->vtable = tmp.vtable;
  198|  46.9k|            if(tmp.vtable != nullptr)
  ------------------
  |  Branch (198:16): [True: 16.2k, False: 30.6k]
  ------------------
  199|  16.2k|            {
  200|  16.2k|                tmp.vtable->move(tmp.storage, this->storage);
  201|  16.2k|                tmp.vtable = nullptr;
  202|  16.2k|            }
  203|  46.9k|        }
  204|   117k|        else // same types
  205|   117k|        {
  206|   117k|            if(this->vtable != nullptr)
  ------------------
  |  Branch (206:16): [True: 84.9k, False: 32.1k]
  ------------------
  207|  84.9k|                this->vtable->swap(this->storage, rhs.storage);
  208|   117k|        }
  209|   164k|    }
_ZN4linb3anyC2EOS0_:
   89|  1.83M|        vtable(rhs.vtable)
   90|  1.83M|    {
   91|  1.83M|        if(!rhs.empty())
  ------------------
  |  Branch (91:12): [True: 1.80M, False: 30.6k]
  ------------------
   92|  1.80M|        {
   93|  1.80M|            rhs.vtable->move(rhs.storage, this->storage);
   94|  1.80M|            rhs.vtable = nullptr;
   95|  1.80M|        }
   96|  1.83M|    }
_ZN4linb3anyaSEOS0_:
  139|  43.4k|    {
  140|  43.4k|        std::move(rhs).swap(*this);
  141|  43.4k|        return *this;
  142|  43.4k|    }
_ZN4linb3anyaSIlvEERS0_OT_:
  150|  1.28k|    {
  151|  1.28k|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  152|  1.28k|            "T shall satisfy the CopyConstructible requirements.");
  153|  1.28k|        any(std::forward<ValueType>(value)).swap(*this);
  154|  1.28k|        return *this;
  155|  1.28k|    }
_ZN4linb3anyaSIdvEERS0_OT_:
  150|    260|    {
  151|    260|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  152|    260|            "T shall satisfy the CopyConstructible requirements.");
  153|    260|        any(std::forward<ValueType>(value)).swap(*this);
  154|    260|        return *this;
  155|    260|    }
_ZN4linb3anyC2IdvEEOT_:
  110|    260|    {
  111|    260|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  112|    260|            "T shall satisfy the CopyConstructible requirements.");
  113|    260|        this->construct(std::forward<ValueType>(value));
  114|    260|    }
_ZN4linb3any9constructIdEEvOT_:
  439|    260|    {
  440|    260|        using T = typename std::decay<ValueType>::type;
  441|       |
  442|    260|        this->vtable = vtable_for_type<T>();
  443|       |
  444|    260|        do_construct<ValueType,T>(std::forward<ValueType>(value));
  445|    260|    }
_ZN4linb3any12do_constructIddEENSt9enable_ifIXntsr19requires_allocationIT0_EE5valueEvE4typeEOT_:
  431|    260|    {
  432|    260|        new (&storage.stack) T(std::forward<ValueType>(value));
  433|    260|    }
_ZN4linb3anyC2IN7SafeAny12SimpleStringEvEEOT_:
  110|   123k|    {
  111|   123k|        static_assert(std::is_copy_constructible<typename std::decay<ValueType>::type>::value,
  112|   123k|            "T shall satisfy the CopyConstructible requirements.");
  113|   123k|        this->construct(std::forward<ValueType>(value));
  114|   123k|    }
_ZN4linb3any9constructIN7SafeAny12SimpleStringEEEvOT_:
  439|   123k|    {
  440|   123k|        using T = typename std::decay<ValueType>::type;
  441|       |
  442|   123k|        this->vtable = vtable_for_type<T>();
  443|       |
  444|   123k|        do_construct<ValueType,T>(std::forward<ValueType>(value));
  445|   123k|    }
_ZN4linb3any15vtable_for_typeIN7SafeAny12SimpleStringEEEPNS0_11vtable_typeEv:
  333|   123k|    {
  334|   123k|        using VTableType = typename std::conditional<requires_allocation<T>::value, vtable_dynamic<T>, vtable_stack<T>>::type;
  335|   123k|        static vtable_type table = {
  336|   123k|#ifndef ANY_IMPL_NO_RTTI
  337|   123k|            VTableType::type,
  338|   123k|#endif
  339|   123k|            VTableType::destroy,
  340|   123k|            VTableType::copy, VTableType::move,
  341|   123k|            VTableType::swap,
  342|   123k|        };
  343|   123k|        return &table;
  344|   123k|    }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE4typeEv:
  289|   532k|        {
  290|   532k|            return typeid(T);
  291|   532k|        }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE7destroyERNS0_13storage_unionE:
  295|  2.35M|        {
  296|  2.35M|            reinterpret_cast<T*>(&storage.stack)->~T();
  297|  2.35M|        }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE4copyERKNS0_13storage_unionERS5_:
  300|  2.04M|        {
  301|  2.04M|            new (&dest.stack) T(reinterpret_cast<const T&>(src.stack));
  302|  2.04M|        }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE4moveERNS0_13storage_unionES6_:
  305|   193k|        {
  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|   193k|            new (&dest.stack) T(std::move(reinterpret_cast<T&>(src.stack)));
  309|   193k|            destroy(src);
  310|   193k|        }
_ZN4linb3any12vtable_stackIN7SafeAny12SimpleStringEE4swapERNS0_13storage_unionES6_:
  313|  18.5k|        {
  314|  18.5k|            storage_union tmp_storage;
  315|  18.5k|            move(rhs, tmp_storage);
  316|  18.5k|            move(lhs, rhs);
  317|  18.5k|            move(tmp_storage, lhs);
  318|  18.5k|        }
_ZN4linb3any12do_constructIN7SafeAny12SimpleStringES3_EENSt9enable_ifIXntsr19requires_allocationIT0_EE5valueEvE4typeEOT_:
  431|   123k|    {
  432|   123k|        new (&storage.stack) T(std::forward<ValueType>(value));
  433|   123k|    }

_ZNK6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  5.78k|    {
 2205|  5.78k|        return has_value();
 2206|  5.78k|    }
_ZNK6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  11.5k|    {
 2210|  11.5k|        return contained.has_value();
 2211|  11.5k|    }
_ZNK6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  11.5k|    {
  788|  11.5k|        return m_has_value;
  789|  11.5k|    }
_ZNK6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  7.36k|    {
 2205|  7.36k|        return has_value();
 2206|  7.36k|    }
_ZNK6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  18.9k|    {
 2210|  18.9k|        return contained.has_value();
 2211|  18.9k|    }
_ZNK6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  18.9k|    {
  788|  18.9k|        return m_has_value;
  789|  18.9k|    }
_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|   340k|    : contained( true )
 1941|   340k|    {
 1942|   340k|        contained.construct_value( std::forward<U>( value ) );
 1943|   340k|    }
_ZN6nonstd13expected_lite6detail9storage_tIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|   357k|        : storage_t_impl<T, E>( has_value )
  923|   357k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|   357k|        : m_has_value( has_value )
  675|   357k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOd:
  688|   340k|    {
  689|   340k|        new( &m_value ) value_type( std::move( e ) );
  690|   340k|    }
_ZN6nonstd13expected_lite15make_unexpectedIRA39_KcEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOS7_:
 1567|    154|{
 1568|    154|    return unexpected_type< typename std::decay<E>::type >( std::forward<E>(value) );
 1569|    154|}
_ZN6nonstd13expected_lite15unexpected_typeIPKcEC2IRA39_S2_TnNSt9enable_ifIXaaaasr3std16is_constructibleIS3_T_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefIS9_E4typeESt10in_place_tEE5valuentsr3std7is_sameISD_S4_EE5valueEiE4typeELi0EEEOS9_:
 1238|    154|    : m_error( std::forward<E2>( error ) )
 1239|    154|    {}
_ZN6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS7_OT_EE5valuesr3std14is_convertibleISE_S7_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISD_EE:
 1990|    154|    : contained( false )
 1991|    154|    {
 1992|    154|        contained.construct_error( std::move( error.error() ) );
 1993|    154|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_errorEOS8_:
  715|    308|    {
  716|    308|        new( &m_error ) error_type( std::move( e ) );
  717|    308|    }
_ZNR6nonstd13expected_lite15unexpected_typeIPKcE5errorEv:
 1335|  6.05k|    {
 1336|  6.05k|        return m_error;
 1337|  6.05k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|   357k|    ~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|  16.0k|    : contained( true )
 1941|  16.0k|    {
 1942|  16.0k|        contained.construct_value( std::forward<U>( value ) );
 1943|  16.0k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueERKd:
  683|  16.0k|    {
  684|  16.0k|        new( &m_value ) value_type( e );
  685|  16.0k|    }
_ZN6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2EOS8_:
 1806|    154|    nsel_constexpr14 expected( expected &&      ) = default;
_ZN6nonstd13expected_lite6detail9storage_tIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2EOS9_:
  933|    154|        : storage_t_impl<T, E>( other.has_value() )
  934|    154|    {
  935|    154|        if ( this->has_value() ) this->construct_value( std::move( other.value() ) );
  ------------------
  |  Branch (935:14): [True: 0, False: 154]
  ------------------
  936|    154|        else                     this->construct_error( std::move( other.error() ) );
  937|    154|    }
_ZNK6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  1.07M|    {
  788|  1.07M|        return m_has_value;
  789|  1.07M|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|   356k|    {
  743|   356k|        return m_value;
  744|   356k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
  772|    308|    {
  773|    308|        return m_error;
  774|    308|    }
_ZNR6nonstd13expected_lite15unexpected_typeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
 1335|  1.57k|    {
 1336|  1.57k|        return m_error;
 1337|  1.57k|    }
_ZNK6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|   357k|    {
 2205|   357k|        return has_value();
 2206|   357k|    }
_ZNK6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  1.07M|    {
 2210|  1.07M|        return contained.has_value();
 2211|  1.07M|    }
_ZNR6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|   356k|    {
 2224|   356k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 356k, False: 0]
  ------------------
 2225|   356k|            ? ( contained.value() )
 2226|   356k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|   356k|    }
_ZNR6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
 2254|    154|    {
 2255|       |        return assert( ! has_value() ), contained.error();
 2256|    154|    }
_ZN6nonstd13expected_lite8expectedIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|   357k|    {
 2051|   357k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 356k, False: 308]
  ------------------
 2052|    308|        else               contained.destruct_error();
 2053|   357k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|   356k|    {
  706|   356k|        m_value.~value_type();
  707|   356k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIdNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_errorEv:
  732|    308|    {
  733|    308|        m_error.~error_type();
  734|    308|    }
_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.96k|    : contained( true )
 1941|  8.96k|    {
 1942|  8.96k|        contained.construct_value( std::forward<U>( value ) );
 1943|  8.96k|    }
_ZN6nonstd13expected_lite6detail9storage_tIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  8.96k|        : storage_t_impl<T, E>( has_value )
  923|  8.96k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  8.96k|        : m_has_value( has_value )
  675|  8.96k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOl:
  688|  8.96k|    {
  689|  8.96k|        new( &m_value ) value_type( std::move( e ) );
  690|  8.96k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  8.96k|    ~storage_t_impl() {}
_ZNK6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  26.8k|    {
  788|  26.8k|        return m_has_value;
  789|  26.8k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|  8.96k|    {
  743|  8.96k|        return m_value;
  744|  8.96k|    }
_ZNK6nonstd13expected_lite8expectedIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  8.96k|    {
 2205|  8.96k|        return has_value();
 2206|  8.96k|    }
_ZNK6nonstd13expected_lite8expectedIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  26.8k|    {
 2210|  26.8k|        return contained.has_value();
 2211|  26.8k|    }
_ZNR6nonstd13expected_lite8expectedIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|  8.96k|    {
 2224|  8.96k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 8.96k, False: 0]
  ------------------
 2225|  8.96k|            ? ( contained.value() )
 2226|  8.96k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|  8.96k|    }
_ZN6nonstd13expected_lite8expectedIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  8.96k|    {
 2051|  8.96k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 8.96k, False: 0]
  ------------------
 2052|      0|        else               contained.destruct_error();
 2053|  8.96k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIlNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  8.96k|    {
  706|  8.96k|        m_value.~value_type();
  707|  8.96k|    }
_ZN6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  5.78k|    {
 2051|  5.78k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 4.20k, False: 1.57k]
  ------------------
 2052|  1.57k|        else               contained.destruct_error();
 2053|  5.78k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  4.20k|    {
  706|  4.20k|        m_value.~value_type();
  707|  4.20k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_errorEv:
  732|  1.57k|    {
  733|  1.57k|        m_error.~error_type();
  734|  1.57k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  5.78k|    ~storage_t_impl() {}
_ZN6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  7.36k|    {
 2051|  7.36k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 4.20k, False: 3.15k]
  ------------------
 2052|  3.15k|        else               contained.destruct_error();
 2053|  7.36k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  4.20k|    {
  706|  4.20k|        m_value.~value_type();
  707|  4.20k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_errorEv:
  732|  3.15k|    {
  733|  3.15k|        m_error.~error_type();
  734|  3.15k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  7.36k|    ~storage_t_impl() {}
_ZNR6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|  4.20k|    {
 2224|  4.20k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 4.20k, False: 0]
  ------------------
 2225|  4.20k|            ? ( contained.value() )
 2226|  4.20k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|  4.20k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|  4.20k|    {
  743|  4.20k|        return m_value;
  744|  4.20k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
  772|  1.57k|    {
  773|  1.57k|        return m_error;
  774|  1.57k|    }
_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.82k|    : contained( true )
 1941|  2.82k|    {
 1942|  2.82k|        contained.construct_value( std::forward<U>( value ) );
 1943|  2.82k|    }
_ZN6nonstd13expected_lite6detail9storage_tIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  5.56k|        : storage_t_impl<T, E>( has_value )
  923|  5.56k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  5.56k|        : m_has_value( has_value )
  675|  5.56k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOS4_:
  688|  2.82k|    {
  689|  2.82k|        new( &m_value ) value_type( std::move( e ) );
  690|  2.82k|    }
_ZN6nonstd13expected_lite8expectedIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS9_TnNSt9enable_ifIXaasr3std16is_constructibleIS9_OT_EE5valuesr3std14is_convertibleISE_S9_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISD_EE:
 1990|  1.57k|    : contained( false )
 1991|  1.57k|    {
 1992|  1.57k|        contained.construct_error( std::move( error.error() ) );
 1993|  1.57k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_errorEOSA_:
  715|  2.74k|    {
  716|  2.74k|        new( &m_error ) error_type( std::move( e ) );
  717|  2.74k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  5.56k|    ~storage_t_impl() {}
_ZNK6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  5.56k|    {
  788|  5.56k|        return m_has_value;
  789|  5.56k|    }
_ZNK6nonstd13expected_lite8expectedIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  5.56k|    {
 2210|  5.56k|        return contained.has_value();
 2211|  5.56k|    }
_ZN6nonstd13expected_lite15make_unexpectedIRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOSB_:
 1567|  1.57k|{
 1568|  1.57k|    return unexpected_type< typename std::decay<E>::type >( std::forward<E>(value) );
 1569|  1.57k|}
_ZN6nonstd13expected_lite15unexpected_typeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IRS7_TnNSt9enable_ifIXaaaasr3std16is_constructibleIS7_T_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISC_E4typeESt10in_place_tEE5valuentsr3std7is_sameISG_S8_EE5valueEiE4typeELi0EEEOSC_:
 1238|  1.57k|    : m_error( std::forward<E2>( error ) )
 1239|  1.57k|    {}
_ZN6nonstd13expected_lite8expectedIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  5.56k|    {
 2051|  5.56k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 2.82k, False: 2.74k]
  ------------------
 2052|  2.74k|        else               contained.destruct_error();
 2053|  5.56k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  2.82k|    {
  706|  2.82k|        m_value.~value_type();
  707|  2.82k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_errorEv:
  732|  2.74k|    {
  733|  2.74k|        m_error.~error_type();
  734|  2.74k|    }
_ZNK6nonstd13expected_lite8expectedINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_E9has_valueEv:
 2209|   316k|    {
 2210|   316k|        return contained.has_value();
 2211|   316k|    }
_ZNK6nonstd13expected_lite8expectedINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_EcvbEv:
 2204|   105k|    {
 2205|   105k|        return has_value();
 2206|   105k|    }
_ZNK6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_E9has_valueEv:
  787|   316k|    {
  788|   316k|        return m_has_value;
  789|   316k|    }
_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|   105k|    : contained( true )
 1941|   105k|    {
 1942|   105k|        contained.construct_value( std::forward<U>( value ) );
 1943|   105k|    }
_ZN6nonstd13expected_lite6detail9storage_tINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_Lb1ELb1EEC2Eb:
  922|   105k|        : storage_t_impl<T, E>( has_value )
  923|   105k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_EC2Eb:
  674|   105k|        : m_has_value( has_value )
  675|   105k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_E15construct_valueEOS8_:
  688|   105k|    {
  689|   105k|        new( &m_value ) value_type( std::move( e ) );
  690|   105k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_ED2Ev:
  671|   105k|    ~storage_t_impl() {}
_ZN6nonstd13expected_lite15make_unexpectedIPKcEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOS6_:
 1567|  5.80k|{
 1568|  5.80k|    return unexpected_type< typename std::decay<E>::type >( std::forward<E>(value) );
 1569|  5.80k|}
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEv:
  678|  4.20k|    {
  679|  4.20k|        new( &m_value ) value_type();
  680|  4.20k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_errorEOS9_:
  715|  1.57k|    {
  716|  1.57k|        new( &m_error ) error_type( std::move( e ) );
  717|  1.57k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_E5valueEv:
  742|   105k|    {
  743|   105k|        return m_value;
  744|   105k|    }
_ZNR6nonstd13expected_lite8expectedINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_E5valueEv:
 2223|   105k|    {
 2224|   105k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 105k, False: 0]
  ------------------
 2225|   105k|            ? ( contained.value() )
 2226|   105k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|   105k|    }
_ZN6nonstd13expected_lite8expectedINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_ED2Ev:
 2050|   105k|    {
 2051|   105k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 105k, False: 0]
  ------------------
 2052|      0|        else               contained.destruct_error();
 2053|   105k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_E14destruct_valueEv:
  705|   105k|    {
  706|   105k|        m_value.~value_type();
  707|   105k|    }
_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|  17.7k|    : contained( true )
 1941|  17.7k|    {
 1942|  17.7k|        contained.construct_value( std::forward<U>( value ) );
 1943|  17.7k|    }
_ZN6nonstd13expected_lite6detail9storage_tIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  17.7k|        : storage_t_impl<T, E>( has_value )
  923|  17.7k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  17.7k|        : m_has_value( has_value )
  675|  17.7k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOS4_:
  688|  17.7k|    {
  689|  17.7k|        new( &m_value ) value_type( std::move( e ) );
  690|  17.7k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  17.7k|    ~storage_t_impl() {}
_ZNK6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  53.3k|    {
  788|  53.3k|        return m_has_value;
  789|  53.3k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|  17.7k|    {
  743|  17.7k|        return m_value;
  744|  17.7k|    }
_ZNK6nonstd13expected_lite8expectedIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  17.7k|    {
 2205|  17.7k|        return has_value();
 2206|  17.7k|    }
_ZNK6nonstd13expected_lite8expectedIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  53.3k|    {
 2210|  53.3k|        return contained.has_value();
 2211|  53.3k|    }
_ZNR6nonstd13expected_lite8expectedIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|  17.7k|    {
 2224|  17.7k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 17.7k, False: 0]
  ------------------
 2225|  17.7k|            ? ( contained.value() )
 2226|  17.7k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|  17.7k|    }
_ZN6nonstd13expected_lite8expectedIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  17.7k|    {
 2051|  17.7k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 17.7k, False: 0]
  ------------------
 2052|      0|        else               contained.destruct_error();
 2053|  17.7k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIN7SafeAny12SimpleStringENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  17.7k|    {
  706|  17.7k|        m_value.~value_type();
  707|  17.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.58k|    : contained( true )
 1941|  4.58k|    {
 1942|  4.58k|        contained.construct_value( std::forward<U>( value ) );
 1943|  4.58k|    }
_ZN6nonstd13expected_lite6detail9storage_tIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  4.58k|        : storage_t_impl<T, E>( has_value )
  923|  4.58k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  4.58k|        : m_has_value( has_value )
  675|  4.58k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOb:
  688|  4.58k|    {
  689|  4.58k|        new( &m_value ) value_type( std::move( e ) );
  690|  4.58k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
  671|  4.58k|    ~storage_t_impl() {}
_ZNK6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
  787|  13.7k|    {
  788|  13.7k|        return m_has_value;
  789|  13.7k|    }
_ZNR6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
  742|  4.58k|    {
  743|  4.58k|        return m_value;
  744|  4.58k|    }
_ZNK6nonstd13expected_lite8expectedIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEcvbEv:
 2204|  4.58k|    {
 2205|  4.58k|        return has_value();
 2206|  4.58k|    }
_ZNK6nonstd13expected_lite8expectedIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE9has_valueEv:
 2209|  13.7k|    {
 2210|  13.7k|        return contained.has_value();
 2211|  13.7k|    }
_ZNR6nonstd13expected_lite8expectedIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5valueEv:
 2223|  4.58k|    {
 2224|  4.58k|        return has_value()
  ------------------
  |  Branch (2224:16): [True: 4.58k, False: 0]
  ------------------
 2225|  4.58k|            ? ( contained.value() )
 2226|  4.58k|            : ( error_traits<error_type>::rethrow( contained.error() ), contained.value() );
 2227|  4.58k|    }
_ZN6nonstd13expected_lite8expectedIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEED2Ev:
 2050|  4.58k|    {
 2051|  4.58k|        if ( has_value() ) contained.destruct_value();
  ------------------
  |  Branch (2051:14): [True: 4.58k, False: 0]
  ------------------
 2052|      0|        else               contained.destruct_error();
 2053|  4.58k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implIbNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE14destruct_valueEv:
  705|  4.58k|    {
  706|  4.58k|        m_value.~value_type();
  707|  4.58k|    }
_ZN6nonstd13expected_lite15make_unexpectedIRA13_KcEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOS7_:
 1567|     96|{
 1568|     96|    return unexpected_type< typename std::decay<E>::type >( std::forward<E>(value) );
 1569|     96|}
_ZN6nonstd13expected_lite15unexpected_typeIPKcEC2IRA13_S2_TnNSt9enable_ifIXaaaasr3std16is_constructibleIS3_T_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefIS9_E4typeESt10in_place_tEE5valuentsr3std7is_sameISD_S4_EE5valueEiE4typeELi0EEEOS9_:
 1238|     96|    : m_error( std::forward<E2>( error ) )
 1239|     96|    {}
_ZN6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleISF_OT_EE5valuesr3std14is_convertibleISM_SF_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISL_EE:
 1990|  3.15k|    : contained( false )
 1991|  3.15k|    {
 1992|  3.15k|        contained.construct_error( std::move( error.error() ) );
 1993|  3.15k|    }
_ZN6nonstd13expected_lite6detail9storage_tISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  7.36k|        : storage_t_impl<T, E>( has_value )
  923|  7.36k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  7.36k|        : m_has_value( has_value )
  675|  7.36k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_errorEOSG_:
  715|  3.15k|    {
  716|  3.15k|        new( &m_error ) error_type( std::move( e ) );
  717|  3.15k|    }
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.20k|    : contained( true )
 1941|  4.20k|    {
 1942|  4.20k|        contained.construct_value( std::forward<U>( value ) );
 1943|  4.20k|    }
_ZN6nonstd13expected_lite6detail14storage_t_implISt8functionIFN2BT3AnyERNS4_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE15construct_valueEOSA_:
  688|  4.20k|    {
  689|  4.20k|        new( &m_value ) value_type( std::move( e ) );
  690|  4.20k|    }
_ZN6nonstd13expected_lite15unexpected_typeIPKcEC2IS3_TnNSt9enable_ifIXaaaasr3std16is_constructibleIS3_T_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefIS7_E4typeESt10in_place_tEE5valuentsr3std7is_sameISB_S4_EE5valueEiE4typeELi0EEEOS7_:
 1238|  5.80k|    : m_error( std::forward<E2>( error ) )
 1239|  5.80k|    {}
_ZN6nonstd13expected_lite8expectedIN2BT3AnyENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS9_OT_EE5valuesr3std14is_convertibleISG_S9_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISF_EE:
 1990|  1.16k|    : contained( false )
 1991|  1.16k|    {
 1992|  1.16k|        contained.construct_error( std::move( error.error() ) );
 1993|  1.16k|    }
_ZN6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS8_OT_EE5valuesr3std14is_convertibleISF_S8_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISE_EE:
 1990|  1.57k|    : contained( false )
 1991|  1.57k|    {
 1992|  1.57k|        contained.construct_error( std::move( error.error() ) );
 1993|  1.57k|    }
_ZN6nonstd13expected_lite6detail9storage_tISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEELb1ELb1EEC2Eb:
  922|  5.78k|        : storage_t_impl<T, E>( has_value )
  923|  5.78k|    {}
_ZN6nonstd13expected_lite6detail14storage_t_implISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2Eb:
  674|  5.78k|        : m_has_value( has_value )
  675|  5.78k|    {}
_ZN6nonstd13expected_lite8expectedISt9monostateNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2ILb1ETnNSt9enable_ifIXT_EiE4typeELi0EEEv:
 1800|  4.20k|    : contained( true )
 1801|  4.20k|    {
 1802|  4.20k|        contained.construct_value();
 1803|  4.20k|    }
_ZNR6nonstd13expected_lite8expectedISt8functionIFN2BT3AnyERNS3_3Ast11EnvironmentEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE5errorEv:
 2254|  1.57k|    {
 2255|       |        return assert( ! has_value() ), contained.error();
 2256|  1.57k|    }

_ZN2BT21BehaviorTreeExceptionC2IJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEDpRKT_:
   33|  6.47k|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|  6.47k|  {}
_ZNK2BT21BehaviorTreeException4whatEv:
   37|  6.96k|  {
   38|  6.96k|    return message_.c_str();
   39|  6.96k|  }
_ZN2BT12RuntimeErrorC2IJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEDpRKT_:
   67|  6.47k|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|  6.47k|  {}
_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|    207|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|    207|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA33_cEEEDpRKT_:
   33|    207|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|    207|  {}
_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|     23|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|     23|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA47_cEEEDpRKT_:
   33|     23|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|     23|  {}
_ZN2BT12RuntimeErrorC2IJA63_cEEEDpRKT_:
   67|     11|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|     11|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA63_cEEEDpRKT_:
   33|     11|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|     11|  {}
_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|    130|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|    130|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA79_cEEEDpRKT_:
   33|    130|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|    130|  {}
_ZN2BT12RuntimeErrorC2IJA24_cEEEDpRKT_:
   67|    105|  RuntimeError(const SV&... args) : BehaviorTreeException(args...)
   68|    105|  {}
_ZN2BT21BehaviorTreeExceptionC2IJA24_cEEEDpRKT_:
   33|    105|  BehaviorTreeException(const SV&... args) : message_(StrCat(args...))
   34|    105|  {}

_ZN2BT3Ast19ExprUnaryArithmeticC2ENS1_4op_tESt10shared_ptrINS0_8ExprBaseEE:
  138|  34.9k|  explicit ExprUnaryArithmetic(op_t op, expr_ptr e) : op(op), rhs(std::move(e))
  139|  34.9k|  {}
_ZN2BT3Ast8ExprBaseD2Ev:
   77|  15.3M|  virtual ~ExprBase() = default;
_ZNK2BT3Ast19ExprUnaryArithmetic8evaluateERNS0_11EnvironmentE:
  142|  7.96k|  {
  143|  7.96k|    auto rhs_v = rhs->evaluate(env);
  144|  7.96k|    if(rhs_v.isNumber())
  ------------------
  |  Branch (144:8): [True: 6.16k, False: 1.80k]
  ------------------
  145|  6.16k|    {
  146|  6.16k|      const double rv = rhs_v.cast<double>();
  147|  6.16k|      switch(op)
  ------------------
  |  Branch (147:14): [True: 6.14k, False: 19]
  ------------------
  148|  6.16k|      {
  149|  1.51k|        case negate:
  ------------------
  |  Branch (149:9): [True: 1.51k, False: 4.64k]
  ------------------
  150|  1.51k|          return Any(-rv);
  151|  2.75k|        case complement:
  ------------------
  |  Branch (151:9): [True: 2.75k, False: 3.40k]
  ------------------
  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.75k|          try
  159|  2.75k|          {
  160|  2.75k|            return Any(static_cast<double>(~rhs_v.cast<int64_t>()));
  161|  2.75k|          }
  162|  2.75k|          catch(const std::exception&)
  163|  2.75k|          {
  164|      1|            throw RuntimeError("Number out of range for bitwise operation");
  165|      1|          }
  166|  1.86k|        case logical_not:
  ------------------
  |  Branch (166:9): [True: 1.86k, False: 4.29k]
  ------------------
  167|  1.86k|          return Any(static_cast<double>(!static_cast<bool>(rv)));
  168|  6.16k|      }
  169|  6.16k|    }
  170|  1.80k|    else if(rhs_v.isString())
  ------------------
  |  Branch (170:13): [True: 1.76k, False: 35]
  ------------------
  171|  1.76k|    {
  172|  1.76k|      if(op == logical_not)
  ------------------
  |  Branch (172:10): [True: 1.76k, False: 4]
  ------------------
  173|  1.76k|      {
  174|  1.76k|        const auto str = rhs_v.cast<std::string>();
  175|  1.76k|        if(str == "true" || str == "True" || str == "TRUE" || str == "1")
  ------------------
  |  Branch (175:12): [True: 194, False: 1.56k]
  |  Branch (175:29): [True: 194, False: 1.37k]
  |  Branch (175:46): [True: 194, False: 1.18k]
  |  Branch (175:63): [True: 198, False: 982]
  ------------------
  176|    780|        {
  177|    780|          return Any(0.0);
  178|    780|        }
  179|    982|        if(str == "false" || str == "False" || str == "FALSE" || str == "0")
  ------------------
  |  Branch (179:12): [True: 194, False: 788]
  |  Branch (179:30): [True: 194, False: 594]
  |  Branch (179:48): [True: 194, False: 400]
  |  Branch (179:66): [True: 197, False: 203]
  ------------------
  180|    779|        {
  181|    779|          return Any(1.0);
  182|    779|        }
  183|    982|      }
  184|    207|      throw RuntimeError("Invalid operator for std::string");
  185|  1.76k|    }
  186|     35|    throw RuntimeError("ExprUnaryArithmetic: undefined");
  187|  7.96k|  }
_ZN2BT3Ast11ExprLiteralC2ENS_3AnyE:
   91|  1.78M|  ExprLiteral(Any v) : value(v)
   92|  1.78M|  {}
_ZNK2BT3Ast11ExprLiteral8evaluateERNS0_11EnvironmentE:
   95|   115k|  {
   96|   115k|    return value;
   97|   115k|  }
_ZN2BT3Ast8ExprNameC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  104|  13.3M|  explicit ExprName(std::string n) : name(std::move(n))
  105|  13.3M|  {}
_ZNK2BT3Ast8ExprName8evaluateERNS0_11EnvironmentE:
  108|  1.87M|  {
  109|       |    //search first in the enums table
  110|  1.87M|    if(env.enums)
  ------------------
  |  Branch (110:8): [True: 1.87M, False: 0]
  ------------------
  111|  1.87M|    {
  112|  1.87M|      auto enum_ptr = env.enums->find(name);
  113|  1.87M|      if(enum_ptr != env.enums->end())
  ------------------
  |  Branch (113:10): [True: 0, False: 1.87M]
  ------------------
  114|      0|      {
  115|      0|        return Any(double(enum_ptr->second));
  116|      0|      }
  117|  1.87M|    }
  118|       |    // search now in the variables table
  119|  1.87M|    auto any_ref = env.vars->getAnyLocked(name);
  120|  1.87M|    if(!any_ref)
  ------------------
  |  Branch (120:8): [True: 502, False: 1.87M]
  ------------------
  121|    502|    {
  122|    502|      throw RuntimeError(StrCat("Variable not found: ", name));
  123|    502|    }
  124|  1.87M|    return *any_ref.get();
  125|  1.87M|  }
_ZN2BT3Ast14ExprAssignmentC2ESt10shared_ptrINS0_8ExprBaseEENS1_4op_tES4_:
  561|  53.0k|    : op(op), lhs(std::move(_lhs)), rhs(std::move(_rhs))
  562|  53.0k|  {}
_ZNK2BT3Ast14ExprAssignment8evaluateERNS0_11EnvironmentE:
  565|  22.5k|  {
  566|  22.5k|    auto varname = dynamic_cast<ExprName*>(lhs.get());
  567|  22.5k|    if(!varname)
  ------------------
  |  Branch (567:8): [True: 23, False: 22.4k]
  ------------------
  568|     23|    {
  569|     23|      throw RuntimeError("Assignment left operand not a blackboard entry");
  570|     23|    }
  571|  22.4k|    const auto& key = varname->name;
  572|       |
  573|  22.4k|    auto entry = env.vars->getEntry(key);
  574|  22.4k|    if(!entry)
  ------------------
  |  Branch (574:8): [True: 9.11k, False: 13.3k]
  ------------------
  575|  9.11k|    {
  576|       |      // variable doesn't exist, create it if using operator assign_create
  577|  9.11k|      if(op == assign_create)
  ------------------
  |  Branch (577:10): [True: 9.06k, False: 49]
  ------------------
  578|  9.06k|      {
  579|  9.06k|        env.vars->createEntry(key, PortInfo());
  580|  9.06k|        entry = env.vars->getEntry(key);
  581|  9.06k|        if(!entry)
  ------------------
  |  Branch (581:12): [True: 0, False: 9.06k]
  ------------------
  582|      0|        {
  583|      0|          throw LogicError("Bug: report");
  584|      0|        }
  585|  9.06k|      }
  586|     49|      else
  587|     49|      {
  588|       |        // fail otherwise
  589|     49|        auto msg = StrCat("The blackboard entry [", key,
  590|     49|                          "] doesn't exist, yet.\n"
  591|     49|                          "If you want to create a new one, "
  592|     49|                          "use the operator "
  593|     49|                          "[:=] instead of [=]");
  594|     49|        throw RuntimeError(msg);
  595|     49|      }
  596|  9.11k|    }
  597|  22.4k|    auto value = rhs->evaluate(env);
  598|       |
  599|  22.4k|    std::unique_lock lock(entry->entry_mutex);
  600|  22.4k|    auto* dst_ptr = &entry->value;
  601|       |
  602|  22.4k|    auto errorPrefix = [dst_ptr, &key]() {
  603|  22.4k|      return StrCat("Error assigning a value to entry [", key, "] with type [",
  604|  22.4k|                    BT::demangle(dst_ptr->type()), "]. ");
  605|  22.4k|    };
  606|       |
  607|  22.4k|    if(value.empty())
  ------------------
  |  Branch (607:8): [True: 46, False: 22.3k]
  ------------------
  608|     46|    {
  609|     46|      throw RuntimeError(ErrorNotInit("right", opStr()));
  610|     46|    }
  611|       |
  612|  22.3k|    if(op == assign_create || op == assign_existing)
  ------------------
  |  Branch (612:8): [True: 11.0k, False: 11.3k]
  |  Branch (612:31): [True: 2.94k, False: 8.40k]
  ------------------
  613|  11.2k|    {
  614|       |      // the very fist assignment can come from any type.
  615|       |      // In the future, type check will be done by Any::copyInto
  616|  11.2k|      if(dst_ptr->empty() && entry->info.type() == typeid(AnyTypeAllowed))
  ------------------
  |  Branch (616:10): [True: 7.55k, False: 3.73k]
  |  Branch (616:10): [True: 7.55k, False: 3.73k]
  |  Branch (616:30): [True: 7.55k, False: 0]
  ------------------
  617|  7.55k|      {
  618|  7.55k|        *dst_ptr = value;
  619|  7.55k|      }
  620|  3.73k|      else if(value.isString() && !dst_ptr->isString())
  ------------------
  |  Branch (620:15): [True: 1.77k, False: 1.95k]
  |  Branch (620:35): [True: 753, False: 1.02k]
  ------------------
  621|    753|      {
  622|       |        // special case: string to other type.
  623|       |        // Check if we can use the StringConverter
  624|    753|        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|    753|        if(auto converter = entry->info.converter())
  ------------------
  |  Branch (627:17): [True: 0, False: 753]
  ------------------
  628|      0|        {
  629|      0|          *dst_ptr = converter(str);
  630|      0|        }
  631|    753|        else if(dst_ptr->isNumber())
  ------------------
  |  Branch (631:17): [True: 753, False: 0]
  ------------------
  632|    753|        {
  633|    753|          auto num_value = StringToDouble(value, env);
  634|    753|          *dst_ptr = Any(num_value);
  635|    753|        }
  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|    753|      }
  645|  2.98k|      else
  646|  2.98k|      {
  647|  2.98k|        try
  648|  2.98k|        {
  649|  2.98k|          value.copyInto(*dst_ptr);
  650|  2.98k|        }
  651|  2.98k|        catch(std::exception&)
  652|  2.98k|        {
  653|     48|          auto msg = StrCat(errorPrefix(), "\nThe right operand has type [",
  654|     48|                            BT::demangle(value.type()), "] and can't be converted to [",
  655|     48|                            BT::demangle(dst_ptr->type()), "]");
  656|     48|          throw RuntimeError(msg);
  657|     48|        }
  658|  2.98k|      }
  659|  11.2k|      entry->sequence_id++;
  660|  11.2k|      entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  661|  11.2k|      const Any result = *dst_ptr;
  662|  11.2k|      auto update_signal = entry->update_signal;
  663|  11.2k|      lock.unlock();
  664|  11.2k|      if(update_signal)
  ------------------
  |  Branch (664:10): [True: 0, False: 11.2k]
  ------------------
  665|      0|      {
  666|      0|        update_signal->notify();
  667|      0|      }
  668|  11.2k|      return result;
  669|  11.2k|    }
  670|       |
  671|  11.1k|    if(dst_ptr->empty())
  ------------------
  |  Branch (671:8): [True: 5, False: 11.0k]
  ------------------
  672|      5|    {
  673|      5|      throw RuntimeError(ErrorNotInit("left", opStr()));
  674|      5|    }
  675|       |
  676|       |    // temporary use
  677|  11.0k|    Any temp_variable = *dst_ptr;
  678|       |
  679|  11.0k|    if(value.isNumber())
  ------------------
  |  Branch (679:8): [True: 1.94k, False: 9.15k]
  ------------------
  680|  1.94k|    {
  681|  1.94k|      if(!temp_variable.isNumber())
  ------------------
  |  Branch (681:10): [True: 11, False: 1.92k]
  ------------------
  682|     11|      {
  683|     11|        throw RuntimeError("This Assignment operator can't be used "
  684|     11|                           "with a non-numeric type");
  685|     11|      }
  686|       |
  687|  1.92k|      auto lv = temp_variable.cast<double>();
  688|  1.92k|      auto rv = value.cast<double>();
  689|  1.92k|      switch(op)
  690|  1.92k|      {
  691|    497|        case assign_plus:
  ------------------
  |  Branch (691:9): [True: 497, False: 1.43k]
  ------------------
  692|    497|          temp_variable = Any(lv + rv);
  693|    497|          break;
  694|    527|        case assign_minus:
  ------------------
  |  Branch (694:9): [True: 527, False: 1.40k]
  ------------------
  695|    527|          temp_variable = Any(lv - rv);
  696|    527|          break;
  697|    506|        case assign_times:
  ------------------
  |  Branch (697:9): [True: 506, False: 1.42k]
  ------------------
  698|    506|          temp_variable = Any(lv * rv);
  699|    506|          break;
  700|    397|        case assign_div:
  ------------------
  |  Branch (700:9): [True: 397, False: 1.53k]
  ------------------
  701|    397|          temp_variable = Any(lv / rv);
  702|    397|          break;
  703|      0|        default: {
  ------------------
  |  Branch (703:9): [True: 0, False: 1.92k]
  ------------------
  704|      0|        }
  705|  1.92k|      }
  706|  1.92k|    }
  707|  9.15k|    else if(value.isString())
  ------------------
  |  Branch (707:13): [True: 6.45k, False: 2.70k]
  ------------------
  708|  6.45k|    {
  709|  6.45k|      if(op == assign_plus)
  ------------------
  |  Branch (709:10): [True: 6.45k, False: 2]
  ------------------
  710|  6.45k|      {
  711|  6.45k|        auto lv = temp_variable.cast<std::string>();
  712|  6.45k|        auto rv = value.cast<std::string>();
  713|  6.45k|        temp_variable = Any(lv + rv);
  714|  6.45k|      }
  715|      2|      else
  716|      2|      {
  717|      2|        throw RuntimeError("Operator not supported for strings");
  718|      2|      }
  719|  6.45k|    }
  720|       |
  721|  11.0k|    temp_variable.copyInto(*dst_ptr);
  722|  11.0k|    entry->sequence_id++;
  723|  11.0k|    entry->stamp = std::chrono::steady_clock::now().time_since_epoch();
  724|  11.0k|    const Any result = *dst_ptr;
  725|  11.0k|    auto update_signal = entry->update_signal;
  726|  11.0k|    lock.unlock();
  727|  11.0k|    if(update_signal)
  ------------------
  |  Branch (727:8): [True: 0, False: 11.0k]
  ------------------
  728|      0|    {
  729|      0|      update_signal->notify();
  730|      0|    }
  731|  11.0k|    return result;
  732|  11.0k|  }
_ZN2BT3Ast12ErrorNotInitB5cxx11EPKcS2_:
   82|     77|{
   83|     77|  return StrCat("The ", side, " operand of the operator [", op_str,
   84|     77|                "] is not initialized");
   85|     77|}
_ZNK2BT3Ast14ExprAssignment5opStrEv:
  539|     51|  {
  540|     51|    switch(op)
  ------------------
  |  Branch (540:12): [True: 51, False: 0]
  ------------------
  541|     51|    {
  542|     29|      case assign_create:
  ------------------
  |  Branch (542:7): [True: 29, False: 22]
  ------------------
  543|     29|        return ":=";
  544|     14|      case assign_existing:
  ------------------
  |  Branch (544:7): [True: 14, False: 37]
  ------------------
  545|     14|        return "=";
  546|      2|      case assign_plus:
  ------------------
  |  Branch (546:7): [True: 2, False: 49]
  ------------------
  547|      2|        return "+=";
  548|      1|      case assign_minus:
  ------------------
  |  Branch (548:7): [True: 1, False: 50]
  ------------------
  549|      1|        return "-=";
  550|      4|      case assign_times:
  ------------------
  |  Branch (550:7): [True: 4, False: 47]
  ------------------
  551|      4|        return "*=";
  552|      1|      case assign_div:
  ------------------
  |  Branch (552:7): [True: 1, False: 50]
  ------------------
  553|      1|        return "/=";
  554|     51|    }
  555|      0|    return "";
  556|     51|  }
_ZN2BT3Ast14StringToDoubleERKNS_3AnyERKNS0_11EnvironmentE:
   33|  16.5k|{
   34|  16.5k|  const auto str = value.cast<std::string>();
   35|  16.5k|  if(str == "true")
  ------------------
  |  Branch (35:6): [True: 194, False: 16.3k]
  ------------------
   36|    194|  {
   37|    194|    return 1.0;
   38|    194|  }
   39|  16.3k|  if(str == "false")
  ------------------
  |  Branch (39:6): [True: 194, False: 16.1k]
  ------------------
   40|    194|  {
   41|    194|    return 0.0;
   42|    194|  }
   43|  16.1k|  if(env.enums)
  ------------------
  |  Branch (43:6): [True: 16.1k, False: 0]
  ------------------
   44|  16.1k|  {
   45|  16.1k|    auto it = env.enums->find(str);
   46|  16.1k|    if(it != env.enums->end())
  ------------------
  |  Branch (46:8): [True: 0, False: 16.1k]
  ------------------
   47|      0|    {
   48|      0|      return it->second;
   49|      0|    }
   50|  16.1k|  }
   51|  16.1k|  return value.cast<double>();
   52|  16.1k|}
_ZZNK2BT3Ast14ExprAssignment8evaluateERNS0_11EnvironmentEENKUlvE_clB5cxx11Ev:
  602|     48|    auto errorPrefix = [dst_ptr, &key]() {
  603|     48|      return StrCat("Error assigning a value to entry [", key, "] with type [",
  604|     48|                    BT::demangle(dst_ptr->type()), "]. ");
  605|     48|    };
_ZN2BT3Ast6ExprIfC2ESt10shared_ptrINS0_8ExprBaseEES4_S4_:
  507|  6.54k|    : condition(std::move(condition)), then(std::move(then)), else_(std::move(else_))
  508|  6.54k|  {}
_ZNK2BT3Ast6ExprIf8evaluateERNS0_11EnvironmentE:
  511|  1.95k|  {
  512|  1.95k|    const auto& v = condition->evaluate(env);
  513|  1.95k|    bool valid = (v.isType<SimpleString>() && v.cast<SimpleString>().size() > 0) ||
  ------------------
  |  Branch (513:19): [True: 0, False: 1.95k]
  |  Branch (513:47): [True: 0, False: 0]
  ------------------
  514|  1.94k|                 (v.cast<double>() != 0.0);
  ------------------
  |  Branch (514:18): [True: 839, False: 1.10k]
  ------------------
  515|  1.95k|    if(valid)
  ------------------
  |  Branch (515:8): [True: 836, False: 1.11k]
  ------------------
  516|    836|    {
  517|    836|      return then->evaluate(env);
  518|    836|    }
  519|  1.11k|    else
  520|  1.11k|    {
  521|  1.11k|      return else_->evaluate(env);
  522|  1.11k|    }
  523|  1.95k|  }
_ZNK2BT3Ast14ExprComparison8evaluateERNS0_11EnvironmentE:
  406|  16.6k|  {
  407|  16.6k|    auto SwitchImpl = [&](const auto& lv, const auto& rv, op_t op) {
  408|  16.6k|      switch(op)
  409|  16.6k|      {
  410|  16.6k|        case equal:
  411|  16.6k|          if(!IsSame(lv, rv))
  412|  16.6k|            return false;
  413|  16.6k|          break;
  414|  16.6k|        case not_equal:
  415|  16.6k|          if(IsSame(lv, rv))
  416|  16.6k|            return false;
  417|  16.6k|          break;
  418|  16.6k|        case less:
  419|  16.6k|          if(lv >= rv)
  420|  16.6k|            return false;
  421|  16.6k|          break;
  422|  16.6k|        case greater:
  423|  16.6k|          if(lv <= rv)
  424|  16.6k|            return false;
  425|  16.6k|          break;
  426|  16.6k|        case less_equal:
  427|  16.6k|          if(lv > rv)
  428|  16.6k|            return false;
  429|  16.6k|          break;
  430|  16.6k|        case greater_equal:
  431|  16.6k|          if(lv < rv)
  432|  16.6k|            return false;
  433|  16.6k|          break;
  434|  16.6k|      }
  435|  16.6k|      return true;
  436|  16.6k|    };
  437|       |
  438|  16.6k|    auto lhs_v = operands[0]->evaluate(env);
  439|  95.4k|    for(auto i = 0u; i != ops.size(); ++i)
  ------------------
  |  Branch (439:22): [True: 90.0k, False: 5.34k]
  ------------------
  440|  90.0k|    {
  441|  90.0k|      auto rhs_v = operands[i + 1]->evaluate(env);
  442|       |
  443|  90.0k|      if(lhs_v.empty())
  ------------------
  |  Branch (443:10): [True: 8, False: 90.0k]
  ------------------
  444|      8|      {
  445|      8|        throw RuntimeError(ErrorNotInit("left", opStr(ops[i])));
  446|      8|      }
  447|  90.0k|      if(rhs_v.empty())
  ------------------
  |  Branch (447:10): [True: 5, False: 90.0k]
  ------------------
  448|      5|      {
  449|      5|        throw RuntimeError(ErrorNotInit("right", opStr(ops[i])));
  450|      5|      }
  451|  90.0k|      const Any False(0.0);
  452|       |
  453|  90.0k|      if(lhs_v.isNumber() && rhs_v.isNumber())
  ------------------
  |  Branch (453:10): [True: 73.0k, False: 17.0k]
  |  Branch (453:30): [True: 65.1k, False: 7.92k]
  ------------------
  454|  65.1k|      {
  455|  65.1k|        auto lv = lhs_v.cast<double>();
  456|  65.1k|        auto rv = rhs_v.cast<double>();
  457|  65.1k|        if(!SwitchImpl(lv, rv, ops[i]))
  ------------------
  |  Branch (457:12): [True: 3.73k, False: 61.3k]
  ------------------
  458|  3.73k|        {
  459|  3.73k|          return False;
  460|  3.73k|        }
  461|  65.1k|      }
  462|  24.9k|      else if(lhs_v.isString() && rhs_v.isString())
  ------------------
  |  Branch (462:15): [True: 16.8k, False: 8.12k]
  |  Branch (462:35): [True: 8.89k, False: 7.91k]
  ------------------
  463|  8.89k|      {
  464|  8.89k|        auto lv = lhs_v.cast<SimpleString>();
  465|  8.89k|        auto rv = rhs_v.cast<SimpleString>();
  466|  8.89k|        if(!SwitchImpl(lv, rv, ops[i]))
  ------------------
  |  Branch (466:12): [True: 4.27k, False: 4.62k]
  ------------------
  467|  4.27k|        {
  468|  4.27k|          return False;
  469|  4.27k|        }
  470|  8.89k|      }
  471|  16.0k|      else if(lhs_v.isString() && rhs_v.isNumber())
  ------------------
  |  Branch (471:15): [True: 7.91k, False: 8.12k]
  |  Branch (471:35): [True: 7.91k, False: 0]
  ------------------
  472|  7.91k|      {
  473|  7.91k|        auto lv = StringToDouble(lhs_v, env);
  474|  7.91k|        auto rv = rhs_v.cast<double>();
  475|  7.91k|        if(!SwitchImpl(lv, rv, ops[i]))
  ------------------
  |  Branch (475:12): [True: 1.36k, False: 6.54k]
  ------------------
  476|  1.36k|        {
  477|  1.36k|          return False;
  478|  1.36k|        }
  479|  7.91k|      }
  480|  8.12k|      else if(lhs_v.isNumber() && rhs_v.isString())
  ------------------
  |  Branch (480:15): [True: 7.92k, False: 198]
  |  Branch (480:35): [True: 7.92k, False: 0]
  ------------------
  481|  7.92k|      {
  482|  7.92k|        auto lv = lhs_v.cast<double>();
  483|  7.92k|        auto rv = StringToDouble(rhs_v, env);
  484|  7.92k|        if(!SwitchImpl(lv, rv, ops[i]))
  ------------------
  |  Branch (484:12): [True: 1.66k, False: 6.25k]
  ------------------
  485|  1.66k|        {
  486|  1.66k|          return False;
  487|  1.66k|        }
  488|  7.92k|      }
  489|    198|      else
  490|    198|      {
  491|    198|        throw RuntimeError(StrCat("Can't mix different types in Comparison. "
  492|    198|                                  "Left operand [",
  493|    198|                                  BT::demangle(lhs_v.type()), "] right operand [",
  494|    198|                                  BT::demangle(rhs_v.type()), "]"));
  495|    198|      }
  496|  78.8k|      lhs_v = rhs_v;
  497|  78.8k|    }
  498|  5.34k|    return Any(1.0);
  499|  16.6k|  }
_ZNK2BT3Ast14ExprComparison5opStrENS1_4op_tE:
  383|     13|  {
  384|     13|    switch(op)
  ------------------
  |  Branch (384:12): [True: 13, False: 0]
  ------------------
  385|     13|    {
  386|      0|      case equal:
  ------------------
  |  Branch (386:7): [True: 0, False: 13]
  ------------------
  387|      0|        return "==";
  388|      1|      case not_equal:
  ------------------
  |  Branch (388:7): [True: 1, False: 12]
  ------------------
  389|      1|        return "!=";
  390|      3|      case less:
  ------------------
  |  Branch (390:7): [True: 3, False: 10]
  ------------------
  391|      3|        return "<";
  392|      7|      case greater:
  ------------------
  |  Branch (392:7): [True: 7, False: 6]
  ------------------
  393|      7|        return ">";
  394|      0|      case less_equal:
  ------------------
  |  Branch (394:7): [True: 0, False: 13]
  ------------------
  395|      0|        return "<=";
  396|      2|      case greater_equal:
  ------------------
  |  Branch (396:7): [True: 2, False: 11]
  ------------------
  397|      2|        return ">=";
  398|     13|    }
  399|      0|    return "";
  400|     13|  }
_ZZNK2BT3Ast14ExprComparison8evaluateERNS0_11EnvironmentEENKUlRKT_RKT0_NS1_4op_tEE_clIddEEDaS6_S9_SA_:
  407|  80.8k|    auto SwitchImpl = [&](const auto& lv, const auto& rv, op_t op) {
  408|  80.8k|      switch(op)
  ------------------
  |  Branch (408:14): [True: 80.8k, False: 0]
  ------------------
  409|  80.8k|      {
  410|  1.42k|        case equal:
  ------------------
  |  Branch (410:9): [True: 1.42k, False: 79.3k]
  ------------------
  411|  1.42k|          if(!IsSame(lv, rv))
  ------------------
  |  Branch (411:14): [True: 715, False: 708]
  ------------------
  412|    715|            return false;
  413|    708|          break;
  414|  50.9k|        case not_equal:
  ------------------
  |  Branch (414:9): [True: 50.9k, False: 29.8k]
  ------------------
  415|  50.9k|          if(IsSame(lv, rv))
  ------------------
  |  Branch (415:14): [True: 635, False: 50.3k]
  ------------------
  416|    635|            return false;
  417|  50.3k|          break;
  418|  50.3k|        case less:
  ------------------
  |  Branch (418:9): [True: 13.1k, False: 67.7k]
  ------------------
  419|  13.1k|          if(lv >= rv)
  ------------------
  |  Branch (419:14): [True: 2.14k, False: 10.9k]
  ------------------
  420|  2.14k|            return false;
  421|  10.9k|          break;
  422|  11.9k|        case greater:
  ------------------
  |  Branch (422:9): [True: 11.9k, False: 68.8k]
  ------------------
  423|  11.9k|          if(lv <= rv)
  ------------------
  |  Branch (423:14): [True: 1.40k, False: 10.5k]
  ------------------
  424|  1.40k|            return false;
  425|  10.5k|          break;
  426|  10.5k|        case less_equal:
  ------------------
  |  Branch (426:9): [True: 1.23k, False: 79.5k]
  ------------------
  427|  1.23k|          if(lv > rv)
  ------------------
  |  Branch (427:14): [True: 647, False: 585]
  ------------------
  428|    647|            return false;
  429|    585|          break;
  430|  2.18k|        case greater_equal:
  ------------------
  |  Branch (430:9): [True: 2.18k, False: 78.6k]
  ------------------
  431|  2.18k|          if(lv < rv)
  ------------------
  |  Branch (431:14): [True: 1.22k, False: 965]
  ------------------
  432|  1.22k|            return false;
  433|    965|          break;
  434|  80.8k|      }
  435|  74.0k|      return true;
  436|  80.8k|    };
_ZN2BT3Ast6IsSameIdEEbRKT_S4_:
  358|  52.3k|{
  359|       |  if constexpr(std::is_same_v<double, T>)
  360|  52.3k|  {
  361|  52.3k|    constexpr double EPS = static_cast<double>(std::numeric_limits<float>::epsilon());
  362|  52.3k|    return std::abs(lv - rv) <= EPS;
  363|       |  }
  364|       |  else
  365|       |  {
  366|       |    return (lv == rv);
  367|       |  }
  368|  52.3k|}
_ZZNK2BT3Ast14ExprComparison8evaluateERNS0_11EnvironmentEENKUlRKT_RKT0_NS1_4op_tEE_clIN7SafeAny12SimpleStringESE_EEDaS6_S9_SA_:
  407|  8.89k|    auto SwitchImpl = [&](const auto& lv, const auto& rv, op_t op) {
  408|  8.89k|      switch(op)
  ------------------
  |  Branch (408:14): [True: 8.89k, False: 0]
  ------------------
  409|  8.89k|      {
  410|  1.08k|        case equal:
  ------------------
  |  Branch (410:9): [True: 1.08k, False: 7.81k]
  ------------------
  411|  1.08k|          if(!IsSame(lv, rv))
  ------------------
  |  Branch (411:14): [True: 653, False: 428]
  ------------------
  412|    653|            return false;
  413|    428|          break;
  414|  1.12k|        case not_equal:
  ------------------
  |  Branch (414:9): [True: 1.12k, False: 7.77k]
  ------------------
  415|  1.12k|          if(IsSame(lv, rv))
  ------------------
  |  Branch (415:14): [True: 397, False: 726]
  ------------------
  416|    397|            return false;
  417|    726|          break;
  418|  1.65k|        case less:
  ------------------
  |  Branch (418:9): [True: 1.65k, False: 7.24k]
  ------------------
  419|  1.65k|          if(lv >= rv)
  ------------------
  |  Branch (419:14): [True: 1.07k, False: 579]
  ------------------
  420|  1.07k|            return false;
  421|    579|          break;
  422|  1.73k|        case greater:
  ------------------
  |  Branch (422:9): [True: 1.73k, False: 7.15k]
  ------------------
  423|  1.73k|          if(lv <= rv)
  ------------------
  |  Branch (423:14): [True: 723, False: 1.01k]
  ------------------
  424|    723|            return false;
  425|  1.01k|          break;
  426|  1.23k|        case less_equal:
  ------------------
  |  Branch (426:9): [True: 1.23k, False: 7.65k]
  ------------------
  427|  1.23k|          if(lv > rv)
  ------------------
  |  Branch (427:14): [True: 485, False: 752]
  ------------------
  428|    485|            return false;
  429|    752|          break;
  430|  2.06k|        case greater_equal:
  ------------------
  |  Branch (430:9): [True: 2.06k, False: 6.83k]
  ------------------
  431|  2.06k|          if(lv < rv)
  ------------------
  |  Branch (431:14): [True: 941, False: 1.12k]
  ------------------
  432|    941|            return false;
  433|  1.12k|          break;
  434|  8.89k|      }
  435|  4.62k|      return true;
  436|  8.89k|    };
_ZN2BT3Ast6IsSameIN7SafeAny12SimpleStringEEEbRKT_S6_:
  358|  2.20k|{
  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.20k|  {
  366|  2.20k|    return (lv == rv);
  367|  2.20k|  }
  368|  2.20k|}
_ZN2BT3Ast20ExprBinaryArithmeticC2ESt10shared_ptrINS0_8ExprBaseEENS1_4op_tES4_:
  239|  46.8k|    : op(op), lhs(std::move(lhs)), rhs(std::move(rhs))
  240|  46.8k|  {}
_ZNK2BT3Ast20ExprBinaryArithmetic8evaluateERNS0_11EnvironmentE:
  243|  15.9k|  {
  244|  15.9k|    auto lhs_v = lhs->evaluate(env);
  245|  15.9k|    auto rhs_v = rhs->evaluate(env);
  246|       |
  247|  15.9k|    if(lhs_v.empty())
  ------------------
  |  Branch (247:8): [True: 12, False: 15.9k]
  ------------------
  248|     12|    {
  249|     12|      throw RuntimeError(ErrorNotInit("left", opStr()));
  250|     12|    }
  251|  15.9k|    if(rhs_v.empty())
  ------------------
  |  Branch (251:8): [True: 1, False: 15.9k]
  ------------------
  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|  15.9k|    if(op == plus || op == minus || op == times || op == div)
  ------------------
  |  Branch (258:8): [True: 7.44k, False: 8.49k]
  |  Branch (258:22): [True: 971, False: 7.52k]
  |  Branch (258:37): [True: 638, False: 6.88k]
  |  Branch (258:52): [True: 257, False: 6.62k]
  ------------------
  259|  8.92k|    {
  260|  8.92k|      if(lhs_v.isString() && rhs_v.isNumber())
  ------------------
  |  Branch (260:10): [True: 5.66k, False: 3.26k]
  |  Branch (260:30): [True: 549, False: 5.11k]
  ------------------
  261|    549|      {
  262|    549|        NumericStringToNumber(lhs_v);
  263|    549|      }
  264|  8.38k|      else if(lhs_v.isNumber() && rhs_v.isString())
  ------------------
  |  Branch (264:15): [True: 3.26k, False: 5.11k]
  |  Branch (264:35): [True: 1.69k, False: 1.56k]
  ------------------
  265|  1.69k|      {
  266|  1.69k|        NumericStringToNumber(rhs_v);
  267|  1.69k|      }
  268|  8.92k|    }
  269|       |
  270|  15.9k|    if(rhs_v.isNumber() && lhs_v.isNumber())
  ------------------
  |  Branch (270:8): [True: 7.67k, False: 8.25k]
  |  Branch (270:28): [True: 6.20k, False: 1.47k]
  ------------------
  271|  6.20k|    {
  272|  6.20k|      auto lv = lhs_v.cast<double>();
  273|  6.20k|      auto rv = rhs_v.cast<double>();
  274|       |
  275|  6.20k|      switch(op)
  276|  6.20k|      {
  277|  1.91k|        case plus:
  ------------------
  |  Branch (277:9): [True: 1.91k, False: 4.29k]
  ------------------
  278|  1.91k|          return Any(lv + rv);
  279|    926|        case minus:
  ------------------
  |  Branch (279:9): [True: 926, False: 5.28k]
  ------------------
  280|    926|          return Any(lv - rv);
  281|    634|        case times:
  ------------------
  |  Branch (281:9): [True: 634, False: 5.57k]
  ------------------
  282|    634|          return Any(lv * rv);
  283|    250|        case div:
  ------------------
  |  Branch (283:9): [True: 250, False: 5.95k]
  ------------------
  284|    250|          return Any(lv / rv);
  285|  2.47k|        default: {
  ------------------
  |  Branch (285:9): [True: 2.47k, False: 3.73k]
  ------------------
  286|  2.47k|        }
  287|  6.20k|      }
  288|       |
  289|  2.47k|      if(op == bit_and || op == bit_or || op == bit_xor)
  ------------------
  |  Branch (289:10): [True: 367, False: 2.11k]
  |  Branch (289:27): [True: 439, False: 1.67k]
  |  Branch (289:43): [True: 196, False: 1.47k]
  ------------------
  290|  1.00k|      {
  291|  1.00k|        try
  292|  1.00k|        {
  293|  1.00k|          int64_t li = lhs_v.cast<int64_t>();
  294|  1.00k|          int64_t ri = rhs_v.cast<int64_t>();
  295|  1.00k|          switch(op)
  296|  1.00k|          {
  297|    365|            case bit_and:
  ------------------
  |  Branch (297:13): [True: 365, False: 637]
  ------------------
  298|    365|              return Any(static_cast<double>(li & ri));
  299|    436|            case bit_or:
  ------------------
  |  Branch (299:13): [True: 436, False: 566]
  ------------------
  300|    436|              return Any(static_cast<double>(li | ri));
  301|    196|            case bit_xor:
  ------------------
  |  Branch (301:13): [True: 196, False: 806]
  ------------------
  302|    196|              return Any(static_cast<double>(li ^ ri));
  303|      0|            default: {
  ------------------
  |  Branch (303:13): [True: 0, False: 1.00k]
  ------------------
  304|      0|            }
  305|  1.00k|          }
  306|  1.00k|        }
  307|  1.00k|        catch(...)
  308|  1.00k|        {
  309|      5|          throw RuntimeError("Binary operators are not allowed if "
  310|      5|                             "one of the operands is not an integer");
  311|      5|        }
  312|  1.00k|      }
  313|       |
  314|  1.47k|      if(op == logic_or || op == logic_and)
  ------------------
  |  Branch (314:10): [True: 595, False: 882]
  |  Branch (314:28): [True: 675, False: 207]
  ------------------
  315|  1.27k|      {
  316|  1.27k|        try
  317|  1.27k|        {
  318|  1.27k|          auto lb = lhs_v.cast<bool>();
  319|  1.27k|          auto rb = rhs_v.cast<bool>();
  320|  1.27k|          switch(op)
  321|  1.27k|          {
  322|    573|            case logic_or:
  ------------------
  |  Branch (322:13): [True: 573, False: 697]
  ------------------
  323|    573|              return Any(static_cast<double>(lb || rb));
  ------------------
  |  Branch (323:46): [True: 194, False: 379]
  |  Branch (323:52): [True: 3, False: 376]
  ------------------
  324|    567|            case logic_and:
  ------------------
  |  Branch (324:13): [True: 567, False: 703]
  ------------------
  325|    567|              return Any(static_cast<double>(lb && rb));
  ------------------
  |  Branch (325:46): [True: 295, False: 272]
  |  Branch (325:52): [True: 286, False: 9]
  ------------------
  326|      0|            default: {
  ------------------
  |  Branch (326:13): [True: 0, False: 1.27k]
  ------------------
  327|      0|            }
  328|  1.27k|          }
  329|  1.27k|        }
  330|  1.27k|        catch(...)
  331|  1.27k|        {
  332|    130|          throw RuntimeError("Logic operators are not allowed if "
  333|    130|                             "one of the operands is not castable to bool");
  334|    130|        }
  335|  1.27k|      }
  336|  1.47k|    }
  337|  9.72k|    else if(rhs_v.isString() && lhs_v.isString() && op == plus)
  ------------------
  |  Branch (337:13): [True: 7.87k, False: 1.85k]
  |  Branch (337:33): [True: 5.43k, False: 2.44k]
  |  Branch (337:53): [True: 5.11k, False: 320]
  ------------------
  338|  5.11k|    {
  339|  5.11k|      return Any(lhs_v.cast<std::string>() + rhs_v.cast<std::string>());
  340|  5.11k|    }
  341|  4.61k|    else if(op == concat && ((rhs_v.isString() && lhs_v.isString()) ||
  ------------------
  |  Branch (341:13): [True: 4.12k, False: 487]
  |  Branch (341:31): [True: 2.71k, False: 1.41k]
  |  Branch (341:51): [True: 313, False: 2.40k]
  ------------------
  342|  3.81k|                             (rhs_v.isString() && lhs_v.isNumber()) ||
  ------------------
  |  Branch (342:31): [True: 2.40k, False: 1.41k]
  |  Branch (342:51): [True: 2.40k, False: 0]
  ------------------
  343|  1.41k|                             (rhs_v.isNumber() && lhs_v.isString())))
  ------------------
  |  Branch (343:31): [True: 1.41k, False: 0]
  |  Branch (343:51): [True: 1.41k, False: 0]
  ------------------
  344|  4.12k|    {
  345|  4.12k|      return Any(lhs_v.cast<std::string>() + rhs_v.cast<std::string>());
  346|  4.12k|    }
  347|    487|    else
  348|    487|    {
  349|    487|      throw RuntimeError("Operation not permitted");
  350|    487|    }
  351|       |
  352|    207|    return {};  // unreachable
  353|  15.9k|  }
_ZNK2BT3Ast20ExprBinaryArithmetic5opStrEv:
  209|     13|  {
  210|     13|    switch(op)
  ------------------
  |  Branch (210:12): [True: 13, False: 0]
  ------------------
  211|     13|    {
  212|      2|      case plus:
  ------------------
  |  Branch (212:7): [True: 2, False: 11]
  ------------------
  213|      2|        return "+";
  214|      2|      case minus:
  ------------------
  |  Branch (214:7): [True: 2, False: 11]
  ------------------
  215|      2|        return "-";
  216|      2|      case times:
  ------------------
  |  Branch (216:7): [True: 2, False: 11]
  ------------------
  217|      2|        return "*";
  218|      3|      case div:
  ------------------
  |  Branch (218:7): [True: 3, False: 10]
  ------------------
  219|      3|        return "/";
  220|      0|      case concat:
  ------------------
  |  Branch (220:7): [True: 0, False: 13]
  ------------------
  221|      0|        return "..";
  222|      1|      case bit_and:
  ------------------
  |  Branch (222:7): [True: 1, False: 12]
  ------------------
  223|      1|        return "&";
  224|      2|      case bit_or:
  ------------------
  |  Branch (224:7): [True: 2, False: 11]
  ------------------
  225|      2|        return "|";
  226|      1|      case bit_xor:
  ------------------
  |  Branch (226:7): [True: 1, False: 12]
  ------------------
  227|      1|        return "^";
  228|      0|      case logic_and:
  ------------------
  |  Branch (228:7): [True: 0, False: 13]
  ------------------
  229|      0|        return "&&";
  230|      0|      case logic_or:
  ------------------
  |  Branch (230:7): [True: 0, False: 13]
  ------------------
  231|      0|        return "||";
  232|     13|    }
  233|      0|    return "";
  234|     13|  }
_ZN2BT3Ast21NumericStringToNumberERNS_3AnyE:
   57|  2.24k|{
   58|  2.24k|  const auto str = value.cast<std::string>();
   59|  2.24k|  const char* end = str.data() + str.size();
   60|  2.24k|  int64_t int_val = 0;
   61|  2.24k|  const auto [ptr, ec] = std::from_chars(str.data(), end, int_val);
   62|  2.24k|  double dbl_val = 0;
   63|  2.24k|  if(ec == std::errc() && ptr == end)
  ------------------
  |  Branch (63:6): [True: 1.13k, False: 1.11k]
  |  Branch (63:27): [True: 562, False: 570]
  ------------------
   64|    562|  {
   65|    562|    value = Any(int_val);
   66|    562|  }
   67|  1.68k|  else if(parseDouble(str, dbl_val, /*require_full_consumption=*/true))
  ------------------
  |  Branch (67:11): [True: 1.59k, False: 86]
  ------------------
   68|  1.59k|  {
   69|  1.59k|    value = Any(dbl_val);
   70|  1.59k|  }
   71|  2.24k|}

_ZN7SafeAny7details13convertNumberIldEEvRKT_RT0_:
  184|   154k|{
  185|   154k|  static_assert(is_convertible_type<SRC>() && is_convertible_type<DST>(), "Not "
  186|   154k|                                                                          "convertible");
  187|       |
  188|   154k|  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|   154k|  {
  233|   154k|    checkTruncation<SRC, DST>(source);
  234|   154k|    target = static_cast<DST>(source);
  235|   154k|  }
  236|   154k|}
_ZN7SafeAny7details15checkTruncationIldEEvRKT_:
  115|   154k|{
  116|       |  // Handle integer to floating point
  117|       |  if constexpr(std::is_integral_v<From> && std::is_floating_point_v<To>)
  118|   154k|  {
  119|       |    // Check if value can be represented exactly in the target type
  120|   154k|    constexpr uint64_t max_exact = (1LL << std::numeric_limits<double>::digits) - 1;
  121|   154k|    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|   154k|    {
  128|       |      // Negate in unsigned arithmetic: std::abs(INT64_MIN) overflows.
  129|   154k|      const auto value = static_cast<int64_t>(from);
  130|   154k|      const uint64_t magnitude =
  131|   154k|          value < 0 ? 0 - static_cast<uint64_t>(value) : static_cast<uint64_t>(value);
  ------------------
  |  Branch (131:11): [True: 2.85k, False: 151k]
  ------------------
  132|   154k|      doesnt_fit = magnitude > max_exact;
  133|   154k|    }
  134|   154k|    if(doesnt_fit)
  ------------------
  |  Branch (134:8): [True: 31, False: 154k]
  ------------------
  135|     31|    {
  136|     31|      throw std::runtime_error("Loss of precision when converting a large integer number "
  137|     31|                               "to floating point:" +
  138|     31|                               std::to_string(from));
  139|     31|    }
  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|   154k|}
_ZN7SafeAny7details13convertNumberIddEEvRKT_RT0_:
  184|  16.0k|{
  185|  16.0k|  static_assert(is_convertible_type<SRC>() && is_convertible_type<DST>(), "Not "
  186|  16.0k|                                                                          "convertible");
  187|       |
  188|  16.0k|  constexpr bool both_integers = is_integer<SRC>() && is_integer<DST>();
  ------------------
  |  Branch (188:34): [Folded, False: 16.0k]
  |  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|  16.0k|  {
  204|  16.0k|    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|  16.0k|}
_ZN7SafeAny7details13convertNumberIdlEEvRKT_RT0_:
  184|  2.93k|{
  185|  2.93k|  static_assert(is_convertible_type<SRC>() && is_convertible_type<DST>(), "Not "
  186|  2.93k|                                                                          "convertible");
  187|       |
  188|  2.93k|  constexpr bool both_integers = is_integer<SRC>() && is_integer<DST>();
  ------------------
  |  Branch (188:34): [Folded, False: 2.93k]
  |  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|  2.93k|  {
  233|  2.93k|    checkTruncation<SRC, DST>(source);
  234|  2.93k|    target = static_cast<DST>(source);
  235|  2.93k|  }
  236|  2.93k|}
_ZN7SafeAny7details15checkTruncationIdlEEvRKT_:
  115|  2.93k|{
  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|  2.93k|  {
  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|  2.93k|    constexpr bool max_rounds_up =
  149|  2.93k|        std::numeric_limits<To>::digits > std::numeric_limits<From>::digits;
  150|  2.93k|    const From max_limit = static_cast<From>(std::numeric_limits<To>::max());
  151|  2.93k|    const bool over = max_rounds_up ? (from >= max_limit) : (from > max_limit);
  ------------------
  |  Branch (151:23): [True: 2.93k, Folded]
  ------------------
  152|  2.93k|    if(over || from < static_cast<From>(std::numeric_limits<To>::lowest()) ||
  ------------------
  |  Branch (152:8): [True: 1, False: 2.93k]
  |  Branch (152:16): [True: 2, False: 2.93k]
  ------------------
  153|  2.93k|       from != std::nearbyint(from))
  ------------------
  |  Branch (153:8): [True: 8, False: 2.92k]
  ------------------
  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|  2.93k|}
_ZN7SafeAny7details13convertNumberIlbEEvRKT_RT0_:
  184|  1.47k|{
  185|  1.47k|  static_assert(is_convertible_type<SRC>() && is_convertible_type<DST>(), "Not "
  186|  1.47k|                                                                          "convertible");
  187|       |
  188|  1.47k|  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.47k|  {
  192|  1.47k|    if(source < 0)
  ------------------
  |  Branch (192:8): [True: 53, False: 1.42k]
  ------------------
  193|     53|    {
  194|     53|      throw std::runtime_error("Value is negative and can't be converted to unsigned");
  195|     53|    }
  196|  1.47k|  }
  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.47k|  {
  209|  1.47k|    checkLowerLimit<SRC, DST>(source);
  210|  1.47k|    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.47k|}
_ZN7SafeAny7details15checkLowerLimitIlbEEvRKT_:
   76|  1.42k|{
   77|       |  if constexpr(std::is_same<To, bool>::value)
   78|  1.42k|  {
   79|  1.42k|    if(from != 0 && from != 1)
  ------------------
  |  Branch (79:8): [True: 815, False: 610]
  |  Branch (79:21): [True: 76, False: 739]
  ------------------
   80|     76|    {
   81|     76|      throw std::runtime_error("Implicit casting to bool is not allowed");
   82|     76|    }
   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.42k|}
_ZN7SafeAny7details13convertNumberIdbEEvRKT_RT0_:
  184|    943|{
  185|    943|  static_assert(is_convertible_type<SRC>() && is_convertible_type<DST>(), "Not "
  186|    943|                                                                          "convertible");
  187|       |
  188|    943|  constexpr bool both_integers = is_integer<SRC>() && is_integer<DST>();
  ------------------
  |  Branch (188:34): [Folded, False: 943]
  |  Branch (188:55): [True: 0, Folded]
  ------------------
  189|       |
  190|       |  if constexpr(is_signed<SRC>() && !is_signed<DST>())
  191|    943|  {
  192|    943|    if(source < 0)
  ------------------
  |  Branch (192:8): [True: 1, False: 942]
  ------------------
  193|      1|    {
  194|      1|      throw std::runtime_error("Value is negative and can't be converted to unsigned");
  195|      1|    }
  196|    943|  }
  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|    943|  {
  204|    943|    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|    943|}

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

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

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

_ZN7SafeAny12SimpleStringC2ERKS0_:
   33|  2.14M|  SimpleString(const SimpleString& other) : SimpleString(other.data(), other.size())
   34|  2.14M|  {}
_ZNK7SafeAny12SimpleString4dataEv:
   87|  2.21M|  {
   88|  2.21M|    if(isSOO())
  ------------------
  |  Branch (88:8): [True: 2.10M, False: 113k]
  ------------------
   89|  2.10M|    {
   90|  2.10M|      return _storage.soo.data;
   91|  2.10M|    }
   92|   113k|    else
   93|   113k|    {
   94|   113k|      return _storage.str.data;
   95|   113k|    }
   96|  2.21M|  }
_ZNK7SafeAny12SimpleString5isSOOEv:
  158|  7.11M|  {
  159|  7.11M|    return (_storage.soo.capacity_left & IS_LONG_BIT) == 0;
  160|  7.11M|  }
_ZNK7SafeAny12SimpleString4sizeEv:
   99|  2.29M|  {
  100|  2.29M|    if(isSOO())
  ------------------
  |  Branch (100:8): [True: 2.15M, False: 139k]
  ------------------
  101|  2.15M|    {
  102|  2.15M|      return CAPACITY - _storage.soo.capacity_left;
  103|  2.15M|    }
  104|   139k|    else
  105|   139k|    {
  106|   139k|      return _storage.str.size & LONG_MASK;
  107|   139k|    }
  108|  2.29M|  }
_ZN7SafeAny12SimpleStringC2EPKcm:
   64|  2.26M|  {
   65|  2.26M|    createImpl(input_data, size);
   66|  2.26M|  }
_ZN7SafeAny12SimpleString10createImplEPKcm:
  187|  2.26M|  {
  188|  2.26M|    if(size > MAX_SIZE)
  ------------------
  |  Branch (188:8): [True: 20, False: 2.26M]
  ------------------
  189|     20|    {
  190|     20|      throw std::invalid_argument("size too large for a simple string");
  191|     20|    }
  192|       |
  193|  2.26M|    if(size > CAPACITY)
  ------------------
  |  Branch (193:8): [True: 116k, False: 2.14M]
  ------------------
  194|   116k|    {
  195|   116k|      _storage.str.size = size;
  196|   116k|      _storage.soo.capacity_left = IS_LONG_BIT;
  197|   116k|      _storage.str.data = new char[size + 1];  // NOLINT(cppcoreguidelines-owning-memory)
  198|   116k|      std::memcpy(_storage.str.data, input_data, size);
  199|   116k|      _storage.str.data[size] = '\0';
  200|   116k|    }
  201|  2.14M|    else
  202|  2.14M|    {
  203|  2.14M|      _storage.soo.capacity_left = uint8_t(CAPACITY - size);
  204|  2.14M|      if(size > 0)
  ------------------
  |  Branch (204:10): [True: 242k, False: 1.90M]
  ------------------
  205|   242k|      {
  206|   242k|        std::memcpy(_storage.soo.data, input_data, size);
  207|   242k|      }
  208|  2.14M|      if(size < CAPACITY)
  ------------------
  |  Branch (208:10): [True: 2.14M, False: 1.43k]
  ------------------
  209|  2.14M|      {
  210|  2.14M|        _storage.soo.data[size] = '\0';
  211|  2.14M|      }
  212|  2.14M|    }
  213|  2.26M|  }
_ZNK7SafeAny12SimpleString15toStdStringViewEv:
   82|  16.1k|  {
   83|  16.1k|    return size() > 0 ? std::string_view(data(), size()) : std::string_view();
  ------------------
  |  Branch (83:12): [True: 16.1k, False: 40]
  ------------------
   84|  16.1k|  }
_ZN7SafeAny12SimpleStringD2Ev:
   69|  2.59M|  {
   70|  2.59M|    if(!isSOO())
  ------------------
  |  Branch (70:8): [True: 116k, False: 2.48M]
  ------------------
   71|   116k|    {
   72|   116k|      delete[] _storage.str.data;
   73|   116k|    }
   74|  2.59M|    _storage.soo.capacity_left = CAPACITY;
   75|  2.59M|  }
_ZNK7SafeAny12SimpleString11toStdStringB5cxx11Ev:
   78|  48.9k|  {
   79|  48.9k|    return size() > 0 ? std::string(data(), size()) : std::string();
  ------------------
  |  Branch (79:12): [True: 45.0k, False: 3.87k]
  ------------------
   80|  48.9k|  }
_ZN7SafeAny12SimpleStringC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
   27|   123k|  SimpleString(const std::string& str) : SimpleString(str.data(), str.size())
   28|   123k|  {}
_ZN7SafeAny12SimpleStringC2EOS0_:
   46|   334k|  SimpleString(SimpleString&& other) noexcept : SimpleString()
   47|   334k|  {
   48|   334k|    std::swap(_storage, other._storage);
   49|   334k|  }
_ZN7SafeAny12SimpleStringC2Ev:
   22|   334k|  {
   23|   334k|    _storage.soo.capacity_left = CAPACITY;
   24|   334k|    _storage.soo.data[0] = '\0';
   25|   334k|  }
_ZNK7SafeAny12SimpleStringeqERKS0_:
  111|  2.20k|  {
  112|  2.20k|    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.20k|    return other.size() == N && std::memcmp(data(), other.data(), N) == 0;
  ------------------
  |  Branch (116:12): [True: 1.31k, False: 894]
  |  Branch (116:33): [True: 825, False: 485]
  ------------------
  117|  2.20k|  }
_ZNK7SafeAny12SimpleStringleERKS0_:
  126|  1.73k|  {
  127|  1.73k|    return !(*this > other);
  128|  1.73k|  }
_ZNK7SafeAny12SimpleStringgeERKS0_:
  131|  1.65k|  {
  132|  1.65k|    return !(*this < other);
  133|  1.65k|  }
_ZNK7SafeAny12SimpleStringltERKS0_:
  136|  3.71k|  {
  137|  3.71k|    const size_t min_size = std::min(size(), other.size());
  138|  3.71k|    int cmp = std::memcmp(data(), other.data(), min_size);
  139|  3.71k|    if(cmp != 0)
  ------------------
  |  Branch (139:8): [True: 1.81k, False: 1.90k]
  ------------------
  140|  1.81k|    {
  141|  1.81k|      return cmp < 0;
  142|  1.81k|    }
  143|  1.90k|    return size() < other.size();
  144|  3.71k|  }
_ZNK7SafeAny12SimpleStringgtERKS0_:
  147|  2.97k|  {
  148|  2.97k|    const size_t min_size = std::min(size(), other.size());
  149|  2.97k|    int cmp = std::memcmp(data(), other.data(), min_size);
  150|  2.97k|    if(cmp != 0)
  ------------------
  |  Branch (150:8): [True: 1.55k, False: 1.42k]
  ------------------
  151|  1.55k|    {
  152|  1.55k|      return cmp > 0;
  153|  1.55k|    }
  154|  1.42k|    return size() > other.size();
  155|  2.97k|  }

_ZN2BT6StrCatIJA2_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|     12|{
   73|     12|  return strings_internal::CatPieces(
   74|     12|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|     12|}
_ZN2BT16strings_internal9CatPiecesB5cxx11ESt16initializer_listISt17basic_string_viewIcSt11char_traitsIcEEE:
   38|  6.52k|{
   39|  6.52k|  std::string out;
   40|  6.52k|  AppendPieces(&out, std::move(pieces));
   41|  6.52k|  return out;
   42|  6.52k|}
_ZN2BT16strings_internal12AppendPiecesEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt16initializer_listISt17basic_string_viewIcS4_EE:
   24|  6.52k|{
   25|  6.52k|  size_t size = 0;
   26|  6.52k|  for(const auto& piece : pieces)
  ------------------
  |  Branch (26:25): [True: 28.5k, False: 6.52k]
  ------------------
   27|  28.5k|  {
   28|  28.5k|    size += piece.size();
   29|  28.5k|  }
   30|  6.52k|  dest->reserve(dest->size() + size);
   31|  6.52k|  for(const auto& piece : pieces)
  ------------------
  |  Branch (31:25): [True: 28.5k, False: 6.52k]
  ------------------
   32|  28.5k|  {
   33|  28.5k|    dest->append(piece.data(), piece.size());
   34|  28.5k|  }
   35|  6.52k|}
_ZN2BT6StrCatB5cxx11ERKSt17basic_string_viewIcSt11char_traitsIcEE:
   52|  6.96k|{
   53|  6.96k|  return std::string(a.data(), a.size());
   54|  6.96k|}
_ZN2BT6StrCatB5cxx11ERKSt17basic_string_viewIcSt11char_traitsIcEES5_:
   57|    502|{
   58|    502|  return strings_internal::CatPieces({ a, b });
   59|    502|}
_ZN2BT6StrCatB5cxx11ERKSt17basic_string_viewIcSt11char_traitsIcEES5_S5_:
   63|    100|{
   64|    100|  return strings_internal::CatPieces({ a, b, c });
   65|    100|}
_ZN2BT6StrCatIJEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS4_ESA_SA_SA_DpRKT_:
   72|  3.15k|{
   73|  3.15k|  return strings_internal::CatPieces(
   74|  3.15k|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|  3.15k|}
_ZN2BT6StrCatIJA8_cSt17basic_string_viewIcSt11char_traitsIcEEA3_cEEENSt7__cxx1112basic_stringIcS4_SaIcEEERKS5_SC_SC_SC_DpRKT_:
   72|    345|{
   73|    345|  return strings_internal::CatPieces(
   74|    345|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|    345|}
_ZN2BT6StrCatIJA38_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|    501|{
   73|    501|  return strings_internal::CatPieces(
   74|    501|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|    501|}
_ZN2BT6StrCatIJA3_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|  1.70k|{
   73|  1.70k|  return strings_internal::CatPieces(
   74|  1.70k|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|  1.70k|}
_ZN2BT6StrCatIJA21_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|     77|{
   73|     77|  return strings_internal::CatPieces(
   74|     77|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|     77|}
_ZN2BT6StrCatIJA4_cEEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt17basic_string_viewIcS5_ESB_SB_SB_DpRKT_:
   72|     48|{
   73|     48|  return strings_internal::CatPieces(
   74|     48|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|     48|}
_ZN2BT6StrCatIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEA2_cEEES6_RKSt17basic_string_viewIcS4_ESB_SB_SB_DpRKT_:
   72|     48|{
   73|     48|  return strings_internal::CatPieces(
   74|     48|      { a, b, c, d, static_cast<const std::string_view&>(args)... });
   75|     48|}
_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|  23.5k|{
  211|       |#if defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L)
  212|       |  // std::from_chars is locale-independent and thread-safe.
  213|       |  const char* begin = str.data();
  214|       |  const char* end = begin + str.size();
  215|       |  const auto [ptr, ec] = std::from_chars(begin, end, out);
  216|       |  if(ec != std::errc())
  217|       |  {
  218|       |    return false;
  219|       |  }
  220|       |  return !require_full_consumption || ptr == end;
  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|  23.5k|  if(str.empty())
  ------------------
  |  Branch (227:6): [True: 58, False: 23.5k]
  ------------------
  228|     58|  {
  229|     58|    return false;
  230|     58|  }
  231|  23.5k|  const char first = str.front();
  232|  23.5k|  if(first == '+' || std::isspace(static_cast<unsigned char>(first)) != 0)
  ------------------
  |  Branch (232:6): [True: 3, False: 23.5k]
  |  Branch (232:22): [True: 3, False: 23.5k]
  ------------------
  233|      6|  {
  234|      6|    return false;
  235|      6|  }
  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|  23.5k|  const std::size_t mantissa = (first == '-') ? 1u : 0u;
  ------------------
  |  Branch (240:32): [True: 1.01k, False: 22.5k]
  ------------------
  241|  23.5k|  if(str.size() > mantissa + 1 && str[mantissa] == '0' &&
  ------------------
  |  Branch (241:6): [True: 9.72k, False: 13.8k]
  |  Branch (241:35): [True: 1.82k, False: 7.90k]
  ------------------
  242|  1.82k|     (str[mantissa + 1] == 'x' || str[mantissa + 1] == 'X'))
  ------------------
  |  Branch (242:7): [True: 392, False: 1.42k]
  |  Branch (242:35): [True: 237, False: 1.19k]
  ------------------
  243|    629|  {
  244|    629|    if(require_full_consumption)
  ------------------
  |  Branch (244:8): [True: 1, False: 628]
  ------------------
  245|      1|    {
  246|      1|      return false;
  247|      1|    }
  248|    628|    out = (first == '-') ? -0.0 : 0.0;
  ------------------
  |  Branch (248:11): [True: 61, False: 567]
  ------------------
  249|    628|    return true;
  250|    629|  }
  251|  22.9k|  static ::locale_t c_locale =
  252|  22.9k|      ::newlocale(LC_NUMERIC_MASK, "C", static_cast<::locale_t>(0));
  253|  22.9k|  if(c_locale == static_cast<::locale_t>(0))
  ------------------
  |  Branch (253:6): [True: 0, False: 22.9k]
  ------------------
  254|      0|  {
  255|      0|    return false;
  256|      0|  }
  257|       |  // strtod_l needs a null-terminated buffer.
  258|  22.9k|  const std::string buffer(str.data(), str.size());
  259|  22.9k|  errno = 0;
  260|  22.9k|  char* parse_end = nullptr;
  261|  22.9k|  const double value = ::strtod_l(buffer.c_str(), &parse_end, c_locale);
  262|  22.9k|  if(parse_end == buffer.c_str() || errno == ERANGE)
  ------------------
  |  Branch (262:6): [True: 141, False: 22.7k]
  |  Branch (262:37): [True: 52, False: 22.7k]
  ------------------
  263|    193|  {
  264|    193|    return false;
  265|    193|  }
  266|  22.7k|  if(require_full_consumption && parse_end != buffer.c_str() + buffer.size())
  ------------------
  |  Branch (266:6): [True: 1.63k, False: 21.0k]
  |  Branch (266:34): [True: 33, False: 1.59k]
  ------------------
  267|     33|  {
  268|     33|    return false;
  269|     33|  }
  270|  22.6k|  out = value;
  271|  22.6k|  return true;
  272|  22.7k|#endif
  273|  22.7k|}
_ZN2BT17convertFromStringIdEET_St17basic_string_viewIcSt11char_traitsIcEE:
  277|  5.71k|{
  278|  5.71k|  double result = 0;
  279|  5.71k|  if(!parseDouble(str, result, /*require_full_consumption=*/false))
  ------------------
  |  Branch (279:6): [True: 51, False: 5.66k]
  ------------------
  280|     51|  {
  281|     51|    throw RuntimeError(StrCat("Can't convert string [", str, "] to double"));
  282|     51|  }
  283|  5.66k|  return result;
  284|  5.71k|}
_ZNK2BT8TypeInfo4typeEv:
  520|  39.7k|{
  521|  39.7k|  return type_info_;
  522|  39.7k|}
_ZN2BT9StartWithESt17basic_string_viewIcSt11char_traitsIcEEc:
  683|  3.86M|{
  684|  3.86M|  return str.size() >= 1 && str[0] == prefix;
  ------------------
  |  Branch (684:10): [True: 1.99M, False: 1.86M]
  |  Branch (684:29): [True: 1.87M, False: 119k]
  ------------------
  685|  3.86M|}

_ZN2BT10Blackboard12getAnyLockedERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  153|  1.87M|{
  154|  1.87M|  if(auto entry = getEntry(key))
  ------------------
  |  Branch (154:11): [True: 1.87M, False: 502]
  ------------------
  155|  1.87M|  {
  156|  1.87M|    return AnyPtrLocked(&entry->value, &entry->entry_mutex);
  157|  1.87M|  }
  158|    502|  return {};
  159|  1.87M|}
_ZNK2BT10Blackboard8getEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  183|  3.79M|{
  184|       |  // special syntax: "@" will always refer to the root BB
  185|  3.79M|  if(StartWith(key, '@'))
  ------------------
  |  Branch (185:6): [True: 1.87M, False: 1.92M]
  ------------------
  186|  1.87M|  {
  187|  1.87M|    return rootBlackboard()->getEntry(key.substr(1, key.size() - 1));
  188|  1.87M|  }
  189|       |
  190|  1.92M|  {
  191|  1.92M|    const std::shared_lock<std::shared_mutex> storage_lock(storage_mutex_);
  192|  1.92M|    auto it = storage_.find(key);
  193|  1.92M|    if(it != storage_.end())
  ------------------
  |  Branch (193:8): [True: 1.89M, False: 32.7k]
  ------------------
  194|  1.89M|    {
  195|  1.89M|      return it->second;
  196|  1.89M|    }
  197|  1.92M|  }
  198|       |  // not found. Try autoremapping
  199|  32.7k|  if(auto parent = parent_bb_.lock())
  ------------------
  |  Branch (199:11): [True: 0, False: 32.7k]
  ------------------
  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.7k|  return {};
  213|  32.7k|}
_ZN2BT10Blackboard8getEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  216|  1.92M|{
  217|  1.92M|  return static_cast<const Blackboard&>(*this).getEntry(key);
  218|  1.92M|}
_ZN2BT10Blackboard11createEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_8TypeInfoE:
  307|  9.06k|{
  308|  9.06k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (308:6): [True: 2.85k, False: 6.20k]
  ------------------
  309|  2.85k|  {
  310|  2.85k|    if(key.find('@', 1) != std::string::npos)
  ------------------
  |  Branch (310:8): [True: 0, False: 2.85k]
  ------------------
  311|      0|    {
  312|      0|      throw LogicError("Character '@' used multiple times in the key");
  313|      0|    }
  314|  2.85k|    rootBlackboard()->createEntryImpl(key.substr(1, key.size() - 1), info);
  315|  2.85k|  }
  316|  6.20k|  else
  317|  6.20k|  {
  318|  6.20k|    createEntryImpl(key, info);
  319|  6.20k|  }
  320|  9.06k|}
_ZN2BT10Blackboard15createEntryImplERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_8TypeInfoE:
  443|  32.1k|{
  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|  32.1k|  if(StartWith(key, '@'))
  ------------------
  |  Branch (448:6): [True: 0, False: 32.1k]
  ------------------
  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|  32.1k|  if(GetRetiredEntries().count != 0)
  ------------------
  |  Branch (454:6): [True: 0, False: 32.1k]
  ------------------
  455|      0|  {
  456|      0|    SweepRetiredEntries();
  457|      0|  }
  458|       |
  459|  32.1k|  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|  32.1k|  auto storage_it = storage_.find(key);
  465|  32.1k|  if(storage_it != storage_.end())
  ------------------
  |  Branch (465:6): [True: 0, False: 32.1k]
  ------------------
  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|  32.1k|  auto remapping_it = internal_to_external_.find(key);
  484|  32.1k|  if(remapping_it != internal_to_external_.end())
  ------------------
  |  Branch (484:6): [True: 0, False: 32.1k]
  ------------------
  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|  32.1k|  if(autoremapping_ && !IsPrivateKey(key))
  ------------------
  |  Branch (494:6): [True: 0, False: 32.1k]
  |  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|  32.1k|  auto entry = MakeEntry(info);
  505|       |  // even if empty, let's assign to it a default type
  506|  32.1k|  entry->value = Any(info.type());
  507|  32.1k|  storage_.insert({ key, entry });
  508|  32.1k|  return entry;
  509|  32.1k|}
_ZN2BT10Blackboard14rootBlackboardEv:
  559|  2.85k|{
  560|  2.85k|  auto bb = static_cast<const Blackboard&>(*this).rootBlackboard();
  561|       |  // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast)
  562|  2.85k|  return const_cast<Blackboard*>(bb);
  563|  2.85k|}
_ZNK2BT10Blackboard14rootBlackboardEv:
  566|  1.87M|{
  567|  1.87M|  const Blackboard* bb = this;
  568|  1.87M|  Blackboard::Ptr prev = parent_bb_.lock();
  569|  1.87M|  while(prev)
  ------------------
  |  Branch (569:9): [True: 0, False: 1.87M]
  ------------------
  570|      0|  {
  571|      0|    bb = prev.get();
  572|      0|    prev = bb->parent_bb_.lock();
  573|      0|  }
  574|  1.87M|  return bb;
  575|  1.87M|}
blackboard.cpp:_ZN2BT12_GLOBAL__N_19MakeEntryERKNS_8TypeInfoE:
  106|  32.1k|{
  107|  32.1k|  return { new Blackboard::Entry(info), &RetireEntry };
  108|  32.1k|}
blackboard.cpp:_ZN2BT12_GLOBAL__N_111RetireEntryEPNS_10Blackboard5EntryE:
   95|  32.1k|{
   96|       |  // Common case: nothing is parked and nobody holds this entry
   97|  32.1k|  if(GetRetiredEntries().count == 0 && IsUnlocked(retired))
  ------------------
  |  Branch (97:6): [True: 32.1k, False: 0]
  |  Branch (97:40): [True: 32.1k, False: 0]
  ------------------
   98|  32.1k|  {
   99|  32.1k|    delete retired;  // NOLINT(cppcoreguidelines-owning-memory)
  100|  32.1k|    return;
  101|  32.1k|  }
  102|      0|  SweepRetiredEntries(retired);
  103|      0|}
blackboard.cpp:_ZN2BT12_GLOBAL__N_110IsUnlockedEPNS_10Blackboard5EntryE:
   51|  32.1k|{
   52|  32.1k|  if(entry->entry_mutex.try_lock())
  ------------------
  |  Branch (52:6): [True: 32.1k, False: 0]
  ------------------
   53|  32.1k|  {
   54|  32.1k|    entry->entry_mutex.unlock();
   55|  32.1k|    return true;
   56|  32.1k|  }
   57|      0|  return false;
   58|  32.1k|}
blackboard.cpp:_ZN2BT12_GLOBAL__N_117GetRetiredEntriesEv:
   37|  64.3k|{
   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|  64.3k|  static auto* const instance = new RetiredEntries();
   42|  64.3k|  return *instance;
   43|  64.3k|}

_ZN2BT9Scripting15parseStatementsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  490|  13.1k|{
  491|  13.1k|  auto tokens = tokenize(script);
  492|  13.1k|  ScriptParser parser(std::move(tokens));
  493|  13.1k|  return parser.parseAll();
  494|  13.1k|}
_ZN2BT11ParseScriptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  501|  7.36k|{
  502|  7.36k|  try
  503|  7.36k|  {
  504|  7.36k|    auto exprs = Scripting::parseStatements(script);
  505|  7.36k|    if(exprs.empty())
  ------------------
  |  Branch (505:8): [True: 64, False: 7.29k]
  ------------------
  506|     64|    {
  507|     64|      return nonstd::make_unexpected("Empty Script");
  508|     64|    }
  509|  7.29k|    return [exprs = std::move(exprs), script](Ast::Environment& env) {
  510|  7.29k|      try
  511|  7.29k|      {
  512|  7.29k|        for(size_t i = 0; i < exprs.size() - 1; ++i)
  513|  7.29k|        {
  514|  7.29k|          exprs[i]->evaluate(env);
  515|  7.29k|        }
  516|  7.29k|        return exprs.back()->evaluate(env);
  517|  7.29k|      }
  518|  7.29k|      catch(RuntimeError& err)
  519|  7.29k|      {
  520|  7.29k|        throw RuntimeError(StrCat("Error in script [", script, "]\n", err.what()));
  521|  7.29k|      }
  522|  7.29k|    };
  523|  7.36k|  }
  524|  7.36k|  catch(RuntimeError& err)
  525|  7.36k|  {
  526|  3.09k|    return nonstd::make_unexpected(err.what());
  527|  3.09k|  }
  528|  7.36k|}
_ZN2BT21ParseScriptAndExecuteERNS_3Ast11EnvironmentERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  531|  5.78k|{
  532|  5.78k|  auto executor = ParseScript(script);
  533|  5.78k|  if(executor)
  ------------------
  |  Branch (533:6): [True: 4.20k, False: 1.57k]
  ------------------
  534|  4.20k|  {
  535|  4.20k|    try
  536|  4.20k|    {
  537|  4.20k|      return executor.value()(env);
  538|  4.20k|    }
  539|  4.20k|    catch(RuntimeError& err)
  540|  4.20k|    {
  541|  1.16k|      return nonstd::make_unexpected(err.what());
  542|  1.16k|    }
  543|  4.20k|  }
  544|  1.57k|  return nonstd::make_unexpected(executor.error());
  545|  5.78k|}
_ZN2BT14ValidateScriptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  548|  5.78k|{
  549|  5.78k|  try
  550|  5.78k|  {
  551|  5.78k|    auto exprs = Scripting::parseStatements(script);
  552|  5.78k|    if(exprs.empty())
  ------------------
  |  Branch (552:8): [True: 32, False: 5.75k]
  ------------------
  553|     32|    {
  554|     32|      return nonstd::make_unexpected("Empty Script");
  555|     32|    }
  556|  5.75k|    return {};
  557|  5.78k|  }
  558|  5.78k|  catch(RuntimeError& err)
  559|  5.78k|  {
  560|  1.54k|    return nonstd::make_unexpected(err.what());
  561|  1.54k|  }
  562|  5.78k|}
_ZN2BT9Scripting12ScriptParserC2ESt6vectorINS0_5TokenESaIS3_EE:
   29|  13.1k|  explicit ScriptParser(std::vector<Token> tokens) : tokens_(std::move(tokens))
   30|  13.1k|  {}
_ZN2BT9Scripting12ScriptParser8parseAllEv:
   33|  13.1k|  {
   34|  13.1k|    std::vector<Ast::expr_ptr> stmts;
   35|  13.0M|    while(!atEnd())
  ------------------
  |  Branch (35:11): [True: 13.0M, False: 13.1k]
  ------------------
   36|  13.0M|    {
   37|  13.0M|      stmts.push_back(parseExpr(0));
   38|       |      // consume optional semicolons between statements
   39|  13.0M|      while(check(TokenType::Semicolon))
  ------------------
  |  Branch (39:13): [True: 5.90k, False: 13.0M]
  ------------------
   40|  5.90k|      {
   41|  5.90k|        advance();
   42|  5.90k|      }
   43|  13.0M|    }
   44|  13.1k|    return stmts;
   45|  13.1k|  }
_ZNK2BT9Scripting12ScriptParser5atEndEv:
   92|  30.3M|  {
   93|  30.3M|    return peek().type == TokenType::EndOfInput;
   94|  30.3M|  }
_ZNK2BT9Scripting12ScriptParser4peekEv:
   79|  75.7M|  {
   80|  75.7M|    return tokens_[current_];
   81|  75.7M|  }
_ZN2BT9Scripting12ScriptParser9parseExprEi:
  300|  15.1M|  {
  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|  15.1M|    if(++depth_ > kMaxNestingDepth)
  ------------------
  |  Branch (306:8): [True: 12, False: 15.1M]
  ------------------
  307|     12|    {
  308|     12|      throw RuntimeError(StrCat("Parse error at position ", std::to_string(peek().pos),
  309|     12|                                ": expression nesting is too deep (limit ",
  310|     12|                                std::to_string(kMaxNestingDepth), ")"));
  311|     12|    }
  312|       |
  313|  15.1M|    auto left = parsePrefix();
  314|  15.1M|    int left_height = height_;
  315|       |
  316|  15.2M|    while(true)
  ------------------
  |  Branch (316:11): [True: 15.2M, Folded]
  ------------------
  317|  15.2M|    {
  318|  15.2M|      auto tokType = peek().type;
  319|  15.2M|      int lbp = leftBP(tokType);
  320|  15.2M|      if(lbp < 0 || lbp < minBP)
  ------------------
  |  Branch (320:10): [True: 13.1M, False: 2.09M]
  |  Branch (320:21): [True: 1.92M, False: 174k]
  ------------------
  321|  15.0M|      {
  322|  15.0M|        break;
  323|  15.0M|      }
  324|       |
  325|       |      // Assignment (non-associative: parse once, then break)
  326|   174k|      if(isAssignment(tokType))
  ------------------
  |  Branch (326:10): [True: 58.4k, False: 115k]
  ------------------
  327|  58.4k|      {
  328|  58.4k|        left = parseAssignment(std::move(left));
  329|  58.4k|        left_height = combinedHeight(left_height);
  330|  58.4k|        break;
  331|  58.4k|      }
  332|       |
  333|       |      // Ternary (non-associative: parse once, then break)
  334|   115k|      if(tokType == TokenType::Question)
  ------------------
  |  Branch (334:10): [True: 11.0k, False: 104k]
  ------------------
  335|  11.0k|      {
  336|  11.0k|        left = parseTernary(std::move(left));
  337|  11.0k|        left_height = combinedHeight(left_height);
  338|  11.0k|        break;
  339|  11.0k|      }
  340|       |
  341|       |      // Chained comparison
  342|   104k|      if(isComparison(tokType))
  ------------------
  |  Branch (342:10): [True: 56.4k, False: 48.0k]
  ------------------
  343|  56.4k|      {
  344|  56.4k|        left = parseChainedComparison(std::move(left));
  345|  56.4k|        left_height = combinedHeight(left_height);
  346|  56.4k|        continue;
  347|  56.4k|      }
  348|       |
  349|       |      // Regular left-associative binary operator
  350|  48.0k|      const auto& opTok = advance();
  351|       |      // Right BP = LBP + 1 for left-associativity
  352|  48.0k|      auto right = parseExpr(lbp + 1);
  353|  48.0k|      left = makeBinary(std::move(left), opTok.type, std::move(right));
  354|  48.0k|      left_height = combinedHeight(left_height);
  355|  48.0k|    }
  356|       |
  357|  15.1M|    --depth_;
  358|  15.1M|    height_ = left_height;
  359|  15.1M|    return left;
  360|  15.1M|  }
_ZN2BT9Scripting12ScriptParser11parsePrefixEv:
  197|  15.1M|  {
  198|  15.1M|    const auto& tok = peek();
  199|       |    // literals and identifiers are leaves; the cases below that parse a
  200|       |    // subexpression overwrite it
  201|  15.1M|    height_ = 1;
  202|       |
  203|       |    // Unary minus
  204|  15.1M|    if(tok.type == TokenType::Minus)
  ------------------
  |  Branch (204:8): [True: 9.46k, False: 15.1M]
  ------------------
  205|  9.46k|    {
  206|  9.46k|      advance();
  207|  9.46k|      auto operand = parseExpr(kPrefixBP);
  208|  9.46k|      height_ = combinedHeight(0);
  209|  9.46k|      return std::make_shared<Ast::ExprUnaryArithmetic>(Ast::ExprUnaryArithmetic::negate,
  210|  9.46k|                                                        std::move(operand));
  211|  9.46k|    }
  212|       |    // Bitwise complement
  213|  15.1M|    if(tok.type == TokenType::Tilde)
  ------------------
  |  Branch (213:8): [True: 19.9k, False: 15.1M]
  ------------------
  214|  19.9k|    {
  215|  19.9k|      advance();
  216|  19.9k|      auto operand = parseExpr(kPrefixBP);
  217|  19.9k|      height_ = combinedHeight(0);
  218|  19.9k|      return std::make_shared<Ast::ExprUnaryArithmetic>(
  219|  19.9k|          Ast::ExprUnaryArithmetic::complement, std::move(operand));
  220|  19.9k|    }
  221|       |    // Logical NOT
  222|  15.1M|    if(tok.type == TokenType::Bang)
  ------------------
  |  Branch (222:8): [True: 12.3k, False: 15.1M]
  ------------------
  223|  12.3k|    {
  224|  12.3k|      advance();
  225|  12.3k|      auto operand = parseExpr(kPrefixBP);
  226|  12.3k|      height_ = combinedHeight(0);
  227|  12.3k|      return std::make_shared<Ast::ExprUnaryArithmetic>(
  228|  12.3k|          Ast::ExprUnaryArithmetic::logical_not, std::move(operand));
  229|  12.3k|    }
  230|       |    // Parenthesized expression
  231|  15.1M|    if(tok.type == TokenType::LeftParen)
  ------------------
  |  Branch (231:8): [True: 17.1k, False: 15.1M]
  ------------------
  232|  17.1k|    {
  233|  17.1k|      advance();
  234|  17.1k|      auto expr = parseExpr(0);
  235|  17.1k|      expect(TokenType::RightParen, "expected ')'");
  236|  17.1k|      return expr;
  237|  17.1k|    }
  238|       |    // Boolean literal
  239|  15.1M|    if(tok.type == TokenType::Boolean)
  ------------------
  |  Branch (239:8): [True: 1.66k, False: 15.1M]
  ------------------
  240|  1.66k|    {
  241|  1.66k|      advance();
  242|  1.66k|      double val = (tok.text == "true") ? 1.0 : 0.0;
  ------------------
  |  Branch (242:20): [True: 930, False: 731]
  ------------------
  243|  1.66k|      return std::make_shared<Ast::ExprLiteral>(Any(val));
  244|  1.66k|    }
  245|       |    // Integer literal
  246|  15.1M|    if(tok.type == TokenType::Integer)
  ------------------
  |  Branch (246:8): [True: 1.68M, False: 13.4M]
  ------------------
  247|  1.68M|    {
  248|  1.68M|      advance();
  249|  1.68M|      int64_t val = 0;
  250|  1.68M|      const char* first = tok.text.data();
  251|  1.68M|      const char* last = first + tok.text.size();
  252|  1.68M|      const bool is_hex = tok.text.size() > 2 && tok.text[0] == '0' &&
  ------------------
  |  Branch (252:27): [True: 23.0k, False: 1.65M]
  |  Branch (252:50): [True: 3.26k, False: 19.7k]
  ------------------
  253|  3.26k|                          (tok.text[1] == 'x' || tok.text[1] == 'X');
  ------------------
  |  Branch (253:28): [True: 1.01k, False: 2.24k]
  |  Branch (253:50): [True: 1.39k, False: 854]
  ------------------
  254|  1.68M|      const auto [ptr, ec] = is_hex ? std::from_chars(first + 2, last, val, 16) :
  ------------------
  |  Branch (254:30): [True: 2.40k, False: 1.67M]
  ------------------
  255|  1.68M|                                      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.68M|      if(ec != std::errc() || ptr != last)
  ------------------
  |  Branch (260:10): [True: 501, False: 1.67M]
  |  Branch (260:31): [True: 0, False: 1.67M]
  ------------------
  261|    501|      {
  262|    501|        throw RuntimeError(StrCat("Integer literal '", tok.text, "' at position ",
  263|    501|                                  std::to_string(tok.pos),
  264|    501|                                  " is out of range for a 64-bit integer"));
  265|    501|      }
  266|  1.67M|      return std::make_shared<Ast::ExprLiteral>(Any(val));
  267|  1.68M|    }
  268|       |    // Real literal
  269|  13.4M|    if(tok.type == TokenType::Real)
  ------------------
  |  Branch (269:8): [True: 5.71k, False: 13.4M]
  ------------------
  270|  5.71k|    {
  271|  5.71k|      advance();
  272|  5.71k|      double val = convertFromString<double>(tok.text);
  273|  5.71k|      return std::make_shared<Ast::ExprLiteral>(Any(val));
  274|  5.71k|    }
  275|       |    // String literal
  276|  13.4M|    if(tok.type == TokenType::String)
  ------------------
  |  Branch (276:8): [True: 101k, False: 13.3M]
  ------------------
  277|   101k|    {
  278|   101k|      advance();
  279|   101k|      return std::make_shared<Ast::ExprLiteral>(Any(std::string(tok.text)));
  280|   101k|    }
  281|       |    // Identifier
  282|  13.3M|    if(tok.type == TokenType::Identifier)
  ------------------
  |  Branch (282:8): [True: 13.3M, False: 3.69k]
  ------------------
  283|  13.3M|    {
  284|  13.3M|      advance();
  285|  13.3M|      return std::make_shared<Ast::ExprName>(std::string(tok.text));
  286|  13.3M|    }
  287|       |    // Error token from tokenizer
  288|  3.69k|    if(tok.type == TokenType::Error)
  ------------------
  |  Branch (288:8): [True: 1.99k, False: 1.70k]
  ------------------
  289|  1.99k|    {
  290|  1.99k|      throw RuntimeError(
  291|  1.99k|          StrCat("Invalid token '", tok.text, "' at position ", std::to_string(tok.pos)));
  292|  1.99k|    }
  293|       |
  294|  1.70k|    throw RuntimeError(StrCat("Expected operand at position ", std::to_string(tok.pos),
  295|  1.70k|                              " (got '", tok.text, "')"));
  296|  3.69k|  }
_ZN2BT9Scripting12ScriptParser6expectENS0_9TokenTypeEPKc:
  102|  10.8k|  {
  103|  10.8k|    if(!check(type))
  ------------------
  |  Branch (103:8): [True: 345, False: 10.5k]
  ------------------
  104|    345|    {
  105|    345|      throw RuntimeError(StrCat("Parse error at position ", std::to_string(peek().pos),
  106|    345|                                ": ", msg, " (got '", peek().text, "')"));
  107|    345|    }
  108|  10.5k|    return advance();
  109|  10.8k|  }
_ZN2BT9Scripting12ScriptParser6leftBPENS0_9TokenTypeE:
  116|  15.2M|  {
  117|  15.2M|    switch(type)
  118|  15.2M|    {
  119|       |      // Assignment (level 1, non-associative)
  120|  23.5k|      case TokenType::ColonEqual:
  ------------------
  |  Branch (120:7): [True: 23.5k, False: 15.2M]
  ------------------
  121|  36.4k|      case TokenType::Equal:
  ------------------
  |  Branch (121:7): [True: 12.8k, False: 15.2M]
  ------------------
  122|  54.3k|      case TokenType::PlusEqual:
  ------------------
  |  Branch (122:7): [True: 17.9k, False: 15.2M]
  ------------------
  123|  56.1k|      case TokenType::MinusEqual:
  ------------------
  |  Branch (123:7): [True: 1.79k, False: 15.2M]
  ------------------
  124|  57.9k|      case TokenType::StarEqual:
  ------------------
  |  Branch (124:7): [True: 1.74k, False: 15.2M]
  ------------------
  125|  59.6k|      case TokenType::SlashEqual:
  ------------------
  |  Branch (125:7): [True: 1.71k, False: 15.2M]
  ------------------
  126|  59.6k|        return kAssignmentBP;
  127|       |      // Ternary (level 2, non-associative)
  128|  15.8k|      case TokenType::Question:
  ------------------
  |  Branch (128:7): [True: 15.8k, False: 15.2M]
  ------------------
  129|  15.8k|        return kTernaryBP;
  130|       |      // Logical OR (level 3)
  131|  2.21k|      case TokenType::PipePipe:
  ------------------
  |  Branch (131:7): [True: 2.21k, False: 15.2M]
  ------------------
  132|  2.21k|        return 6;
  133|       |      // Logical AND (level 4)
  134|  5.47k|      case TokenType::AmpAmp:
  ------------------
  |  Branch (134:7): [True: 5.47k, False: 15.2M]
  ------------------
  135|  5.47k|        return 8;
  136|       |      // Comparison (level 5, chainable)
  137|  6.95k|      case TokenType::EqualEqual:
  ------------------
  |  Branch (137:7): [True: 6.95k, False: 15.2M]
  ------------------
  138|   114k|      case TokenType::BangEqual:
  ------------------
  |  Branch (138:7): [True: 107k, False: 15.1M]
  ------------------
  139|   377k|      case TokenType::Less:
  ------------------
  |  Branch (139:7): [True: 263k, False: 14.9M]
  ------------------
  140|  1.91M|      case TokenType::Greater:
  ------------------
  |  Branch (140:7): [True: 1.53M, False: 13.7M]
  ------------------
  141|  1.91M|      case TokenType::LessEqual:
  ------------------
  |  Branch (141:7): [True: 7.07k, False: 15.2M]
  ------------------
  142|  1.93M|      case TokenType::GreaterEqual:
  ------------------
  |  Branch (142:7): [True: 20.4k, False: 15.2M]
  ------------------
  143|  1.93M|        return kComparisonBP;
  144|       |      // Bitwise OR/XOR (level 6)
  145|  21.8k|      case TokenType::Pipe:
  ------------------
  |  Branch (145:7): [True: 21.8k, False: 15.2M]
  ------------------
  146|  22.9k|      case TokenType::Caret:
  ------------------
  |  Branch (146:7): [True: 1.12k, False: 15.2M]
  ------------------
  147|  22.9k|        return 12;
  148|       |      // Bitwise AND (level 7)
  149|  4.16k|      case TokenType::Ampersand:
  ------------------
  |  Branch (149:7): [True: 4.16k, False: 15.2M]
  ------------------
  150|  4.16k|        return 14;
  151|       |      // Add/Sub/Concat (level 8)
  152|  25.0k|      case TokenType::Plus:
  ------------------
  |  Branch (152:7): [True: 25.0k, False: 15.2M]
  ------------------
  153|  33.0k|      case TokenType::Minus:
  ------------------
  |  Branch (153:7): [True: 7.99k, False: 15.2M]
  ------------------
  154|  46.9k|      case TokenType::DotDot:
  ------------------
  |  Branch (154:7): [True: 13.9k, False: 15.2M]
  ------------------
  155|  46.9k|        return 16;
  156|       |      // Mul/Div (level 9)
  157|  2.47k|      case TokenType::Star:
  ------------------
  |  Branch (157:7): [True: 2.47k, False: 15.2M]
  ------------------
  158|  4.03k|      case TokenType::Slash:
  ------------------
  |  Branch (158:7): [True: 1.55k, False: 15.2M]
  ------------------
  159|  4.03k|        return kMulDivBP;
  160|  13.1M|      default:
  ------------------
  |  Branch (160:7): [True: 13.1M, False: 2.09M]
  ------------------
  161|  13.1M|        return -1;
  162|  15.2M|    }
  163|  15.2M|  }
_ZN2BT9Scripting12ScriptParser12isAssignmentENS0_9TokenTypeE:
  173|   174k|  {
  174|   174k|    return type == TokenType::ColonEqual || type == TokenType::Equal ||
  ------------------
  |  Branch (174:12): [True: 22.7k, False: 151k]
  |  Branch (174:45): [True: 12.5k, False: 138k]
  ------------------
  175|   138k|           type == TokenType::PlusEqual || type == TokenType::MinusEqual ||
  ------------------
  |  Branch (175:12): [True: 17.9k, False: 120k]
  |  Branch (175:44): [True: 1.78k, False: 118k]
  ------------------
  176|   118k|           type == TokenType::StarEqual || type == TokenType::SlashEqual;
  ------------------
  |  Branch (176:12): [True: 1.74k, False: 117k]
  |  Branch (176:44): [True: 1.61k, False: 115k]
  ------------------
  177|   174k|  }
_ZN2BT9Scripting12ScriptParser15parseAssignmentESt10shared_ptrINS_3Ast8ExprBaseEE:
  363|  58.4k|  {
  364|  58.4k|    const auto& opTok = advance();
  365|  58.4k|    Ast::ExprAssignment::op_t op{};
  366|  58.4k|    switch(opTok.type)
  367|  58.4k|    {
  368|  22.7k|      case TokenType::ColonEqual:
  ------------------
  |  Branch (368:7): [True: 22.7k, False: 35.6k]
  ------------------
  369|  22.7k|        op = Ast::ExprAssignment::assign_create;
  370|  22.7k|        break;
  371|  12.5k|      case TokenType::Equal:
  ------------------
  |  Branch (371:7): [True: 12.5k, False: 45.9k]
  ------------------
  372|  12.5k|        op = Ast::ExprAssignment::assign_existing;
  373|  12.5k|        break;
  374|  17.9k|      case TokenType::PlusEqual:
  ------------------
  |  Branch (374:7): [True: 17.9k, False: 40.4k]
  ------------------
  375|  17.9k|        op = Ast::ExprAssignment::assign_plus;
  376|  17.9k|        break;
  377|  1.78k|      case TokenType::MinusEqual:
  ------------------
  |  Branch (377:7): [True: 1.78k, False: 56.6k]
  ------------------
  378|  1.78k|        op = Ast::ExprAssignment::assign_minus;
  379|  1.78k|        break;
  380|  1.74k|      case TokenType::StarEqual:
  ------------------
  |  Branch (380:7): [True: 1.74k, False: 56.6k]
  ------------------
  381|  1.74k|        op = Ast::ExprAssignment::assign_times;
  382|  1.74k|        break;
  383|  1.61k|      case TokenType::SlashEqual:
  ------------------
  |  Branch (383:7): [True: 1.61k, False: 56.8k]
  ------------------
  384|  1.61k|        op = Ast::ExprAssignment::assign_div;
  385|  1.61k|        break;
  386|      0|      default:
  ------------------
  |  Branch (386:7): [True: 0, False: 58.4k]
  ------------------
  387|      0|        throw RuntimeError("Internal error: unexpected assignment op");
  388|  58.4k|    }
  389|       |    // Parse RHS -- use minBP=0 to allow full expression
  390|  58.4k|    auto right = parseExpr(0);
  391|  58.4k|    return std::make_shared<Ast::ExprAssignment>(std::move(left), op, std::move(right));
  392|  58.4k|  }
_ZNK2BT9Scripting12ScriptParser14combinedHeightEi:
  182|   195k|  {
  183|   195k|    const int height = std::max(lhs_height, height_) + 1;
  184|   195k|    if(height > kMaxExpressionHeight)
  ------------------
  |  Branch (184:8): [True: 33, False: 195k]
  ------------------
  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|   195k|    return height;
  191|   195k|  }
_ZN2BT9Scripting12ScriptParser12parseTernaryESt10shared_ptrINS_3Ast8ExprBaseEE:
  395|  11.0k|  {
  396|  11.0k|    advance();                     // consume '?'
  397|  11.0k|    auto thenExpr = parseExpr(0);  // full expression inside
  398|  11.0k|    const int then_height = height_;
  399|  11.0k|    expect(TokenType::Colon, "expected ':' in ternary expression");
  400|  11.0k|    auto elseExpr = parseExpr(kTernaryBP);
  401|  11.0k|    height_ = std::max(then_height, height_);
  402|  11.0k|    return std::make_shared<Ast::ExprIf>(std::move(condition), std::move(thenExpr),
  403|  11.0k|                                         std::move(elseExpr));
  404|  11.0k|  }
_ZN2BT9Scripting12ScriptParser12isComparisonENS0_9TokenTypeE:
  166|  2.09M|  {
  167|  2.09M|    return type == TokenType::EqualEqual || type == TokenType::BangEqual ||
  ------------------
  |  Branch (167:12): [True: 11.2k, False: 2.07M]
  |  Branch (167:45): [True: 111k, False: 1.96M]
  ------------------
  168|  1.96M|           type == TokenType::Less || type == TokenType::Greater ||
  ------------------
  |  Branch (168:12): [True: 274k, False: 1.69M]
  |  Branch (168:39): [True: 1.54M, False: 148k]
  ------------------
  169|   148k|           type == TokenType::LessEqual || type == TokenType::GreaterEqual;
  ------------------
  |  Branch (169:12): [True: 11.1k, False: 137k]
  |  Branch (169:44): [True: 34.8k, False: 102k]
  ------------------
  170|  2.09M|  }
_ZN2BT9Scripting12ScriptParser22parseChainedComparisonESt10shared_ptrINS_3Ast8ExprBaseEE:
  407|  56.4k|  {
  408|  56.4k|    auto node = std::make_shared<Ast::ExprComparison>();
  409|  56.4k|    node->operands.push_back(std::move(first));
  410|       |
  411|  56.4k|    int max_height = 0;
  412|  1.98M|    while(isComparison(peek().type))
  ------------------
  |  Branch (412:11): [True: 1.93M, False: 56.4k]
  ------------------
  413|  1.93M|    {
  414|  1.93M|      node->ops.push_back(mapComparisonOp(advance().type));
  415|       |      // Parse the next operand above comparison level
  416|       |      // so that arithmetic binds tighter
  417|  1.93M|      node->operands.push_back(parseExpr(kComparisonBP + 1));
  418|  1.93M|      max_height = std::max(max_height, height_);
  419|  1.93M|    }
  420|  56.4k|    height_ = max_height;
  421|  56.4k|    return node;
  422|  56.4k|  }
_ZN2BT9Scripting12ScriptParser15mapComparisonOpENS0_9TokenTypeE:
  425|  1.93M|  {
  426|  1.93M|    switch(type)
  427|  1.93M|    {
  428|  6.56k|      case TokenType::EqualEqual:
  ------------------
  |  Branch (428:7): [True: 6.56k, False: 1.92M]
  ------------------
  429|  6.56k|        return Ast::ExprComparison::equal;
  430|   106k|      case TokenType::BangEqual:
  ------------------
  |  Branch (430:7): [True: 106k, False: 1.82M]
  ------------------
  431|   106k|        return Ast::ExprComparison::not_equal;
  432|   262k|      case TokenType::Less:
  ------------------
  |  Branch (432:7): [True: 262k, False: 1.66M]
  ------------------
  433|   262k|        return Ast::ExprComparison::less;
  434|  1.53M|      case TokenType::Greater:
  ------------------
  |  Branch (434:7): [True: 1.53M, False: 400k]
  ------------------
  435|  1.53M|        return Ast::ExprComparison::greater;
  436|  6.54k|      case TokenType::LessEqual:
  ------------------
  |  Branch (436:7): [True: 6.54k, False: 1.92M]
  ------------------
  437|  6.54k|        return Ast::ExprComparison::less_equal;
  438|  18.6k|      case TokenType::GreaterEqual:
  ------------------
  |  Branch (438:7): [True: 18.6k, False: 1.91M]
  ------------------
  439|  18.6k|        return Ast::ExprComparison::greater_equal;
  440|      0|      default:
  ------------------
  |  Branch (440:7): [True: 0, False: 1.93M]
  ------------------
  441|      0|        throw RuntimeError("Internal error: not a comparison op");
  442|  1.93M|    }
  443|  1.93M|  }
_ZN2BT9Scripting12ScriptParser10makeBinaryESt10shared_ptrINS_3Ast8ExprBaseEENS0_9TokenTypeES5_:
  447|  46.8k|  {
  448|  46.8k|    Ast::ExprBinaryArithmetic::op_t op{};
  449|  46.8k|    switch(opType)
  450|  46.8k|    {
  451|  14.9k|      case TokenType::Plus:
  ------------------
  |  Branch (451:7): [True: 14.9k, False: 31.9k]
  ------------------
  452|  14.9k|        op = Ast::ExprBinaryArithmetic::plus;
  453|  14.9k|        break;
  454|  3.72k|      case TokenType::Minus:
  ------------------
  |  Branch (454:7): [True: 3.72k, False: 43.1k]
  ------------------
  455|  3.72k|        op = Ast::ExprBinaryArithmetic::minus;
  456|  3.72k|        break;
  457|  1.43k|      case TokenType::Star:
  ------------------
  |  Branch (457:7): [True: 1.43k, False: 45.4k]
  ------------------
  458|  1.43k|        op = Ast::ExprBinaryArithmetic::times;
  459|  1.43k|        break;
  460|    859|      case TokenType::Slash:
  ------------------
  |  Branch (460:7): [True: 859, False: 46.0k]
  ------------------
  461|    859|        op = Ast::ExprBinaryArithmetic::div;
  462|    859|        break;
  463|  9.54k|      case TokenType::DotDot:
  ------------------
  |  Branch (463:7): [True: 9.54k, False: 37.3k]
  ------------------
  464|  9.54k|        op = Ast::ExprBinaryArithmetic::concat;
  465|  9.54k|        break;
  466|  1.88k|      case TokenType::Ampersand:
  ------------------
  |  Branch (466:7): [True: 1.88k, False: 45.0k]
  ------------------
  467|  1.88k|        op = Ast::ExprBinaryArithmetic::bit_and;
  468|  1.88k|        break;
  469|  10.9k|      case TokenType::Pipe:
  ------------------
  |  Branch (469:7): [True: 10.9k, False: 35.9k]
  ------------------
  470|  10.9k|        op = Ast::ExprBinaryArithmetic::bit_or;
  471|  10.9k|        break;
  472|    569|      case TokenType::Caret:
  ------------------
  |  Branch (472:7): [True: 569, False: 46.3k]
  ------------------
  473|    569|        op = Ast::ExprBinaryArithmetic::bit_xor;
  474|    569|        break;
  475|  1.77k|      case TokenType::AmpAmp:
  ------------------
  |  Branch (475:7): [True: 1.77k, False: 45.1k]
  ------------------
  476|  1.77k|        op = Ast::ExprBinaryArithmetic::logic_and;
  477|  1.77k|        break;
  478|  1.22k|      case TokenType::PipePipe:
  ------------------
  |  Branch (478:7): [True: 1.22k, False: 45.6k]
  ------------------
  479|  1.22k|        op = Ast::ExprBinaryArithmetic::logic_or;
  480|  1.22k|        break;
  481|      0|      default:
  ------------------
  |  Branch (481:7): [True: 0, False: 46.8k]
  ------------------
  482|      0|        throw RuntimeError("Internal error: unknown binary operator");
  483|  46.8k|    }
  484|  46.8k|    return std::make_shared<Ast::ExprBinaryArithmetic>(std::move(left), op,
  485|  46.8k|                                                       std::move(right));
  486|  46.8k|  }
_ZNK2BT9Scripting12ScriptParser5checkENS0_9TokenTypeE:
   97|  13.0M|  {
   98|  13.0M|    return peek().type == type;
   99|  13.0M|  }
_ZN2BT9Scripting12ScriptParser7advanceEv:
   84|  17.2M|  {
   85|  17.2M|    const Token& tok = tokens_[current_];
   86|  17.2M|    if(!atEnd())
  ------------------
  |  Branch (86:8): [True: 17.2M, False: 0]
  ------------------
   87|  17.2M|      current_++;
   88|  17.2M|    return tok;
   89|  17.2M|  }
script_parser.cpp:_ZZN2BT11ParseScriptERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEENK3$_0clERNS_3Ast11EnvironmentE:
  509|  4.20k|    return [exprs = std::move(exprs), script](Ast::Environment& env) {
  510|  4.20k|      try
  511|  4.20k|      {
  512|  1.87M|        for(size_t i = 0; i < exprs.size() - 1; ++i)
  ------------------
  |  Branch (512:27): [True: 1.87M, False: 4.20k]
  ------------------
  513|  1.87M|        {
  514|  1.87M|          exprs[i]->evaluate(env);
  515|  1.87M|        }
  516|  4.20k|        return exprs.back()->evaluate(env);
  517|  4.20k|      }
  518|  4.20k|      catch(RuntimeError& err)
  519|  4.20k|      {
  520|  1.16k|        throw RuntimeError(StrCat("Error in script [", script, "]\n", err.what()));
  521|  1.16k|      }
  522|  4.20k|    };

_ZN2BT9Scripting8tokenizeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE:
  224|  13.1k|{
  225|  13.1k|  std::vector<Token> tokens;
  226|  13.1k|  const size_t len = source.size();
  227|  13.1k|  size_t i = 0;
  228|       |
  229|  40.8M|  while(i < len)
  ------------------
  |  Branch (229:9): [True: 40.8M, False: 13.1k]
  ------------------
  230|  40.8M|  {
  231|  40.8M|    const char c = source[i];
  232|       |
  233|       |    // Skip whitespace (space, tab, newline, carriage return)
  234|  40.8M|    if(c == ' ' || c == '\t' || c == '\n' || c == '\r')
  ------------------
  |  Branch (234:8): [True: 4.95k, False: 40.8M]
  |  Branch (234:20): [True: 18.3k, False: 40.8M]
  |  Branch (234:33): [True: 137k, False: 40.6M]
  |  Branch (234:46): [True: 7.47k, False: 40.6M]
  ------------------
  235|   168k|    {
  236|   168k|      ++i;
  237|   168k|      continue;
  238|   168k|    }
  239|       |
  240|  40.6M|    const size_t start = i;
  241|       |
  242|       |    // Single-quoted string literal
  243|  40.6M|    if(c == '\'')
  ------------------
  |  Branch (243:8): [True: 531k, False: 40.1M]
  ------------------
  244|   531k|    {
  245|   531k|      ++i;
  246|  48.2M|      while(i < len && source[i] != '\'')
  ------------------
  |  Branch (246:13): [True: 48.2M, False: 348]
  |  Branch (246:24): [True: 47.6M, False: 530k]
  ------------------
  247|  47.6M|      {
  248|  47.6M|        ++i;
  249|  47.6M|      }
  250|   531k|      if(i < len)
  ------------------
  |  Branch (250:10): [True: 530k, False: 348]
  ------------------
  251|   530k|      {
  252|       |        // extract content without quotes
  253|   530k|        std::string_view text(&source[start + 1], i - start - 1);
  254|   530k|        tokens.push_back({ TokenType::String, text, start });
  255|   530k|        ++i;  // skip closing quote
  256|   530k|      }
  257|    348|      else
  258|    348|      {
  259|    348|        std::string_view text(&source[start], i - start);
  260|    348|        tokens.push_back({ TokenType::Error, text, start });
  261|    348|      }
  262|   531k|      continue;
  263|   531k|    }
  264|       |
  265|       |    // Number literal (integer or real)
  266|  40.1M|    if(isDigit(c))
  ------------------
  |  Branch (266:8): [True: 3.59M, False: 36.5M]
  ------------------
  267|  3.59M|    {
  268|  3.59M|      NumberResult nr;
  269|  3.59M|      const bool is_hex =
  270|  3.59M|          c == '0' && i + 1 < len && (source[i + 1] == 'x' || source[i + 1] == 'X');
  ------------------
  |  Branch (270:11): [True: 777k, False: 2.82M]
  |  Branch (270:23): [True: 776k, False: 761]
  |  Branch (270:39): [True: 122k, False: 654k]
  |  Branch (270:63): [True: 5.29k, False: 648k]
  ------------------
  271|  3.59M|      if(is_hex)
  ------------------
  |  Branch (271:10): [True: 127k, False: 3.46M]
  ------------------
  272|   127k|      {
  273|   127k|        nr = scanHexNumber(source, len, i);
  274|   127k|      }
  275|  3.46M|      else
  276|  3.46M|      {
  277|  3.46M|        nr = scanDecimalNumber(source, len, i);
  278|  3.46M|      }
  279|       |
  280|  3.59M|      std::string_view text(&source[start], i - start);
  281|  3.59M|      if(nr.has_error)
  ------------------
  |  Branch (281:10): [True: 287k, False: 3.30M]
  ------------------
  282|   287k|      {
  283|   287k|        tokens.push_back({ TokenType::Error, text, start });
  284|   287k|      }
  285|  3.30M|      else if(nr.is_real)
  ------------------
  |  Branch (285:15): [True: 363k, False: 2.94M]
  ------------------
  286|   363k|      {
  287|   363k|        tokens.push_back({ TokenType::Real, text, start });
  288|   363k|      }
  289|  2.94M|      else
  290|  2.94M|      {
  291|  2.94M|        tokens.push_back({ TokenType::Integer, text, start });
  292|  2.94M|      }
  293|  3.59M|      continue;
  294|  3.59M|    }
  295|       |
  296|       |    // Identifier or keyword (true/false)
  297|  36.5M|    if(isIdentStart(c))
  ------------------
  |  Branch (297:8): [True: 15.6M, False: 20.9M]
  ------------------
  298|  15.6M|    {
  299|  15.6M|      ++i;  // consume start character (may not be isIdentChar, e.g. '@')
  300|  62.6M|      while(i < len && isIdentChar(source[i]))
  ------------------
  |  Branch (300:13): [True: 62.6M, False: 3.30k]
  |  Branch (300:24): [True: 46.9M, False: 15.6M]
  ------------------
  301|  46.9M|      {
  302|  46.9M|        ++i;
  303|  46.9M|      }
  304|  15.6M|      if(std::string_view text(&source[start], i - start); text == "true" || text == "fal"
  ------------------
  |  Branch (304:60): [True: 4.84k, False: 15.6M]
  |  Branch (304:78): [True: 827, False: 15.6M]
  ------------------
  305|  15.6M|                                                                                     "se")
  306|  5.66k|      {
  307|  5.66k|        tokens.push_back({ TokenType::Boolean, text, start });
  308|  5.66k|      }
  309|  15.6M|      else
  310|  15.6M|      {
  311|  15.6M|        tokens.push_back({ TokenType::Identifier, text, start });
  312|  15.6M|      }
  313|  15.6M|      continue;
  314|  15.6M|    }
  315|       |
  316|       |    // Two-character operators (check before single-char)
  317|  20.9M|    if(i + 1 < len)
  ------------------
  |  Branch (317:8): [True: 20.9M, False: 2.21k]
  ------------------
  318|  20.9M|    {
  319|  20.9M|      TokenType two_char_type = matchTwoCharOp(c, source[i + 1]);
  320|  20.9M|      if(two_char_type != TokenType::Error)
  ------------------
  |  Branch (320:10): [True: 337k, False: 20.5M]
  ------------------
  321|   337k|      {
  322|   337k|        std::string_view text(&source[start], 2);
  323|   337k|        tokens.push_back({ two_char_type, text, start });
  324|   337k|        i += 2;
  325|   337k|        continue;
  326|   337k|      }
  327|  20.9M|    }
  328|       |
  329|       |    // Single-character operators and delimiters
  330|  20.5M|    std::string_view text(&source[start], 1);
  331|  20.5M|    tokens.push_back({ matchSingleCharOp(c), text, start });
  332|  20.5M|    ++i;
  333|  20.5M|  }
  334|       |
  335|       |  // Sentinel
  336|  13.1k|  tokens.push_back({ TokenType::EndOfInput, {}, i });
  337|  13.1k|  return tokens;
  338|  13.1k|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_17isDigitEc:
   34|   127M|{
   35|   127M|  return std::isdigit(static_cast<unsigned char>(c)) != 0;
   36|   127M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_113scanHexNumberERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmRm:
   59|   127k|{
   60|   127k|  NumberResult result;
   61|   127k|  i += 2;  // skip "0x"/"0X"
   62|   127k|  if(i >= len || !isHexDigit(source[i]))
  ------------------
  |  Branch (62:6): [True: 33, False: 127k]
  |  Branch (62:18): [True: 101k, False: 25.5k]
  ------------------
   63|   101k|  {
   64|   101k|    result.has_error = true;
   65|   101k|  }
   66|  25.5k|  else
   67|  25.5k|  {
   68|  1.42M|    while(i < len && isHexDigit(source[i]))
  ------------------
  |  Branch (68:11): [True: 1.42M, False: 581]
  |  Branch (68:22): [True: 1.39M, False: 24.9k]
  ------------------
   69|  1.39M|    {
   70|  1.39M|      ++i;
   71|  1.39M|    }
   72|  25.5k|  }
   73|       |  // Hex numbers don't support dot or exponent
   74|   127k|  if(i < len && (source[i] == '.' || isIdentChar(source[i])))
  ------------------
  |  Branch (74:6): [True: 126k, False: 614]
  |  Branch (74:18): [True: 11.3k, False: 115k]
  |  Branch (74:38): [True: 50.3k, False: 65.1k]
  ------------------
   75|  61.6k|  {
   76|  61.6k|    result.has_error = true;
   77|  61.6k|    consumeTrailingGarbage(source, len, i);
   78|  61.6k|  }
   79|   127k|  return result;
   80|   127k|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_110isHexDigitEc:
   39|  1.54M|{
   40|  1.54M|  return std::isxdigit(static_cast<unsigned char>(c)) != 0;
   41|  1.54M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_122consumeTrailingGarbageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmRm:
   45|  68.1k|{
   46|   400k|  while(i < len && (isIdentChar(source[i]) || source[i] == '.'))
  ------------------
  |  Branch (46:9): [True: 400k, False: 192]
  |  Branch (46:21): [True: 318k, False: 81.5k]
  |  Branch (46:47): [True: 13.6k, False: 67.9k]
  ------------------
   47|   332k|  {
   48|   332k|    ++i;
   49|   332k|  }
   50|  68.1k|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_117scanDecimalNumberERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEmRm:
   83|  3.46M|{
   84|  3.46M|  NumberResult result;
   85|       |
   86|       |  // Integer part
   87|  72.9M|  while(i < len && isDigit(source[i]))
  ------------------
  |  Branch (87:9): [True: 72.9M, False: 2.63k]
  |  Branch (87:20): [True: 69.5M, False: 3.46M]
  ------------------
   88|  69.5M|  {
   89|  69.5M|    ++i;
   90|  69.5M|  }
   91|       |  // Fractional part
   92|  3.46M|  if(i < len && source[i] == '.')
  ------------------
  |  Branch (92:6): [True: 3.46M, False: 2.63k]
  |  Branch (92:17): [True: 352k, False: 3.11M]
  ------------------
   93|   352k|  {
   94|       |    // Distinguish from ".." (concat operator)
   95|   352k|    if(i + 1 < len && source[i + 1] == '.')
  ------------------
  |  Branch (95:8): [True: 352k, False: 6]
  |  Branch (95:23): [True: 7.04k, False: 345k]
  ------------------
   96|  7.04k|    {
   97|       |      // Stop here: "65.." is Integer("65") + DotDot
   98|  7.04k|    }
   99|   345k|    else if(i + 1 < len && isDigit(source[i + 1]))
  ------------------
  |  Branch (99:13): [True: 345k, False: 6]
  |  Branch (99:28): [True: 338k, False: 6.46k]
  ------------------
  100|   338k|    {
  101|   338k|      result.is_real = true;
  102|   338k|      ++i;  // consume '.'
  103|  13.4M|      while(i < len && isDigit(source[i]))
  ------------------
  |  Branch (103:13): [True: 13.4M, False: 108]
  |  Branch (103:24): [True: 13.1M, False: 338k]
  ------------------
  104|  13.1M|      {
  105|  13.1M|        ++i;
  106|  13.1M|      }
  107|   338k|    }
  108|  6.46k|    else
  109|  6.46k|    {
  110|       |      // "65." or "65.x" -- incomplete real
  111|  6.46k|      result.has_error = true;
  112|  6.46k|      ++i;  // consume the dot
  113|  6.46k|      consumeTrailingGarbage(source, len, i);
  114|  6.46k|    }
  115|   352k|  }
  116|       |  // Exponent (only for decimal numbers)
  117|  3.46M|  if(!result.has_error && i < len && (source[i] == 'e' || source[i] == 'E'))
  ------------------
  |  Branch (117:6): [True: 3.46M, False: 6.46k]
  |  Branch (117:27): [True: 3.46M, False: 2.74k]
  |  Branch (117:39): [True: 6.41k, False: 3.45M]
  |  Branch (117:59): [True: 25.5k, False: 3.42M]
  ------------------
  118|  31.9k|  {
  119|  31.9k|    result.is_real = true;
  120|  31.9k|    ++i;  // consume 'e'/'E'
  121|  31.9k|    if(i < len && (source[i] == '+' || source[i] == '-'))
  ------------------
  |  Branch (121:8): [True: 31.9k, False: 33]
  |  Branch (121:20): [True: 1.16k, False: 30.7k]
  |  Branch (121:40): [True: 755, False: 29.9k]
  ------------------
  122|  1.92k|    {
  123|  1.92k|      ++i;  // consume sign
  124|  1.92k|    }
  125|  31.9k|    if(i >= len || !isDigit(source[i]))
  ------------------
  |  Branch (125:8): [True: 72, False: 31.8k]
  |  Branch (125:20): [True: 6.47k, False: 25.4k]
  ------------------
  126|  6.54k|    {
  127|  6.54k|      result.has_error = true;
  128|  6.54k|    }
  129|  25.4k|    else
  130|  25.4k|    {
  131|   904k|      while(i < len && isDigit(source[i]))
  ------------------
  |  Branch (131:13): [True: 904k, False: 197]
  |  Branch (131:24): [True: 879k, False: 25.2k]
  ------------------
  132|   879k|      {
  133|   879k|        ++i;
  134|   879k|      }
  135|  25.4k|    }
  136|  31.9k|  }
  137|       |  // Trailing alpha (e.g. "3foo", "65.43foo")
  138|  3.46M|  if(!result.has_error && i < len && isIdentStart(source[i]))
  ------------------
  |  Branch (138:6): [True: 3.45M, False: 13.0k]
  |  Branch (138:27): [True: 3.45M, False: 2.94k]
  |  Branch (138:38): [True: 166k, False: 3.28M]
  ------------------
  139|   166k|  {
  140|   166k|    result.has_error = true;
  141|  4.32M|    while(i < len && isIdentChar(source[i]))
  ------------------
  |  Branch (141:11): [True: 4.32M, False: 93]
  |  Branch (141:22): [True: 4.15M, False: 166k]
  ------------------
  142|  4.15M|    {
  143|  4.15M|      ++i;
  144|  4.15M|    }
  145|   166k|  }
  146|  3.46M|  return result;
  147|  3.46M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_112isIdentStartEc:
   24|  40.0M|{
   25|  40.0M|  return std::isalpha(static_cast<unsigned char>(c)) != 0 || c == '_' || c == '@';
  ------------------
  |  Branch (25:10): [True: 1.06M, False: 38.9M]
  |  Branch (25:62): [True: 18.0k, False: 38.9M]
  |  Branch (25:74): [True: 14.7M, False: 24.1M]
  ------------------
   26|  40.0M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_111isIdentCharEc:
   29|  67.4M|{
   30|  67.4M|  return std::isalnum(static_cast<unsigned char>(c)) != 0 || c == '_';
  ------------------
  |  Branch (30:10): [True: 51.0M, False: 16.4M]
  |  Branch (30:62): [True: 457k, False: 15.9M]
  ------------------
   31|  67.4M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_114matchTwoCharOpEcc:
  150|  20.9M|{
  151|  20.9M|  if(c == '.' && next == '.')
  ------------------
  |  Branch (151:6): [True: 370k, False: 20.5M]
  |  Branch (151:18): [True: 30.9k, False: 339k]
  ------------------
  152|  30.9k|    return TokenType::DotDot;
  153|  20.8M|  if(c == '&' && next == '&')
  ------------------
  |  Branch (153:6): [True: 23.2k, False: 20.8M]
  |  Branch (153:18): [True: 9.02k, False: 14.2k]
  ------------------
  154|  9.02k|    return TokenType::AmpAmp;
  155|  20.8M|  if(c == '|' && next == '|')
  ------------------
  |  Branch (155:6): [True: 117k, False: 20.7M]
  |  Branch (155:18): [True: 5.80k, False: 111k]
  ------------------
  156|  5.80k|    return TokenType::PipePipe;
  157|  20.8M|  if(c == '=' && next == '=')
  ------------------
  |  Branch (157:6): [True: 50.4k, False: 20.8M]
  |  Branch (157:18): [True: 13.6k, False: 36.7k]
  ------------------
  158|  13.6k|    return TokenType::EqualEqual;
  159|  20.8M|  if(c == '!' && next == '=')
  ------------------
  |  Branch (159:6): [True: 204k, False: 20.6M]
  |  Branch (159:18): [True: 130k, False: 74.3k]
  ------------------
  160|   130k|    return TokenType::BangEqual;
  161|  20.7M|  if(c == '<' && next == '=')
  ------------------
  |  Branch (161:6): [True: 320k, False: 20.3M]
  |  Branch (161:18): [True: 21.7k, False: 298k]
  ------------------
  162|  21.7k|    return TokenType::LessEqual;
  163|  20.6M|  if(c == '>' && next == '=')
  ------------------
  |  Branch (163:6): [True: 2.49M, False: 18.2M]
  |  Branch (163:18): [True: 41.2k, False: 2.45M]
  ------------------
  164|  41.2k|    return TokenType::GreaterEqual;
  165|  20.6M|  if(c == ':' && next == '=')
  ------------------
  |  Branch (165:6): [True: 1.64M, False: 19.0M]
  |  Branch (165:18): [True: 45.8k, False: 1.60M]
  ------------------
  166|  45.8k|    return TokenType::ColonEqual;
  167|  20.6M|  if(c == '+' && next == '=')
  ------------------
  |  Branch (167:6): [True: 68.3k, False: 20.5M]
  |  Branch (167:18): [True: 28.6k, False: 39.7k]
  ------------------
  168|  28.6k|    return TokenType::PlusEqual;
  169|  20.5M|  if(c == '-' && next == '=')
  ------------------
  |  Branch (169:6): [True: 133k, False: 20.4M]
  |  Branch (169:18): [True: 2.89k, False: 130k]
  ------------------
  170|  2.89k|    return TokenType::MinusEqual;
  171|  20.5M|  if(c == '*' && next == '=')
  ------------------
  |  Branch (171:6): [True: 17.8k, False: 20.5M]
  |  Branch (171:18): [True: 2.99k, False: 14.8k]
  ------------------
  172|  2.99k|    return TokenType::StarEqual;
  173|  20.5M|  if(c == '/' && next == '=')
  ------------------
  |  Branch (173:6): [True: 62.0k, False: 20.5M]
  |  Branch (173:18): [True: 4.30k, False: 57.7k]
  ------------------
  174|  4.30k|    return TokenType::SlashEqual;
  175|  20.5M|  return TokenType::Error;
  176|  20.5M|}
script_tokenizer.cpp:_ZN2BT9Scripting12_GLOBAL__N_117matchSingleCharOpEc:
  179|  20.5M|{
  180|  20.5M|  switch(c)
  181|  20.5M|  {
  182|  39.7k|    case '+':
  ------------------
  |  Branch (182:5): [True: 39.7k, False: 20.5M]
  ------------------
  183|  39.7k|      return TokenType::Plus;
  184|   130k|    case '-':
  ------------------
  |  Branch (184:5): [True: 130k, False: 20.4M]
  ------------------
  185|   130k|      return TokenType::Minus;
  186|  14.8k|    case '*':
  ------------------
  |  Branch (186:5): [True: 14.8k, False: 20.5M]
  ------------------
  187|  14.8k|      return TokenType::Star;
  188|  57.7k|    case '/':
  ------------------
  |  Branch (188:5): [True: 57.7k, False: 20.5M]
  ------------------
  189|  57.7k|      return TokenType::Slash;
  190|  14.3k|    case '&':
  ------------------
  |  Branch (190:5): [True: 14.3k, False: 20.5M]
  ------------------
  191|  14.3k|      return TokenType::Ampersand;
  192|   111k|    case '|':
  ------------------
  |  Branch (192:5): [True: 111k, False: 20.4M]
  ------------------
  193|   111k|      return TokenType::Pipe;
  194|  20.1k|    case '^':
  ------------------
  |  Branch (194:5): [True: 20.1k, False: 20.5M]
  ------------------
  195|  20.1k|      return TokenType::Caret;
  196|  73.2k|    case '~':
  ------------------
  |  Branch (196:5): [True: 73.2k, False: 20.4M]
  ------------------
  197|  73.2k|      return TokenType::Tilde;
  198|  74.4k|    case '!':
  ------------------
  |  Branch (198:5): [True: 74.4k, False: 20.4M]
  ------------------
  199|  74.4k|      return TokenType::Bang;
  200|   298k|    case '<':
  ------------------
  |  Branch (200:5): [True: 298k, False: 20.2M]
  ------------------
  201|   298k|      return TokenType::Less;
  202|  2.45M|    case '>':
  ------------------
  |  Branch (202:5): [True: 2.45M, False: 18.1M]
  ------------------
  203|  2.45M|      return TokenType::Greater;
  204|  36.8k|    case '=':
  ------------------
  |  Branch (204:5): [True: 36.8k, False: 20.5M]
  ------------------
  205|  36.8k|      return TokenType::Equal;
  206|  38.8k|    case '?':
  ------------------
  |  Branch (206:5): [True: 38.8k, False: 20.5M]
  ------------------
  207|  38.8k|      return TokenType::Question;
  208|  1.60M|    case ':':
  ------------------
  |  Branch (208:5): [True: 1.60M, False: 18.9M]
  ------------------
  209|  1.60M|      return TokenType::Colon;
  210|  46.1k|    case '(':
  ------------------
  |  Branch (210:5): [True: 46.1k, False: 20.5M]
  ------------------
  211|  46.1k|      return TokenType::LeftParen;
  212|  7.74k|    case ')':
  ------------------
  |  Branch (212:5): [True: 7.74k, False: 20.5M]
  ------------------
  213|  7.74k|      return TokenType::RightParen;
  214|  1.71M|    case ';':
  ------------------
  |  Branch (214:5): [True: 1.71M, False: 18.8M]
  ------------------
  215|  1.71M|      return TokenType::Semicolon;
  216|  13.8M|    default:
  ------------------
  |  Branch (216:5): [True: 13.8M, False: 6.73M]
  ------------------
  217|  13.8M|      return TokenType::Error;
  218|  20.5M|  }
  219|  20.5M|}

