LLVMFuzzerTestOneInput:
   10|    418|{
   11|    418|    std::string s(reinterpret_cast<const char*>(data), size);
   12|    418|    std::istringstream is(s);
   13|    418|    std::vector<uint8_t> s1;
   14|    418|    ubjson_bytes_encoder encoder(s1);
   15|    418|    ubjson_stream_reader reader(is, encoder);
   16|       |
   17|    418|    std::error_code ec;
   18|    418|    reader.read(ec);
   19|       |
   20|    418|    return 0;
   21|    418|}

_ZN8jsoncons18basic_json_visitorIcEC2Ev:
  103|    418|        basic_json_visitor() = default;
_ZN8jsoncons19typed_array_visitorD2Ev:
   33|    418|        virtual ~typed_array_visitor() = default;
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  345|   138k|        {
  346|   138k|            visit_begin_array(length, tag, context, ec);
  347|   138k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   138k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  348|   138k|        }
_ZN8jsoncons18basic_json_visitorIcE12uint64_valueEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  414|   373k|        {
  415|   373k|            visit_uint64(value, tag, context, ec);
  416|   373k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   373k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  417|   373k|        }
_ZN8jsoncons18basic_json_visitorIcE9end_arrayERKNS_11ser_contextERNSt3__110error_codeE:
  351|  3.05M|        {
  352|  3.05M|            visit_end_array(context, ec);
  353|  3.05M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.05M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  354|  3.05M|        }
_ZN8jsoncons18basic_json_visitorIcE11int64_valueElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  423|  2.00M|        {
  424|  2.00M|            visit_int64(value, tag, context, ec);
  425|  2.00M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.00M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  426|  2.00M|        }
_ZN8jsoncons18basic_json_visitorIcE12double_valueEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  441|  35.6k|        {
  442|  35.6k|            visit_double(value, tag, context, ec);
  443|  35.6k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  35.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  444|  35.6k|        }
_ZN8jsoncons18basic_json_visitorIcE10null_valueENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  365|  4.07M|        {
  366|  4.07M|            visit_null(tag, context, ec);
  367|  4.07M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  4.07M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  368|  4.07M|        }
_ZN8jsoncons18basic_json_visitorIcE10bool_valueEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  374|   212k|        {
  375|   212k|            visit_bool(value, tag, context, ec);
  376|   212k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   212k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|   212k|        }
_ZN8jsoncons18basic_json_visitorIcE12string_valueERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  383|  2.64M|        {
  384|  2.64M|            visit_string(value, tag, context, ec);
  385|  2.64M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.64M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  386|  2.64M|        }
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  339|  2.94M|        {
  340|  2.94M|            visit_begin_array(tag, context, ec);
  341|  2.94M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.94M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  342|  2.94M|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  327|  84.5k|        {
  328|  84.5k|            visit_begin_object(length, tag, context, ec);
  329|  84.5k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  84.5k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  330|  84.5k|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  318|  2.17k|        {
  319|  2.17k|            visit_begin_object(tag, context, ec);
  320|  2.17k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.17k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  321|  2.17k|        }
_ZN8jsoncons18basic_json_visitorIcE3keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  357|   543k|        {
  358|   543k|            visit_key(name, context, ec);
  359|   543k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   543k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  360|   543k|        }
_ZN8jsoncons18basic_json_visitorIcE10end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  333|  85.7k|        {
  334|  85.7k|            visit_end_object(context, ec);
  335|  85.7k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  85.7k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  336|  85.7k|        }
_ZN8jsoncons18basic_json_visitorIcE5flushEv:
  108|     13|        {
  109|     13|            visit_flush();
  110|     13|        }

_ZNK8jsoncons6nonstd4spanIKhLm18446744073709551615EE4sizeEv:
  116|  2.03M|        {
  117|  2.03M|            return size_;
  118|  2.03M|        }
_ZN8jsoncons6nonstd4spanIKhLm18446744073709551615EEC2Ev:
   58|   517k|        {
   59|   517k|        }
_ZN8jsoncons6nonstd4spanIKhLm18446744073709551615EEC2EPS2_m:
   61|   161k|            : data_(data), size_(size)
   62|   161k|        {
   63|   161k|        }
_ZNK8jsoncons6nonstd4spanIKhLm18446744073709551615EE4dataEv:
  111|  1.35M|        {
  112|  1.35M|            return data_;
  113|  1.35M|        }

_ZN8jsoncons11ser_contextD2Ev:
   21|    418|    virtual ~ser_context() = default;

_ZN8jsoncons10bytes_sinkINSt3__16vectorIhNS1_9allocatorIhEEEEvEC2ERS5_:
  315|    418|            : buf_ptr(std::addressof(buf))
  316|    418|        {
  317|    418|        }
_ZN8jsoncons10bytes_sinkINSt3__16vectorIhNS1_9allocatorIhEEEEvE9push_backEh:
  334|  39.3M|        {
  335|  39.3M|            buf_ptr->push_back(static_cast<value_type>(ch));
  336|  39.3M|        }
_ZN8jsoncons10bytes_sinkINSt3__16vectorIhNS1_9allocatorIhEEEEvE5flushEv:
  325|    431|        {
  326|    431|        }

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|    418|    {
  194|    418|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 418, False: 0]
  ------------------
  195|    418|        {
  196|    418|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|    418|        }
  198|    418|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|    418|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|    418|          chunk_size_(default_max_chunk_size)
  178|    418|    {
  179|    418|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|    418|        data_end_ = chunk_;
  181|    418|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|    418|      : std::basic_istream<CharT>(&nb_)
   58|    418|    {
   59|    418|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|    418|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  4.96M|    {
  277|  4.96M|        return stream_ptr_->bad();  
  278|  4.96M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  377|  11.8M|    {
  378|  11.8M|        std::size_t len = 0;
  379|  11.8M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 11.8M, False: 848]
  ------------------
  380|  11.8M|        {
  381|  11.8M|            len = (std::min)(remaining_, length);
  382|  11.8M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  11.8M|            data_end_ += len;
  384|  11.8M|            remaining_ -= len;
  385|  11.8M|            position_ += len;
  386|  11.8M|        }
  387|  11.8M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 11.8M, False: 2.10k]
  ------------------
  388|  11.8M|        {
  389|  11.8M|            return len;
  390|  11.8M|        }
  391|  2.10k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 2.10k, False: 0]
  ------------------
  392|  2.10k|        {
  393|  2.10k|            data_end_ = chunk_;
  394|  2.10k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  2.10k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 1.97k, False: 131]
  ------------------
  396|  1.97k|            {
  397|  1.97k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  1.97k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  1.97k|                data_end_ += len2;
  400|  1.97k|                remaining_ -= len2;
  401|  1.97k|                position_ += len2;
  402|  1.97k|                len += len2;
  403|  1.97k|            }
  404|  2.10k|            return len;
  405|  2.10k|        }
  406|      0|        else
  407|      0|        {
  408|      0|            if (stream_ptr_->eof())
  ------------------
  |  Branch (408:17): [True: 0, False: 0]
  ------------------
  409|      0|            {
  410|      0|                remaining_ = 0;
  411|      0|                return 0;
  412|      0|            }
  413|      0|            JSONCONS_TRY
  ------------------
  |  |   37|      0|    #define JSONCONS_TRY try
  ------------------
  414|      0|            {
  415|      0|                std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(p+len), length-len);
  416|      0|                std::size_t len2 = static_cast<std::size_t>(count);
  417|      0|                if (len2 < length-len)
  ------------------
  |  Branch (417:21): [True: 0, False: 0]
  ------------------
  418|      0|                {
  419|      0|                    stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  420|      0|                }
  421|      0|                len += len2;
  422|      0|                position_ += len2;
  423|      0|                return len;
  424|      0|            }
  425|      0|            JSONCONS_CATCH(const std::exception&)     
  426|      0|            {
  427|      0|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  428|      0|                return 0;
  429|      0|            }
  430|      0|        }
  431|  11.8M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  2.98k|    {
  443|  2.98k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 169, False: 2.82k]
  ------------------
  444|    169|        {
  445|    169|            return 0;
  446|    169|        }
  447|       |
  448|  2.82k|        JSONCONS_TRY
  ------------------
  |  |   37|  2.82k|    #define JSONCONS_TRY try
  ------------------
  449|  2.82k|        {
  450|  2.82k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  2.82k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  2.82k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 410, False: 2.41k]
  ------------------
  454|    410|            {
  455|    410|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|    410|            }
  457|  2.82k|            return length;
  458|  2.82k|        }
  459|  2.82k|        JSONCONS_CATCH(const std::exception&)     
  460|  2.82k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  2.82k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6nonstd4spanIKhLm18446744073709551615EEEmOT_:
  352|   679k|    {
  353|   679k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   79|   679k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 517k, False: 161k]
  |  |  ------------------
  ------------------
  354|   517k|        {
  355|   517k|            return span<const value_type>{};
  356|   517k|        }
  357|   161k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 150, False: 161k]
  |  Branch (357:32): [True: 21, False: 129]
  ------------------
  358|     21|        {
  359|     21|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     21|            data_end_ = chunk_;
  361|     21|        }
  362|   161k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 637, False: 161k]
  ------------------
  363|    637|        {
  364|    637|            buffer.clear();
  365|    637|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    637|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    637|        }
  368|       |
  369|   161k|        const value_type* data = data_end_;
  370|   161k|        data_end_ += length;
  371|   161k|        remaining_ -= length;
  372|   161k|        position_ += length;
  373|   161k|        return span<const value_type>(data, length);
  374|   161k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr6nonstd7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  746|    637|    {
  747|    637|        std::size_t unread = length;
  748|       |
  749|  2.43k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.99k, False: 438]
  |  Branch (749:30): [True: 1.79k, False: 199]
  ------------------
  750|  1.79k|        {
  751|  1.79k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 412, False: 1.38k]
  |  Branch (751:44): [True: 407, False: 5]
  ------------------
  752|    407|            {
  753|    407|                std::size_t n = source.chunk_size();
  754|    407|                std::size_t offset = buffer.size();
  755|    407|                buffer.resize(offset+n);
  756|    407|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    407|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    407|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 122, False: 285]
  |  |  ------------------
  ------------------
  758|    122|                {
  759|    122|                    buffer.resize(offset+actual);
  760|    122|                }
  761|    407|                unread -= actual;
  762|    407|            }
  763|  1.39k|            else
  764|  1.39k|            {
  765|  1.39k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|  1.39k|                std::size_t offset = buffer.size();
  767|  1.39k|                buffer.resize(offset+n);
  768|  1.39k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|  1.39k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|  1.39k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 68, False: 1.32k]
  |  |  ------------------
  ------------------
  770|     68|                {
  771|     68|                    buffer.resize(offset + actual);
  772|     68|                }
  773|  1.39k|                unread -= actual;
  774|  1.39k|            }
  775|  1.79k|        }
  776|    637|        return length - unread;
  777|    637|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  1.99k|    {
  272|  1.99k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 611, False: 1.38k]
  |  Branch (272:35): [True: 199, False: 412]
  ------------------
  273|  1.99k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  1.79k|    {
  347|  1.79k|        return remaining_;
  348|  1.79k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  2.20k|    {
  262|  2.20k|        return chunk_size_;
  263|  2.20k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    407|    {
  436|    407|        auto len = fill_buffer(chunk, chunk_size);
  437|    407|        position_ += len;
  438|    407|        return len;
  439|    407|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4peekEv:
  312|  11.1M|    {
  313|  11.1M|        if (remaining_ == 0)
  ------------------
  |  Branch (313:13): [True: 458, False: 11.1M]
  ------------------
  314|    458|        {
  315|    458|            data_end_ = chunk_;
  316|    458|            remaining_ = fill_buffer(chunk_, chunk_size_);
  317|    458|        }
  318|  11.1M|        if (remaining_ > 0)
  ------------------
  |  Branch (318:13): [True: 11.1M, False: 46]
  ------------------
  319|  11.1M|        {
  320|  11.1M|            value_type c = *data_end_;
  321|  11.1M|            return char_result<value_type>{c, false};
  322|  11.1M|        }
  323|     46|        else
  324|     46|        {
  325|     46|            return char_result<value_type>{0, true};
  326|     46|        }
  327|  11.1M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE6ignoreEm:
  286|  3.27M|    {
  287|  3.27M|        std::size_t len = 0;
  288|  3.27M|        if (remaining_ > 0)
  ------------------
  |  Branch (288:13): [True: 3.27M, False: 0]
  ------------------
  289|  3.27M|        {
  290|  3.27M|            len = (std::min)(remaining_, length);
  291|  3.27M|            position_ += len;
  292|  3.27M|            data_end_ += len;
  293|  3.27M|            remaining_ -= len;
  294|  3.27M|        }
  295|  3.27M|        while (len < length)
  ------------------
  |  Branch (295:16): [True: 0, False: 3.27M]
  ------------------
  296|      0|        {
  297|      0|            data_end_ = chunk_;
  298|      0|            remaining_ = fill_buffer(chunk_, chunk_size_);
  299|      0|            if (remaining_ == 0)
  ------------------
  |  Branch (299:17): [True: 0, False: 0]
  ------------------
  300|      0|            {
  301|      0|                break;
  302|      0|            }
  303|      0|            std::size_t len2 = (std::min)(remaining_, length-len);
  304|      0|            position_ += len2;
  305|      0|            data_end_ += len2;
  306|      0|            remaining_ -= len2;
  307|      0|            len += len2;
  308|      0|        }
  309|  3.27M|    }

_ZN8jsoncons6binary13native_to_bigIhNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  9.05M|    {
  128|  9.05M|        T val2 = byte_swap(val);
  129|  9.05M|        uint8_t buf[sizeof(T)];
  130|  9.05M|        std::memcpy(buf, &val2, sizeof(T));
  131|  9.05M|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 9.05M, False: 9.05M]
  ------------------
  132|  9.05M|        {
  133|  9.05M|            *d_first++ = item;
  134|  9.05M|        }
  135|  9.05M|    }
_ZN8jsoncons6binary9byte_swapIhEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm1EES4_E4typeES4_:
   21|  9.05M|    {
   22|  9.05M|        return val;
   23|  9.05M|    }
_ZN8jsoncons6binary13native_to_bigItNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  14.6k|    {
  128|  14.6k|        T val2 = byte_swap(val);
  129|  14.6k|        uint8_t buf[sizeof(T)];
  130|  14.6k|        std::memcpy(buf, &val2, sizeof(T));
  131|  14.6k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 29.2k, False: 14.6k]
  ------------------
  132|  29.2k|        {
  133|  29.2k|            *d_first++ = item;
  134|  29.2k|        }
  135|  14.6k|    }
_ZN8jsoncons6binary9byte_swapItEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm2EES4_E4typeES4_:
   28|  14.6k|    {
   29|  14.6k|    #if defined(JSONCONS_BYTE_SWAP_16)
   30|  14.6k|        return JSONCONS_BYTE_SWAP_16(val);
  ------------------
  |  |  467|  14.6k|#      define JSONCONS_BYTE_SWAP_16    __builtin_bswap16
  ------------------
   31|       |    #else
   32|       |        return (static_cast<uint16_t>(val) >> 8) | (static_cast<uint16_t>(val) << 8);
   33|       |    #endif
   34|  14.6k|    }
_ZN8jsoncons6binary13native_to_bigIjNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|    443|    {
  128|    443|        T val2 = byte_swap(val);
  129|    443|        uint8_t buf[sizeof(T)];
  130|    443|        std::memcpy(buf, &val2, sizeof(T));
  131|    443|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 1.77k, False: 443]
  ------------------
  132|  1.77k|        {
  133|  1.77k|            *d_first++ = item;
  134|  1.77k|        }
  135|    443|    }
_ZN8jsoncons6binary9byte_swapIjEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm4EES4_E4typeES4_:
   39|  48.2k|    {
   40|  48.2k|    #if defined(JSONCONS_BYTE_SWAP_32)
   41|  48.2k|        return JSONCONS_BYTE_SWAP_32(val);
  ------------------
  |  |  463|  48.2k|#  define JSONCONS_BYTE_SWAP_32 __builtin_bswap32
  ------------------
   42|       |    #else
   43|       |        uint32_t tmp = ((static_cast<uint32_t>(val) << 8) & 0xff00ff00) | ((static_cast<uint32_t>(val) >> 8) & 0xff00ff);
   44|       |        return (tmp << 16) | (tmp >> 16);
   45|       |    #endif
   46|  48.2k|    }
_ZN8jsoncons6binary9byte_swapImEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm8EES4_E4typeES4_:
   51|  23.5k|    {
   52|  23.5k|    #if defined(JSONCONS_BYTE_SWAP_64)
   53|  23.5k|        return JSONCONS_BYTE_SWAP_64(val);
  ------------------
  |  |  462|  23.5k|#  define JSONCONS_BYTE_SWAP_64 __builtin_bswap64
  ------------------
   54|       |    #else
   55|       |        uint64_t tmp = ((static_cast<uint64_t>(val) & 0x00000000ffffffffull) << 32) | ((static_cast<uint64_t>(val) & 0xffffffff00000000ull) >> 32);
   56|       |        tmp = ((tmp & 0x0000ffff0000ffffull) << 16) | ((tmp & 0xffff0000ffff0000ull) >> 16);
   57|       |        return ((tmp & 0x00ff00ff00ff00ffull) << 8)  | ((tmp & 0xff00ff00ff00ff00ull) >> 8);
   58|       |    #endif
   59|  23.5k|    }
_ZN8jsoncons6binary13native_to_bigIsNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|   604k|    {
  128|   604k|        T val2 = byte_swap(val);
  129|   604k|        uint8_t buf[sizeof(T)];
  130|   604k|        std::memcpy(buf, &val2, sizeof(T));
  131|   604k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 1.20M, False: 604k]
  ------------------
  132|  1.20M|        {
  133|  1.20M|            *d_first++ = item;
  134|  1.20M|        }
  135|   604k|    }
_ZN8jsoncons6binary9byte_swapIsEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm2EES4_E4typeES4_:
   28|  1.46M|    {
   29|  1.46M|    #if defined(JSONCONS_BYTE_SWAP_16)
   30|  1.46M|        return JSONCONS_BYTE_SWAP_16(val);
  ------------------
  |  |  467|  1.46M|#      define JSONCONS_BYTE_SWAP_16    __builtin_bswap16
  ------------------
   31|       |    #else
   32|       |        return (static_cast<uint16_t>(val) >> 8) | (static_cast<uint16_t>(val) << 8);
   33|       |    #endif
   34|  1.46M|    }
_ZN8jsoncons6binary13native_to_bigIiNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  97.3k|    {
  128|  97.3k|        T val2 = byte_swap(val);
  129|  97.3k|        uint8_t buf[sizeof(T)];
  130|  97.3k|        std::memcpy(buf, &val2, sizeof(T));
  131|  97.3k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 389k, False: 97.3k]
  ------------------
  132|   389k|        {
  133|   389k|            *d_first++ = item;
  134|   389k|        }
  135|  97.3k|    }
_ZN8jsoncons6binary9byte_swapIiEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm4EES4_E4typeES4_:
   39|   203k|    {
   40|   203k|    #if defined(JSONCONS_BYTE_SWAP_32)
   41|   203k|        return JSONCONS_BYTE_SWAP_32(val);
  ------------------
  |  |  463|   203k|#  define JSONCONS_BYTE_SWAP_32 __builtin_bswap32
  ------------------
   42|       |    #else
   43|       |        uint32_t tmp = ((static_cast<uint32_t>(val) << 8) & 0xff00ff00) | ((static_cast<uint32_t>(val) >> 8) & 0xff00ff);
   44|       |        return (tmp << 16) | (tmp >> 16);
   45|       |    #endif
   46|   203k|    }
_ZN8jsoncons6binary13native_to_bigIlNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  24.8k|    {
  128|  24.8k|        T val2 = byte_swap(val);
  129|  24.8k|        uint8_t buf[sizeof(T)];
  130|  24.8k|        std::memcpy(buf, &val2, sizeof(T));
  131|  24.8k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 198k, False: 24.8k]
  ------------------
  132|   198k|        {
  133|   198k|            *d_first++ = item;
  134|   198k|        }
  135|  24.8k|    }
_ZN8jsoncons6binary9byte_swapIlEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm8EES4_E4typeES4_:
   51|  50.6k|    {
   52|  50.6k|    #if defined(JSONCONS_BYTE_SWAP_64)
   53|  50.6k|        return JSONCONS_BYTE_SWAP_64(val);
  ------------------
  |  |  462|  50.6k|#  define JSONCONS_BYTE_SWAP_64 __builtin_bswap64
  ------------------
   54|       |    #else
   55|       |        uint64_t tmp = ((static_cast<uint64_t>(val) & 0x00000000ffffffffull) << 32) | ((static_cast<uint64_t>(val) & 0xffffffff00000000ull) >> 32);
   56|       |        tmp = ((tmp & 0x0000ffff0000ffffull) << 16) | ((tmp & 0xffff0000ffff0000ull) >> 16);
   57|       |        return ((tmp & 0x00ff00ff00ff00ffull) << 8)  | ((tmp & 0xff00ff00ff00ff00ull) >> 8);
   58|       |    #endif
   59|  50.6k|    }
_ZN8jsoncons6binary13native_to_bigIaNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  75.0k|    {
  128|  75.0k|        T val2 = byte_swap(val);
  129|  75.0k|        uint8_t buf[sizeof(T)];
  130|  75.0k|        std::memcpy(buf, &val2, sizeof(T));
  131|  75.0k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 75.0k, False: 75.0k]
  ------------------
  132|  75.0k|        {
  133|  75.0k|            *d_first++ = item;
  134|  75.0k|        }
  135|  75.0k|    }
_ZN8jsoncons6binary9byte_swapIaEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm1EES4_E4typeES4_:
   21|  1.64M|    {
   22|  1.64M|        return val;
   23|  1.64M|    }
_ZN8jsoncons6binary13native_to_bigIfNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  21.4k|    {
  128|  21.4k|        T val2 = byte_swap(val);
  129|  21.4k|        uint8_t buf[sizeof(T)];
  130|  21.4k|        std::memcpy(buf, &val2, sizeof(T));
  131|  21.4k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 85.6k, False: 21.4k]
  ------------------
  132|  85.6k|        {
  133|  85.6k|            *d_first++ = item;
  134|  85.6k|        }
  135|  21.4k|    }
_ZN8jsoncons6binary9byte_swapIfEENSt3__19enable_ifIXaasr3std17is_floating_pointIT_EE5valueeqstS4_Lm4EES4_E4typeES4_:
   64|  47.7k|    {
   65|  47.7k|        uint32_t x;
   66|  47.7k|        std::memcpy(&x,&val,sizeof(uint32_t));
   67|  47.7k|        uint32_t y = byte_swap(x);
   68|  47.7k|        T val2;
   69|  47.7k|        std::memcpy(&val2,&y,sizeof(uint32_t));
   70|  47.7k|        return val2;
   71|  47.7k|    }
_ZN8jsoncons6binary13native_to_bigIdNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  14.2k|    {
  128|  14.2k|        T val2 = byte_swap(val);
  129|  14.2k|        uint8_t buf[sizeof(T)];
  130|  14.2k|        std::memcpy(buf, &val2, sizeof(T));
  131|  14.2k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 114k, False: 14.2k]
  ------------------
  132|   114k|        {
  133|   114k|            *d_first++ = item;
  134|   114k|        }
  135|  14.2k|    }
_ZN8jsoncons6binary9byte_swapIdEENSt3__19enable_ifIXaasr3std17is_floating_pointIT_EE5valueeqstS4_Lm8EES4_E4typeES4_:
   76|  23.5k|    {
   77|  23.5k|        uint64_t x;
   78|  23.5k|        std::memcpy(&x,&val,sizeof(uint64_t));
   79|  23.5k|        uint64_t y = byte_swap(x);
   80|  23.5k|        T val2;
   81|  23.5k|        std::memcpy(&val2,&y,sizeof(uint64_t));
   82|  23.5k|        return val2;
   83|  23.5k|    }
_ZN8jsoncons6binary13big_to_nativeIaNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|  1.57M|    {
  183|  1.57M|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 1.57M]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|  1.57M|        T val;
  188|  1.57M|        std::memcpy(&val,first,sizeof(T));
  189|  1.57M|        return byte_swap(val);
  190|  1.57M|    }
_ZN8jsoncons6binary13big_to_nativeIsNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|   861k|    {
  183|   861k|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 861k]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|   861k|        T val;
  188|   861k|        std::memcpy(&val,first,sizeof(T));
  189|   861k|        return byte_swap(val);
  190|   861k|    }
_ZN8jsoncons6binary13big_to_nativeIiNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|   106k|    {
  183|   106k|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 106k]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|   106k|        T val;
  188|   106k|        std::memcpy(&val,first,sizeof(T));
  189|   106k|        return byte_swap(val);
  190|   106k|    }
_ZN8jsoncons6binary13big_to_nativeIlNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|  25.7k|    {
  183|  25.7k|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 25.7k]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|  25.7k|        T val;
  188|  25.7k|        std::memcpy(&val,first,sizeof(T));
  189|  25.7k|        return byte_swap(val);
  190|  25.7k|    }
_ZN8jsoncons6binary13big_to_nativeIfNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|  26.3k|    {
  183|  26.3k|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 26.3k]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|  26.3k|        T val;
  188|  26.3k|        std::memcpy(&val,first,sizeof(T));
  189|  26.3k|        return byte_swap(val);
  190|  26.3k|    }
_ZN8jsoncons6binary13big_to_nativeIdNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|  9.27k|    {
  183|  9.27k|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 9.27k]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|  9.27k|        T val;
  188|  9.27k|        std::memcpy(&val,first,sizeof(T));
  189|  9.27k|        return byte_swap(val);
  190|  9.27k|    }

_ZN8jsoncons9is_base10IhEEbPKT_m:
  187|   135k|{
  188|   135k|    integer_chars_state state = integer_chars_state::initial;
  189|       |
  190|   135k|    const CharT* end = s + length; 
  191|   142k|    for (;s < end; ++s)
  ------------------
  |  Branch (191:11): [True: 141k, False: 1.01k]
  ------------------
  192|   141k|    {
  193|   141k|        switch(state)
  194|   141k|        {
  195|   135k|            case integer_chars_state::initial:
  ------------------
  |  Branch (195:13): [True: 135k, False: 6.81k]
  ------------------
  196|   135k|            {
  197|   135k|                switch(*s)
  198|   135k|                {
  199|  4.99k|                    case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (199:21): [True: 141, False: 134k]
  |  Branch (199:30): [True: 1.13k, False: 133k]
  |  Branch (199:39): [True: 2, False: 135k]
  |  Branch (199:48): [True: 8, False: 135k]
  |  Branch (199:57): [True: 495, False: 134k]
  |  Branch (199:66): [True: 5, False: 135k]
  |  Branch (199:75): [True: 31, False: 134k]
  |  Branch (199:84): [True: 0, False: 135k]
  |  Branch (199:93): [True: 1, False: 135k]
  |  Branch (199:103): [True: 3.17k, False: 131k]
  ------------------
  200|  4.99k|                        state = integer_chars_state::decimal;
  201|  4.99k|                        break;
  202|  1.32k|                    case '-':
  ------------------
  |  Branch (202:21): [True: 1.32k, False: 133k]
  ------------------
  203|  1.32k|                        state = integer_chars_state::minus;
  204|  1.32k|                        break;
  205|   128k|                    default:
  ------------------
  |  Branch (205:21): [True: 128k, False: 6.31k]
  ------------------
  206|   128k|                        return false;
  207|   135k|                }
  208|  6.31k|                break;
  209|   135k|            }
  210|  6.31k|            case integer_chars_state::minus:
  ------------------
  |  Branch (210:13): [True: 1.32k, False: 140k]
  ------------------
  211|  1.32k|            {
  212|  1.32k|                switch(*s)
  213|  1.32k|                {
  214|    195|                    case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (214:21): [True: 36, False: 1.28k]
  |  Branch (214:30): [True: 10, False: 1.31k]
  |  Branch (214:39): [True: 1, False: 1.31k]
  |  Branch (214:48): [True: 0, False: 1.32k]
  |  Branch (214:57): [True: 0, False: 1.32k]
  |  Branch (214:66): [True: 8, False: 1.31k]
  |  Branch (214:75): [True: 1, False: 1.31k]
  |  Branch (214:84): [True: 0, False: 1.32k]
  |  Branch (214:93): [True: 56, False: 1.26k]
  |  Branch (214:103): [True: 83, False: 1.23k]
  ------------------
  215|    195|                        state = integer_chars_state::decimal;
  216|    195|                        break;
  217|  1.12k|                    default:
  ------------------
  |  Branch (217:21): [True: 1.12k, False: 195]
  ------------------
  218|  1.12k|                        return false;
  219|  1.32k|                }
  220|    195|                break;
  221|  1.32k|            }
  222|  5.49k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (222:13): [True: 5.49k, False: 136k]
  ------------------
  223|  5.49k|            {
  224|  5.49k|                switch(*s)
  225|  5.49k|                {
  226|  1.13k|                    case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (226:21): [True: 1.12k, False: 4.37k]
  |  Branch (226:30): [True: 7, False: 5.49k]
  |  Branch (226:39): [True: 1, False: 5.49k]
  |  Branch (226:48): [True: 1, False: 5.49k]
  |  Branch (226:57): [True: 0, False: 5.49k]
  |  Branch (226:66): [True: 0, False: 5.49k]
  |  Branch (226:75): [True: 1, False: 5.49k]
  |  Branch (226:84): [True: 0, False: 5.49k]
  |  Branch (226:93): [True: 1, False: 5.49k]
  |  Branch (226:103): [True: 2, False: 5.49k]
  ------------------
  227|  1.13k|                        break;
  228|  4.36k|                    default:
  ------------------
  |  Branch (228:21): [True: 4.36k, False: 1.13k]
  ------------------
  229|  4.36k|                        return false;
  230|  5.49k|                }
  231|  1.13k|                break;
  232|  5.49k|            }
  233|  1.13k|            default:
  ------------------
  |  Branch (233:13): [True: 0, False: 141k]
  ------------------
  234|      0|                break;
  235|   141k|        }
  236|   141k|    }
  237|  1.01k|    return state == integer_chars_state::decimal ? true : false;
  ------------------
  |  Branch (237:12): [True: 826, False: 190]
  ------------------
  238|   135k|}

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr6nonstd8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|  3.19M|    {
 1148|  3.19M|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|  3.19M|        const uint8_t* end = it + length;
 1150|       |
 1151|  3.19M|        unicode_errc  result{};
 1152|  7.11M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 3.92M, False: 3.19M]
  ------------------
 1153|  3.92M|        {
 1154|  3.92M|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 1.32M, False: 2.59M]
  ------------------
 1155|  1.32M|            {
 1156|  9.24M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  326|  2.65M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (326:32): [True: 1.32M, False: 1.21k]
  |  |  |  Branch (326:34): [True: 1.32M, False: 1.74k]
  |  |  |  Branch (326:36): [True: 1.32M, False: 626]
  |  |  |  Branch (326:38): [True: 1.31M, False: 3.39k]
  |  |  |  Branch (326:40): [True: 1.31M, False: 716]
  |  |  |  Branch (326:42): [True: 1.31M, False: 1.42k]
  |  |  |  Branch (326:44): [True: 1.31M, False: 1.13k]
  |  |  |  Branch (326:46): [True: 1.31M, False: 1.07k]
  |  |  ------------------
  ------------------
 1157|  1.31M|                continue;
 1158|  9.24M|            }
 1159|  2.60M|    non_ascii:
 1160|  2.60M|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|  2.60M|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 0, False: 2.60M]
  ------------------
 1162|      0|            {
 1163|      0|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|      0|            }
 1165|  2.60M|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 19, False: 2.60M]
  ------------------
 1166|     19|            {
 1167|     19|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|     19|            }
 1169|  2.60M|            it += len;
 1170|  2.60M|        }
 1171|  3.19M|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|  3.19M|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|  5.20M|    {
  306|  5.20M|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|  5.20M|        const uint8_t* end = it+length;
  308|       |
  309|  5.20M|        uint8_t byte;
  310|  5.20M|        switch (length) {
  311|     24|        default:
  ------------------
  |  Branch (311:9): [True: 24, False: 5.20M]
  ------------------
  312|     24|            return unicode_errc::over_long_utf8_sequence;
  313|  12.1k|        case 4:
  ------------------
  |  Branch (313:9): [True: 12.1k, False: 5.19M]
  ------------------
  314|  12.1k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 2, False: 12.1k]
  ------------------
  315|      2|                return unicode_errc::bad_continuation_byte;
  316|  12.1k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  565|  12.1k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  15.3k|        case 3:
  ------------------
  |  Branch (317:9): [True: 3.14k, False: 5.19M]
  ------------------
  318|  15.3k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 1, False: 15.3k]
  ------------------
  319|      1|                return unicode_errc::bad_continuation_byte;
  320|  15.3k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  565|  15.3k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  18.5k|        case 2:
  ------------------
  |  Branch (321:9): [True: 3.25k, False: 5.19M]
  ------------------
  322|  18.5k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 2, False: 18.5k]
  ------------------
  323|      2|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  18.5k|            switch (*it) 
  326|  18.5k|            {
  327|       |                // no fall-through in this inner switch
  328|     69|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 69, False: 18.5k]
  |  Branch (328:32): [True: 0, False: 69]
  ------------------
  329|     69|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 58, False: 18.5k]
  |  Branch (329:32): [True: 0, False: 58]
  ------------------
  330|  2.09k|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 2.09k, False: 16.4k]
  |  Branch (330:32): [True: 0, False: 2.09k]
  ------------------
  331|  8.90k|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 8.90k, False: 9.67k]
  |  Branch (331:32): [True: 0, False: 8.90k]
  ------------------
  332|  8.90k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 7.45k, False: 11.1k]
  |  Branch (332:32): [True: 0, False: 7.45k]
  ------------------
  333|  18.5k|            }
  334|       |
  335|  18.5k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  565|  18.5k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|  5.20M|        case 1:
  ------------------
  |  Branch (336:9): [True: 5.18M, False: 18.6k]
  ------------------
  337|  5.20M|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 18.5k, False: 5.18M]
  |  Branch (337:32): [True: 15, False: 18.5k]
  ------------------
  338|     15|                return unicode_errc::source_illegal;
  339|  5.20M|            break;
  340|  5.20M|        }
  341|  5.20M|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 0, False: 5.20M]
  ------------------
  342|      0|            return unicode_errc::source_illegal;
  343|       |
  344|  5.20M|        return unicode_errc();
  345|  5.20M|    }
_ZN8jsoncons14unicode_traits8validateIhEENSt3__19enable_ifIXsr6nonstd8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|  3.05M|    {
 1148|  3.05M|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|  3.05M|        const uint8_t* end = it + length;
 1150|       |
 1151|  3.05M|        unicode_errc  result{};
 1152|  6.63M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 3.58M, False: 3.05M]
  ------------------
 1153|  3.58M|        {
 1154|  3.58M|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 996k, False: 2.58M]
  ------------------
 1155|   996k|            {
 1156|  6.94M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  326|  1.99M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (326:32): [True: 995k, False: 800]
  |  |  |  Branch (326:34): [True: 994k, False: 992]
  |  |  |  Branch (326:36): [True: 994k, False: 453]
  |  |  |  Branch (326:38): [True: 991k, False: 2.41k]
  |  |  |  Branch (326:40): [True: 991k, False: 420]
  |  |  |  Branch (326:42): [True: 990k, False: 477]
  |  |  |  Branch (326:44): [True: 990k, False: 526]
  |  |  |  Branch (326:46): [True: 989k, False: 992]
  |  |  ------------------
  ------------------
 1157|   989k|                continue;
 1158|  6.94M|            }
 1159|  2.59M|    non_ascii:
 1160|  2.59M|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|  2.59M|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 1, False: 2.59M]
  ------------------
 1162|      1|            {
 1163|      1|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|      1|            }
 1165|  2.59M|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 25, False: 2.59M]
  ------------------
 1166|     25|            {
 1167|     25|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|     25|            }
 1169|  2.59M|            it += len;
 1170|  2.59M|        }
 1171|  3.05M|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|  3.05M|    }

_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKS9_:
  105|    418|       : basic_ubjson_encoder(std::forward<Sink>(sink), ubjson_encode_options(), alloc)
  106|    418|    {
  107|    418|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKNS0_21ubjson_encode_optionsERKS9_:
  112|    418|       : sink_(std::forward<Sink>(sink)),
  113|    418|         max_nesting_depth_(static_cast<std::size_t>(options.max_nesting_depth())),
  114|    418|         alloc_(alloc)
  115|    418|    {
  116|    418|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayEmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  223|   138k|    {
  224|   138k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|   138k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 138k]
  |  |  ------------------
  ------------------
  225|      0|        {
  226|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  227|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  228|      0|        } 
  229|   138k|        stack_.emplace_back(container_type::array, length);
  230|   138k|        sink_.push_back(jsoncons::ubjson::ubjson_type::start_array_marker);
  231|   138k|        sink_.push_back(jsoncons::ubjson::ubjson_type::count_marker);
  232|   138k|        put_length(length);
  233|       |
  234|   138k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   138k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  235|   138k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_itemC2ENS0_14container_typeEm:
   59|  3.16M|           : type_(type), length_(length)
   60|  3.16M|        {
   61|  3.16M|        }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10put_lengthEm:
  329|  3.41M|    {
  330|  3.41M|        if (length <= (std::numeric_limits<uint8_t>::max)())
  ------------------
  |  Branch (330:13): [True: 3.39M, False: 15.0k]
  ------------------
  331|  3.39M|        {
  332|  3.39M|            sink_.push_back(ubjson_type::uint8_type);
  333|  3.39M|            binary::native_to_big(static_cast<uint8_t>(length), std::back_inserter(sink_));
  334|  3.39M|        }
  335|  15.0k|        else if (length <= (std::size_t)(std::numeric_limits<int16_t>::max)())
  ------------------
  |  Branch (335:18): [True: 14.6k, False: 443]
  ------------------
  336|  14.6k|        {
  337|  14.6k|            sink_.push_back(ubjson_type::int16_type);
  338|  14.6k|            binary::native_to_big(static_cast<uint16_t>(length), std::back_inserter(sink_));
  339|  14.6k|        }
  340|    443|        else if (length <= (std::size_t)(std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (340:18): [True: 443, False: 0]
  ------------------
  341|    443|        {
  342|    443|            sink_.push_back(ubjson_type::int32_type);
  343|    443|            binary::native_to_big(static_cast<uint32_t>(length),std::back_inserter(sink_));
  344|    443|        }
  345|      0|        else if (length <= (std::size_t)(std::numeric_limits<int64_t>::max)())
  ------------------
  |  Branch (345:18): [True: 0, False: 0]
  ------------------
  346|      0|        {
  347|      0|            sink_.push_back(ubjson_type::int64_type);
  348|      0|            binary::native_to_big(static_cast<uint64_t>(length),std::back_inserter(sink_));
  349|      0|        }
  350|      0|        else
  351|      0|        {
  352|      0|            JSONCONS_THROW(ser_error(ubjson_errc::too_many_items));
  ------------------
  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  ------------------
  353|      0|        }
  354|  3.41M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE15visit_end_arrayERKNS_11ser_contextERNS3_10error_codeE:
  238|  3.05M|    {
  239|  3.05M|        if (JSONCONS_UNLIKELY(stack_.empty() || !stack_.back().is_array()))
  ------------------
  |  |   79|  6.10M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 3.05M]
  |  |  |  Branch (79:50): [True: 0, False: 3.05M]
  |  |  |  Branch (79:50): [True: 0, False: 3.05M]
  |  |  ------------------
  ------------------
  240|      0|        {
  241|      0|            ec = ubjson_errc::unmatched_end_array;
  242|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  243|      0|        }
  244|       |
  245|  3.05M|        if (stack_.back().is_indefinite_length())
  ------------------
  |  Branch (245:13): [True: 2.93M, False: 121k]
  ------------------
  246|  2.93M|        {
  247|  2.93M|            sink_.push_back(jsoncons::ubjson::ubjson_type::end_array_marker);
  248|  2.93M|        }
  249|   121k|        else
  250|   121k|        {
  251|   121k|            if (stack_.back().count() < stack_.back().length())
  ------------------
  |  Branch (251:17): [True: 0, False: 121k]
  ------------------
  252|      0|            {
  253|      0|                ec = ubjson_errc::too_few_items;
  254|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  255|      0|            }
  256|   121k|            if (stack_.back().count() > stack_.back().length())
  ------------------
  |  Branch (256:17): [True: 0, False: 121k]
  ------------------
  257|      0|            {
  258|      0|                ec = ubjson_errc::too_many_items;
  259|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  260|      0|            }
  261|   121k|        }
  262|  3.05M|        stack_.pop_back();
  263|  3.05M|        end_value();
  264|  3.05M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.05M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  265|  3.05M|    }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item8is_arrayEv:
   81|  3.05M|        {
   82|  3.05M|            return type_ == container_type::array || type_ == container_type::indefinite_length_array;
  ------------------
  |  Branch (82:20): [True: 121k, False: 2.93M]
  |  Branch (82:54): [True: 2.93M, False: 0]
  ------------------
   83|  3.05M|        }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item20is_indefinite_lengthEv:
   86|  3.14M|        {
   87|  3.14M|            return type_ == container_type::indefinite_length_array || type_ == container_type::indefinite_length_object;
  ------------------
  |  Branch (87:20): [True: 2.93M, False: 207k]
  |  Branch (87:72): [True: 1.51k, False: 205k]
  ------------------
   88|  3.14M|        }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item5countEv:
   71|   411k|        {
   72|   411k|            return count_;
   73|   411k|        }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item6lengthEv:
   66|   411k|        {
   67|   411k|            return length_;
   68|   411k|        }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9end_valueEv:
  516|  12.4M|    {
  517|  12.4M|        if (!stack_.empty())
  ------------------
  |  Branch (517:13): [True: 12.4M, False: 13]
  ------------------
  518|  12.4M|        {
  519|  12.4M|            ++stack_.back().count_;
  520|  12.4M|        }
  521|  12.4M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  472|   373k|    {
  473|   373k|        if (val <= (std::numeric_limits<uint8_t>::max)())
  ------------------
  |  Branch (473:13): [True: 373k, False: 0]
  ------------------
  474|   373k|        {
  475|   373k|            sink_.push_back(jsoncons::ubjson::ubjson_type::uint8_type);
  476|   373k|            binary::native_to_big(static_cast<uint8_t>(val),std::back_inserter(sink_));
  477|   373k|        }
  478|      0|        else if (val <= static_cast<uint64_t>((std::numeric_limits<int16_t>::max)()))
  ------------------
  |  Branch (478:18): [True: 0, False: 0]
  ------------------
  479|      0|        {
  480|      0|            sink_.push_back(jsoncons::ubjson::ubjson_type::int16_type);
  481|      0|            binary::native_to_big(static_cast<int16_t>(val),std::back_inserter(sink_));
  482|      0|        }
  483|      0|        else if (val <= static_cast<uint64_t>((std::numeric_limits<int32_t>::max)()))
  ------------------
  |  Branch (483:18): [True: 0, False: 0]
  ------------------
  484|      0|        {
  485|      0|            sink_.push_back(jsoncons::ubjson::ubjson_type::int32_type);
  486|      0|            binary::native_to_big(static_cast<int32_t>(val),std::back_inserter(sink_));
  487|      0|        }
  488|      0|        else if (val <= static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()))
  ------------------
  |  Branch (488:18): [True: 0, False: 0]
  ------------------
  489|      0|        {
  490|      0|            sink_.push_back(jsoncons::ubjson::ubjson_type::int64_type);
  491|      0|            binary::native_to_big(static_cast<int64_t>(val),std::back_inserter(sink_));
  492|      0|        }
  493|      0|        else
  494|      0|        {
  495|       |            // too large for int64, write as high-precision number
  496|      0|            std::string s;
  497|      0|            jsoncons::from_integer(val, s);
  498|      0|            sink_.push_back(jsoncons::ubjson::ubjson_type::high_precision_number_type);
  499|      0|            put_length(s.length());
  500|      0|            sink_.append(reinterpret_cast<const uint8_t*>(s.data()), s.size());
  501|      0|        }
  502|   373k|        end_value();
  503|   373k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   373k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  504|   373k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  405|  2.00M|    {
  406|  2.00M|        if (val >= 0)
  ------------------
  |  Branch (406:13): [True: 1.69M, False: 317k]
  ------------------
  407|  1.69M|        {
  408|  1.69M|            if (val <= (std::numeric_limits<uint8_t>::max)())
  ------------------
  |  Branch (408:17): [True: 1.20M, False: 484k]
  ------------------
  409|  1.20M|            {
  410|       |                // uint 8 stores a 8-bit unsigned integer
  411|  1.20M|                sink_.push_back(jsoncons::ubjson::ubjson_type::uint8_type);
  412|  1.20M|                binary::native_to_big(static_cast<uint8_t>(val),std::back_inserter(sink_));
  413|  1.20M|            }
  414|   484k|            else if (val <= (std::numeric_limits<int16_t>::max)())
  ------------------
  |  Branch (414:22): [True: 430k, False: 53.7k]
  ------------------
  415|   430k|            {
  416|       |                // uint 16 stores a 16-bit big-endian unsigned integer
  417|   430k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int16_type);
  418|   430k|                binary::native_to_big(static_cast<int16_t>(val),std::back_inserter(sink_));
  419|   430k|            }
  420|  53.7k|            else if (val <= (std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (420:22): [True: 42.1k, False: 11.5k]
  ------------------
  421|  42.1k|            {
  422|       |                // uint 32 stores a 32-bit big-endian unsigned integer
  423|  42.1k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int32_type);
  424|  42.1k|                binary::native_to_big(static_cast<int32_t>(val),std::back_inserter(sink_));
  425|  42.1k|            }
  426|  11.5k|            else if (val <= (std::numeric_limits<int64_t>::max)())
  ------------------
  |  Branch (426:22): [True: 11.5k, False: 0]
  ------------------
  427|  11.5k|            {
  428|       |                // int 64 stores a 64-bit big-endian signed integer
  429|  11.5k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int64_type);
  430|  11.5k|                binary::native_to_big(val,std::back_inserter(sink_));
  431|  11.5k|            }
  432|      0|            else
  433|      0|            {
  434|       |                // big integer
  435|      0|            }
  436|  1.69M|        }
  437|   317k|        else
  438|   317k|        {
  439|   317k|            if (val >= (std::numeric_limits<int8_t>::lowest)())
  ------------------
  |  Branch (439:17): [True: 75.0k, False: 242k]
  ------------------
  440|  75.0k|            {
  441|       |                // int 8 stores a 8-bit signed integer
  442|  75.0k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int8_type);
  443|  75.0k|                binary::native_to_big(static_cast<int8_t>(val),std::back_inserter(sink_));
  444|  75.0k|            }
  445|   242k|            else if (val >= (std::numeric_limits<int16_t>::lowest)())
  ------------------
  |  Branch (445:22): [True: 173k, False: 68.5k]
  ------------------
  446|   173k|            {
  447|       |                // int 16 stores a 16-bit big-endian signed integer
  448|   173k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int16_type);
  449|   173k|                binary::native_to_big(static_cast<int16_t>(val),std::back_inserter(sink_));
  450|   173k|            }
  451|  68.5k|            else if (val >= (std::numeric_limits<int32_t>::lowest)())
  ------------------
  |  Branch (451:22): [True: 55.1k, False: 13.3k]
  ------------------
  452|  55.1k|            {
  453|       |                // int 32 stores a 32-bit big-endian signed integer
  454|  55.1k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int32_type);
  455|  55.1k|                binary::native_to_big(static_cast<int32_t>(val),std::back_inserter(sink_));
  456|  55.1k|            }
  457|  13.3k|            else if (val >= (std::numeric_limits<int64_t>::lowest)())
  ------------------
  |  Branch (457:22): [True: 13.3k, False: 0]
  ------------------
  458|  13.3k|            {
  459|       |                // int 64 stores a 64-bit big-endian signed integer
  460|  13.3k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int64_type);
  461|  13.3k|                binary::native_to_big(val,std::back_inserter(sink_));
  462|  13.3k|            }
  463|   317k|        }
  464|  2.00M|        end_value();
  465|  2.00M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.00M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  466|  2.00M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  382|  35.6k|    {
  383|  35.6k|        float valf = (float)val;
  384|  35.6k|        if ((double)valf == val)
  ------------------
  |  Branch (384:13): [True: 21.4k, False: 14.2k]
  ------------------
  385|  21.4k|        {
  386|       |            // float 32
  387|  21.4k|            sink_.push_back(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::float32_type));
  388|  21.4k|            binary::native_to_big(valf,std::back_inserter(sink_));
  389|  21.4k|        }
  390|  14.2k|        else
  391|  14.2k|        {
  392|       |            // float 64
  393|  14.2k|            sink_.push_back(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::float64_type));
  394|  14.2k|            binary::native_to_big(val,std::back_inserter(sink_));
  395|  14.2k|        }
  396|       |
  397|       |        // write double
  398|       |
  399|  35.6k|        end_value();
  400|  35.6k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  35.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  401|  35.6k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_flushEv:
  147|     13|    {
  148|     13|        sink_.flush();
  149|     13|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE18visit_begin_objectENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  152|  2.17k|    {
  153|  2.17k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  2.17k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 2.17k]
  |  |  ------------------
  ------------------
  154|      0|        {
  155|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  156|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  157|      0|        } 
  158|  2.17k|        stack_.emplace_back(container_type::indefinite_length_object);
  159|  2.17k|        sink_.push_back(jsoncons::ubjson::ubjson_type::start_object_marker);
  160|       |
  161|  2.17k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.17k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  162|  2.17k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE18visit_begin_objectEmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  165|  84.5k|    {
  166|  84.5k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  84.5k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 84.5k]
  |  |  ------------------
  ------------------
  167|      0|        {
  168|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  169|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  170|      0|        } 
  171|  84.5k|        stack_.emplace_back(container_type::object, length);
  172|  84.5k|        sink_.push_back(jsoncons::ubjson::ubjson_type::start_object_marker);
  173|  84.5k|        sink_.push_back(jsoncons::ubjson::ubjson_type::count_marker);
  174|  84.5k|        put_length(length);
  175|       |
  176|  84.5k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  84.5k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  177|  84.5k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE16visit_end_objectERKNS_11ser_contextERNS3_10error_codeE:
  180|  85.7k|    {
  181|  85.7k|        if (JSONCONS_UNLIKELY(stack_.empty() || !stack_.back().is_object()))
  ------------------
  |  |   79|   171k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 85.7k]
  |  |  |  Branch (79:50): [True: 0, False: 85.7k]
  |  |  |  Branch (79:50): [True: 0, False: 85.7k]
  |  |  ------------------
  ------------------
  182|      0|        {
  183|      0|            ec = ubjson_errc::unmatched_end_object;
  184|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  185|      0|        }
  186|       |
  187|  85.7k|        if (stack_.back().is_indefinite_length())
  ------------------
  |  Branch (187:13): [True: 1.51k, False: 84.1k]
  ------------------
  188|  1.51k|        {
  189|  1.51k|            sink_.push_back(jsoncons::ubjson::ubjson_type::end_object_marker);
  190|  1.51k|        }
  191|  84.1k|        else
  192|  84.1k|        {
  193|  84.1k|            if (stack_.back().count() < stack_.back().length())
  ------------------
  |  Branch (193:17): [True: 0, False: 84.1k]
  ------------------
  194|      0|            {
  195|      0|                ec = ubjson_errc::too_few_items;
  196|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  197|      0|            }
  198|  84.1k|            if (stack_.back().count() > stack_.back().length())
  ------------------
  |  Branch (198:17): [True: 0, False: 84.1k]
  ------------------
  199|      0|            {
  200|      0|                ec = ubjson_errc::too_many_items;
  201|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  202|      0|            }
  203|  84.1k|        }
  204|  85.7k|        stack_.pop_back();
  205|  85.7k|        end_value();
  206|  85.7k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  85.7k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  207|  85.7k|    }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item9is_objectEv:
   76|  85.7k|        {
   77|  85.7k|            return type_ == container_type::object || type_ == container_type::indefinite_length_object;
  ------------------
  |  Branch (77:20): [True: 84.1k, False: 1.51k]
  |  Branch (77:55): [True: 1.51k, False: 0]
  ------------------
   78|  85.7k|        }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  210|  2.94M|    {
  211|  2.94M|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  2.94M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 2.94M]
  |  |  ------------------
  ------------------
  212|      0|        {
  213|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  214|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  215|      0|        } 
  216|  2.94M|        stack_.emplace_back(container_type::indefinite_length_array);
  217|  2.94M|        sink_.push_back(jsoncons::ubjson::ubjson_type::start_array_marker);
  218|       |
  219|  2.94M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.94M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  220|  2.94M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9visit_keyERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEERKNS_11ser_contextERNS3_10error_codeE:
  268|   543k|    {
  269|   543k|        auto sink = unicode_traits::validate(name.data(), name.size());
  270|   543k|        if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (270:13): [True: 0, False: 543k]
  ------------------
  271|      0|        {
  272|      0|            ec = ubjson_errc::invalid_utf8_text_string;
  273|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  274|      0|        }
  275|       |
  276|   543k|        put_length(name.length());
  277|       |
  278|   543k|        for (auto c : name)
  ------------------
  |  Branch (278:21): [True: 7.09M, False: 543k]
  ------------------
  279|  7.09M|        {
  280|  7.09M|            sink_.push_back(c);
  281|  7.09M|        }
  282|   543k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   543k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  283|   543k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  286|  4.07M|    {
  287|       |        // nil
  288|  4.07M|        binary::native_to_big(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::null_type), std::back_inserter(sink_));
  289|  4.07M|        end_value();
  290|  4.07M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  4.07M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  291|  4.07M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  507|   212k|    {
  508|       |        // true and false
  509|   212k|        sink_.push_back(static_cast<uint8_t>(val ? jsoncons::ubjson::ubjson_type::true_type : jsoncons::ubjson::ubjson_type::false_type));
  ------------------
  |  Branch (509:46): [True: 155k, False: 56.4k]
  ------------------
  510|       |
  511|   212k|        end_value();
  512|   212k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   212k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  513|   212k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_stringERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  294|  2.64M|    {
  295|  2.64M|        switch (tag)
  296|  2.64M|        {
  297|    826|            case semantic_tag::bigint:
  ------------------
  |  Branch (297:13): [True: 826, False: 2.64M]
  ------------------
  298|   135k|            case semantic_tag::bigdec:
  ------------------
  |  Branch (298:13): [True: 134k, False: 2.51M]
  ------------------
  299|   135k|            {
  300|   135k|                sink_.push_back(jsoncons::ubjson::ubjson_type::high_precision_number_type);
  301|   135k|                break;
  302|    826|            }
  303|  2.51M|            default:
  ------------------
  |  Branch (303:13): [True: 2.51M, False: 135k]
  ------------------
  304|  2.51M|            {
  305|  2.51M|                sink_.push_back(jsoncons::ubjson::ubjson_type::string_type);
  306|  2.51M|                break;
  307|    826|            }
  308|  2.64M|        }
  309|       |
  310|  2.64M|        auto sink = unicode_traits::validate(sv.data(), sv.size());
  311|  2.64M|        if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (311:13): [True: 19, False: 2.64M]
  ------------------
  312|     19|        {
  313|     19|            ec = ubjson_errc::invalid_utf8_text_string;
  314|     19|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|     19|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  315|     19|        }
  316|       |
  317|  2.64M|        put_length(sv.length());
  318|       |
  319|  2.64M|        for (auto c : sv)
  ------------------
  |  Branch (319:21): [True: 6.04M, False: 2.64M]
  ------------------
  320|  6.04M|        {
  321|  6.04M|            sink_.push_back(c);
  322|  6.04M|        }
  323|       |
  324|  2.64M|        end_value();
  325|  2.64M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.64M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  326|  2.64M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEED2Ev:
  119|    418|    {
  120|    418|        JSONCONS_TRY
  ------------------
  |  |   37|    418|    #define JSONCONS_TRY try
  ------------------
  121|    418|        {
  122|    418|            sink_.flush();
  123|    418|        }
  124|    418|        JSONCONS_CATCH(...)
  125|    418|        {
  126|      0|        }
  127|    418|    }

_ZN8jsoncons6ubjson15make_error_codeENS0_11ubjson_errcE:
   96|    412|{
   97|    412|    return std::error_code(static_cast<int>(e),ubjson_error_category());
   98|    412|}
_ZN8jsoncons6ubjson21ubjson_error_categoryEv:
   89|    412|{
   90|    412|  static ubjson_error_category_impl instance;
   91|    412|  return instance;
   92|    412|}

_ZN8jsoncons6ubjson21ubjson_decode_optionsC1Ev:
   38|    418|    ubjson_decode_options() = default;
_ZN8jsoncons6ubjson21ubjson_options_commonC2Ev:
   23|    836|    ubjson_options_common() = default;
_ZN8jsoncons6ubjson21ubjson_options_commonD2Ev:
   25|    836|    virtual ~ubjson_options_common() = default;
_ZN8jsoncons6ubjson21ubjson_encode_optionsC1Ev:
   53|    418|    ubjson_encode_options() = default;
_ZNK8jsoncons6ubjson21ubjson_options_common17max_nesting_depthEv:
   28|    836|    {
   29|    836|        return max_nesting_depth_;
   30|    836|    }
_ZNK8jsoncons6ubjson21ubjson_decode_options9max_itemsEv:
   44|    418|    {
   45|    418|        return max_items_;
   46|    418|    }

_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEEC2IRNS3_19basic_istringstreamIcNS3_11char_traitsIcEES7_EEEEOT_RKNS0_21ubjson_decode_optionsERKS7_:
   79|    418|       : source_(std::forward<Sourceable>(source)), 
   80|    418|         max_nesting_depth_(options.max_nesting_depth()),
   81|    418|         max_items_(options.max_items()),
   82|    418|         text_buffer_(alloc),
   83|    418|         state_stack_(alloc)
   84|    418|    {
   85|    418|        state_stack_.emplace_back(parse_mode::root,0);
   86|    418|    }
_ZN8jsoncons6ubjson11parse_stateC2ENS0_10parse_modeEmh:
   45|  3.16M|        : mode(mode), length(length), type(type)
   46|  3.16M|    {
   47|  3.16M|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5resetEv:
   94|    418|    {
   95|    418|        more_ = true;
   96|    418|        done_ = false;
   97|    418|        text_buffer_.clear();
   98|    418|        state_stack_.clear();
   99|    418|        state_stack_.emplace_back(parse_mode::root,0,uint8_t(0));
  100|    418|        nesting_depth_ = 0;
  101|    418|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5parseERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  151|    418|    {
  152|  16.2M|        while (!done_ && more_)
  ------------------
  |  Branch (152:16): [True: 16.2M, False: 13]
  |  Branch (152:26): [True: 16.2M, False: 0]
  ------------------
  153|  16.2M|        {
  154|  16.2M|            switch (state_stack_.back().mode)
  ------------------
  |  Branch (154:21): [True: 16.2M, False: 0]
  ------------------
  155|  16.2M|            {
  156|   128k|                case parse_mode::array:
  ------------------
  |  Branch (156:17): [True: 128k, False: 16.1M]
  ------------------
  157|   128k|                {
  158|   128k|                    if (state_stack_.back().index < state_stack_.back().length)
  ------------------
  |  Branch (158:25): [True: 30.3k, False: 97.8k]
  ------------------
  159|  30.3k|                    {
  160|  30.3k|                        ++state_stack_.back().index;
  161|  30.3k|                        read_type_and_value(visitor, ec);
  162|  30.3k|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  30.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 3, False: 30.3k]
  |  |  ------------------
  ------------------
  163|      3|                        {
  164|      3|                            return;
  165|      3|                        }
  166|  30.3k|                    }
  167|  97.8k|                    else
  168|  97.8k|                    {
  169|  97.8k|                        end_array(visitor, ec);
  170|  97.8k|                    }
  171|   128k|                    break;
  172|   128k|                }
  173|  7.61M|                case parse_mode::strongly_typed_array:
  ------------------
  |  Branch (173:17): [True: 7.61M, False: 8.62M]
  ------------------
  174|  7.61M|                {
  175|  7.61M|                    if (state_stack_.back().index < state_stack_.back().length)
  ------------------
  |  Branch (175:25): [True: 7.58M, False: 23.9k]
  ------------------
  176|  7.58M|                    {
  177|  7.58M|                        ++state_stack_.back().index;
  178|  7.58M|                        read_value(visitor, state_stack_.back().type, ec);
  179|  7.58M|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  7.58M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 71, False: 7.58M]
  |  |  ------------------
  ------------------
  180|     71|                        {
  181|     71|                            return;
  182|     71|                        }
  183|  7.58M|                    }
  184|  23.9k|                    else
  185|  23.9k|                    {
  186|  23.9k|                        end_array(visitor, ec);
  187|  23.9k|                    }
  188|  7.61M|                    break;
  189|  7.61M|                }
  190|  7.61M|                case parse_mode::indefinite_array:
  ------------------
  |  Branch (190:17): [True: 7.32M, False: 8.91M]
  ------------------
  191|  7.32M|                {
  192|  7.32M|                    auto c = source_.peek();
  193|  7.32M|                    if (JSONCONS_UNLIKELY(c.eof))
  ------------------
  |  |   79|  7.32M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 16, False: 7.32M]
  |  |  ------------------
  ------------------
  194|     16|                    {
  195|     16|                        ec = ubjson_errc::unexpected_eof;
  196|     16|                        more_ = false;
  197|     16|                        return;
  198|     16|                    }
  199|  7.32M|                    if (c.value == jsoncons::ubjson::ubjson_type::end_array_marker)
  ------------------
  |  Branch (199:25): [True: 2.93M, False: 4.38M]
  ------------------
  200|  2.93M|                    {
  201|  2.93M|                        source_.ignore(1);
  202|  2.93M|                        end_array(visitor, ec);
  203|  2.93M|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  2.93M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 2.93M]
  |  |  ------------------
  ------------------
  204|      0|                        {
  205|      0|                            return;
  206|      0|                        }
  207|  2.93M|                    }
  208|  4.38M|                    else
  209|  4.38M|                    {
  210|  4.38M|                        if (++state_stack_.back().index > max_items_)
  ------------------
  |  Branch (210:29): [True: 0, False: 4.38M]
  ------------------
  211|      0|                        {
  212|      0|                            ec = ubjson_errc::max_items_exceeded;
  213|      0|                            more_ = false;
  214|      0|                            return;
  215|      0|                        }
  216|  4.38M|                        read_type_and_value(visitor, ec);
  217|  4.38M|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  4.38M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 138, False: 4.38M]
  |  |  ------------------
  ------------------
  218|    138|                        {
  219|    138|                            return;
  220|    138|                        }
  221|  4.38M|                    }
  222|  7.32M|                    break;
  223|  7.32M|                }
  224|  7.32M|                case parse_mode::map_key:
  ------------------
  |  Branch (224:17): [True: 2.38k, False: 16.2M]
  ------------------
  225|  2.38k|                {
  226|  2.38k|                    if (state_stack_.back().index < state_stack_.back().length)
  ------------------
  |  Branch (226:25): [True: 331, False: 2.05k]
  ------------------
  227|    331|                    {
  228|    331|                        ++state_stack_.back().index;
  229|    331|                        read_key(visitor, ec);
  230|    331|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|    331|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 6, False: 325]
  |  |  ------------------
  ------------------
  231|      6|                        {
  232|      6|                            return;
  233|      6|                        }
  234|    325|                        state_stack_.back().mode = parse_mode::map_value;
  235|    325|                    }
  236|  2.05k|                    else
  237|  2.05k|                    {
  238|  2.05k|                        end_object(visitor, ec);
  239|  2.05k|                    }
  240|  2.38k|                    break;
  241|  2.38k|                }
  242|  2.38k|                case parse_mode::map_value:
  ------------------
  |  Branch (242:17): [True: 325, False: 16.2M]
  ------------------
  243|    325|                {
  244|    325|                    state_stack_.back().mode = parse_mode::map_key;
  245|    325|                    read_type_and_value(visitor, ec);
  246|    325|                    if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|    325|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 4, False: 321]
  |  |  ------------------
  ------------------
  247|      4|                    {
  248|      4|                        return;
  249|      4|                    }
  250|    321|                    break;
  251|    325|                }
  252|  82.3k|                case parse_mode::strongly_typed_map_key:
  ------------------
  |  Branch (252:17): [True: 82.3k, False: 16.1M]
  ------------------
  253|  82.3k|                {
  254|  82.3k|                    if (state_stack_.back().index < state_stack_.back().length)
  ------------------
  |  Branch (254:25): [True: 177, False: 82.1k]
  ------------------
  255|    177|                    {
  256|    177|                        ++state_stack_.back().index;
  257|    177|                        read_key(visitor, ec);
  258|    177|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|    177|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 3, False: 174]
  |  |  ------------------
  ------------------
  259|      3|                        {
  260|      3|                            return;
  261|      3|                        }
  262|    174|                        state_stack_.back().mode = parse_mode::strongly_typed_map_value;
  263|    174|                    }
  264|  82.1k|                    else
  265|  82.1k|                    {
  266|  82.1k|                        end_object(visitor, ec);
  267|  82.1k|                    }
  268|  82.3k|                    break;
  269|  82.3k|                }
  270|  82.3k|                case parse_mode::strongly_typed_map_value:
  ------------------
  |  Branch (270:17): [True: 174, False: 16.2M]
  ------------------
  271|    174|                {
  272|    174|                    state_stack_.back().mode = parse_mode::strongly_typed_map_key;
  273|    174|                    read_value(visitor, state_stack_.back().type, ec);
  274|    174|                    if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|    174|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 174]
  |  |  ------------------
  ------------------
  275|      0|                    {
  276|      0|                        return;
  277|      0|                    }
  278|    174|                    break;
  279|    174|                }
  280|   544k|                case parse_mode::indefinite_map_key:
  ------------------
  |  Branch (280:17): [True: 544k, False: 15.6M]
  ------------------
  281|   544k|                {
  282|   544k|                    auto c = source_.peek();
  283|   544k|                    if (JSONCONS_UNLIKELY(c.eof))
  ------------------
  |  |   79|   544k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 10, False: 544k]
  |  |  ------------------
  ------------------
  284|     10|                    {
  285|     10|                        ec = ubjson_errc::unexpected_eof;
  286|     10|                        more_ = false;
  287|     10|                        return;
  288|     10|                    }
  289|   544k|                    if (c.value == jsoncons::ubjson::ubjson_type::end_object_marker)
  ------------------
  |  Branch (289:25): [True: 1.51k, False: 542k]
  ------------------
  290|  1.51k|                    {
  291|  1.51k|                        source_.ignore(1);
  292|  1.51k|                        end_object(visitor, ec);
  293|  1.51k|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  1.51k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 1.51k]
  |  |  ------------------
  ------------------
  294|      0|                        {
  295|      0|                            return;
  296|      0|                        }
  297|  1.51k|                    }
  298|   542k|                    else
  299|   542k|                    {
  300|   542k|                        if (++state_stack_.back().index > max_items_)
  ------------------
  |  Branch (300:29): [True: 0, False: 542k]
  ------------------
  301|      0|                        {
  302|      0|                            ec = ubjson_errc::max_items_exceeded;
  303|      0|                            more_ = false;
  304|      0|                            return;
  305|      0|                        }
  306|   542k|                        read_key(visitor, ec);
  307|   542k|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|   542k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 107, False: 542k]
  |  |  ------------------
  ------------------
  308|    107|                        {
  309|    107|                            return;
  310|    107|                        }
  311|   542k|                        state_stack_.back().mode = parse_mode::indefinite_map_value;
  312|   542k|                    }
  313|   544k|                    break;
  314|   544k|                }
  315|   544k|                case parse_mode::indefinite_map_value:
  ------------------
  |  Branch (315:17): [True: 542k, False: 15.6M]
  ------------------
  316|   542k|                {
  317|   542k|                    state_stack_.back().mode = parse_mode::indefinite_map_key;
  318|   542k|                    read_type_and_value(visitor, ec);
  319|   542k|                    if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|   542k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 15, False: 542k]
  |  |  ------------------
  ------------------
  320|     15|                    {
  321|     15|                        return;
  322|     15|                    }
  323|   542k|                    break;
  324|   542k|                }
  325|   542k|                case parse_mode::root:
  ------------------
  |  Branch (325:17): [True: 418, False: 16.2M]
  ------------------
  326|    418|                {
  327|    418|                    state_stack_.back().mode = parse_mode::accept;
  328|    418|                    read_type_and_value(visitor, ec);
  329|    418|                    if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|    418|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 32, False: 386]
  |  |  ------------------
  ------------------
  330|     32|                    {
  331|     32|                        return;
  332|     32|                    }
  333|    386|                    break;
  334|    418|                }
  335|    386|                case parse_mode::accept:
  ------------------
  |  Branch (335:17): [True: 13, False: 16.2M]
  ------------------
  336|     13|                {
  337|     13|                    JSONCONS_ASSERT(state_stack_.size() == 1);
  ------------------
  |  |   54|     13|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (54:32): [True: 0, False: 13]
  |  |  ------------------
  |  |   55|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   56|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  338|     13|                    state_stack_.clear();
  339|     13|                    more_ = false;
  340|     13|                    done_ = true;
  341|     13|                    visitor.flush();
  342|     13|                    break;
  343|     13|                }
  344|  16.2M|            }
  345|  16.2M|        }
  346|    418|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE19read_type_and_valueERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  349|  4.96M|    {
  350|  4.96M|        if (source_.is_error())
  ------------------
  |  Branch (350:13): [True: 0, False: 4.96M]
  ------------------
  351|      0|        {
  352|      0|            ec = ubjson_errc::source_error;
  353|      0|            more_ = false;
  354|      0|            return;
  355|      0|        }   
  356|       |
  357|  4.96M|        uint8_t b;
  358|  4.96M|        if (source_.read(&b, 1) == 0)
  ------------------
  |  Branch (358:13): [True: 12, False: 4.96M]
  ------------------
  359|     12|        {
  360|     12|            ec = ubjson_errc::unexpected_eof;
  361|     12|            more_ = false;
  362|     12|            return;
  363|     12|        }
  364|  4.96M|        read_value(visitor, b, ec);
  365|  4.96M|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE9end_arrayERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  671|  3.05M|    {
  672|  3.05M|        --nesting_depth_;
  673|       |
  674|  3.05M|        visitor.end_array(*this, ec);
  675|  3.05M|        more_ = !cursor_mode_;
  676|  3.05M|        if (level() == mark_level_)
  ------------------
  |  Branch (676:13): [True: 0, False: 3.05M]
  ------------------
  677|      0|        {
  678|      0|            more_ = false;
  679|      0|        }
  680|  3.05M|        state_stack_.pop_back();
  681|  3.05M|    }
_ZNK8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5levelEv:
  116|  3.14M|    {
  117|  3.14M|        return static_cast<int>(state_stack_.size());
  118|  3.14M|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE10read_valueERNS_18basic_json_visitorIcEEhRNS3_10error_codeE:
  368|  12.5M|    {
  369|  12.5M|        switch (type)
  370|  12.5M|        {
  371|  4.07M|            case jsoncons::ubjson::ubjson_type::null_type: 
  ------------------
  |  Branch (371:13): [True: 4.07M, False: 8.47M]
  ------------------
  372|  4.07M|            {
  373|  4.07M|                visitor.null_value(semantic_tag::none, *this, ec);
  374|  4.07M|                more_ = !cursor_mode_;
  375|  4.07M|                break;
  376|      0|            }
  377|  28.4k|            case jsoncons::ubjson::ubjson_type::no_op_type: 
  ------------------
  |  Branch (377:13): [True: 28.4k, False: 12.5M]
  ------------------
  378|  28.4k|            {
  379|  28.4k|                break;
  380|      0|            }
  381|   155k|            case jsoncons::ubjson::ubjson_type::true_type:
  ------------------
  |  Branch (381:13): [True: 155k, False: 12.3M]
  ------------------
  382|   155k|            {
  383|   155k|                visitor.bool_value(true, semantic_tag::none, *this, ec);
  384|   155k|                more_ = !cursor_mode_;
  385|   155k|                break;
  386|      0|            }
  387|  56.4k|            case jsoncons::ubjson::ubjson_type::false_type:
  ------------------
  |  Branch (387:13): [True: 56.4k, False: 12.4M]
  ------------------
  388|  56.4k|            {
  389|  56.4k|                visitor.bool_value(false, semantic_tag::none, *this, ec);
  390|  56.4k|                more_ = !cursor_mode_;
  391|  56.4k|                break;
  392|      0|            }
  393|  1.03M|            case jsoncons::ubjson::ubjson_type::int8_type: 
  ------------------
  |  Branch (393:13): [True: 1.03M, False: 11.5M]
  ------------------
  394|  1.03M|            {
  395|  1.03M|                uint8_t buf[sizeof(int8_t)];
  396|  1.03M|                if (source_.read(buf, sizeof(int8_t)) != sizeof(int8_t))
  ------------------
  |  Branch (396:21): [True: 9, False: 1.03M]
  ------------------
  397|      9|                {
  398|      9|                    ec = ubjson_errc::unexpected_eof;
  399|      9|                    more_ = false;
  400|      9|                    return;
  401|      9|                }
  402|  1.03M|                int8_t val = binary::big_to_native<int8_t>(buf, sizeof(buf));
  403|  1.03M|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  404|  1.03M|                more_ = !cursor_mode_;
  405|  1.03M|                break;
  406|  1.03M|            }
  407|   373k|            case jsoncons::ubjson::ubjson_type::uint8_type: 
  ------------------
  |  Branch (407:13): [True: 373k, False: 12.1M]
  ------------------
  408|   373k|            {
  409|   373k|                uint8_t b;
  410|   373k|                if (source_.read(&b, 1) == 0)
  ------------------
  |  Branch (410:21): [True: 1, False: 373k]
  ------------------
  411|      1|                {
  412|      1|                    ec = ubjson_errc::unexpected_eof;
  413|      1|                    more_ = false;
  414|      1|                    return;
  415|      1|                }
  416|   373k|                visitor.uint64_value(b, semantic_tag::none, *this, ec);
  417|   373k|                more_ = !cursor_mode_;
  418|   373k|                break;
  419|   373k|            }
  420|   846k|            case jsoncons::ubjson::ubjson_type::int16_type: 
  ------------------
  |  Branch (420:13): [True: 846k, False: 11.7M]
  ------------------
  421|   846k|            {
  422|   846k|                uint8_t buf[sizeof(int16_t)];
  423|   846k|                if (source_.read(buf, sizeof(int16_t)) != sizeof(int16_t))
  ------------------
  |  Branch (423:21): [True: 11, False: 846k]
  ------------------
  424|     11|                {
  425|     11|                    ec = ubjson_errc::unexpected_eof;
  426|     11|                    more_ = false;
  427|     11|                    return;
  428|     11|                }
  429|   846k|                int16_t val = binary::big_to_native<int16_t>(buf, sizeof(buf));
  430|   846k|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  431|   846k|                more_ = !cursor_mode_;
  432|   846k|                break;
  433|   846k|            }
  434|   106k|            case jsoncons::ubjson::ubjson_type::int32_type: 
  ------------------
  |  Branch (434:13): [True: 106k, False: 12.4M]
  ------------------
  435|   106k|            {
  436|   106k|                uint8_t buf[sizeof(int32_t)];
  437|   106k|                if (source_.read(buf, sizeof(int32_t)) != sizeof(int32_t))
  ------------------
  |  Branch (437:21): [True: 6, False: 106k]
  ------------------
  438|      6|                {
  439|      6|                    ec = ubjson_errc::unexpected_eof;
  440|      6|                    more_ = false;
  441|      6|                    return;
  442|      6|                }
  443|   106k|                int32_t val = binary::big_to_native<int32_t>(buf, sizeof(buf));
  444|   106k|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  445|   106k|                more_ = !cursor_mode_;
  446|   106k|                break;
  447|   106k|            }
  448|  25.6k|            case jsoncons::ubjson::ubjson_type::int64_type: 
  ------------------
  |  Branch (448:13): [True: 25.6k, False: 12.5M]
  ------------------
  449|  25.6k|            {
  450|  25.6k|                uint8_t buf[sizeof(int64_t)];
  451|  25.6k|                if (source_.read(buf, sizeof(int64_t)) != sizeof(int64_t))
  ------------------
  |  Branch (451:21): [True: 4, False: 25.6k]
  ------------------
  452|      4|                {
  453|      4|                    ec = ubjson_errc::unexpected_eof;
  454|      4|                    more_ = false;
  455|      4|                    return;
  456|      4|                }
  457|  25.6k|                int64_t val = binary::big_to_native<int64_t>(buf, sizeof(buf));
  458|  25.6k|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  459|  25.6k|                more_ = !cursor_mode_;
  460|  25.6k|                break;
  461|  25.6k|            }
  462|  26.3k|            case jsoncons::ubjson::ubjson_type::float32_type: 
  ------------------
  |  Branch (462:13): [True: 26.3k, False: 12.5M]
  ------------------
  463|  26.3k|            {
  464|  26.3k|                uint8_t buf[sizeof(float)];
  465|  26.3k|                if (source_.read(buf, sizeof(float)) != sizeof(float))
  ------------------
  |  Branch (465:21): [True: 3, False: 26.3k]
  ------------------
  466|      3|                {
  467|      3|                    ec = ubjson_errc::unexpected_eof;
  468|      3|                    more_ = false;
  469|      3|                    return;
  470|      3|                }
  471|  26.3k|                float val = binary::big_to_native<float>(buf, sizeof(buf));
  472|  26.3k|                visitor.double_value(val, semantic_tag::none, *this, ec);
  473|  26.3k|                more_ = !cursor_mode_;
  474|  26.3k|                break;
  475|  26.3k|            }
  476|  9.28k|            case jsoncons::ubjson::ubjson_type::float64_type: 
  ------------------
  |  Branch (476:13): [True: 9.28k, False: 12.5M]
  ------------------
  477|  9.28k|            {
  478|  9.28k|                uint8_t buf[sizeof(double)];
  479|  9.28k|                if (source_.read(buf, sizeof(double)) != sizeof(double))
  ------------------
  |  Branch (479:21): [True: 1, False: 9.27k]
  ------------------
  480|      1|                {
  481|      1|                    ec = ubjson_errc::unexpected_eof;
  482|      1|                    more_ = false;
  483|      1|                    return;
  484|      1|                }
  485|  9.27k|                double val = binary::big_to_native<double>(buf, sizeof(buf));
  486|  9.27k|                visitor.double_value(val, semantic_tag::none, *this, ec);
  487|  9.27k|                more_ = !cursor_mode_;
  488|  9.27k|                break;
  489|  9.28k|            }
  490|  2.51M|            case jsoncons::ubjson::ubjson_type::char_type: 
  ------------------
  |  Branch (490:13): [True: 2.51M, False: 10.0M]
  ------------------
  491|  2.51M|            {
  492|  2.51M|                uint8_t ch{};
  493|  2.51M|                if (source_.read(&ch, 1) != 1)
  ------------------
  |  Branch (493:21): [True: 11, False: 2.51M]
  ------------------
  494|     11|                {
  495|     11|                    ec = ubjson_errc::unexpected_eof;
  496|     11|                    more_ = false;
  497|     11|                    return;
  498|     11|                }
  499|  2.51M|                auto result = unicode_traits::validate(&ch, 1);
  500|  2.51M|                if (result.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (500:21): [True: 1, False: 2.51M]
  ------------------
  501|      1|                {
  502|      1|                    ec = ubjson_errc::invalid_utf8_text_string;
  503|      1|                    more_ = false;
  504|      1|                    return;
  505|      1|                }
  506|  2.51M|                visitor.string_value(string_view(reinterpret_cast<const char*>(&ch), 1), semantic_tag::none, *this, ec);
  507|  2.51M|                more_ = !cursor_mode_;
  508|  2.51M|                break;
  509|  2.51M|            }
  510|    489|            case jsoncons::ubjson::ubjson_type::string_type: 
  ------------------
  |  Branch (510:13): [True: 489, False: 12.5M]
  ------------------
  511|    489|            {
  512|    489|                std::size_t length = get_length(ec);
  513|    489|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|    489|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 489]
  |  |  ------------------
  ------------------
  514|      0|                {
  515|      0|                    return;
  516|      0|                }
  517|    489|                auto data = source_.read_span(length, text_buffer_);
  518|    489|                if (data.size() != length)
  ------------------
  |  Branch (518:21): [True: 77, False: 412]
  ------------------
  519|     77|                {
  520|     77|                    ec = ubjson_errc::unexpected_eof;
  521|     77|                    more_ = false;
  522|     77|                    return;
  523|     77|                }
  524|    412|                auto result = unicode_traits::validate(data.data(), data.size());
  525|    412|                if (result.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (525:21): [True: 8, False: 404]
  ------------------
  526|      8|                {
  527|      8|                    ec = ubjson_errc::invalid_utf8_text_string;
  528|      8|                    more_ = false;
  529|      8|                    return;
  530|      8|                }
  531|    404|                visitor.string_value(jsoncons::string_view(reinterpret_cast<const char*>(data.data()),data.size()), 
  532|    404|                    semantic_tag::none, *this, ec);
  533|    404|                more_ = !cursor_mode_;
  534|    404|                break;
  535|    412|            }
  536|   135k|            case jsoncons::ubjson::ubjson_type::high_precision_number_type: 
  ------------------
  |  Branch (536:13): [True: 135k, False: 12.4M]
  ------------------
  537|   135k|            {
  538|   135k|                std::size_t length = get_length(ec);
  539|   135k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|   135k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 1, False: 135k]
  |  |  ------------------
  ------------------
  540|      1|                {
  541|      1|                    return;
  542|      1|                }
  543|   135k|                auto data = source_.read_span(length, text_buffer_);
  544|   135k|                if (data.size() != length)
  ------------------
  |  Branch (544:21): [True: 30, False: 135k]
  ------------------
  545|     30|                {
  546|     30|                    ec = ubjson_errc::unexpected_eof;
  547|     30|                    more_ = false;
  548|     30|                    return;
  549|     30|                }
  550|   135k|                if (jsoncons::is_base10(data.data(), data.size()))
  ------------------
  |  Branch (550:21): [True: 826, False: 134k]
  ------------------
  551|    826|                {
  552|    826|                    visitor.string_value(jsoncons::string_view(reinterpret_cast<const char*>(data.data()), data.size()), 
  553|    826|                        semantic_tag::bigint, *this, ec);
  554|    826|                    more_ = !cursor_mode_;
  555|    826|                }
  556|   134k|                else
  557|   134k|                {
  558|   134k|                    visitor.string_value(jsoncons::string_view(reinterpret_cast<const char*>(data.data()), data.size()), 
  559|   134k|                        semantic_tag::bigdec, *this, ec);
  560|   134k|                    more_ = !cursor_mode_;
  561|   134k|                }
  562|   135k|                break;
  563|   135k|            }
  564|  3.08M|            case jsoncons::ubjson::ubjson_type::start_array_marker: 
  ------------------
  |  Branch (564:13): [True: 3.08M, False: 9.46M]
  ------------------
  565|  3.08M|            {
  566|  3.08M|                begin_array(visitor,ec);
  567|  3.08M|                break;
  568|   135k|            }
  569|  86.7k|            case jsoncons::ubjson::ubjson_type::start_object_marker: 
  ------------------
  |  Branch (569:13): [True: 86.7k, False: 12.4M]
  ------------------
  570|  86.7k|            {
  571|  86.7k|                begin_object(visitor, ec);
  572|  86.7k|                break;
  573|   135k|            }
  574|     20|            default:
  ------------------
  |  Branch (574:13): [True: 20, False: 12.5M]
  ------------------
  575|     20|            {
  576|     20|                ec = ubjson_errc::unknown_type;
  577|     20|                break;
  578|   135k|            }
  579|  12.5M|        }
  580|  12.5M|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  12.5M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 88, False: 12.5M]
  |  |  ------------------
  ------------------
  581|     88|        {
  582|     88|            more_ = false;
  583|     88|        }
  584|  12.5M|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE10get_lengthERNS3_10error_codeE:
  790|   901k|    {
  791|   901k|        std::size_t length = 0;
  792|   901k|        uint8_t type;
  793|   901k|        if (source_.read(&type, 1) == 0)
  ------------------
  |  Branch (793:13): [True: 11, False: 901k]
  ------------------
  794|     11|        {
  795|     11|            ec = ubjson_errc::unexpected_eof;
  796|     11|            more_ = false;
  797|     11|            return length;
  798|     11|        }
  799|   901k|        switch (type)
  800|   901k|        {
  801|   543k|            case jsoncons::ubjson::ubjson_type::int8_type: 
  ------------------
  |  Branch (801:13): [True: 543k, False: 357k]
  ------------------
  802|   543k|            {
  803|   543k|                uint8_t buf[sizeof(int8_t)];
  804|   543k|                if (source_.read(buf, sizeof(int8_t)) != sizeof(int8_t))
  ------------------
  |  Branch (804:21): [True: 1, False: 543k]
  ------------------
  805|      1|                {
  806|      1|                    ec = ubjson_errc::unexpected_eof;
  807|      1|                    more_ = false;
  808|      1|                    return length;
  809|      1|                }
  810|   543k|                int8_t val = binary::big_to_native<int8_t>(buf, sizeof(buf));
  811|   543k|                if (val >= 0)
  ------------------
  |  Branch (811:21): [True: 543k, False: 0]
  ------------------
  812|   543k|                {
  813|   543k|                    length = val;
  814|   543k|                }
  815|      0|                else
  816|      0|                {
  817|      0|                    ec = ubjson_errc::length_is_negative;
  818|      0|                    more_ = false;
  819|      0|                    return length;
  820|      0|                }
  821|   543k|                break;
  822|   543k|            }
  823|   543k|            case jsoncons::ubjson::ubjson_type::uint8_type: 
  ------------------
  |  Branch (823:13): [True: 342k, False: 559k]
  ------------------
  824|   342k|            {
  825|   342k|                uint8_t b;
  826|   342k|                if (source_.read(&b, 1) == 0)
  ------------------
  |  Branch (826:21): [True: 1, False: 342k]
  ------------------
  827|      1|                {
  828|      1|                    ec = ubjson_errc::unexpected_eof;
  829|      1|                    more_ = false;
  830|      1|                    return length;
  831|      1|                }
  832|   342k|                length = b;
  833|   342k|                break;
  834|   342k|            }
  835|  14.6k|            case jsoncons::ubjson::ubjson_type::int16_type: 
  ------------------
  |  Branch (835:13): [True: 14.6k, False: 887k]
  ------------------
  836|  14.6k|            {
  837|  14.6k|                uint8_t buf[sizeof(int16_t)];
  838|  14.6k|                if (source_.read(buf, sizeof(int16_t)) != sizeof(int16_t))
  ------------------
  |  Branch (838:21): [True: 0, False: 14.6k]
  ------------------
  839|      0|                {
  840|      0|                    ec = ubjson_errc::unexpected_eof;
  841|      0|                    more_ = false;
  842|      0|                    return length;
  843|      0|                }
  844|  14.6k|                int16_t val = binary::big_to_native<int16_t>(buf, sizeof(buf));
  845|  14.6k|                if (val >= 0)
  ------------------
  |  Branch (845:21): [True: 14.6k, False: 0]
  ------------------
  846|  14.6k|                {
  847|  14.6k|                    length = val;
  848|  14.6k|                }
  849|      0|                else
  850|      0|                {
  851|      0|                    ec = ubjson_errc::length_is_negative;
  852|      0|                    more_ = false;
  853|      0|                    return length;
  854|      0|                }
  855|  14.6k|                break;
  856|  14.6k|            }
  857|  14.6k|            case jsoncons::ubjson::ubjson_type::int32_type: 
  ------------------
  |  Branch (857:13): [True: 538, False: 901k]
  ------------------
  858|    538|            {
  859|    538|                uint8_t buf[sizeof(int32_t)];
  860|    538|                if (source_.read(buf, sizeof(int32_t)) != sizeof(int32_t))
  ------------------
  |  Branch (860:21): [True: 0, False: 538]
  ------------------
  861|      0|                {
  862|      0|                    ec = ubjson_errc::unexpected_eof;
  863|      0|                    more_ = false;
  864|      0|                    return length;
  865|      0|                }
  866|    538|                int32_t val = binary::big_to_native<int32_t>(buf, sizeof(buf));
  867|    538|                if (val >= 0)
  ------------------
  |  Branch (867:21): [True: 538, False: 0]
  ------------------
  868|    538|                {
  869|    538|                    length = static_cast<std::size_t>(val);
  870|    538|                }
  871|      0|                else
  872|      0|                {
  873|      0|                    ec = ubjson_errc::length_is_negative;
  874|      0|                    more_ = false;
  875|      0|                    return length;
  876|      0|                }
  877|    538|                break;
  878|    538|            }
  879|    538|            case jsoncons::ubjson::ubjson_type::int64_type: 
  ------------------
  |  Branch (879:13): [True: 129, False: 901k]
  ------------------
  880|    129|            {
  881|    129|                uint8_t buf[sizeof(int64_t)];
  882|    129|                if (source_.read(buf, sizeof(int64_t)) != sizeof(int64_t))
  ------------------
  |  Branch (882:21): [True: 0, False: 129]
  ------------------
  883|      0|                {
  884|      0|                    ec = ubjson_errc::unexpected_eof;
  885|      0|                    more_ = false;
  886|      0|                    return length;
  887|      0|                }
  888|    129|                int64_t val = binary::big_to_native<int64_t>(buf, sizeof(buf));
  889|    129|                if (val >= 0)
  ------------------
  |  Branch (889:21): [True: 129, False: 0]
  ------------------
  890|    129|                {
  891|    129|                    length = (std::size_t)val;
  892|    129|                    if (length != (uint64_t)val)
  ------------------
  |  Branch (892:25): [True: 0, False: 129]
  ------------------
  893|      0|                    {
  894|      0|                        ec = ubjson_errc::number_too_large;
  895|      0|                        more_ = false;
  896|      0|                        return length;
  897|      0|                    }
  898|    129|                }
  899|      0|                else
  900|      0|                {
  901|      0|                    ec = ubjson_errc::length_is_negative;
  902|      0|                    more_ = false;
  903|      0|                    return length;
  904|      0|                }
  905|    129|                break;
  906|    129|            }
  907|    129|            default:
  ------------------
  |  Branch (907:13): [True: 9, False: 901k]
  ------------------
  908|      9|            {
  909|      9|                ec = ubjson_errc::length_must_be_integer;
  910|      9|                more_ = false;
  911|      9|                return length;
  912|    129|            }
  913|   901k|        }
  914|   901k|        return length;
  915|   901k|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11begin_arrayERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  587|  3.08M|    {
  588|  3.08M|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   79|  3.08M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 3.08M]
  |  |  ------------------
  ------------------
  589|      0|        {
  590|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  591|      0|            more_ = false;
  592|      0|            return;
  593|      0|        } 
  594|       |
  595|  3.08M|        auto c = source_.peek();
  596|  3.08M|        if (JSONCONS_UNLIKELY(c.eof))
  ------------------
  |  |   79|  3.08M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 8, False: 3.08M]
  |  |  ------------------
  ------------------
  597|      8|        {
  598|      8|            ec = ubjson_errc::unexpected_eof;
  599|      8|            more_ = false;
  600|      8|            return;
  601|      8|        }
  602|  3.08M|        if (c.value == jsoncons::ubjson::ubjson_type::type_marker)
  ------------------
  |  Branch (602:13): [True: 39.3k, False: 3.04M]
  ------------------
  603|  39.3k|        {
  604|  39.3k|            source_.ignore(1);
  605|  39.3k|            uint8_t b;
  606|  39.3k|            if (source_.read(&b, 1) == 0)
  ------------------
  |  Branch (606:17): [True: 5, False: 39.3k]
  ------------------
  607|      5|            {
  608|      5|                ec = ubjson_errc::unexpected_eof;
  609|      5|                more_ = false;
  610|      5|                return;
  611|      5|            }
  612|  39.3k|            c = source_.peek();
  613|  39.3k|            if (JSONCONS_UNLIKELY(c.eof))
  ------------------
  |  |   79|  39.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 4, False: 39.3k]
  |  |  ------------------
  ------------------
  614|      4|            {
  615|      4|                ec = ubjson_errc::unexpected_eof;
  616|      4|                more_ = false;
  617|      4|                return;
  618|      4|            }
  619|  39.3k|            if (c.value == jsoncons::ubjson::ubjson_type::count_marker)
  ------------------
  |  Branch (619:17): [True: 39.3k, False: 0]
  ------------------
  620|  39.3k|            {
  621|  39.3k|                source_.ignore(1);
  622|  39.3k|                std::size_t length = get_length(ec);
  623|  39.3k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  39.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 3, False: 39.3k]
  |  |  ------------------
  ------------------
  624|      3|                {
  625|      3|                    return;
  626|      3|                }
  627|  39.3k|                if (length > max_items_)
  ------------------
  |  Branch (627:21): [True: 0, False: 39.3k]
  ------------------
  628|      0|                {
  629|      0|                    ec = ubjson_errc::max_items_exceeded;
  630|      0|                    more_ = false;
  631|      0|                    return;
  632|      0|                }
  633|  39.3k|                state_stack_.emplace_back(parse_mode::strongly_typed_array,length,b);
  634|  39.3k|                visitor.begin_array(length, semantic_tag::none, *this, ec);
  635|  39.3k|                more_ = !cursor_mode_;
  636|  39.3k|            }
  637|      0|            else
  638|      0|            {
  639|      0|                ec = ubjson_errc::count_required_after_type;
  640|      0|                more_ = false;
  641|      0|                return;
  642|      0|            }
  643|  39.3k|        }
  644|  3.04M|        else if (c.value == jsoncons::ubjson::ubjson_type::count_marker)
  ------------------
  |  Branch (644:18): [True: 98.6k, False: 2.94M]
  ------------------
  645|  98.6k|        {
  646|  98.6k|            source_.ignore(1);
  647|  98.6k|            std::size_t length = get_length(ec);
  648|  98.6k|            if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  98.6k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 4, False: 98.6k]
  |  |  ------------------
  ------------------
  649|      4|            {
  650|      4|                return;
  651|      4|            }
  652|  98.6k|            if (length > max_items_)
  ------------------
  |  Branch (652:17): [True: 0, False: 98.6k]
  ------------------
  653|      0|            {
  654|      0|                ec = ubjson_errc::max_items_exceeded;
  655|      0|                more_ = false;
  656|      0|                return;
  657|      0|            }
  658|  98.6k|            state_stack_.emplace_back(parse_mode::array,length);
  659|  98.6k|            visitor.begin_array(length, semantic_tag::none, *this, ec);
  660|  98.6k|            more_ = !cursor_mode_;
  661|  98.6k|        }
  662|  2.94M|        else
  663|  2.94M|        {
  664|  2.94M|            state_stack_.emplace_back(parse_mode::indefinite_array,0);
  665|  2.94M|            visitor.begin_array(semantic_tag::none, *this, ec);
  666|  2.94M|            more_ = !cursor_mode_;
  667|  2.94M|        }
  668|  3.08M|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE12begin_objectERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  684|  86.7k|    {
  685|  86.7k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   79|  86.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 86.7k]
  |  |  ------------------
  ------------------
  686|      0|        {
  687|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  688|      0|            more_ = false;
  689|      0|            return;
  690|      0|        } 
  691|       |
  692|  86.7k|        auto c = source_.peek();
  693|  86.7k|        if (JSONCONS_UNLIKELY(c.eof))
  ------------------
  |  |   79|  86.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 4, False: 86.7k]
  |  |  ------------------
  ------------------
  694|      4|        {
  695|      4|            ec = ubjson_errc::unexpected_eof;
  696|      4|            more_ = false;
  697|      4|            return;
  698|      4|        }
  699|  86.7k|        if (c.value == jsoncons::ubjson::ubjson_type::type_marker)
  ------------------
  |  Branch (699:13): [True: 82.3k, False: 4.43k]
  ------------------
  700|  82.3k|        {
  701|  82.3k|            source_.ignore(1);
  702|  82.3k|            uint8_t b;
  703|  82.3k|            if (source_.read(&b, 1) == 0)
  ------------------
  |  Branch (703:17): [True: 5, False: 82.3k]
  ------------------
  704|      5|            {
  705|      5|                ec = ubjson_errc::unexpected_eof;
  706|      5|                more_ = false;
  707|      5|                return;
  708|      5|            }
  709|  82.3k|            c = source_.peek();
  710|  82.3k|            if (JSONCONS_UNLIKELY(c.eof))
  ------------------
  |  |   79|  82.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 4, False: 82.3k]
  |  |  ------------------
  ------------------
  711|      4|            {
  712|      4|                ec = ubjson_errc::unexpected_eof;
  713|      4|                more_ = false;
  714|      4|                return;
  715|      4|            }
  716|  82.3k|            if (c.value == jsoncons::ubjson::ubjson_type::count_marker)
  ------------------
  |  Branch (716:17): [True: 82.3k, False: 2]
  ------------------
  717|  82.3k|            {
  718|  82.3k|                source_.ignore(1);
  719|  82.3k|                std::size_t length = get_length(ec);
  720|  82.3k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  82.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 5, False: 82.2k]
  |  |  ------------------
  ------------------
  721|      5|                {
  722|      5|                    return;
  723|      5|                }
  724|  82.2k|                if (length > max_items_)
  ------------------
  |  Branch (724:21): [True: 2, False: 82.2k]
  ------------------
  725|      2|                {
  726|      2|                    ec = ubjson_errc::max_items_exceeded;
  727|      2|                    more_ = false;
  728|      2|                    return;
  729|      2|                }
  730|  82.2k|                state_stack_.emplace_back(parse_mode::strongly_typed_map_key,length,b);
  731|  82.2k|                visitor.begin_object(length, semantic_tag::none, *this, ec);
  732|  82.2k|                more_ = !cursor_mode_;
  733|  82.2k|            }
  734|      2|            else
  735|      2|            {
  736|      2|                ec = ubjson_errc::count_required_after_type;
  737|      2|                more_ = false;
  738|      2|                return;
  739|      2|            }
  740|  82.3k|        }
  741|  4.43k|        else
  742|  4.43k|        {
  743|  4.43k|            c = source_.peek();
  744|  4.43k|            if (JSONCONS_UNLIKELY(c.eof))
  ------------------
  |  |   79|  4.43k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 4.43k]
  |  |  ------------------
  ------------------
  745|      0|            {
  746|      0|                ec = ubjson_errc::unexpected_eof;
  747|      0|                more_ = false;
  748|      0|                return;
  749|      0|            }
  750|  4.43k|            if (c.value == jsoncons::ubjson::ubjson_type::count_marker)
  ------------------
  |  Branch (750:17): [True: 2.26k, False: 2.17k]
  ------------------
  751|  2.26k|            {
  752|  2.26k|                source_.ignore(1);
  753|  2.26k|                std::size_t length = get_length(ec);
  754|  2.26k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  2.26k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 2, False: 2.25k]
  |  |  ------------------
  ------------------
  755|      2|                {
  756|      2|                    return;
  757|      2|                }
  758|  2.25k|                if (length > max_items_)
  ------------------
  |  Branch (758:21): [True: 1, False: 2.25k]
  ------------------
  759|      1|                {
  760|      1|                    ec = ubjson_errc::max_items_exceeded;
  761|      1|                    more_ = false;
  762|      1|                    return;
  763|      1|                }
  764|  2.25k|                state_stack_.emplace_back(parse_mode::map_key,length);
  765|  2.25k|                visitor.begin_object(length, semantic_tag::none, *this, ec);
  766|  2.25k|                more_ = !cursor_mode_;
  767|  2.25k|            }
  768|  2.17k|            else
  769|  2.17k|            {
  770|  2.17k|                state_stack_.emplace_back(parse_mode::indefinite_map_key,0);
  771|  2.17k|                visitor.begin_object(semantic_tag::none, *this, ec);
  772|  2.17k|                more_ = !cursor_mode_;
  773|  2.17k|            }
  774|  4.43k|        }
  775|  86.7k|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE8read_keyERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  918|   543k|    {
  919|   543k|        std::size_t length = get_length(ec);
  920|   543k|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|   543k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 7, False: 543k]
  |  |  ------------------
  ------------------
  921|      7|        {
  922|      7|            ec = ubjson_errc::key_expected;
  923|      7|            more_ = false;
  924|      7|            return;
  925|      7|        }
  926|   543k|        auto data = source_.read_span(length, text_buffer_);
  927|   543k|        if (data.size() != length)
  ------------------
  |  Branch (927:13): [True: 92, False: 543k]
  ------------------
  928|     92|        {
  929|     92|            ec = ubjson_errc::unexpected_eof;
  930|     92|            more_ = false;
  931|     92|            return;
  932|     92|        }
  933|       |
  934|   543k|        auto result = unicode_traits::validate(data.data(), data.size());
  935|   543k|        if (result.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (935:13): [True: 17, False: 543k]
  ------------------
  936|     17|        {
  937|     17|            ec = ubjson_errc::invalid_utf8_text_string;
  938|     17|            more_ = false;
  939|     17|            return;
  940|     17|        }
  941|   543k|        visitor.key(jsoncons::string_view(reinterpret_cast<const char*>(data.data()),data.size()), 
  942|   543k|            *this, ec);
  943|   543k|        more_ = !cursor_mode_;
  944|   543k|    }
_ZN8jsoncons6ubjson19basic_ubjson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE10end_objectERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  778|  85.7k|    {
  779|  85.7k|        --nesting_depth_;
  780|  85.7k|        visitor.end_object(*this, ec);
  781|  85.7k|        more_ = !cursor_mode_;
  782|  85.7k|        if (level() == mark_level_)
  ------------------
  |  Branch (782:13): [True: 0, False: 85.7k]
  ------------------
  783|      0|        {
  784|      0|            more_ = false;
  785|      0|        }
  786|  85.7k|        state_stack_.pop_back();
  787|  85.7k|    }

_ZN8jsoncons6ubjson19basic_ubjson_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEEC2IRNS3_19basic_istringstreamIcNS3_11char_traitsIcEES7_EEEEOT_RNS_18basic_json_visitorIcEERKNS0_21ubjson_decode_optionsERKS7_:
   48|    418|       : parser_(std::forward<Sourceable>(source), options, alloc),
   49|    418|         visitor_(visitor)
   50|    418|    {
   51|    418|    }
_ZN8jsoncons6ubjson19basic_ubjson_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE4readERNS3_10error_codeE:
   64|    418|    {
   65|    418|        parser_.reset();
   66|    418|        parser_.parse(visitor_, ec);
   67|    418|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|    418|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 405, False: 13]
  |  |  ------------------
  ------------------
   68|    405|        {
   69|    405|            return;
   70|    405|        }
   71|    418|    }

