LLVMFuzzerTestOneInput:
   10|  2.10k|{
   11|  2.10k|    std::string s(reinterpret_cast<const char*>(data), size);
   12|  2.10k|    std::istringstream is(s);
   13|       |
   14|  2.10k|    default_json_visitor visitor;
   15|       |
   16|  2.10k|    bson_stream_reader reader(is, visitor);
   17|  2.10k|    std::error_code ec;
   18|  2.10k|    reader.read(ec);
   19|       |
   20|  2.10k|    return 0;
   21|  2.10k|}

_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4sizeEv:
  116|   216k|        {
  117|   216k|            return size_;
  118|   216k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2Ev:
   58|  2.63k|        {
   59|  2.63k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2EPS2_m:
   61|  70.1k|            : data_(data), size_(size)
   62|  70.1k|        {
   63|  70.1k|        }
_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4dataEv:
  111|  72.1k|        {
  112|  72.1k|            return data_;
  113|  72.1k|        }

_ZN8jsoncons26basic_default_json_visitorIcEC2Ev:
  811|  2.10k|        basic_default_json_visitor() = default;
_ZN8jsoncons18basic_json_visitorIcEC2Ev:
  103|  2.10k|        basic_json_visitor() = default;
_ZN8jsoncons19typed_array_visitorD2Ev:
   33|  2.10k|        virtual ~typed_array_visitor() = default;
_ZN8jsoncons26basic_default_json_visitorIcE15visit_end_arrayERKNS_11ser_contextERNSt3__110error_codeE:
  833|  1.96k|        {
  834|  1.96k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.96k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  835|  1.96k|        }
_ZN8jsoncons26basic_default_json_visitorIcE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  858|    642|        {
  859|    642|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    642|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  860|    642|        }
_ZN8jsoncons26basic_default_json_visitorIcE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  863|  19.2k|        {
  864|  19.2k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  19.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  865|  19.2k|        }
_ZN8jsoncons26basic_default_json_visitorIcE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  873|  14.8k|        {
  874|  14.8k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  14.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  875|  14.8k|        }
_ZN8jsoncons26basic_default_json_visitorIcE11visit_flushEv:
  814|      7|        {
  815|      7|        }
_ZN8jsoncons26basic_default_json_visitorIcE18visit_begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  818|  4.49k|        {
  819|  4.49k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.49k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  820|  4.49k|        }
_ZN8jsoncons26basic_default_json_visitorIcE16visit_end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  823|    863|        {
  824|    863|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    863|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  825|    863|        }
_ZN8jsoncons26basic_default_json_visitorIcE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  828|  31.1k|        {
  829|  31.1k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  31.1k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  830|  31.1k|        }
_ZN8jsoncons26basic_default_json_visitorIcE9visit_keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  838|  23.6k|        {
  839|  23.6k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  23.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  840|  23.6k|        }
_ZN8jsoncons26basic_default_json_visitorIcE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  843|  2.53k|        {
  844|  2.53k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  2.53k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  845|  2.53k|        }
_ZN8jsoncons26basic_default_json_visitorIcE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  878|  1.90k|        {
  879|  1.90k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.90k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  880|  1.90k|        }
_ZN8jsoncons26basic_default_json_visitorIcE12visit_stringERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  848|  89.7k|        {
  849|  89.7k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  89.7k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  850|  89.7k|        }
_ZN8jsoncons26basic_default_json_visitorIcE17visit_byte_stringERKNS_16byte_string_viewENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  853|  11.6k|        {
  854|  11.6k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  11.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  855|  11.6k|        }
_ZN8jsoncons18basic_json_visitorIcE17visit_byte_stringERKNS_16byte_string_viewEmRKNS_11ser_contextERNSt3__110error_codeE:
  595|  11.6k|        {
  596|  11.6k|            visit_byte_string(value, semantic_tag::none, context, ec);
  597|  11.6k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  11.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  598|  11.6k|        }
_ZN8jsoncons18basic_json_visitorIcE12uint64_valueEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  414|    642|        {
  415|    642|            visit_uint64(value, tag, context, ec);
  416|    642|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    642|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  417|    642|        }
_ZN8jsoncons18basic_json_visitorIcE9end_arrayERKNS_11ser_contextERNSt3__110error_codeE:
  351|  1.96k|        {
  352|  1.96k|            visit_end_array(context, ec);
  353|  1.96k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.96k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  354|  1.96k|        }
_ZN8jsoncons18basic_json_visitorIcE11int64_valueElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  423|  19.2k|        {
  424|  19.2k|            visit_int64(value, tag, context, ec);
  425|  19.2k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  19.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  426|  19.2k|        }
_ZN8jsoncons18basic_json_visitorIcE12double_valueEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  441|  14.8k|        {
  442|  14.8k|            visit_double(value, tag, context, ec);
  443|  14.8k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  14.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  444|  14.8k|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  318|  4.49k|        {
  319|  4.49k|            visit_begin_object(tag, context, ec);
  320|  4.49k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.49k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  321|  4.49k|        }
_ZN8jsoncons18basic_json_visitorIcE3keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  357|  23.6k|        {
  358|  23.6k|            visit_key(name, context, ec);
  359|  23.6k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  23.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  360|  23.6k|        }
_ZN8jsoncons18basic_json_visitorIcE10end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  333|    863|        {
  334|    863|            visit_end_object(context, ec);
  335|    863|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    863|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  336|    863|        }
_ZN8jsoncons18basic_json_visitorIcE12string_valueERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  383|  89.7k|        {
  384|  89.7k|            visit_string(value, tag, context, ec);
  385|  89.7k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  89.7k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  386|  89.7k|        }
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  339|  31.1k|        {
  340|  31.1k|            visit_begin_array(tag, context, ec);
  341|  31.1k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  31.1k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  342|  31.1k|        }
_ZN8jsoncons18basic_json_visitorIcE10null_valueENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  365|  2.53k|        {
  366|  2.53k|            visit_null(tag, context, ec);
  367|  2.53k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  2.53k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  368|  2.53k|        }
_ZN8jsoncons18basic_json_visitorIcE10bool_valueEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  374|  1.90k|        {
  375|  1.90k|            visit_bool(value, tag, context, ec);
  376|  1.90k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.90k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|  1.90k|        }
_ZN8jsoncons18basic_json_visitorIcE17byte_string_valueINS_16byte_string_viewEEEbRKT_mRKNS_11ser_contextERNSt3__110error_codeENSA_9enable_ifIXsr10ext_traits18is_bytes_view_likeIS4_EE5valueEiE4typeE:
  405|  11.6k|        {
  406|  11.6k|            visit_byte_string(byte_string_view(reinterpret_cast<const uint8_t*>(b.data()),b.size()), raw_tag, context, ec);
  407|  11.6k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  11.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  408|  11.6k|        }
_ZN8jsoncons18basic_json_visitorIcE5flushEv:
  108|      7|        {
  109|      7|            visit_flush();
  110|      7|        }

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|  2.10k|    {
  194|  2.10k|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 2.10k, False: 0]
  ------------------
  195|  2.10k|        {
  196|  2.10k|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|  2.10k|        }
  198|  2.10k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|  2.10k|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|  2.10k|          chunk_size_(default_max_chunk_size)
  178|  2.10k|    {
  179|  2.10k|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|  2.10k|        data_end_ = chunk_;
  181|  2.10k|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|  2.10k|      : std::basic_istream<CharT>(&nb_)
   58|  2.10k|    {
   59|  2.10k|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|  2.10k|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  2.10k|    {
  277|  2.10k|        return stream_ptr_->bad();  
  278|  2.10k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  377|  13.0M|    {
  378|  13.0M|        std::size_t len = 0;
  379|  13.0M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 13.0M, False: 3.56k]
  ------------------
  380|  13.0M|        {
  381|  13.0M|            len = (std::min)(remaining_, length);
  382|  13.0M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  13.0M|            data_end_ += len;
  384|  13.0M|            remaining_ -= len;
  385|  13.0M|            position_ += len;
  386|  13.0M|        }
  387|  13.0M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 13.0M, False: 5.55k]
  ------------------
  388|  13.0M|        {
  389|  13.0M|            return len;
  390|  13.0M|        }
  391|  5.55k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 5.55k, False: 0]
  ------------------
  392|  5.55k|        {
  393|  5.55k|            data_end_ = chunk_;
  394|  5.55k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  5.55k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 4.32k, False: 1.22k]
  ------------------
  396|  4.32k|            {
  397|  4.32k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  4.32k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  4.32k|                data_end_ += len2;
  400|  4.32k|                remaining_ -= len2;
  401|  4.32k|                position_ += len2;
  402|  4.32k|                len += len2;
  403|  4.32k|            }
  404|  5.55k|            return len;
  405|  5.55k|        }
  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|  13.0M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  6.33k|    {
  443|  6.33k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 1.25k, False: 5.08k]
  ------------------
  444|  1.25k|        {
  445|  1.25k|            return 0;
  446|  1.25k|        }
  447|       |
  448|  5.08k|        JSONCONS_TRY
  ------------------
  |  |   37|  5.08k|    #define JSONCONS_TRY try
  ------------------
  449|  5.08k|        {
  450|  5.08k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  5.08k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  5.08k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 2.09k, False: 2.99k]
  ------------------
  454|  2.09k|            {
  455|  2.09k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|  2.09k|            }
  457|  5.08k|            return length;
  458|  5.08k|        }
  459|  5.08k|        JSONCONS_CATCH(const std::exception&)     
  460|  5.08k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  5.08k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  60.7k|    {
  353|  60.7k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  60.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 2.06k, False: 58.6k]
  |  |  ------------------
  ------------------
  354|  2.06k|        {
  355|  2.06k|            return span<const value_type>{};
  356|  2.06k|        }
  357|  58.6k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 186, False: 58.5k]
  |  Branch (357:32): [True: 54, False: 132]
  ------------------
  358|     54|        {
  359|     54|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     54|            data_end_ = chunk_;
  361|     54|        }
  362|  58.6k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 569, False: 58.1k]
  ------------------
  363|    569|        {
  364|    569|            buffer.clear();
  365|    569|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    569|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    569|        }
  368|       |
  369|  58.1k|        const value_type* data = data_end_;
  370|  58.1k|        data_end_ += length;
  371|  58.1k|        remaining_ -= length;
  372|  58.1k|        position_ += length;
  373|  58.1k|        return span<const value_type>(data, length);
  374|  58.6k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  746|    569|    {
  747|    569|        std::size_t unread = length;
  748|       |
  749|  1.88k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.57k, False: 302]
  |  Branch (749:30): [True: 1.31k, False: 267]
  ------------------
  750|  1.31k|        {
  751|  1.31k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 324, False: 988]
  |  Branch (751:44): [True: 322, False: 2]
  ------------------
  752|    322|            {
  753|    322|                std::size_t n = source.chunk_size();
  754|    322|                std::size_t offset = buffer.size();
  755|    322|                buffer.resize(offset+n);
  756|    322|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    322|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    322|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 71, False: 251]
  |  |  ------------------
  ------------------
  758|     71|                {
  759|     71|                    buffer.resize(offset+actual);
  760|     71|                }
  761|    322|                unread -= actual;
  762|    322|            }
  763|    990|            else
  764|    990|            {
  765|    990|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|    990|                std::size_t offset = buffer.size();
  767|    990|                buffer.resize(offset+n);
  768|    990|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|    990|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    990|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 114, False: 876]
  |  |  ------------------
  ------------------
  770|    114|                {
  771|    114|                    buffer.resize(offset + actual);
  772|    114|                }
  773|    990|                unread -= actual;
  774|    990|            }
  775|  1.31k|        }
  776|    569|        return length - unread;
  777|    569|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  3.56k|    {
  272|  3.56k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 1.34k, False: 2.22k]
  |  Branch (272:35): [True: 621, False: 721]
  ------------------
  273|  3.56k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  2.94k|    {
  347|  2.94k|        return remaining_;
  348|  2.94k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  3.66k|    {
  262|  3.66k|        return chunk_size_;
  263|  3.66k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    710|    {
  436|    710|        auto len = fill_buffer(chunk, chunk_size);
  437|    710|        position_ += len;
  438|    710|        return len;
  439|    710|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  11.9k|    {
  353|  11.9k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  11.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 565, False: 11.4k]
  |  |  ------------------
  ------------------
  354|    565|        {
  355|    565|            return span<const value_type>{};
  356|    565|        }
  357|  11.4k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 165, False: 11.2k]
  |  Branch (357:32): [True: 24, False: 141]
  ------------------
  358|     24|        {
  359|     24|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     24|            data_end_ = chunk_;
  361|     24|        }
  362|  11.4k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 701, False: 10.7k]
  ------------------
  363|    701|        {
  364|    701|            buffer.clear();
  365|    701|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    701|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    701|        }
  368|       |
  369|  10.7k|        const value_type* data = data_end_;
  370|  10.7k|        data_end_ += length;
  371|  10.7k|        remaining_ -= length;
  372|  10.7k|        position_ += length;
  373|  10.7k|        return span<const value_type>(data, length);
  374|  11.4k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  746|    701|    {
  747|    701|        std::size_t unread = length;
  748|       |
  749|  2.33k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.99k, False: 347]
  |  Branch (749:30): [True: 1.63k, False: 354]
  ------------------
  750|  1.63k|        {
  751|  1.63k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 397, False: 1.23k]
  |  Branch (751:44): [True: 388, False: 9]
  ------------------
  752|    388|            {
  753|    388|                std::size_t n = source.chunk_size();
  754|    388|                std::size_t offset = buffer.size();
  755|    388|                buffer.resize(offset+n);
  756|    388|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    388|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    388|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 74, False: 314]
  |  |  ------------------
  ------------------
  758|     74|                {
  759|     74|                    buffer.resize(offset+actual);
  760|     74|                }
  761|    388|                unread -= actual;
  762|    388|            }
  763|  1.24k|            else
  764|  1.24k|            {
  765|  1.24k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|  1.24k|                std::size_t offset = buffer.size();
  767|  1.24k|                buffer.resize(offset+n);
  768|  1.24k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|  1.24k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|  1.24k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 204, False: 1.04k]
  |  |  ------------------
  ------------------
  770|    204|                {
  771|    204|                    buffer.resize(offset + actual);
  772|    204|                }
  773|  1.24k|                unread -= actual;
  774|  1.24k|            }
  775|  1.63k|        }
  776|    701|        return length - unread;
  777|    701|    }

_ZN8jsoncons6binary16little_to_nativeIiNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   109k|    {
  198|   109k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 109k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   109k|        T val;
  203|   109k|        std::memcpy(&val,first,sizeof(T));
  204|   109k|        return val;
  205|   109k|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  14.8k|    {
  198|  14.8k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 14.8k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  14.8k|        T val;
  203|  14.8k|        std::memcpy(&val,first,sizeof(T));
  204|  14.8k|        return val;
  205|  14.8k|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  38.6k|    {
  198|  38.6k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 38.6k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  38.6k|        T val;
  203|  38.6k|        std::memcpy(&val,first,sizeof(T));
  204|  38.6k|        return val;
  205|  38.6k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  18.2k|    {
  198|  18.2k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 18.2k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  18.2k|        T val;
  203|  18.2k|        std::memcpy(&val,first,sizeof(T));
  204|  18.2k|        return val;
  205|  18.2k|    }

_ZNK8jsoncons16byte_string_view4dataEv:
  399|  11.6k|        {
  400|  11.6k|            return data_;
  401|  11.6k|        }
_ZNK8jsoncons16byte_string_view4sizeEv:
  403|  11.6k|        {
  404|  11.6k|            return size_;
  405|  11.6k|        }
_ZN8jsoncons16byte_string_viewC2EPKhm:
  362|  23.2k|            : data_(data), size_(length)
  363|  23.2k|        {
  364|  23.2k|        }

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|  84.3k|    {
 1148|  84.3k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|  84.3k|        const uint8_t* end = it + length;
 1150|       |
 1151|  84.3k|        unicode_errc  result{};
 1152|   941k|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 857k, False: 84.1k]
  ------------------
 1153|   857k|        {
 1154|   857k|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 486k, False: 371k]
  ------------------
 1155|   486k|            {
 1156|  3.33M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  281|   972k|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (281:32): [True: 482k, False: 3.25k]
  |  |  |  Branch (281:34): [True: 478k, False: 3.85k]
  |  |  |  Branch (281:36): [True: 476k, False: 2.33k]
  |  |  |  Branch (281:38): [True: 475k, False: 790]
  |  |  |  Branch (281:40): [True: 475k, False: 716]
  |  |  |  Branch (281:42): [True: 472k, False: 2.44k]
  |  |  |  Branch (281:44): [True: 472k, False: 534]
  |  |  |  Branch (281:46): [True: 448k, False: 23.8k]
  |  |  ------------------
  ------------------
 1157|   448k|                continue;
 1158|  3.33M|            }
 1159|   409k|    non_ascii:
 1160|   409k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|   409k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 46, False: 409k]
  ------------------
 1162|     46|            {
 1163|     46|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     46|            }
 1165|   409k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 187, False: 409k]
  ------------------
 1166|    187|            {
 1167|    187|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    187|            }
 1169|   409k|            it += len;
 1170|   409k|        }
 1171|  84.1k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|  84.3k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|   409k|    {
  306|   409k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|   409k|        const uint8_t* end = it+length;
  308|       |
  309|   409k|        uint8_t byte;
  310|   409k|        switch (length) {
  311|     37|        default:
  ------------------
  |  Branch (311:9): [True: 37, False: 409k]
  ------------------
  312|     37|            return unicode_errc::over_long_utf8_sequence;
  313|    986|        case 4:
  ------------------
  |  Branch (313:9): [True: 986, False: 408k]
  ------------------
  314|    986|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 11, False: 975]
  ------------------
  315|     11|                return unicode_errc::bad_continuation_byte;
  316|    975|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|    975|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  1.77k|        case 3:
  ------------------
  |  Branch (317:9): [True: 795, False: 408k]
  ------------------
  318|  1.77k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 14, False: 1.75k]
  ------------------
  319|     14|                return unicode_errc::bad_continuation_byte;
  320|  1.75k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.75k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  37.8k|        case 2:
  ------------------
  |  Branch (321:9): [True: 36.1k, False: 373k]
  ------------------
  322|  37.8k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 41, False: 37.8k]
  ------------------
  323|     41|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  37.8k|            switch (*it) 
  326|  37.8k|            {
  327|       |                // no fall-through in this inner switch
  328|    258|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 258, False: 37.5k]
  |  Branch (328:32): [True: 9, False: 249]
  ------------------
  329|    458|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 458, False: 37.3k]
  |  Branch (329:32): [True: 4, False: 454]
  ------------------
  330|    646|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 646, False: 37.1k]
  |  Branch (330:32): [True: 5, False: 641]
  ------------------
  331|    641|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 303, False: 37.5k]
  |  Branch (331:32): [True: 5, False: 298]
  ------------------
  332|  36.1k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 36.1k, False: 1.66k]
  |  Branch (332:32): [True: 0, False: 36.1k]
  ------------------
  333|  37.8k|            }
  334|       |
  335|  37.7k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  37.7k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|   409k|        case 1:
  ------------------
  |  Branch (336:9): [True: 371k, False: 37.9k]
  ------------------
  337|   409k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 37.8k, False: 371k]
  |  Branch (337:32): [True: 60, False: 37.7k]
  ------------------
  338|     60|                return unicode_errc::source_illegal;
  339|   409k|            break;
  340|   409k|        }
  341|   409k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 1, False: 409k]
  ------------------
  342|      1|            return unicode_errc::source_illegal;
  343|       |
  344|   409k|        return unicode_errc();
  345|   409k|    }

_ZN8jsoncons12from_integerIiNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS1_9enable_ifIXsr10ext_traits10is_integerIT_EE5valueEmE4typeES9_RT0_:
   42|  15.0k|{
   43|  15.0k|    using char_type = typename Result::value_type;
   44|       |
   45|  15.0k|    char_type buf[255];
   46|  15.0k|    char_type *p = buf;
   47|  15.0k|    const char_type* last = buf+255;
   48|       |
   49|  15.0k|    bool is_negative = value < 0;
   50|       |
   51|  15.0k|    if (value < 0)
  ------------------
  |  Branch (51:9): [True: 12.3k, False: 2.76k]
  ------------------
   52|  12.3k|    {
   53|  12.3k|        do
   54|  48.2k|        {
   55|  48.2k|            *p++ = static_cast<char_type>(48 - (value % 10));
   56|  48.2k|        }
   57|  48.2k|        while ((value /= 10) && (p < last));
  ------------------
  |  Branch (57:16): [True: 35.8k, False: 12.3k]
  |  Branch (57:33): [True: 35.8k, False: 0]
  ------------------
   58|  12.3k|    }
   59|  2.76k|    else
   60|  2.76k|    {
   61|       |
   62|  2.76k|        do
   63|  8.68k|        {
   64|  8.68k|            *p++ = static_cast<char_type>(48 + value % 10);
   65|  8.68k|        }
   66|  8.68k|        while ((value /= 10) && (p < last));
  ------------------
  |  Branch (66:16): [True: 5.92k, False: 2.76k]
  |  Branch (66:33): [True: 5.92k, False: 0]
  ------------------
   67|  2.76k|    }
   68|  15.0k|    JSONCONS_ASSERT(p != last);
  ------------------
  |  |   49|  15.0k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 15.0k]
  |  |  ------------------
  |  |   50|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   51|      0|            JSONCONS_STR( 0 ))); }
  ------------------
   69|       |
   70|  15.0k|    std::size_t count = (p - buf);
   71|  15.0k|    if (is_negative)
  ------------------
  |  Branch (71:9): [True: 12.3k, False: 2.76k]
  ------------------
   72|  12.3k|    {
   73|  12.3k|        result.push_back('-');
   74|  12.3k|        ++count;
   75|  12.3k|    }
   76|  71.9k|    while (--p >= buf)
  ------------------
  |  Branch (76:12): [True: 56.8k, False: 15.0k]
  ------------------
   77|  56.8k|    {
   78|  56.8k|        result.push_back(*p);
   79|  56.8k|    }
   80|       |
   81|  15.0k|    return count;
   82|  15.0k|}

_ZN8jsoncons4bson3TP1C2Ev:
   78|  19.0k|        constexpr TP1() : low(0), high(0) {}
_ZN8jsoncons4bson19decimal128_to_charsEPcS1_RKNS0_3TP1E:
  335|  19.0k|    {
  336|  19.0k|        static const std::string bson_decimal128_inf = "Infinity";
  337|  19.0k|        static const std::string bson_decimal128_nan = "NaN";
  338|       |
  339|  19.0k|        static constexpr uint32_t combination_mask = 0x1f;   /* Extract least significant 5 bits */
  340|  19.0k|        static constexpr uint32_t exponent_mask = 0x3fff;    /* Extract least significant 14 bits */
  341|  19.0k|        static constexpr uint32_t combination_infinity = 30; /* Value of combination field for Inf */
  342|  19.0k|        static constexpr uint32_t combination_nan = 31;      /* Value of combination field for NaN */
  343|  19.0k|        static constexpr uint32_t exponent_bias = 6176;      /* decimal128 exponent bias */
  344|       |
  345|  19.0k|        char* str_out = first;      /* output pointer in string */
  346|  19.0k|        char significand_str[35]; /* decoded significand digits */
  347|       |
  348|       |        /* Note: bits in this routine are referred to starting at 0, */
  349|       |        /* from the sign bit, towards the coefficient. */
  350|  19.0k|        uint32_t high;                   /* bits 0 - 31 */
  351|  19.0k|        uint32_t midh;                   /* bits 32 - 63 */
  352|  19.0k|        uint32_t midl;                   /* bits 64 - 95 */
  353|  19.0k|        uint32_t low;                    /* bits 96 - 127 */
  354|  19.0k|        uint32_t combination;            /* bits 1 - 5 */
  355|  19.0k|        uint32_t biased_exponent;        /* decoded biased exponent (14 bits) */
  356|  19.0k|        uint32_t significand_digits = 0; /* the number of significand digits */
  357|  19.0k|        uint32_t significand[36] = {0};  /* the base-10 digits in the significand */
  358|  19.0k|        uint32_t *significand_read = significand; /* read pointer into significand */
  359|  19.0k|        int32_t exponent;                         /* unbiased exponent */
  360|  19.0k|        int32_t scientific_exponent; /* the exponent if scientific notation is
  361|       |                                      * used */
  362|  19.0k|        bool is_zero = false;        /* true if the number is zero */
  363|       | 
  364|  19.0k|        uint8_t significand_msb; /* the most signifcant significand bits (50-46) */
  365|  19.0k|        bson_uint128_t
  366|  19.0k|           significand128; /* temporary storage for significand decoding */
  367|       | 
  368|  19.0k|        memset (significand_str, 0, sizeof (significand_str));
  369|       | 
  370|  19.0k|        if ((int64_t) dec.high < 0) { /* negative */
  ------------------
  |  Branch (370:13): [True: 4.29k, False: 14.7k]
  ------------------
  371|  4.29k|           *(str_out++) = '-';
  372|  4.29k|        }
  373|       | 
  374|  19.0k|        low = (uint32_t) dec.low, midl = (uint32_t) (dec.low >> 32),
  375|  19.0k|        midh = (uint32_t) dec.high, high = (uint32_t) (dec.high >> 32);
  376|       | 
  377|       |        /* Decode combination field and exponent */
  378|  19.0k|        combination = (high >> 26) & combination_mask;
  379|       | 
  380|  19.0k|        if (JSONCONS_UNLIKELY ((combination >> 3) == 3)) {
  ------------------
  |  |   78|  19.0k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 3.86k, False: 15.1k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  3.86k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 1.09k, False: 2.77k]
  ------------------
  383|  1.09k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 1.09k, False: 0]
  ------------------
  384|  1.09k|               {
  385|  1.09k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  1.09k|                   str_out += bson_decimal128_inf.size();
  387|  1.09k|               }
  388|  1.09k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  1.09k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  2.77k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 827, False: 1.94k]
  ------------------
  392|       |               /* first, not str_out, to erase the sign */
  393|    827|               str_out = first;
  394|    827|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_nan.size())) 
  ------------------
  |  Branch (394:20): [True: 827, False: 0]
  ------------------
  395|    827|               {
  396|    827|                   std::memcpy(str_out, bson_decimal128_nan.data(), bson_decimal128_nan.size());
  397|    827|                   str_out += bson_decimal128_nan.size();
  398|    827|               }
  399|    827|               *str_out = 0;
  400|       |              //strcpy_s (first, last-first, bson_decimal128_nan.c_str());
  401|       |              /* we don't care about the NaN payload. */
  402|    827|               return decimal128_to_chars_result{str_out, std::errc{}};
  403|  1.94k|           } else {
  404|  1.94k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  1.94k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  1.94k|           }
  407|  15.1k|        } else {
  408|  15.1k|           significand_msb = (high >> 14) & 0x7;
  409|  15.1k|           biased_exponent = (high >> 17) & exponent_mask;
  410|  15.1k|        }
  411|       | 
  412|  17.0k|        exponent = biased_exponent - exponent_bias;
  413|       |        /* Create string of significand digits */
  414|       | 
  415|       |        /* Convert the 114-bit binary number represented by */
  416|       |        /* (high, midh, midl, low) to at most 34 decimal */
  417|       |        /* digits through modulo and division. */
  418|  17.0k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|  17.0k|        significand128.parts[1] = midh;
  420|  17.0k|        significand128.parts[2] = midl;
  421|  17.0k|        significand128.parts[3] = low;
  422|       | 
  423|  17.0k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 3.77k, False: 13.3k]
  |  Branch (423:45): [True: 1.66k, False: 2.10k]
  ------------------
  424|  1.66k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 771, False: 893]
  |  Branch (424:45): [True: 203, False: 568]
  ------------------
  425|    203|           is_zero = true;
  426|  16.8k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 1.94k, False: 14.9k]
  ------------------
  427|       |           /* The significand is non-canonical or zero.
  428|       |            * In order to preserve compatibility with the densely packed decimal
  429|       |            * format, the maximum value for the significand of decimal128 is
  430|       |            * 1e34 - 1.  If the value is greater than 1e34 - 1, the IEEE 754
  431|       |            * standard dictates that the significand is interpreted as zero.
  432|       |            */
  433|  1.94k|           is_zero = true;
  434|  14.9k|        } else {
  435|  74.6k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 59.7k, False: 14.9k]
  ------------------
  436|  59.7k|              uint32_t least_digits = 0;
  437|  59.7k|              detail::bson_uint128_divide1B (
  438|  59.7k|                 significand128, &significand128, &least_digits);
  439|       | 
  440|       |              /* We now have the 9 least significant digits (in base 2). */
  441|       |              /* Convert and output to string. */
  442|  59.7k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 2.90k, False: 56.8k]
  ------------------
  443|  2.90k|                 continue;
  444|  2.90k|              }
  445|       | 
  446|   568k|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 511k, False: 56.8k]
  ------------------
  447|   511k|                 significand[k * 9 + j] = least_digits % 10;
  448|   511k|                 least_digits /= 10;
  449|   511k|              }
  450|  56.8k|           }
  451|  14.9k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|  17.0k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 2.14k, False: 14.9k]
  ------------------
  458|  2.14k|           significand_digits = 1;
  459|  2.14k|           *significand_read = 0;
  460|  14.9k|        } else {
  461|  14.9k|           significand_digits = 36;
  462|  88.5k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 73.6k, False: 14.9k]
  ------------------
  463|  73.6k|              significand_digits--;
  464|  73.6k|              significand_read++;
  465|  73.6k|           }
  466|  14.9k|        }
  467|       | 
  468|  17.0k|        scientific_exponent = significand_digits - 1 + exponent;
  469|       | 
  470|       |        /* The scientific exponent checks are dictated by the string conversion
  471|       |         * specification and are somewhat arbitrary cutoffs.
  472|       |         *
  473|       |         * We must check exponent > 0, because if this is the case, the number
  474|       |         * has trailing zeros.  However, we *cannot* output these trailing zeros,
  475|       |         * because doing so would change the precision of the value, and would
  476|       |         * change stored data if the string converted number is round tripped.
  477|       |         */
  478|  17.0k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 12.3k, False: 4.77k]
  |  Branch (478:41): [True: 2.76k, False: 2.00k]
  ------------------
  479|       |           /* Scientific format */
  480|  15.0k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|  15.0k|           significand_digits--;
  482|       | 
  483|  15.0k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 13.2k, False: 1.86k]
  ------------------
  484|  13.2k|              *(str_out++) = '.';
  485|  13.2k|           }
  486|       | 
  487|   416k|           for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (487:36): [True: 401k, False: 15.0k]
  |  Branch (487:62): [True: 401k, False: 71]
  ------------------
  488|   401k|              *(str_out++) = char(*(significand_read++)) + '0';
  489|   401k|           }
  490|       |           /* Exponent */
  491|  15.0k|           *(str_out++) = 'E';
  492|       |
  493|  15.0k|           std::string s;
  494|  15.0k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 2.76k, False: 12.3k]
  ------------------
  495|  2.76k|               s.push_back('+');
  496|  2.76k|           }
  497|  15.0k|           jsoncons::from_integer(scientific_exponent, s);
  498|  15.0k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 14.0k, False: 1.03k]
  ------------------
  499|  14.0k|           {
  500|  14.0k|               std::memcpy(str_out, s.data(), s.size());
  501|  14.0k|           }
  502|  1.03k|           else
  503|  1.03k|           {
  504|  1.03k|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|  1.03k|           }
  506|  14.0k|           str_out += s.size();
  507|  14.0k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  2.00k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 575, False: 1.42k]
  ------------------
  510|  5.99k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 5.41k, False: 575]
  |  Branch (510:65): [True: 5.41k, False: 0]
  ------------------
  511|  5.41k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  5.41k|              }
  513|  1.42k|           } else {
  514|  1.42k|              int32_t radix_position = significand_digits + exponent;
  515|       | 
  516|  1.42k|              if (radix_position > 0) { /* non-zero digits before radix */
  ------------------
  |  Branch (516:19): [True: 688, False: 739]
  ------------------
  517|    688|                 for (int32_t i = 0;
  518|  4.18k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 3.49k, False: 688]
  |  Branch (518:45): [True: 3.49k, False: 0]
  ------------------
  519|  3.49k|                      i++) {
  520|  3.49k|                    *(str_out++) = char(*(significand_read++)) + '0';
  521|  3.49k|                 }
  522|    739|              } else { /* leading zero before radix point */
  523|    739|                 *(str_out++) = '0';
  524|    739|              }
  525|       | 
  526|  1.42k|              *(str_out++) = '.';
  527|  3.29k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 1.86k, False: 1.42k]
  ------------------
  528|  1.86k|                 *(str_out++) = '0';
  529|  1.86k|              }
  530|       | 
  531|  1.42k|              for (std::size_t i = 0;
  532|  42.2k|                   (i < significand_digits - (std::max) (radix_position - 1, 0)) &&
  ------------------
  |  Branch (532:20): [True: 40.7k, False: 1.42k]
  |  Branch (532:20): [True: 40.7k, False: 1.42k]
  ------------------
  533|  40.7k|                   (str_out < last);
  ------------------
  |  Branch (533:20): [True: 40.7k, False: 0]
  ------------------
  534|  40.7k|                   i++) {
  535|  40.7k|                 *(str_out++) = char(*(significand_read++)) + '0';
  536|  40.7k|              }
  537|  1.42k|           }
  538|  2.00k|        }
  539|  16.0k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|  17.0k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|  59.7k|        {
  179|  59.7k|            static constexpr uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|  59.7k|            uint64_t _rem = 0;
  181|  59.7k|            int i = 0;
  182|       |            
  183|  59.7k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 48.3k, False: 11.3k]
  |  Branch (183:36): [True: 34.4k, False: 13.8k]
  |  Branch (183:55): [True: 18.9k, False: 15.5k]
  ------------------
  184|  18.9k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 2.90k, False: 16.0k]
  ------------------
  185|  2.90k|               *quotient = value;
  186|  2.90k|               *rem = 0;
  187|  2.90k|               return;
  188|  2.90k|            }
  189|       |            
  190|   284k|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 227k, False: 56.8k]
  ------------------
  191|   227k|               _rem <<= 32; /* Adjust remainder to match value of next dividend */
  192|   227k|               _rem += value.parts[i]; /* Add the divided to _rem */
  193|   227k|               value.parts[i] = (uint32_t) (_rem / DIVISOR);
  194|   227k|               _rem %= DIVISOR; /* Store the remainder */
  195|   227k|            }
  196|       |            
  197|  56.8k|            *quotient = value;
  198|  56.8k|            *rem = (uint32_t) _rem;
  199|  56.8k|        }

_ZN8jsoncons4bson15make_error_codeENS0_9bson_errcE:
   91|  2.16k|{
   92|  2.16k|    return std::error_code(static_cast<int>(result),bson_error_category());
   93|  2.16k|}
_ZN8jsoncons4bson19bson_error_categoryEv:
   84|  2.16k|{
   85|  2.16k|  static bson_error_category_impl instance;
   86|  2.16k|  return instance;
   87|  2.16k|}

_ZN8jsoncons4bson5oid_tC2EPh:
   53|    617|        {
   54|    617|            std::memcpy(bytes_.data(),data,12);
   55|    617|        }
_ZN8jsoncons4bson9to_stringINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEvRKNS0_5oid_tERT_:
  236|    617|    {
  237|    617|        s.resize(24);
  238|    617|        detail::init_hex_char_pairs(oid, reinterpret_cast<uint16_t*>(&s[0]));
  239|    617|    }
_ZN8jsoncons4bson6detail19init_hex_char_pairsERKNS0_5oid_tEPt:
  213|    617|        {
  214|    617|            const uint8_t* bytes = oid.data();
  215|    617|            const uint16_t* gHexCharPairs = get_hex_char_pairs(std::integral_constant<bool, jsoncons::endian::native == jsoncons::endian::big>());
  216|       |
  217|    617|            data[0] = gHexCharPairs[bytes[0]];
  218|    617|            data[1] = gHexCharPairs[bytes[1]];
  219|    617|            data[2] = gHexCharPairs[bytes[2]];
  220|    617|            data[3] = gHexCharPairs[bytes[3]];
  221|    617|            data[4] = gHexCharPairs[bytes[4]];
  222|    617|            data[5] = gHexCharPairs[bytes[5]];
  223|    617|            data[6] = gHexCharPairs[bytes[6]];
  224|    617|            data[7] = gHexCharPairs[bytes[7]];
  225|    617|            data[8] = gHexCharPairs[bytes[8]];
  226|    617|            data[9] = gHexCharPairs[bytes[9]];
  227|    617|            data[10] = gHexCharPairs[bytes[10]];
  228|    617|            data[11] = gHexCharPairs[bytes[11]];
  229|    617|        }
_ZNK8jsoncons4bson5oid_t4dataEv:
   67|    617|        {
   68|    617|            return bytes_.data();
   69|    617|        }
_ZN8jsoncons4bson6detail18get_hex_char_pairsENSt3__117integral_constantIbLb0EEE:
  181|    617|        {
  182|    617|            static constexpr uint16_t hex_char_pairs[] = {
  183|    617|                12336, 12592, 12848, 13104, 13360, 13616, 13872, 14128, 14384, 14640, 24880,
  184|    617|                25136, 25392, 25648, 25904, 26160, 12337, 12593, 12849, 13105, 13361, 13617,
  185|    617|                13873, 14129, 14385, 14641, 24881, 25137, 25393, 25649, 25905, 26161, 12338,
  186|    617|                12594, 12850, 13106, 13362, 13618, 13874, 14130, 14386, 14642, 24882, 25138,
  187|    617|                25394, 25650, 25906, 26162, 12339, 12595, 12851, 13107, 13363, 13619, 13875,
  188|    617|                14131, 14387, 14643, 24883, 25139, 25395, 25651, 25907, 26163, 12340, 12596,
  189|    617|                12852, 13108, 13364, 13620, 13876, 14132, 14388, 14644, 24884, 25140, 25396,
  190|    617|                25652, 25908, 26164, 12341, 12597, 12853, 13109, 13365, 13621, 13877, 14133,
  191|    617|                14389, 14645, 24885, 25141, 25397, 25653, 25909, 26165, 12342, 12598, 12854,
  192|    617|                13110, 13366, 13622, 13878, 14134, 14390, 14646, 24886, 25142, 25398, 25654,
  193|    617|                25910, 26166, 12343, 12599, 12855, 13111, 13367, 13623, 13879, 14135, 14391,
  194|    617|                14647, 24887, 25143, 25399, 25655, 25911, 26167, 12344, 12600, 12856, 13112,
  195|    617|                13368, 13624, 13880, 14136, 14392, 14648, 24888, 25144, 25400, 25656, 25912,
  196|    617|                26168, 12345, 12601, 12857, 13113, 13369, 13625, 13881, 14137, 14393, 14649,
  197|    617|                24889, 25145, 25401, 25657, 25913, 26169, 12385, 12641, 12897, 13153, 13409,
  198|    617|                13665, 13921, 14177, 14433, 14689, 24929, 25185, 25441, 25697, 25953, 26209,
  199|    617|                12386, 12642, 12898, 13154, 13410, 13666, 13922, 14178, 14434, 14690, 24930,
  200|    617|                25186, 25442, 25698, 25954, 26210, 12387, 12643, 12899, 13155, 13411, 13667,
  201|    617|                13923, 14179, 14435, 14691, 24931, 25187, 25443, 25699, 25955, 26211, 12388,
  202|    617|                12644, 12900, 13156, 13412, 13668, 13924, 14180, 14436, 14692, 24932, 25188,
  203|    617|                25444, 25700, 25956, 26212, 12389, 12645, 12901, 13157, 13413, 13669, 13925,
  204|    617|                14181, 14437, 14693, 24933, 25189, 25445, 25701, 25957, 26213, 12390, 12646,
  205|    617|                12902, 13158, 13414, 13670, 13926, 14182, 14438, 14694, 24934, 25190, 25446,
  206|    617|                25702, 25958, 26214};
  207|       |
  208|    617|            return hex_char_pairs;
  209|    617|        }

_ZN8jsoncons4bson19bson_decode_optionsC1Ev:
   40|  2.10k|    bson_decode_options() = default;
_ZN8jsoncons4bson19bson_options_commonC2Ev:
   23|  2.10k|    bson_options_common() = default;
_ZN8jsoncons4bson19bson_options_commonD2Ev:
   25|  2.10k|    virtual ~bson_options_common() = default;
_ZNK8jsoncons4bson19bson_options_common17max_nesting_depthEv:
   31|  2.10k|    {
   32|  2.10k|        return max_nesting_depth_;
   33|  2.10k|    }

_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEEC2IRNS3_19basic_istringstreamIcNS3_11char_traitsIcEES7_EEEEOT_RKNS0_19bson_decode_optionsERKS7_:
   85|  2.10k|       : source_(std::forward<Sourceable>(source)), 
   86|  2.10k|         max_nesting_depth_(options.max_nesting_depth()),
   87|  2.10k|         bytes_buffer_(temp_alloc),
   88|  2.10k|         name_buffer_(temp_alloc),
   89|  2.10k|         text_buffer_(temp_alloc),
   90|  2.10k|         state_stack_(temp_alloc)
   91|  2.10k|    {
   92|  2.10k|        state_stack_.emplace_back(parse_mode::root,0,0);
   93|  2.10k|    }
_ZN8jsoncons4bson11parse_stateC2ENS0_10parse_modeEmmh:
   48|  39.8k|        : mode(mode_), length(length_), pos(pos_), type(type_)
   49|  39.8k|    {
   50|  39.8k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5resetEv:
  101|  2.10k|    {
  102|  2.10k|        more_ = true;
  103|  2.10k|        done_ = false;
  104|  2.10k|        bytes_buffer_.clear();
  105|  2.10k|        name_buffer_.clear();
  106|  2.10k|        text_buffer_.clear();
  107|  2.10k|        state_stack_.clear();
  108|  2.10k|        state_stack_.emplace_back(parse_mode::root,0,0);
  109|  2.10k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5parseERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  169|  2.10k|    {
  170|  2.10k|        if (JSONCONS_UNLIKELY(source_.is_error()))
  ------------------
  |  |   78|  2.10k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 0, False: 2.10k]
  |  |  ------------------
  ------------------
  171|      0|        {
  172|      0|            ec = bson_errc::source_error;
  173|      0|            more_ = false;
  174|      0|            return;
  175|      0|        }
  176|       |        
  177|   206k|        while (!done_ && more_)
  ------------------
  |  Branch (177:16): [True: 206k, False: 7]
  |  Branch (177:26): [True: 204k, False: 1.54k]
  ------------------
  178|   204k|        {
  179|   204k|            switch (state_stack_.back().mode)
  ------------------
  |  Branch (179:21): [True: 204k, False: 0]
  ------------------
  180|   204k|            {
  181|  2.10k|                case parse_mode::root:
  ------------------
  |  Branch (181:17): [True: 2.10k, False: 202k]
  ------------------
  182|  2.10k|                    state_stack_.back().mode = parse_mode::accept;
  183|  2.10k|                    begin_document(visitor, ec);
  184|  2.10k|                    break;
  185|  25.3k|                case parse_mode::document:
  ------------------
  |  Branch (185:17): [True: 25.3k, False: 179k]
  ------------------
  186|  25.3k|                {
  187|  25.3k|                    uint8_t type;
  188|  25.3k|                    std::size_t n = source_.read(&type, 1);
  189|  25.3k|                    state_stack_.back().pos += n;
  190|  25.3k|                    if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|  25.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 514, False: 24.8k]
  |  |  ------------------
  ------------------
  191|    514|                    {
  192|    514|                        ec = bson_errc::unexpected_eof;
  193|    514|                        more_ = false;
  194|    514|                        return;
  195|    514|                    }
  196|  24.8k|                    if (type != 0x00)
  ------------------
  |  Branch (196:25): [True: 23.9k, False: 863]
  ------------------
  197|  23.9k|                    {
  198|  23.9k|                        read_e_name(visitor,jsoncons::bson::bson_container_type::document,ec);
  199|  23.9k|                        state_stack_.back().mode = parse_mode::value;
  200|  23.9k|                        state_stack_.back().type = type;
  201|  23.9k|                    }
  202|    863|                    else
  203|    863|                    {
  204|    863|                        end_document(visitor,ec);
  205|    863|                    }
  206|  24.8k|                    break;
  207|  25.3k|                }
  208|   153k|                case parse_mode::array:
  ------------------
  |  Branch (208:17): [True: 153k, False: 51.1k]
  ------------------
  209|   153k|                {
  210|   153k|                    uint8_t type;
  211|   153k|                    std::size_t n = source_.read(&type, 1);
  212|   153k|                    state_stack_.back().pos += n;
  213|   153k|                    if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|   153k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 44, False: 153k]
  |  |  ------------------
  ------------------
  214|     44|                    {
  215|     44|                        ec = bson_errc::unexpected_eof;
  216|     44|                        more_ = false;
  217|     44|                        return;
  218|     44|                    }
  219|   153k|                    if (type != 0x00)
  ------------------
  |  Branch (219:25): [True: 151k, False: 1.96k]
  ------------------
  220|   151k|                    {
  221|   151k|                        read_e_name(visitor,jsoncons::bson::bson_container_type::array,ec);
  222|   151k|                        read_value(visitor, type, ec);
  223|   151k|                    }
  224|  1.96k|                    else
  225|  1.96k|                    {
  226|  1.96k|                        end_array(visitor,ec);
  227|  1.96k|                    }
  228|   153k|                    break;
  229|   153k|                }
  230|  23.6k|                case parse_mode::value:
  ------------------
  |  Branch (230:17): [True: 23.6k, False: 180k]
  ------------------
  231|  23.6k|                    state_stack_.back().mode = parse_mode::document;
  232|  23.6k|                    read_value(visitor,state_stack_.back().type,ec);
  233|  23.6k|                    break;
  234|      7|                case parse_mode::accept:
  ------------------
  |  Branch (234:17): [True: 7, False: 204k]
  ------------------
  235|      7|                {
  236|      7|                    JSONCONS_ASSERT(state_stack_.size() == 1);
  ------------------
  |  |   49|      7|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 7]
  |  |  ------------------
  |  |   50|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   51|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  237|      7|                    state_stack_.clear();
  238|      7|                    more_ = false;
  239|      7|                    done_ = true;
  240|      7|                    visitor.flush();
  241|      7|                    break;
  242|      7|                }
  243|   204k|            }
  244|   204k|        }
  245|  2.10k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE14begin_documentERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  250|  4.52k|    {
  251|  4.52k|        if (JSONCONS_UNLIKELY(static_cast<int>(state_stack_.size()) > max_nesting_depth_))
  ------------------
  |  |   78|  4.52k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 1, False: 4.52k]
  |  |  ------------------
  ------------------
  252|      1|        {
  253|      1|            ec = bson_errc::max_nesting_depth_exceeded;
  254|      1|            more_ = false;
  255|      1|            return;
  256|      1|        } 
  257|       |
  258|  4.52k|        uint8_t buf[sizeof(int32_t)]; 
  259|  4.52k|        std::size_t n = source_.read(buf, sizeof(int32_t));
  260|  4.52k|        if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|  4.52k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 22, False: 4.49k]
  |  |  ------------------
  ------------------
  261|     22|        {
  262|     22|            ec = bson_errc::unexpected_eof;
  263|     22|            more_ = false;
  264|     22|            return;
  265|     22|        }
  266|       |
  267|  4.49k|        auto length = binary::little_to_native<int32_t>(buf, sizeof(buf));
  268|       |
  269|  4.49k|        visitor.begin_object(semantic_tag::none, *this, ec);
  270|  4.49k|        more_ = !cursor_mode_;
  271|  4.49k|        state_stack_.emplace_back(parse_mode::document,length,n);
  272|  4.49k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11read_e_nameERNS_18basic_json_visitorIcEENS0_19bson_container_typeERNS3_10error_codeE:
  344|   175k|    {
  345|   175k|        name_buffer_.clear();
  346|   175k|        read_cstring(name_buffer_, ec);
  347|   175k|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|   175k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 111, False: 175k]
  |  |  ------------------
  ------------------
  348|    111|        {
  349|    111|            return;
  350|    111|        }
  351|   175k|        if (type == jsoncons::bson::bson_container_type::document)
  ------------------
  |  Branch (351:13): [True: 23.9k, False: 151k]
  ------------------
  352|  23.9k|        {
  353|  23.9k|            auto result = unicode_traits::validate(name_buffer_.data(),name_buffer_.size());
  354|  23.9k|            if (JSONCONS_UNLIKELY(result.ec != unicode_traits::unicode_errc()))
  ------------------
  |  |   78|  23.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 221, False: 23.6k]
  |  |  ------------------
  ------------------
  355|    221|            {
  356|    221|                ec = bson_errc::invalid_utf8_text_string;
  357|    221|                more_ = false;
  358|    221|                return;
  359|    221|            }
  360|  23.6k|            visitor.key(jsoncons::basic_string_view<char>(name_buffer_.data(),name_buffer_.length()), *this, ec);
  361|  23.6k|            more_ = !cursor_mode_;
  362|  23.6k|        }
  363|   175k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE12read_cstringERNS3_12basic_stringIcNS3_11char_traitsIcEES7_EERNS3_10error_codeE:
  641|   194k|    {
  642|   194k|        uint8_t c = 0xff;
  643|  12.6M|        while (true)
  ------------------
  |  Branch (643:16): [True: 12.6M, Folded]
  ------------------
  644|  12.6M|        {
  645|  12.6M|            std::size_t n = source_.read(&c, 1);
  646|  12.6M|            state_stack_.back().pos += n;
  647|  12.6M|            if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|  12.6M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 162, False: 12.6M]
  |  |  ------------------
  ------------------
  648|    162|            {
  649|    162|                ec = bson_errc::unexpected_eof;
  650|    162|                more_ = false;
  651|    162|                return;
  652|    162|            }
  653|  12.6M|            if (c == 0)
  ------------------
  |  Branch (653:17): [True: 194k, False: 12.4M]
  ------------------
  654|   194k|            {
  655|   194k|                break;
  656|   194k|            }
  657|  12.4M|            buffer.push_back(c);
  658|  12.4M|        }
  659|   194k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE12end_documentERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  275|    863|    {
  276|    863|        JSONCONS_ASSERT(state_stack_.size() >= 2);
  ------------------
  |  |   49|    863|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 863]
  |  |  ------------------
  |  |   50|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   51|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  277|       |
  278|    863|        visitor.end_object(*this,ec);
  279|    863|        more_ = !cursor_mode_;
  280|    863|        if (level() == mark_level_)
  ------------------
  |  Branch (280:13): [True: 0, False: 863]
  ------------------
  281|      0|        {
  282|      0|            more_ = false;
  283|      0|        }
  284|    863|        if (JSONCONS_UNLIKELY(state_stack_.back().pos != state_stack_.back().length))
  ------------------
  |  |   78|    863|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 109, False: 754]
  |  |  ------------------
  ------------------
  285|    109|        {
  286|    109|            ec = bson_errc::size_mismatch;
  287|    109|            more_ = false;
  288|    109|            return;
  289|    109|        }
  290|    754|        std::size_t pos = state_stack_.back().pos;
  291|    754|        state_stack_.pop_back();
  292|    754|        state_stack_.back().pos += pos;
  293|    754|    }
_ZNK8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5levelEv:
  124|  2.82k|    {
  125|  2.82k|        return static_cast<int>(state_stack_.size());
  126|  2.82k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE10read_valueERNS_18basic_json_visitorIcEEhRNS3_10error_codeE:
  366|   175k|    {
  367|   175k|        switch (type)
  368|   175k|        {
  369|  14.8k|            case jsoncons::bson::bson_type::double_type:
  ------------------
  |  Branch (369:13): [True: 14.8k, False: 160k]
  ------------------
  370|  14.8k|            {
  371|  14.8k|                uint8_t buf[sizeof(double)]; 
  372|  14.8k|                std::size_t n = source_.read(buf, sizeof(double));
  373|  14.8k|                state_stack_.back().pos += n;
  374|  14.8k|                if (JSONCONS_UNLIKELY(n != sizeof(double)))
  ------------------
  |  |   78|  14.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 13, False: 14.8k]
  |  |  ------------------
  ------------------
  375|     13|                {
  376|     13|                    ec = bson_errc::unexpected_eof;
  377|     13|                    more_ = false;
  378|     13|                    return;
  379|     13|                }
  380|  14.8k|                double res = binary::little_to_native<double>(buf, sizeof(buf));
  381|  14.8k|                visitor.double_value(res, semantic_tag::none, *this, ec);
  382|  14.8k|                more_ = !cursor_mode_;
  383|  14.8k|                break;
  384|  14.8k|            }
  385|  9.39k|            case jsoncons::bson::bson_type::symbol_type:
  ------------------
  |  Branch (385:13): [True: 9.39k, False: 165k]
  ------------------
  386|  12.5k|            case jsoncons::bson::bson_type::min_key_type:
  ------------------
  |  Branch (386:13): [True: 3.11k, False: 172k]
  ------------------
  387|  54.3k|            case jsoncons::bson::bson_type::max_key_type:
  ------------------
  |  Branch (387:13): [True: 41.8k, False: 133k]
  ------------------
  388|  54.9k|            case jsoncons::bson::bson_type::string_type:
  ------------------
  |  Branch (388:13): [True: 533, False: 174k]
  ------------------
  389|  54.9k|            {
  390|  54.9k|                auto sv = read_string(ec);
  391|  54.9k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  54.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 321, False: 54.5k]
  |  |  ------------------
  ------------------
  392|    321|                {
  393|    321|                    return;
  394|    321|                }
  395|  54.5k|                auto result = unicode_traits::validate(sv.data(), sv.size());
  396|  54.5k|                if (JSONCONS_UNLIKELY(result.ec != unicode_traits::unicode_errc()))
  ------------------
  |  |   78|  54.5k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 4, False: 54.5k]
  |  |  ------------------
  ------------------
  397|      4|                {
  398|      4|                    ec = bson_errc::invalid_utf8_text_string;
  399|      4|                    more_ = false;
  400|      4|                    return;
  401|      4|                }
  402|  54.5k|                visitor.string_value(sv, semantic_tag::none, *this, ec);
  403|  54.5k|                more_ = !cursor_mode_;
  404|  54.5k|                break;
  405|  54.5k|            }
  406|  5.93k|            case jsoncons::bson::bson_type::javascript_type:
  ------------------
  |  Branch (406:13): [True: 5.93k, False: 169k]
  ------------------
  407|  5.93k|            {
  408|  5.93k|                auto sv = read_string(ec);
  409|  5.93k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  5.93k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 51, False: 5.88k]
  |  |  ------------------
  ------------------
  410|     51|                {
  411|     51|                    return;
  412|     51|                }
  413|  5.88k|                auto result = unicode_traits::validate(sv.data(), sv.size());
  414|  5.88k|                if (JSONCONS_UNLIKELY(result.ec != unicode_traits::unicode_errc()))
  ------------------
  |  |   78|  5.88k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 8, False: 5.87k]
  |  |  ------------------
  ------------------
  415|      8|                {
  416|      8|                    ec = bson_errc::invalid_utf8_text_string;
  417|      8|                    more_ = false;
  418|      8|                    return;
  419|      8|                }
  420|  5.87k|                visitor.string_value(sv, semantic_tag::code, *this, ec);
  421|  5.87k|                more_ = !cursor_mode_;
  422|  5.87k|                break;
  423|  5.88k|            }
  424|  9.72k|            case jsoncons::bson::bson_type::regex_type:
  ------------------
  |  Branch (424:13): [True: 9.72k, False: 165k]
  ------------------
  425|  9.72k|            {
  426|  9.72k|                text_buffer_.clear();
  427|  9.72k|                text_buffer_.push_back('/');
  428|  9.72k|                read_cstring(text_buffer_, ec);
  429|  9.72k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  9.72k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 29, False: 9.69k]
  |  |  ------------------
  ------------------
  430|     29|                {
  431|     29|                    return;
  432|     29|                }
  433|  9.69k|                text_buffer_.push_back('/');
  434|  9.69k|                read_cstring(text_buffer_, ec);
  435|  9.69k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  9.69k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 22, False: 9.67k]
  |  |  ------------------
  ------------------
  436|     22|                {
  437|     22|                    return;
  438|     22|                }
  439|  9.67k|                visitor.string_value(text_buffer_, semantic_tag::regex, *this, ec);
  440|  9.67k|                more_ = !cursor_mode_;
  441|  9.67k|                break;
  442|  9.69k|            }
  443|  2.41k|            case jsoncons::bson::bson_type::document_type: 
  ------------------
  |  Branch (443:13): [True: 2.41k, False: 172k]
  ------------------
  444|  2.41k|            {
  445|  2.41k|                begin_document(visitor,ec);
  446|  2.41k|                break;
  447|  9.69k|            }
  448|       |
  449|  31.1k|            case jsoncons::bson::bson_type::array_type: 
  ------------------
  |  Branch (449:13): [True: 31.1k, False: 143k]
  ------------------
  450|  31.1k|            {
  451|  31.1k|                begin_array(visitor,ec);
  452|  31.1k|                break;
  453|  9.69k|            }
  454|  1.45k|            case jsoncons::bson::bson_type::undefined_type: 
  ------------------
  |  Branch (454:13): [True: 1.45k, False: 173k]
  ------------------
  455|  1.45k|                {
  456|  1.45k|                    visitor.null_value(semantic_tag::undefined, *this, ec);
  457|  1.45k|                    more_ = !cursor_mode_;
  458|  1.45k|                    break;
  459|  9.69k|                }
  460|  1.08k|            case jsoncons::bson::bson_type::null_type: 
  ------------------
  |  Branch (460:13): [True: 1.08k, False: 174k]
  ------------------
  461|  1.08k|            {
  462|  1.08k|                visitor.null_value(semantic_tag::none, *this, ec);
  463|  1.08k|                more_ = !cursor_mode_;
  464|  1.08k|                break;
  465|  9.69k|            }
  466|  1.90k|            case jsoncons::bson::bson_type::bool_type:
  ------------------
  |  Branch (466:13): [True: 1.90k, False: 173k]
  ------------------
  467|  1.90k|            {
  468|  1.90k|                uint8_t c;
  469|  1.90k|                std::size_t n = source_.read(&c, 1);
  470|  1.90k|                state_stack_.back().pos += n;
  471|  1.90k|                if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|  1.90k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 5, False: 1.90k]
  |  |  ------------------
  ------------------
  472|      5|                {
  473|      5|                    ec = bson_errc::unexpected_eof;
  474|      5|                    more_ = false;
  475|      5|                    return;
  476|      5|                }
  477|  1.90k|                visitor.bool_value(c != 0, semantic_tag::none, *this, ec);
  478|  1.90k|                more_ = !cursor_mode_;
  479|  1.90k|                break;
  480|  1.90k|            }
  481|  1.06k|            case jsoncons::bson::bson_type::int32_type: 
  ------------------
  |  Branch (481:13): [True: 1.06k, False: 174k]
  ------------------
  482|  1.06k|            {
  483|  1.06k|                uint8_t buf[sizeof(int32_t)]; 
  484|  1.06k|                std::size_t n = source_.read(buf, sizeof(int32_t));
  485|  1.06k|                state_stack_.back().pos += n;
  486|  1.06k|                if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|  1.06k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 5, False: 1.06k]
  |  |  ------------------
  ------------------
  487|      5|                {
  488|      5|                    ec = bson_errc::unexpected_eof;
  489|      5|                    more_ = false;
  490|      5|                    return;
  491|      5|                }
  492|  1.06k|                auto val = binary::little_to_native<int32_t>(buf, sizeof(buf));
  493|  1.06k|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  494|  1.06k|                more_ = !cursor_mode_;
  495|  1.06k|                break;
  496|  1.06k|            }
  497|       |
  498|    651|            case jsoncons::bson::bson_type::timestamp_type: 
  ------------------
  |  Branch (498:13): [True: 651, False: 174k]
  ------------------
  499|    651|            {
  500|    651|                uint8_t buf[sizeof(uint64_t)]; 
  501|    651|                std::size_t n = source_.read(buf, sizeof(uint64_t));
  502|    651|                state_stack_.back().pos += n;
  503|    651|                if (JSONCONS_UNLIKELY(n != sizeof(uint64_t)))
  ------------------
  |  |   78|    651|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 9, False: 642]
  |  |  ------------------
  ------------------
  504|      9|                {
  505|      9|                    ec = bson_errc::unexpected_eof;
  506|      9|                    more_ = false;
  507|      9|                    return;
  508|      9|                }
  509|    642|                auto val = binary::little_to_native<uint64_t>(buf, sizeof(buf));
  510|    642|                visitor.uint64_value(val, semantic_tag::none, *this, ec);
  511|    642|                more_ = !cursor_mode_;
  512|    642|                break;
  513|    651|            }
  514|       |
  515|  17.9k|            case jsoncons::bson::bson_type::int64_type: 
  ------------------
  |  Branch (515:13): [True: 17.9k, False: 157k]
  ------------------
  516|  17.9k|            {
  517|  17.9k|                uint8_t buf[sizeof(int64_t)]; 
  518|  17.9k|                std::size_t n = source_.read(buf, sizeof(int64_t));
  519|  17.9k|                state_stack_.back().pos += n;
  520|  17.9k|                if (JSONCONS_UNLIKELY(n != sizeof(int64_t)))
  ------------------
  |  |   78|  17.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 8, False: 17.9k]
  |  |  ------------------
  ------------------
  521|      8|                {
  522|      8|                    ec = bson_errc::unexpected_eof;
  523|      8|                    more_ = false;
  524|      8|                    return;
  525|      8|                }
  526|  17.9k|                auto val = binary::little_to_native<int64_t>(buf, sizeof(buf));
  527|  17.9k|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  528|  17.9k|                more_ = !cursor_mode_;
  529|  17.9k|                break;
  530|  17.9k|            }
  531|       |
  532|    302|            case jsoncons::bson::bson_type::datetime_type: 
  ------------------
  |  Branch (532:13): [True: 302, False: 174k]
  ------------------
  533|    302|            {
  534|    302|                uint8_t buf[sizeof(int64_t)]; 
  535|    302|                std::size_t n = source_.read(buf, sizeof(int64_t));
  536|    302|                state_stack_.back().pos += n;
  537|    302|                if (JSONCONS_UNLIKELY(n != sizeof(int64_t)))
  ------------------
  |  |   78|    302|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 9, False: 293]
  |  |  ------------------
  ------------------
  538|      9|                {
  539|      9|                    ec = bson_errc::unexpected_eof;
  540|      9|                    more_ = false;
  541|      9|                    return;
  542|      9|                }
  543|    293|                auto val = binary::little_to_native<int64_t>(buf, sizeof(buf));
  544|    293|                visitor.int64_value(val, semantic_tag::epoch_milli, *this, ec);
  545|    293|                more_ = !cursor_mode_;
  546|    293|                break;
  547|    302|            }
  548|  12.0k|            case jsoncons::bson::bson_type::binary_type: 
  ------------------
  |  Branch (548:13): [True: 12.0k, False: 163k]
  ------------------
  549|  12.0k|            {
  550|  12.0k|                uint8_t buf[sizeof(int32_t)]; 
  551|  12.0k|                std::size_t n = source_.read(buf, sizeof(int32_t));
  552|  12.0k|                state_stack_.back().pos += n;
  553|  12.0k|                if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|  12.0k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 8, False: 12.0k]
  |  |  ------------------
  ------------------
  554|      8|                {
  555|      8|                    ec = bson_errc::unexpected_eof;
  556|      8|                    more_ = false;
  557|      8|                    return;
  558|      8|                }
  559|  12.0k|                const auto len = binary::little_to_native<int32_t>(buf, sizeof(buf));
  560|  12.0k|                if (JSONCONS_UNLIKELY(len < 0))
  ------------------
  |  |   78|  12.0k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 40, False: 11.9k]
  |  |  ------------------
  ------------------
  561|     40|                {
  562|     40|                    ec = bson_errc::length_is_negative;
  563|     40|                    more_ = false;
  564|     40|                    return;
  565|     40|                }
  566|  11.9k|                uint8_t subtype;
  567|  11.9k|                n = source_.read(&subtype, 1);
  568|  11.9k|                state_stack_.back().pos += n;
  569|  11.9k|                if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|  11.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 8, False: 11.9k]
  |  |  ------------------
  ------------------
  570|      8|                {
  571|      8|                    ec = bson_errc::unexpected_eof;
  572|      8|                    more_ = false;
  573|      8|                    return;
  574|      8|                }
  575|       |
  576|  11.9k|                auto data = source_.read_span(len, bytes_buffer_);
  577|  11.9k|                if (JSONCONS_UNLIKELY(data.size() != static_cast<std::size_t>(len)))
  ------------------
  |  |   78|  11.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 354, False: 11.6k]
  |  |  ------------------
  ------------------
  578|    354|                {
  579|    354|                    ec = bson_errc::unexpected_eof;
  580|    354|                    more_ = false;
  581|    354|                    return;
  582|    354|                }
  583|  11.6k|                state_stack_.back().pos += data.size();
  584|       |
  585|  11.6k|                visitor.byte_string_value(byte_string_view(data.data(), data.size()), subtype, *this, ec);
  586|  11.6k|                more_ = !cursor_mode_;
  587|  11.6k|                break;
  588|  11.9k|            }
  589|  19.0k|            case jsoncons::bson::bson_type::decimal128_type: 
  ------------------
  |  Branch (589:13): [True: 19.0k, False: 156k]
  ------------------
  590|  19.0k|            {
  591|  19.0k|                uint8_t buf[sizeof(uint64_t)*2]; 
  592|  19.0k|                std::size_t n = source_.read(buf, sizeof(buf));
  593|  19.0k|                state_stack_.back().pos += n;
  594|  19.0k|                if (JSONCONS_UNLIKELY(n != sizeof(buf)))
  ------------------
  |  |   78|  19.0k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 20, False: 19.0k]
  |  |  ------------------
  ------------------
  595|     20|                {
  596|     20|                    ec = bson_errc::unexpected_eof;
  597|     20|                    more_ = false;
  598|     20|                    return;
  599|     20|                }
  600|       |
  601|  19.0k|                decimal128_t dec;
  602|  19.0k|                dec.low = binary::little_to_native<uint64_t>(buf, sizeof(uint64_t));
  603|  19.0k|                dec.high = binary::little_to_native<uint64_t>(buf+sizeof(uint64_t), sizeof(uint64_t));
  604|       |
  605|  19.0k|                text_buffer_.clear();
  606|  19.0k|                text_buffer_.resize(bson::decimal128_limits::buf_size);
  607|  19.0k|                auto r = bson::decimal128_to_chars(&text_buffer_[0], &text_buffer_[0]+text_buffer_.size(), dec);
  608|  19.0k|                visitor.string_value(string_view(text_buffer_.data(),static_cast<std::size_t>(r.ptr-text_buffer_.data())), semantic_tag::float128, *this, ec);
  609|  19.0k|                more_ = !cursor_mode_;
  610|  19.0k|                break;
  611|  19.0k|            }
  612|    624|            case jsoncons::bson::bson_type::object_id_type: 
  ------------------
  |  Branch (612:13): [True: 624, False: 174k]
  ------------------
  613|    624|            {
  614|    624|                uint8_t buf[12]; 
  615|    624|                std::size_t n = source_.read(buf, sizeof(buf));
  616|    624|                state_stack_.back().pos += n;
  617|    624|                if (JSONCONS_UNLIKELY(n != sizeof(buf)))
  ------------------
  |  |   78|    624|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 7, False: 617]
  |  |  ------------------
  ------------------
  618|      7|                {
  619|      7|                    ec = bson_errc::unexpected_eof;
  620|      7|                    more_ = false;
  621|      7|                    return;
  622|      7|                }
  623|       |
  624|    617|                oid_t oid(buf);
  625|    617|                to_string(oid, text_buffer_);
  626|       |
  627|    617|                visitor.string_value(text_buffer_, semantic_tag::id, *this, ec);
  628|    617|                more_ = !cursor_mode_;
  629|    617|                break;
  630|    624|            }
  631|     83|            default:
  ------------------
  |  Branch (631:13): [True: 83, False: 175k]
  ------------------
  632|     83|            {
  633|     83|                ec = bson_errc::unknown_type;
  634|     83|                more_ = false;
  635|     83|                return;
  636|    624|            }
  637|   175k|        }
  638|   175k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11read_stringERNS3_10error_codeE:
  662|  60.8k|    {
  663|  60.8k|        std::size_t offset = 0;
  664|       |
  665|  60.8k|        uint8_t buf[sizeof(int32_t)]; 
  666|  60.8k|        std::size_t n = source_.read(buf, sizeof(int32_t));
  667|  60.8k|        if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|  60.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 50, False: 60.8k]
  |  |  ------------------
  ------------------
  668|     50|        {
  669|     50|            ec = bson_errc::unexpected_eof;
  670|     50|            more_ = false;
  671|     50|            return string_view{};
  672|     50|        }
  673|  60.8k|        offset += n;
  674|       |
  675|  60.8k|        auto len = binary::little_to_native<int32_t>(buf, sizeof(buf));
  676|  60.8k|        if (JSONCONS_UNLIKELY(len < 1))
  ------------------
  |  |   78|  60.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 38, False: 60.7k]
  |  |  ------------------
  ------------------
  677|     38|        {
  678|     38|            ec = bson_errc::string_length_is_non_positive;
  679|     38|            more_ = false;
  680|     38|            return string_view{};
  681|     38|        }
  682|       |
  683|  60.7k|        std::size_t size = static_cast<std::size_t>(len) - static_cast<std::size_t>(1);
  684|  60.7k|        auto data = source_.read_span(size, text_buffer_);
  685|  60.7k|        if (JSONCONS_UNLIKELY(data.size() != size))
  ------------------
  |  |   78|  60.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 267, False: 60.4k]
  |  |  ------------------
  ------------------
  686|    267|        {
  687|    267|            ec = bson_errc::unexpected_eof;
  688|    267|            more_ = false;
  689|    267|            return string_view{};
  690|    267|        }
  691|  60.4k|        offset += data.size();
  692|       |
  693|  60.4k|        uint8_t c;
  694|  60.4k|        if (JSONCONS_UNLIKELY(source_.read(&c, 1) != 1))
  ------------------
  |  |   78|  60.4k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 17, False: 60.4k]
  |  |  ------------------
  ------------------
  695|     17|        {
  696|     17|            ec = bson_errc::unexpected_eof;
  697|     17|            more_ = false;
  698|     17|            return string_view{};
  699|     17|        }
  700|  60.4k|        ++offset;
  701|       |
  702|  60.4k|        state_stack_.back().pos += offset;
  703|  60.4k|        return string_view{reinterpret_cast<const char*>(data.data()), data.size()};
  704|  60.4k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11begin_arrayERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  296|  31.1k|    {
  297|  31.1k|        if (JSONCONS_UNLIKELY(static_cast<int>(state_stack_.size()) > max_nesting_depth_))
  ------------------
  |  |   78|  31.1k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 1, False: 31.1k]
  |  |  ------------------
  ------------------
  298|      1|        {
  299|      1|            ec = bson_errc::max_nesting_depth_exceeded;
  300|      1|            more_ = false;
  301|      1|            return;
  302|      1|        } 
  303|  31.1k|        uint8_t buf[sizeof(int32_t)]; 
  304|  31.1k|        std::size_t n = source_.read(buf, sizeof(int32_t));
  305|  31.1k|        if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|  31.1k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 33, False: 31.1k]
  |  |  ------------------
  ------------------
  306|     33|        {
  307|     33|            ec = bson_errc::unexpected_eof;
  308|     33|            more_ = false;
  309|     33|            return;
  310|     33|        }
  311|  31.1k|        auto length = binary::little_to_native<int32_t>(buf, sizeof(buf));
  312|       |
  313|  31.1k|        visitor.begin_array(semantic_tag::none, *this, ec);
  314|  31.1k|        more_ = !cursor_mode_;
  315|  31.1k|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  31.1k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 0, False: 31.1k]
  |  |  ------------------
  ------------------
  316|      0|        {
  317|      0|            return;
  318|      0|        }
  319|  31.1k|        state_stack_.emplace_back(parse_mode::array, length, n);
  320|  31.1k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE9end_arrayERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  323|  1.96k|    {
  324|  1.96k|        JSONCONS_ASSERT(state_stack_.size() >= 2);
  ------------------
  |  |   49|  1.96k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 1.96k]
  |  |  ------------------
  |  |   50|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   51|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  325|       |
  326|  1.96k|        visitor.end_array(*this, ec);
  327|  1.96k|        more_ = !cursor_mode_;
  328|  1.96k|        if (level() == mark_level_)
  ------------------
  |  Branch (328:13): [True: 0, False: 1.96k]
  ------------------
  329|      0|        {
  330|      0|            more_ = false;
  331|      0|        }
  332|  1.96k|        if (JSONCONS_UNLIKELY(state_stack_.back().pos != state_stack_.back().length))
  ------------------
  |  |   78|  1.96k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 104, False: 1.86k]
  |  |  ------------------
  ------------------
  333|    104|        {
  334|    104|            ec = bson_errc::size_mismatch;
  335|    104|            more_ = false;
  336|    104|            return;
  337|    104|        }
  338|  1.86k|        std::size_t pos = state_stack_.back().pos;
  339|  1.86k|        state_stack_.pop_back();
  340|  1.86k|        state_stack_.back().pos += pos;
  341|  1.86k|    }

_ZN8jsoncons4bson17basic_bson_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEEC2IRNS3_19basic_istringstreamIcNS3_11char_traitsIcEES7_EEEEOT_RNS_18basic_json_visitorIcEERKNS0_19bson_decode_optionsERKS7_:
   46|  2.10k|       : parser_(std::forward<Sourceable>(source), options, temp_alloc),
   47|  2.10k|         visitor_(visitor)
   48|  2.10k|    {
   49|  2.10k|    }
_ZN8jsoncons4bson17basic_bson_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE4readERNS3_10error_codeE:
   62|  2.10k|    {
   63|  2.10k|        parser_.reset();
   64|  2.10k|        parser_.parse(visitor_, ec);
   65|  2.10k|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  2.10k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 2.10k, False: 7]
  |  |  ------------------
  ------------------
   66|  2.10k|        {
   67|  2.10k|            return;
   68|  2.10k|        }
   69|  2.10k|    }

