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

_ZN8jsoncons18basic_json_visitorIcEC2Ev:
  103|    421|        basic_json_visitor() = default;
_ZN8jsoncons19typed_array_visitorD2Ev:
   33|    421|        virtual ~typed_array_visitor() = default;
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  345|   139k|        {
  346|   139k|            visit_begin_array(length, tag, context, ec);
  347|   139k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|   139k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  348|   139k|        }
_ZN8jsoncons18basic_json_visitorIcE12uint64_valueEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  414|   413k|        {
  415|   413k|            visit_uint64(value, tag, context, ec);
  416|   413k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|   413k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  417|   413k|        }
_ZN8jsoncons18basic_json_visitorIcE9end_arrayERKNS_11ser_contextERNSt3__110error_codeE:
  351|  3.02M|        {
  352|  3.02M|            visit_end_array(context, ec);
  353|  3.02M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  3.02M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  354|  3.02M|        }
_ZN8jsoncons18basic_json_visitorIcE11int64_valueElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  423|  2.17M|        {
  424|  2.17M|            visit_int64(value, tag, context, ec);
  425|  2.17M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  2.17M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  426|  2.17M|        }
_ZN8jsoncons18basic_json_visitorIcE12double_valueEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  441|  27.2k|        {
  442|  27.2k|            visit_double(value, tag, context, ec);
  443|  27.2k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  27.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  444|  27.2k|        }
_ZN8jsoncons18basic_json_visitorIcE10null_valueENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  365|  4.13M|        {
  366|  4.13M|            visit_null(tag, context, ec);
  367|  4.13M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  4.13M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  368|  4.13M|        }
_ZN8jsoncons18basic_json_visitorIcE10bool_valueEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  374|   222k|        {
  375|   222k|            visit_bool(value, tag, context, ec);
  376|   222k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|   222k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|   222k|        }
_ZN8jsoncons18basic_json_visitorIcE12string_valueERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  383|  2.19M|        {
  384|  2.19M|            visit_string(value, tag, context, ec);
  385|  2.19M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  2.19M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  386|  2.19M|        }
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  339|  2.91M|        {
  340|  2.91M|            visit_begin_array(tag, context, ec);
  341|  2.91M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  2.91M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  342|  2.91M|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  327|  86.6k|        {
  328|  86.6k|            visit_begin_object(length, tag, context, ec);
  329|  86.6k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  86.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  330|  86.6k|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  318|  3.14k|        {
  319|  3.14k|            visit_begin_object(tag, context, ec);
  320|  3.14k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  3.14k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  321|  3.14k|        }
_ZN8jsoncons18basic_json_visitorIcE3keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  357|   819k|        {
  358|   819k|            visit_key(name, context, ec);
  359|   819k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|   819k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  360|   819k|        }
_ZN8jsoncons18basic_json_visitorIcE10end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  333|  87.8k|        {
  334|  87.8k|            visit_end_object(context, ec);
  335|  87.8k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  87.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  336|  87.8k|        }
_ZN8jsoncons18basic_json_visitorIcE5flushEv:
  108|     14|        {
  109|     14|            visit_flush();
  110|     14|        }

_ZNK8jsoncons6nonstd4spanIKhLm18446744073709551615EE4sizeEv:
  159|  2.96M|    {
  160|  2.96M|        return size_;
  161|  2.96M|    }
_ZN8jsoncons6nonstd4spanIKhLm18446744073709551615EEC2Ev:
   99|   789k|    {
  100|   789k|    }
_ZN8jsoncons6nonstd4spanIKhLm18446744073709551615EEC2EPS2_m:
  102|   197k|        : data_(data), size_(size)
  103|   197k|    {
  104|   197k|    }
_ZNK8jsoncons6nonstd4spanIKhLm18446744073709551615EE4dataEv:
  154|  1.97M|    {
  155|  1.97M|        return data_;
  156|  1.97M|    }

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

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|    421|    {
  194|    421|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 421, False: 0]
  ------------------
  195|    421|        {
  196|    421|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|    421|        }
  198|    421|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|    421|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|    421|          chunk_size_(default_max_chunk_size)
  178|    421|    {
  179|    421|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|    421|        data_end_ = chunk_;
  181|    421|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|    421|      : std::basic_istream<CharT>(&nb_)
   58|    421|    {
   59|    421|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|    421|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  5.06M|    {
  277|  5.06M|        return stream_ptr_->bad();  
  278|  5.06M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  377|  12.2M|    {
  378|  12.2M|        std::size_t len = 0;
  379|  12.2M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 12.2M, False: 878]
  ------------------
  380|  12.2M|        {
  381|  12.2M|            len = (std::min)(remaining_, length);
  382|  12.2M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  12.2M|            data_end_ += len;
  384|  12.2M|            remaining_ -= len;
  385|  12.2M|            position_ += len;
  386|  12.2M|        }
  387|  12.2M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 12.2M, False: 2.15k]
  ------------------
  388|  12.2M|        {
  389|  12.2M|            return len;
  390|  12.2M|        }
  391|  2.15k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 2.15k, False: 0]
  ------------------
  392|  2.15k|        {
  393|  2.15k|            data_end_ = chunk_;
  394|  2.15k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  2.15k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 2.03k, False: 123]
  ------------------
  396|  2.03k|            {
  397|  2.03k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  2.03k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  2.03k|                data_end_ += len2;
  400|  2.03k|                remaining_ -= len2;
  401|  2.03k|                position_ += len2;
  402|  2.03k|                len += len2;
  403|  2.03k|            }
  404|  2.15k|            return len;
  405|  2.15k|        }
  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|  12.2M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  3.11k|    {
  443|  3.11k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 168, False: 2.94k]
  ------------------
  444|    168|        {
  445|    168|            return 0;
  446|    168|        }
  447|       |
  448|  2.94k|        JSONCONS_TRY
  ------------------
  |  |   37|  2.94k|    #define JSONCONS_TRY try
  ------------------
  449|  2.94k|        {
  450|  2.94k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  2.94k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  2.94k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 409, False: 2.54k]
  ------------------
  454|    409|            {
  455|    409|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|    409|            }
  457|  2.94k|            return length;
  458|  2.94k|        }
  459|  2.94k|        JSONCONS_CATCH(const std::exception&)     
  460|  2.94k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  2.94k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6nonstd4spanIKhLm18446744073709551615EEEmOT_:
  352|   987k|    {
  353|   987k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   79|   987k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 789k, False: 197k]
  |  |  ------------------
  ------------------
  354|   789k|        {
  355|   789k|            return span<const value_type>{};
  356|   789k|        }
  357|   197k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 154, False: 197k]
  |  Branch (357:32): [True: 20, False: 134]
  ------------------
  358|     20|        {
  359|     20|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     20|            data_end_ = chunk_;
  361|     20|        }
  362|   197k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 618, False: 197k]
  ------------------
  363|    618|        {
  364|    618|            buffer.clear();
  365|    618|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    618|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    618|        }
  368|       |
  369|   197k|        const value_type* data = data_end_;
  370|   197k|        data_end_ += length;
  371|   197k|        remaining_ -= length;
  372|   197k|        position_ += length;
  373|   197k|        return span<const value_type>(data, length);
  374|   197k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  749|    618|    {
  750|    618|        std::size_t unread = length;
  751|       |
  752|  2.43k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (752:16): [True: 2.01k, False: 419]
  |  Branch (752:30): [True: 1.81k, False: 199]
  ------------------
  753|  1.81k|        {
  754|  1.81k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (754:17): [True: 481, False: 1.33k]
  |  Branch (754:44): [True: 477, False: 4]
  ------------------
  755|    477|            {
  756|    477|                std::size_t n = source.chunk_size();
  757|    477|                std::size_t offset = buffer.size();
  758|    477|                buffer.resize(offset+n);
  759|    477|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  760|    477|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    477|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 129, False: 348]
  |  |  ------------------
  ------------------
  761|    129|                {
  762|    129|                    buffer.resize(offset+actual);
  763|    129|                }
  764|    477|                unread -= actual;
  765|    477|            }
  766|  1.34k|            else
  767|  1.34k|            {
  768|  1.34k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  769|  1.34k|                std::size_t offset = buffer.size();
  770|  1.34k|                buffer.resize(offset+n);
  771|  1.34k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  772|  1.34k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|  1.34k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 62, False: 1.28k]
  |  |  ------------------
  ------------------
  773|     62|                {
  774|     62|                    buffer.resize(offset + actual);
  775|     62|                }
  776|  1.34k|                unread -= actual;
  777|  1.34k|            }
  778|  1.81k|        }
  779|    618|        return length - unread;
  780|    618|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  2.01k|    {
  272|  2.01k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 680, False: 1.33k]
  |  Branch (272:35): [True: 199, False: 481]
  ------------------
  273|  2.01k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  1.81k|    {
  347|  1.81k|        return remaining_;
  348|  1.81k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  2.30k|    {
  262|  2.30k|        return chunk_size_;
  263|  2.30k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    477|    {
  436|    477|        auto len = fill_buffer(chunk, chunk_size);
  437|    477|        position_ += len;
  438|    477|        return len;
  439|    477|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4peekEv:
  312|  11.2M|    {
  313|  11.2M|        if (remaining_ == 0)
  ------------------
  |  Branch (313:13): [True: 465, False: 11.2M]
  ------------------
  314|    465|        {
  315|    465|            data_end_ = chunk_;
  316|    465|            remaining_ = fill_buffer(chunk_, chunk_size_);
  317|    465|        }
  318|  11.2M|        if (remaining_ > 0)
  ------------------
  |  Branch (318:13): [True: 11.2M, False: 51]
  ------------------
  319|  11.2M|        {
  320|  11.2M|            value_type c = *data_end_;
  321|  11.2M|            return char_result<value_type>{c, false};
  322|  11.2M|        }
  323|     51|        else
  324|     51|        {
  325|     51|            return char_result<value_type>{0, true};
  326|     51|        }
  327|  11.2M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE6ignoreEm:
  286|  3.25M|    {
  287|  3.25M|        std::size_t len = 0;
  288|  3.25M|        if (remaining_ > 0)
  ------------------
  |  Branch (288:13): [True: 3.25M, False: 0]
  ------------------
  289|  3.25M|        {
  290|  3.25M|            len = (std::min)(remaining_, length);
  291|  3.25M|            position_ += len;
  292|  3.25M|            data_end_ += len;
  293|  3.25M|            remaining_ -= len;
  294|  3.25M|        }
  295|  3.25M|        while (len < length)
  ------------------
  |  Branch (295:16): [True: 0, False: 3.25M]
  ------------------
  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.25M|    }

_ZN8jsoncons6binary13native_to_bigIhNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  8.66M|    {
  128|  8.66M|        T val2 = byte_swap(val);
  129|  8.66M|        uint8_t buf[sizeof(T)];
  130|  8.66M|        std::memcpy(buf, &val2, sizeof(T));
  131|  8.66M|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 8.66M, False: 8.66M]
  ------------------
  132|  8.66M|        {
  133|  8.66M|            *d_first++ = item;
  134|  8.66M|        }
  135|  8.66M|    }
_ZN8jsoncons6binary9byte_swapIhEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm1EES4_E4typeES4_:
   21|  8.66M|    {
   22|  8.66M|        return val;
   23|  8.66M|    }
_ZN8jsoncons6binary13native_to_bigItNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  15.4k|    {
  128|  15.4k|        T val2 = byte_swap(val);
  129|  15.4k|        uint8_t buf[sizeof(T)];
  130|  15.4k|        std::memcpy(buf, &val2, sizeof(T));
  131|  15.4k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 30.9k, False: 15.4k]
  ------------------
  132|  30.9k|        {
  133|  30.9k|            *d_first++ = item;
  134|  30.9k|        }
  135|  15.4k|    }
_ZN8jsoncons6binary9byte_swapItEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm2EES4_E4typeES4_:
   28|  15.4k|    {
   29|  15.4k|    #if defined(JSONCONS_BYTE_SWAP_16)
   30|  15.4k|        return JSONCONS_BYTE_SWAP_16(val);
  ------------------
  |  |  478|  15.4k|#      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|  15.4k|    }
_ZN8jsoncons6binary13native_to_bigIjNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|    563|    {
  128|    563|        T val2 = byte_swap(val);
  129|    563|        uint8_t buf[sizeof(T)];
  130|    563|        std::memcpy(buf, &val2, sizeof(T));
  131|    563|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 2.25k, False: 563]
  ------------------
  132|  2.25k|        {
  133|  2.25k|            *d_first++ = item;
  134|  2.25k|        }
  135|    563|    }
_ZN8jsoncons6binary9byte_swapIjEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm4EES4_E4typeES4_:
   39|  31.6k|    {
   40|  31.6k|    #if defined(JSONCONS_BYTE_SWAP_32)
   41|  31.6k|        return JSONCONS_BYTE_SWAP_32(val);
  ------------------
  |  |  474|  31.6k|#  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|  31.6k|    }
_ZN8jsoncons6binary9byte_swapImEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm8EES4_E4typeES4_:
   51|  23.4k|    {
   52|  23.4k|    #if defined(JSONCONS_BYTE_SWAP_64)
   53|  23.4k|        return JSONCONS_BYTE_SWAP_64(val);
  ------------------
  |  |  473|  23.4k|#  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.4k|    }
_ZN8jsoncons6binary13native_to_bigIsNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  1.09M|    {
  128|  1.09M|        T val2 = byte_swap(val);
  129|  1.09M|        uint8_t buf[sizeof(T)];
  130|  1.09M|        std::memcpy(buf, &val2, sizeof(T));
  131|  1.09M|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 2.18M, False: 1.09M]
  ------------------
  132|  2.18M|        {
  133|  2.18M|            *d_first++ = item;
  134|  2.18M|        }
  135|  1.09M|    }
_ZN8jsoncons6binary9byte_swapIsEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm2EES4_E4typeES4_:
   28|  2.43M|    {
   29|  2.43M|    #if defined(JSONCONS_BYTE_SWAP_16)
   30|  2.43M|        return JSONCONS_BYTE_SWAP_16(val);
  ------------------
  |  |  478|  2.43M|#      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|  2.43M|    }
_ZN8jsoncons6binary13native_to_bigIiNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  98.7k|    {
  128|  98.7k|        T val2 = byte_swap(val);
  129|  98.7k|        uint8_t buf[sizeof(T)];
  130|  98.7k|        std::memcpy(buf, &val2, sizeof(T));
  131|  98.7k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 394k, False: 98.7k]
  ------------------
  132|   394k|        {
  133|   394k|            *d_first++ = item;
  134|   394k|        }
  135|  98.7k|    }
_ZN8jsoncons6binary9byte_swapIiEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm4EES4_E4typeES4_:
   39|   207k|    {
   40|   207k|    #if defined(JSONCONS_BYTE_SWAP_32)
   41|   207k|        return JSONCONS_BYTE_SWAP_32(val);
  ------------------
  |  |  474|   207k|#  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|   207k|    }
_ZN8jsoncons6binary13native_to_bigIlNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  29.4k|    {
  128|  29.4k|        T val2 = byte_swap(val);
  129|  29.4k|        uint8_t buf[sizeof(T)];
  130|  29.4k|        std::memcpy(buf, &val2, sizeof(T));
  131|  29.4k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 235k, False: 29.4k]
  ------------------
  132|   235k|        {
  133|   235k|            *d_first++ = item;
  134|   235k|        }
  135|  29.4k|    }
_ZN8jsoncons6binary9byte_swapIlEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm8EES4_E4typeES4_:
   51|  70.8k|    {
   52|  70.8k|    #if defined(JSONCONS_BYTE_SWAP_64)
   53|  70.8k|        return JSONCONS_BYTE_SWAP_64(val);
  ------------------
  |  |  473|  70.8k|#  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|  70.8k|    }
_ZN8jsoncons6binary13native_to_bigIaNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  62.4k|    {
  128|  62.4k|        T val2 = byte_swap(val);
  129|  62.4k|        uint8_t buf[sizeof(T)];
  130|  62.4k|        std::memcpy(buf, &val2, sizeof(T));
  131|  62.4k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 62.4k, False: 62.4k]
  ------------------
  132|  62.4k|        {
  133|  62.4k|            *d_first++ = item;
  134|  62.4k|        }
  135|  62.4k|    }
_ZN8jsoncons6binary9byte_swapIaEENSt3__19enable_ifIXaasr3std11is_integralIT_EE5valueeqstS4_Lm1EES4_E4typeES4_:
   21|  1.61M|    {
   22|  1.61M|        return val;
   23|  1.61M|    }
_ZN8jsoncons6binary13native_to_bigIfNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  13.1k|    {
  128|  13.1k|        T val2 = byte_swap(val);
  129|  13.1k|        uint8_t buf[sizeof(T)];
  130|  13.1k|        std::memcpy(buf, &val2, sizeof(T));
  131|  13.1k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 52.6k, False: 13.1k]
  ------------------
  132|  52.6k|        {
  133|  52.6k|            *d_first++ = item;
  134|  52.6k|        }
  135|  13.1k|    }
_ZN8jsoncons6binary9byte_swapIfEENSt3__19enable_ifIXaasr3std17is_floating_pointIT_EE5valueeqstS4_Lm4EES4_E4typeES4_:
   64|  31.0k|    {
   65|  31.0k|        uint32_t x;
   66|  31.0k|        std::memcpy(&x,&val,sizeof(uint32_t));
   67|  31.0k|        uint32_t y = byte_swap(x);
   68|  31.0k|        T val2;
   69|  31.0k|        std::memcpy(&val2,&y,sizeof(uint32_t));
   70|  31.0k|        return val2;
   71|  31.0k|    }
_ZN8jsoncons6binary13native_to_bigIdNSt3__120back_insert_iteratorINS_10bytes_sinkINS2_6vectorIhNS2_9allocatorIhEEEEvEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSE_6littleEvE4typeET_T0_:
  127|  14.1k|    {
  128|  14.1k|        T val2 = byte_swap(val);
  129|  14.1k|        uint8_t buf[sizeof(T)];
  130|  14.1k|        std::memcpy(buf, &val2, sizeof(T));
  131|  14.1k|        for (auto item : buf)
  ------------------
  |  Branch (131:24): [True: 112k, False: 14.1k]
  ------------------
  132|   112k|        {
  133|   112k|            *d_first++ = item;
  134|   112k|        }
  135|  14.1k|    }
_ZN8jsoncons6binary9byte_swapIdEENSt3__19enable_ifIXaasr3std17is_floating_pointIT_EE5valueeqstS4_Lm8EES4_E4typeES4_:
   76|  23.4k|    {
   77|  23.4k|        uint64_t x;
   78|  23.4k|        std::memcpy(&x,&val,sizeof(uint64_t));
   79|  23.4k|        uint64_t y = byte_swap(x);
   80|  23.4k|        T val2;
   81|  23.4k|        std::memcpy(&val2,&y,sizeof(uint64_t));
   82|  23.4k|        return val2;
   83|  23.4k|    }
_ZN8jsoncons6binary13big_to_nativeIaNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|  1.55M|    {
  183|  1.55M|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 1.55M]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|  1.55M|        T val;
  188|  1.55M|        std::memcpy(&val,first,sizeof(T));
  189|  1.55M|        return byte_swap(val);
  190|  1.55M|    }
_ZN8jsoncons6binary13big_to_nativeIsNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|  1.34M|    {
  183|  1.34M|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 1.34M]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|  1.34M|        T val;
  188|  1.34M|        std::memcpy(&val,first,sizeof(T));
  189|  1.34M|        return byte_swap(val);
  190|  1.34M|    }
_ZN8jsoncons6binary13big_to_nativeIiNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|   108k|    {
  183|   108k|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 108k]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|   108k|        T val;
  188|   108k|        std::memcpy(&val,first,sizeof(T));
  189|   108k|        return byte_swap(val);
  190|   108k|    }
_ZN8jsoncons6binary13big_to_nativeIlNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|  41.3k|    {
  183|  41.3k|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 41.3k]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|  41.3k|        T val;
  188|  41.3k|        std::memcpy(&val,first,sizeof(T));
  189|  41.3k|        return byte_swap(val);
  190|  41.3k|    }
_ZN8jsoncons6binary13big_to_nativeIfNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|  17.9k|    {
  183|  17.9k|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 17.9k]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|  17.9k|        T val;
  188|  17.9k|        std::memcpy(&val,first,sizeof(T));
  189|  17.9k|        return byte_swap(val);
  190|  17.9k|    }
_ZN8jsoncons6binary13big_to_nativeIdNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  182|  9.37k|    {
  183|  9.37k|        if (sizeof(T) > count)
  ------------------
  |  Branch (183:13): [True: 0, False: 9.37k]
  ------------------
  184|      0|        {
  185|      0|            return T{};
  186|      0|        }
  187|  9.37k|        T val;
  188|  9.37k|        std::memcpy(&val,first,sizeof(T));
  189|  9.37k|        return byte_swap(val);
  190|  9.37k|    }

_ZN8jsoncons9is_base10IhEEbPKT_m:
  187|   167k|{
  188|   167k|    integer_chars_state state = integer_chars_state::initial;
  189|       |
  190|   167k|    const CharT* end = s + length; 
  191|   177k|    for (;s < end; ++s)
  ------------------
  |  Branch (191:11): [True: 176k, False: 1.29k]
  ------------------
  192|   176k|    {
  193|   176k|        switch(state)
  194|   176k|        {
  195|   167k|            case integer_chars_state::initial:
  ------------------
  |  Branch (195:13): [True: 167k, False: 8.56k]
  ------------------
  196|   167k|            {
  197|   167k|                switch(*s)
  198|   167k|                {
  199|  6.22k|                    case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (199:21): [True: 131, False: 167k]
  |  Branch (199:30): [True: 1.39k, False: 166k]
  |  Branch (199:39): [True: 2, False: 167k]
  |  Branch (199:48): [True: 4, False: 167k]
  |  Branch (199:57): [True: 709, False: 166k]
  |  Branch (199:66): [True: 9, False: 167k]
  |  Branch (199:75): [True: 11, False: 167k]
  |  Branch (199:84): [True: 1, False: 167k]
  |  Branch (199:93): [True: 2, False: 167k]
  |  Branch (199:103): [True: 3.95k, False: 163k]
  ------------------
  200|  6.22k|                        state = integer_chars_state::decimal;
  201|  6.22k|                        break;
  202|  1.78k|                    case '-':
  ------------------
  |  Branch (202:21): [True: 1.78k, False: 165k]
  ------------------
  203|  1.78k|                        state = integer_chars_state::minus;
  204|  1.78k|                        break;
  205|   159k|                    default:
  ------------------
  |  Branch (205:21): [True: 159k, False: 8.00k]
  ------------------
  206|   159k|                        return false;
  207|   167k|                }
  208|  8.00k|                break;
  209|   167k|            }
  210|  8.00k|            case integer_chars_state::minus:
  ------------------
  |  Branch (210:13): [True: 1.78k, False: 174k]
  ------------------
  211|  1.78k|            {
  212|  1.78k|                switch(*s)
  213|  1.78k|                {
  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: 25, False: 1.75k]
  |  Branch (214:30): [True: 11, False: 1.77k]
  |  Branch (214:39): [True: 0, False: 1.78k]
  |  Branch (214:48): [True: 0, False: 1.78k]
  |  Branch (214:57): [True: 0, False: 1.78k]
  |  Branch (214:66): [True: 5, False: 1.77k]
  |  Branch (214:75): [True: 0, False: 1.78k]
  |  Branch (214:84): [True: 0, False: 1.78k]
  |  Branch (214:93): [True: 60, False: 1.72k]
  |  Branch (214:103): [True: 94, False: 1.68k]
  ------------------
  215|    195|                        state = integer_chars_state::decimal;
  216|    195|                        break;
  217|  1.58k|                    default:
  ------------------
  |  Branch (217:21): [True: 1.58k, False: 195]
  ------------------
  218|  1.58k|                        return false;
  219|  1.78k|                }
  220|    195|                break;
  221|  1.78k|            }
  222|  6.78k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (222:13): [True: 6.78k, False: 169k]
  ------------------
  223|  6.78k|            {
  224|  6.78k|                switch(*s)
  225|  6.78k|                {
  226|  1.38k|                    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.38k, False: 5.39k]
  |  Branch (226:30): [True: 3, False: 6.77k]
  |  Branch (226:39): [True: 1, False: 6.77k]
  |  Branch (226:48): [True: 0, False: 6.78k]
  |  Branch (226:57): [True: 0, False: 6.78k]
  |  Branch (226:66): [True: 0, False: 6.78k]
  |  Branch (226:75): [True: 1, False: 6.77k]
  |  Branch (226:84): [True: 0, False: 6.78k]
  |  Branch (226:93): [True: 1, False: 6.77k]
  |  Branch (226:103): [True: 1, False: 6.77k]
  ------------------
  227|  1.38k|                        break;
  228|  5.39k|                    default:
  ------------------
  |  Branch (228:21): [True: 5.39k, False: 1.38k]
  ------------------
  229|  5.39k|                        return false;
  230|  6.78k|                }
  231|  1.38k|                break;
  232|  6.78k|            }
  233|  1.38k|            default:
  ------------------
  |  Branch (233:13): [True: 0, False: 176k]
  ------------------
  234|      0|                break;
  235|   176k|        }
  236|   176k|    }
  237|  1.29k|    return state == integer_chars_state::decimal ? true : false;
  ------------------
  |  Branch (237:12): [True: 1.02k, False: 266]
  ------------------
  238|   167k|}

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|  3.01M|    {
 1148|  3.01M|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|  3.01M|        const uint8_t* end = it + length;
 1150|       |
 1151|  3.01M|        unicode_errc  result{};
 1152|  6.45M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 3.43M, False: 3.01M]
  ------------------
 1153|  3.43M|        {
 1154|  3.43M|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 1.30M, False: 2.13M]
  ------------------
 1155|  1.30M|            {
 1156|  9.08M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  342|  2.60M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (342:32): [True: 1.30M, False: 1.41k]
  |  |  |  Branch (342:34): [True: 1.30M, False: 1.54k]
  |  |  |  Branch (342:36): [True: 1.29M, False: 687]
  |  |  |  Branch (342:38): [True: 1.29M, False: 3.68k]
  |  |  |  Branch (342:40): [True: 1.29M, False: 714]
  |  |  |  Branch (342:42): [True: 1.29M, False: 1.47k]
  |  |  |  Branch (342:44): [True: 1.29M, False: 1.54k]
  |  |  |  Branch (342:46): [True: 1.29M, False: 1.82k]
  |  |  ------------------
  ------------------
 1157|  1.29M|                continue;
 1158|  9.08M|            }
 1159|  2.14M|    non_ascii:
 1160|  2.14M|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|  2.14M|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 1, False: 2.14M]
  ------------------
 1162|      1|            {
 1163|      1|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|      1|            }
 1165|  2.14M|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 18, False: 2.14M]
  ------------------
 1166|     18|            {
 1167|     18|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|     18|            }
 1169|  2.14M|            it += len;
 1170|  2.14M|        }
 1171|  3.01M|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|  3.01M|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|  4.27M|    {
  306|  4.27M|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|  4.27M|        const uint8_t* end = it+length;
  308|       |
  309|  4.27M|        uint8_t byte;
  310|  4.27M|        switch (length) {
  311|     23|        default:
  ------------------
  |  Branch (311:9): [True: 23, False: 4.27M]
  ------------------
  312|     23|            return unicode_errc::over_long_utf8_sequence;
  313|  14.4k|        case 4:
  ------------------
  |  Branch (313:9): [True: 14.4k, False: 4.26M]
  ------------------
  314|  14.4k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 1, False: 14.4k]
  ------------------
  315|      1|                return unicode_errc::bad_continuation_byte;
  316|  14.4k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  576|  14.4k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  18.8k|        case 3:
  ------------------
  |  Branch (317:9): [True: 4.38k, False: 4.27M]
  ------------------
  318|  18.8k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 2, False: 18.8k]
  ------------------
  319|      2|                return unicode_errc::bad_continuation_byte;
  320|  18.8k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  576|  18.8k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  22.3k|        case 2:
  ------------------
  |  Branch (321:9): [True: 3.46k, False: 4.27M]
  ------------------
  322|  22.3k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 3, False: 22.3k]
  ------------------
  323|      3|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  22.3k|            switch (*it) 
  326|  22.3k|            {
  327|       |                // no fall-through in this inner switch
  328|    677|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 677, False: 21.6k]
  |  Branch (328:32): [True: 0, False: 677]
  ------------------
  329|    677|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 86, False: 22.2k]
  |  Branch (329:32): [True: 0, False: 86]
  ------------------
  330|  3.19k|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 3.19k, False: 19.1k]
  |  Branch (330:32): [True: 1, False: 3.18k]
  ------------------
  331|  10.2k|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 10.2k, False: 12.0k]
  |  Branch (331:32): [True: 0, False: 10.2k]
  ------------------
  332|  10.2k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 8.10k, False: 14.2k]
  |  Branch (332:32): [True: 0, False: 8.10k]
  ------------------
  333|  22.3k|            }
  334|       |
  335|  22.3k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  576|  22.3k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|  4.27M|        case 1:
  ------------------
  |  Branch (336:9): [True: 4.25M, False: 22.3k]
  ------------------
  337|  4.27M|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 22.3k, False: 4.25M]
  |  Branch (337:32): [True: 12, False: 22.3k]
  ------------------
  338|     12|                return unicode_errc::source_illegal;
  339|  4.27M|            break;
  340|  4.27M|        }
  341|  4.27M|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 0, False: 4.27M]
  ------------------
  342|      0|            return unicode_errc::source_illegal;
  343|       |
  344|  4.27M|        return unicode_errc();
  345|  4.27M|    }
_ZN8jsoncons14unicode_traits8validateIhEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|  2.84M|    {
 1148|  2.84M|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|  2.84M|        const uint8_t* end = it + length;
 1150|       |
 1151|  2.84M|        unicode_errc  result{};
 1152|  5.94M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 3.09M, False: 2.84M]
  ------------------
 1153|  3.09M|        {
 1154|  3.09M|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 978k, False: 2.11M]
  ------------------
 1155|   978k|            {
 1156|  6.81M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  342|  1.95M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (342:32): [True: 977k, False: 1.05k]
  |  |  |  Branch (342:34): [True: 976k, False: 925]
  |  |  |  Branch (342:36): [True: 975k, False: 529]
  |  |  |  Branch (342:38): [True: 973k, False: 2.86k]
  |  |  |  Branch (342:40): [True: 972k, False: 471]
  |  |  |  Branch (342:42): [True: 971k, False: 705]
  |  |  |  Branch (342:44): [True: 970k, False: 1.01k]
  |  |  |  Branch (342:46): [True: 969k, False: 1.70k]
  |  |  ------------------
  ------------------
 1157|   969k|                continue;
 1158|  6.81M|            }
 1159|  2.12M|    non_ascii:
 1160|  2.12M|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|  2.12M|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 1, False: 2.12M]
  ------------------
 1162|      1|            {
 1163|      1|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|      1|            }
 1165|  2.12M|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 24, False: 2.12M]
  ------------------
 1166|     24|            {
 1167|     24|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|     24|            }
 1169|  2.12M|            it += len;
 1170|  2.12M|        }
 1171|  2.84M|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|  2.84M|    }

_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKS9_:
  105|    421|       : basic_ubjson_encoder(std::forward<Sink>(sink), ubjson_encode_options(), alloc)
  106|    421|    {
  107|    421|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKNS0_21ubjson_encode_optionsERKS9_:
  112|    421|       : sink_(std::forward<Sink>(sink)),
  113|    421|         max_nesting_depth_(static_cast<std::size_t>(options.max_nesting_depth())),
  114|    421|         alloc_(alloc)
  115|    421|    {
  116|    421|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayEmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  223|   139k|    {
  224|   139k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|   139k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 139k]
  |  |  ------------------
  ------------------
  225|      0|        {
  226|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  227|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  228|      0|        } 
  229|   139k|        stack_.emplace_back(container_type::array, length);
  230|   139k|        sink_.push_back(jsoncons::ubjson::ubjson_type::start_array_marker);
  231|   139k|        sink_.push_back(jsoncons::ubjson::ubjson_type::count_marker);
  232|   139k|        put_length(length);
  233|       |
  234|   139k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|   139k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  235|   139k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_itemC2ENS0_14container_typeEm:
   59|  3.14M|           : type_(type), length_(length)
   60|  3.14M|        {
   61|  3.14M|        }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10put_lengthEm:
  329|  3.24M|    {
  330|  3.24M|        if (length <= (std::numeric_limits<uint8_t>::max)())
  ------------------
  |  Branch (330:13): [True: 3.22M, False: 16.0k]
  ------------------
  331|  3.22M|        {
  332|  3.22M|            sink_.push_back(ubjson_type::uint8_type);
  333|  3.22M|            binary::native_to_big(static_cast<uint8_t>(length), std::back_inserter(sink_));
  334|  3.22M|        }
  335|  16.0k|        else if (length <= (std::size_t)(std::numeric_limits<int16_t>::max)())
  ------------------
  |  Branch (335:18): [True: 15.4k, False: 563]
  ------------------
  336|  15.4k|        {
  337|  15.4k|            sink_.push_back(ubjson_type::int16_type);
  338|  15.4k|            binary::native_to_big(static_cast<uint16_t>(length), std::back_inserter(sink_));
  339|  15.4k|        }
  340|    563|        else if (length <= (std::size_t)(std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (340:18): [True: 563, False: 0]
  ------------------
  341|    563|        {
  342|    563|            sink_.push_back(ubjson_type::int32_type);
  343|    563|            binary::native_to_big(static_cast<uint32_t>(length),std::back_inserter(sink_));
  344|    563|        }
  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.24M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE15visit_end_arrayERKNS_11ser_contextERNS3_10error_codeE:
  238|  3.02M|    {
  239|  3.02M|        if (JSONCONS_UNLIKELY(stack_.empty() || !stack_.back().is_array()))
  ------------------
  |  |   79|  6.05M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 3.02M]
  |  |  |  Branch (79:50): [True: 0, False: 3.02M]
  |  |  |  Branch (79:50): [True: 0, False: 3.02M]
  |  |  ------------------
  ------------------
  240|      0|        {
  241|      0|            ec = ubjson_errc::unmatched_end_array;
  242|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  243|      0|        }
  244|       |
  245|  3.02M|        if (stack_.back().is_indefinite_length())
  ------------------
  |  Branch (245:13): [True: 2.90M, False: 122k]
  ------------------
  246|  2.90M|        {
  247|  2.90M|            sink_.push_back(jsoncons::ubjson::ubjson_type::end_array_marker);
  248|  2.90M|        }
  249|   122k|        else
  250|   122k|        {
  251|   122k|            if (stack_.back().count() < stack_.back().length())
  ------------------
  |  Branch (251:17): [True: 0, False: 122k]
  ------------------
  252|      0|            {
  253|      0|                ec = ubjson_errc::too_few_items;
  254|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  255|      0|            }
  256|   122k|            if (stack_.back().count() > stack_.back().length())
  ------------------
  |  Branch (256:17): [True: 0, False: 122k]
  ------------------
  257|      0|            {
  258|      0|                ec = ubjson_errc::too_many_items;
  259|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  260|      0|            }
  261|   122k|        }
  262|  3.02M|        stack_.pop_back();
  263|  3.02M|        end_value();
  264|  3.02M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  3.02M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  265|  3.02M|    }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item8is_arrayEv:
   81|  3.02M|        {
   82|  3.02M|            return type_ == container_type::array || type_ == container_type::indefinite_length_array;
  ------------------
  |  Branch (82:20): [True: 122k, False: 2.90M]
  |  Branch (82:54): [True: 2.90M, False: 0]
  ------------------
   83|  3.02M|        }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item20is_indefinite_lengthEv:
   86|  3.11M|        {
   87|  3.11M|            return type_ == container_type::indefinite_length_array || type_ == container_type::indefinite_length_object;
  ------------------
  |  Branch (87:20): [True: 2.90M, False: 210k]
  |  Branch (87:72): [True: 1.36k, False: 208k]
  ------------------
   88|  3.11M|        }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item5countEv:
   71|   417k|        {
   72|   417k|            return count_;
   73|   417k|        }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item6lengthEv:
   66|   417k|        {
   67|   417k|            return length_;
   68|   417k|        }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9end_valueEv:
  516|  12.2M|    {
  517|  12.2M|        if (!stack_.empty())
  ------------------
  |  Branch (517:13): [True: 12.2M, False: 14]
  ------------------
  518|  12.2M|        {
  519|  12.2M|            ++stack_.back().count_;
  520|  12.2M|        }
  521|  12.2M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  472|   413k|    {
  473|   413k|        if (val <= (std::numeric_limits<uint8_t>::max)())
  ------------------
  |  Branch (473:13): [True: 413k, False: 0]
  ------------------
  474|   413k|        {
  475|   413k|            sink_.push_back(jsoncons::ubjson::ubjson_type::uint8_type);
  476|   413k|            binary::native_to_big(static_cast<uint8_t>(val),std::back_inserter(sink_));
  477|   413k|        }
  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::append_to_string(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|   413k|        end_value();
  503|   413k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|   413k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  504|   413k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  405|  2.17M|    {
  406|  2.17M|        if (val >= 0)
  ------------------
  |  Branch (406:13): [True: 1.86M, False: 308k]
  ------------------
  407|  1.86M|        {
  408|  1.86M|            if (val <= (std::numeric_limits<uint8_t>::max)())
  ------------------
  |  Branch (408:17): [True: 892k, False: 976k]
  ------------------
  409|   892k|            {
  410|       |                // uint 8 stores a 8-bit unsigned integer
  411|   892k|                sink_.push_back(jsoncons::ubjson::ubjson_type::uint8_type);
  412|   892k|                binary::native_to_big(static_cast<uint8_t>(val),std::back_inserter(sink_));
  413|   892k|            }
  414|   976k|            else if (val <= (std::numeric_limits<int16_t>::max)())
  ------------------
  |  Branch (414:22): [True: 917k, False: 58.8k]
  ------------------
  415|   917k|            {
  416|       |                // uint 16 stores a 16-bit big-endian unsigned integer
  417|   917k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int16_type);
  418|   917k|                binary::native_to_big(static_cast<int16_t>(val),std::back_inserter(sink_));
  419|   917k|            }
  420|  58.8k|            else if (val <= (std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (420:22): [True: 43.3k, False: 15.5k]
  ------------------
  421|  43.3k|            {
  422|       |                // uint 32 stores a 32-bit big-endian unsigned integer
  423|  43.3k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int32_type);
  424|  43.3k|                binary::native_to_big(static_cast<int32_t>(val),std::back_inserter(sink_));
  425|  43.3k|            }
  426|  15.5k|            else if (val <= (std::numeric_limits<int64_t>::max)())
  ------------------
  |  Branch (426:22): [True: 15.5k, False: 0]
  ------------------
  427|  15.5k|            {
  428|       |                // int 64 stores a 64-bit big-endian signed integer
  429|  15.5k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int64_type);
  430|  15.5k|                binary::native_to_big(val,std::back_inserter(sink_));
  431|  15.5k|            }
  432|      0|            else
  433|      0|            {
  434|       |                // big integer
  435|      0|            }
  436|  1.86M|        }
  437|   308k|        else
  438|   308k|        {
  439|   308k|            if (val >= (std::numeric_limits<int8_t>::lowest)())
  ------------------
  |  Branch (439:17): [True: 62.4k, False: 246k]
  ------------------
  440|  62.4k|            {
  441|       |                // int 8 stores a 8-bit signed integer
  442|  62.4k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int8_type);
  443|  62.4k|                binary::native_to_big(static_cast<int8_t>(val),std::back_inserter(sink_));
  444|  62.4k|            }
  445|   246k|            else if (val >= (std::numeric_limits<int16_t>::lowest)())
  ------------------
  |  Branch (445:22): [True: 177k, False: 69.3k]
  ------------------
  446|   177k|            {
  447|       |                // int 16 stores a 16-bit big-endian signed integer
  448|   177k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int16_type);
  449|   177k|                binary::native_to_big(static_cast<int16_t>(val),std::back_inserter(sink_));
  450|   177k|            }
  451|  69.3k|            else if (val >= (std::numeric_limits<int32_t>::lowest)())
  ------------------
  |  Branch (451:22): [True: 55.3k, False: 13.9k]
  ------------------
  452|  55.3k|            {
  453|       |                // int 32 stores a 32-bit big-endian signed integer
  454|  55.3k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int32_type);
  455|  55.3k|                binary::native_to_big(static_cast<int32_t>(val),std::back_inserter(sink_));
  456|  55.3k|            }
  457|  13.9k|            else if (val >= (std::numeric_limits<int64_t>::lowest)())
  ------------------
  |  Branch (457:22): [True: 13.9k, False: 0]
  ------------------
  458|  13.9k|            {
  459|       |                // int 64 stores a 64-bit big-endian signed integer
  460|  13.9k|                sink_.push_back(jsoncons::ubjson::ubjson_type::int64_type);
  461|  13.9k|                binary::native_to_big(val,std::back_inserter(sink_));
  462|  13.9k|            }
  463|   308k|        }
  464|  2.17M|        end_value();
  465|  2.17M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  2.17M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  466|  2.17M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  382|  27.2k|    {
  383|  27.2k|        float valf = (float)val;
  384|  27.2k|        if ((double)valf == val)
  ------------------
  |  Branch (384:13): [True: 13.1k, False: 14.1k]
  ------------------
  385|  13.1k|        {
  386|       |            // float 32
  387|  13.1k|            sink_.push_back(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::float32_type));
  388|  13.1k|            binary::native_to_big(valf,std::back_inserter(sink_));
  389|  13.1k|        }
  390|  14.1k|        else
  391|  14.1k|        {
  392|       |            // float 64
  393|  14.1k|            sink_.push_back(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::float64_type));
  394|  14.1k|            binary::native_to_big(val,std::back_inserter(sink_));
  395|  14.1k|        }
  396|       |
  397|       |        // write double
  398|       |
  399|  27.2k|        end_value();
  400|  27.2k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  27.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  401|  27.2k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_flushEv:
  147|     14|    {
  148|     14|        sink_.flush();
  149|     14|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE18visit_begin_objectENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  152|  3.14k|    {
  153|  3.14k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  3.14k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 3.14k]
  |  |  ------------------
  ------------------
  154|      0|        {
  155|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  156|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  157|      0|        } 
  158|  3.14k|        stack_.emplace_back(container_type::indefinite_length_object);
  159|  3.14k|        sink_.push_back(jsoncons::ubjson::ubjson_type::start_object_marker);
  160|       |
  161|  3.14k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  3.14k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  162|  3.14k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE18visit_begin_objectEmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  165|  86.6k|    {
  166|  86.6k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  86.6k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 86.6k]
  |  |  ------------------
  ------------------
  167|      0|        {
  168|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  169|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  170|      0|        } 
  171|  86.6k|        stack_.emplace_back(container_type::object, length);
  172|  86.6k|        sink_.push_back(jsoncons::ubjson::ubjson_type::start_object_marker);
  173|  86.6k|        sink_.push_back(jsoncons::ubjson::ubjson_type::count_marker);
  174|  86.6k|        put_length(length);
  175|       |
  176|  86.6k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  86.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  177|  86.6k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE16visit_end_objectERKNS_11ser_contextERNS3_10error_codeE:
  180|  87.8k|    {
  181|  87.8k|        if (JSONCONS_UNLIKELY(stack_.empty() || !stack_.back().is_object()))
  ------------------
  |  |   79|   175k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 87.8k]
  |  |  |  Branch (79:50): [True: 0, False: 87.8k]
  |  |  |  Branch (79:50): [True: 0, False: 87.8k]
  |  |  ------------------
  ------------------
  182|      0|        {
  183|      0|            ec = ubjson_errc::unmatched_end_object;
  184|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  185|      0|        }
  186|       |
  187|  87.8k|        if (stack_.back().is_indefinite_length())
  ------------------
  |  Branch (187:13): [True: 1.36k, False: 86.4k]
  ------------------
  188|  1.36k|        {
  189|  1.36k|            sink_.push_back(jsoncons::ubjson::ubjson_type::end_object_marker);
  190|  1.36k|        }
  191|  86.4k|        else
  192|  86.4k|        {
  193|  86.4k|            if (stack_.back().count() < stack_.back().length())
  ------------------
  |  Branch (193:17): [True: 0, False: 86.4k]
  ------------------
  194|      0|            {
  195|      0|                ec = ubjson_errc::too_few_items;
  196|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  197|      0|            }
  198|  86.4k|            if (stack_.back().count() > stack_.back().length())
  ------------------
  |  Branch (198:17): [True: 0, False: 86.4k]
  ------------------
  199|      0|            {
  200|      0|                ec = ubjson_errc::too_many_items;
  201|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  202|      0|            }
  203|  86.4k|        }
  204|  87.8k|        stack_.pop_back();
  205|  87.8k|        end_value();
  206|  87.8k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  87.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  207|  87.8k|    }
_ZNK8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item9is_objectEv:
   76|  87.8k|        {
   77|  87.8k|            return type_ == container_type::object || type_ == container_type::indefinite_length_object;
  ------------------
  |  Branch (77:20): [True: 86.4k, False: 1.36k]
  |  Branch (77:55): [True: 1.36k, False: 0]
  ------------------
   78|  87.8k|        }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  210|  2.91M|    {
  211|  2.91M|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  2.91M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 2.91M]
  |  |  ------------------
  ------------------
  212|      0|        {
  213|      0|            ec = ubjson_errc::max_nesting_depth_exceeded;
  214|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  215|      0|        } 
  216|  2.91M|        stack_.emplace_back(container_type::indefinite_length_array);
  217|  2.91M|        sink_.push_back(jsoncons::ubjson::ubjson_type::start_array_marker);
  218|       |
  219|  2.91M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  2.91M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  220|  2.91M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9visit_keyERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEERKNS_11ser_contextERNS3_10error_codeE:
  268|   819k|    {
  269|   819k|        auto sink = unicode_traits::validate(name.data(), name.size());
  270|   819k|        if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (270:13): [True: 0, False: 819k]
  ------------------
  271|      0|        {
  272|      0|            ec = ubjson_errc::invalid_utf8;
  273|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  274|      0|        }
  275|       |
  276|   819k|        put_length(name.length());
  277|       |
  278|   819k|        for (auto c : name)
  ------------------
  |  Branch (278:21): [True: 6.96M, False: 819k]
  ------------------
  279|  6.96M|        {
  280|  6.96M|            sink_.push_back(c);
  281|  6.96M|        }
  282|   819k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|   819k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  283|   819k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  286|  4.13M|    {
  287|       |        // nil
  288|  4.13M|        binary::native_to_big(static_cast<uint8_t>(jsoncons::ubjson::ubjson_type::null_type), std::back_inserter(sink_));
  289|  4.13M|        end_value();
  290|  4.13M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  4.13M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  291|  4.13M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  507|   222k|    {
  508|       |        // true and false
  509|   222k|        sink_.push_back(static_cast<uint8_t>(val ? jsoncons::ubjson::ubjson_type::true_type : jsoncons::ubjson::ubjson_type::false_type));
  ------------------
  |  Branch (509:46): [True: 163k, False: 59.1k]
  ------------------
  510|       |
  511|   222k|        end_value();
  512|   222k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|   222k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  513|   222k|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_stringERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  294|  2.19M|    {
  295|  2.19M|        switch (tag)
  296|  2.19M|        {
  297|  1.02k|            case semantic_tag::bigint:
  ------------------
  |  Branch (297:13): [True: 1.02k, False: 2.19M]
  ------------------
  298|   167k|            case semantic_tag::bigdec:
  ------------------
  |  Branch (298:13): [True: 166k, False: 2.02M]
  ------------------
  299|   167k|            {
  300|   167k|                sink_.push_back(jsoncons::ubjson::ubjson_type::high_precision_number_type);
  301|   167k|                break;
  302|  1.02k|            }
  303|  2.02M|            default:
  ------------------
  |  Branch (303:13): [True: 2.02M, False: 167k]
  ------------------
  304|  2.02M|            {
  305|  2.02M|                sink_.push_back(jsoncons::ubjson::ubjson_type::string_type);
  306|  2.02M|                break;
  307|  1.02k|            }
  308|  2.19M|        }
  309|       |
  310|  2.19M|        auto sink = unicode_traits::validate(sv.data(), sv.size());
  311|  2.19M|        if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (311:13): [True: 19, False: 2.19M]
  ------------------
  312|     19|        {
  313|     19|            ec = ubjson_errc::invalid_utf8;
  314|     19|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|     19|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  315|     19|        }
  316|       |
  317|  2.19M|        put_length(sv.length());
  318|       |
  319|  2.19M|        for (auto c : sv)
  ------------------
  |  Branch (319:21): [True: 5.53M, False: 2.19M]
  ------------------
  320|  5.53M|        {
  321|  5.53M|            sink_.push_back(c);
  322|  5.53M|        }
  323|       |
  324|  2.19M|        end_value();
  325|  2.19M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  337|  2.19M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  326|  2.19M|    }
_ZN8jsoncons6ubjson20basic_ubjson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEED2Ev:
  119|    421|    {
  120|    421|        JSONCONS_TRY
  ------------------
  |  |   37|    421|    #define JSONCONS_TRY try
  ------------------
  121|    421|        {
  122|    421|            sink_.flush();
  123|    421|        }
  124|    421|        JSONCONS_CATCH(...)
  125|    421|        {
  126|      0|        }
  127|    421|    }

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

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

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

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

