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

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

_ZN8jsoncons26basic_default_json_visitorIcEC2Ev:
  811|  2.08k|        basic_default_json_visitor() = default;
_ZN8jsoncons18basic_json_visitorIcEC2Ev:
  103|  2.08k|        basic_json_visitor() = default;
_ZN8jsoncons19typed_array_visitorD2Ev:
   33|  2.08k|        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|    667|        {
  859|    667|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    667|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  860|    667|        }
_ZN8jsoncons26basic_default_json_visitorIcE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  863|  19.1k|        {
  864|  19.1k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  19.1k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  865|  19.1k|        }
_ZN8jsoncons26basic_default_json_visitorIcE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  873|  15.0k|        {
  874|  15.0k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  15.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  875|  15.0k|        }
_ZN8jsoncons26basic_default_json_visitorIcE11visit_flushEv:
  814|      7|        {
  815|      7|        }
_ZN8jsoncons26basic_default_json_visitorIcE18visit_begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  818|  4.55k|        {
  819|  4.55k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.55k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  820|  4.55k|        }
_ZN8jsoncons26basic_default_json_visitorIcE16visit_end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  823|    920|        {
  824|    920|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    920|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  825|    920|        }
_ZN8jsoncons26basic_default_json_visitorIcE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  828|  32.4k|        {
  829|  32.4k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  32.4k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  830|  32.4k|        }
_ZN8jsoncons26basic_default_json_visitorIcE9visit_keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  838|  23.9k|        {
  839|  23.9k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  23.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  840|  23.9k|        }
_ZN8jsoncons26basic_default_json_visitorIcE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  843|  2.88k|        {
  844|  2.88k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  2.88k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  845|  2.88k|        }
_ZN8jsoncons26basic_default_json_visitorIcE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  878|  1.68k|        {
  879|  1.68k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.68k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  880|  1.68k|        }
_ZN8jsoncons26basic_default_json_visitorIcE12visit_stringERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  848|  90.8k|        {
  849|  90.8k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  90.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  850|  90.8k|        }
_ZN8jsoncons26basic_default_json_visitorIcE17visit_byte_stringERKNS_16byte_string_viewENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  853|  11.8k|        {
  854|  11.8k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  11.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  855|  11.8k|        }
_ZN8jsoncons18basic_json_visitorIcE17visit_byte_stringERKNS_16byte_string_viewEmRKNS_11ser_contextERNSt3__110error_codeE:
  595|  11.8k|        {
  596|  11.8k|            visit_byte_string(value, semantic_tag::none, context, ec);
  597|  11.8k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  11.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  598|  11.8k|        }
_ZN8jsoncons18basic_json_visitorIcE12uint64_valueEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  414|    667|        {
  415|    667|            visit_uint64(value, tag, context, ec);
  416|    667|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    667|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  417|    667|        }
_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.1k|        {
  424|  19.1k|            visit_int64(value, tag, context, ec);
  425|  19.1k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  19.1k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  426|  19.1k|        }
_ZN8jsoncons18basic_json_visitorIcE12double_valueEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  441|  15.0k|        {
  442|  15.0k|            visit_double(value, tag, context, ec);
  443|  15.0k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  15.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  444|  15.0k|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  318|  4.55k|        {
  319|  4.55k|            visit_begin_object(tag, context, ec);
  320|  4.55k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.55k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  321|  4.55k|        }
_ZN8jsoncons18basic_json_visitorIcE3keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  357|  23.9k|        {
  358|  23.9k|            visit_key(name, context, ec);
  359|  23.9k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  23.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  360|  23.9k|        }
_ZN8jsoncons18basic_json_visitorIcE10end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  333|    920|        {
  334|    920|            visit_end_object(context, ec);
  335|    920|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    920|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  336|    920|        }
_ZN8jsoncons18basic_json_visitorIcE12string_valueERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  383|  90.8k|        {
  384|  90.8k|            visit_string(value, tag, context, ec);
  385|  90.8k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  90.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  386|  90.8k|        }
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  339|  32.4k|        {
  340|  32.4k|            visit_begin_array(tag, context, ec);
  341|  32.4k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  32.4k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  342|  32.4k|        }
_ZN8jsoncons18basic_json_visitorIcE10null_valueENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  365|  2.88k|        {
  366|  2.88k|            visit_null(tag, context, ec);
  367|  2.88k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  2.88k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  368|  2.88k|        }
_ZN8jsoncons18basic_json_visitorIcE10bool_valueEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  374|  1.68k|        {
  375|  1.68k|            visit_bool(value, tag, context, ec);
  376|  1.68k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.68k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|  1.68k|        }
_ZN8jsoncons18basic_json_visitorIcE17byte_string_valueINS_16byte_string_viewEEEbRKT_mRKNS_11ser_contextERNSt3__110error_codeENSA_9enable_ifIXsr10ext_traits18is_bytes_view_likeIS4_EE5valueEiE4typeE:
  405|  11.8k|        {
  406|  11.8k|            visit_byte_string(byte_string_view(reinterpret_cast<const uint8_t*>(b.data()),b.size()), raw_tag, context, ec);
  407|  11.8k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  11.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  408|  11.8k|        }
_ZN8jsoncons18basic_json_visitorIcE5flushEv:
  108|      7|        {
  109|      7|            visit_flush();
  110|      7|        }

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|  2.08k|    {
  194|  2.08k|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 2.08k, False: 0]
  ------------------
  195|  2.08k|        {
  196|  2.08k|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|  2.08k|        }
  198|  2.08k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|  2.08k|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|  2.08k|          chunk_size_(default_max_chunk_size)
  178|  2.08k|    {
  179|  2.08k|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|  2.08k|        data_end_ = chunk_;
  181|  2.08k|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|  2.08k|      : std::basic_istream<CharT>(&nb_)
   58|  2.08k|    {
   59|  2.08k|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|  2.08k|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  2.08k|    {
  277|  2.08k|        return stream_ptr_->bad();  
  278|  2.08k|    }
_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.52k]
  ------------------
  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.62k]
  ------------------
  388|  13.0M|        {
  389|  13.0M|            return len;
  390|  13.0M|        }
  391|  5.62k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 5.62k, False: 0]
  ------------------
  392|  5.62k|        {
  393|  5.62k|            data_end_ = chunk_;
  394|  5.62k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  5.62k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 4.40k, False: 1.21k]
  ------------------
  396|  4.40k|            {
  397|  4.40k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  4.40k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  4.40k|                data_end_ += len2;
  400|  4.40k|                remaining_ -= len2;
  401|  4.40k|                position_ += len2;
  402|  4.40k|                len += len2;
  403|  4.40k|            }
  404|  5.62k|            return len;
  405|  5.62k|        }
  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.46k|    {
  443|  6.46k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 1.23k, False: 5.22k]
  ------------------
  444|  1.23k|        {
  445|  1.23k|            return 0;
  446|  1.23k|        }
  447|       |
  448|  5.22k|        JSONCONS_TRY
  ------------------
  |  |   37|  5.22k|    #define JSONCONS_TRY try
  ------------------
  449|  5.22k|        {
  450|  5.22k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  5.22k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  5.22k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 2.07k, False: 3.15k]
  ------------------
  454|  2.07k|            {
  455|  2.07k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|  2.07k|            }
  457|  5.22k|            return length;
  458|  5.22k|        }
  459|  5.22k|        JSONCONS_CATCH(const std::exception&)     
  460|  5.22k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  5.22k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  60.4k|    {
  353|  60.4k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  60.4k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 2.19k, False: 58.2k]
  |  |  ------------------
  ------------------
  354|  2.19k|        {
  355|  2.19k|            return span<const value_type>{};
  356|  2.19k|        }
  357|  58.2k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 179, False: 58.0k]
  |  Branch (357:32): [True: 50, False: 129]
  ------------------
  358|     50|        {
  359|     50|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     50|            data_end_ = chunk_;
  361|     50|        }
  362|  58.2k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 559, False: 57.6k]
  ------------------
  363|    559|        {
  364|    559|            buffer.clear();
  365|    559|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    559|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    559|        }
  368|       |
  369|  57.6k|        const value_type* data = data_end_;
  370|  57.6k|        data_end_ += length;
  371|  57.6k|        remaining_ -= length;
  372|  57.6k|        position_ += length;
  373|  57.6k|        return span<const value_type>(data, length);
  374|  58.2k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  746|    559|    {
  747|    559|        std::size_t unread = length;
  748|       |
  749|  1.86k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.56k, False: 301]
  |  Branch (749:30): [True: 1.30k, False: 258]
  ------------------
  750|  1.30k|        {
  751|  1.30k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 340, False: 967]
  |  Branch (751:44): [True: 338, False: 2]
  ------------------
  752|    338|            {
  753|    338|                std::size_t n = source.chunk_size();
  754|    338|                std::size_t offset = buffer.size();
  755|    338|                buffer.resize(offset+n);
  756|    338|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    338|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    338|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 71, False: 267]
  |  |  ------------------
  ------------------
  758|     71|                {
  759|     71|                    buffer.resize(offset+actual);
  760|     71|                }
  761|    338|                unread -= actual;
  762|    338|            }
  763|    969|            else
  764|    969|            {
  765|    969|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|    969|                std::size_t offset = buffer.size();
  767|    969|                buffer.resize(offset+n);
  768|    969|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|    969|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    969|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 110, False: 859]
  |  |  ------------------
  ------------------
  770|    110|                {
  771|    110|                    buffer.resize(offset + actual);
  772|    110|                }
  773|    969|                unread -= actual;
  774|    969|            }
  775|  1.30k|        }
  776|    559|        return length - unread;
  777|    559|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  3.73k|    {
  272|  3.73k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 1.38k, False: 2.34k]
  |  Branch (272:35): [True: 613, False: 775]
  ------------------
  273|  3.73k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  3.12k|    {
  347|  3.12k|        return remaining_;
  348|  3.12k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  3.89k|    {
  262|  3.89k|        return chunk_size_;
  263|  3.89k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    764|    {
  436|    764|        auto len = fill_buffer(chunk, chunk_size);
  437|    764|        position_ += len;
  438|    764|        return len;
  439|    764|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  12.2k|    {
  353|  12.2k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  12.2k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 654, False: 11.5k]
  |  |  ------------------
  ------------------
  354|    654|        {
  355|    654|            return span<const value_type>{};
  356|    654|        }
  357|  11.5k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 163, False: 11.4k]
  |  Branch (357:32): [True: 25, False: 138]
  ------------------
  358|     25|        {
  359|     25|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     25|            data_end_ = chunk_;
  361|     25|        }
  362|  11.5k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 717, False: 10.8k]
  ------------------
  363|    717|        {
  364|    717|            buffer.clear();
  365|    717|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    717|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    717|        }
  368|       |
  369|  10.8k|        const value_type* data = data_end_;
  370|  10.8k|        data_end_ += length;
  371|  10.8k|        remaining_ -= length;
  372|  10.8k|        position_ += length;
  373|  10.8k|        return span<const value_type>(data, length);
  374|  11.5k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  746|    717|    {
  747|    717|        std::size_t unread = length;
  748|       |
  749|  2.53k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 2.17k, False: 362]
  |  Branch (749:30): [True: 1.81k, False: 355]
  ------------------
  750|  1.81k|        {
  751|  1.81k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 435, False: 1.38k]
  |  Branch (751:44): [True: 426, False: 9]
  ------------------
  752|    426|            {
  753|    426|                std::size_t n = source.chunk_size();
  754|    426|                std::size_t offset = buffer.size();
  755|    426|                buffer.resize(offset+n);
  756|    426|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    426|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    426|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 79, False: 347]
  |  |  ------------------
  ------------------
  758|     79|                {
  759|     79|                    buffer.resize(offset+actual);
  760|     79|                }
  761|    426|                unread -= actual;
  762|    426|            }
  763|  1.39k|            else
  764|  1.39k|            {
  765|  1.39k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|  1.39k|                std::size_t offset = buffer.size();
  767|  1.39k|                buffer.resize(offset+n);
  768|  1.39k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|  1.39k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|  1.39k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 207, False: 1.18k]
  |  |  ------------------
  ------------------
  770|    207|                {
  771|    207|                    buffer.resize(offset + actual);
  772|    207|                }
  773|  1.39k|                unread -= actual;
  774|  1.39k|            }
  775|  1.81k|        }
  776|    717|        return length - unread;
  777|    717|    }

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

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

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|  84.2k|    {
 1148|  84.2k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|  84.2k|        const uint8_t* end = it + length;
 1150|       |
 1151|  84.2k|        unicode_errc  result{};
 1152|   946k|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 862k, False: 84.0k]
  ------------------
 1153|   862k|        {
 1154|   862k|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 495k, False: 367k]
  ------------------
 1155|   495k|            {
 1156|  3.39M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  281|   990k|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (281:32): [True: 491k, False: 3.35k]
  |  |  |  Branch (281:34): [True: 488k, False: 3.93k]
  |  |  |  Branch (281:36): [True: 485k, False: 2.91k]
  |  |  |  Branch (281:38): [True: 484k, False: 890]
  |  |  |  Branch (281:40): [True: 483k, False: 774]
  |  |  |  Branch (281:42): [True: 480k, False: 3.03k]
  |  |  |  Branch (281:44): [True: 479k, False: 664]
  |  |  |  Branch (281:46): [True: 447k, False: 32.0k]
  |  |  ------------------
  ------------------
 1157|   447k|                continue;
 1158|  3.39M|            }
 1159|   414k|    non_ascii:
 1160|   414k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|   414k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 48, False: 414k]
  ------------------
 1162|     48|            {
 1163|     48|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     48|            }
 1165|   414k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 178, False: 414k]
  ------------------
 1166|    178|            {
 1167|    178|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    178|            }
 1169|   414k|            it += len;
 1170|   414k|        }
 1171|  84.0k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|  84.2k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|   414k|    {
  306|   414k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|   414k|        const uint8_t* end = it+length;
  308|       |
  309|   414k|        uint8_t byte;
  310|   414k|        switch (length) {
  311|     33|        default:
  ------------------
  |  Branch (311:9): [True: 33, False: 414k]
  ------------------
  312|     33|            return unicode_errc::over_long_utf8_sequence;
  313|  1.09k|        case 4:
  ------------------
  |  Branch (313:9): [True: 1.09k, False: 413k]
  ------------------
  314|  1.09k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 7, False: 1.08k]
  ------------------
  315|      7|                return unicode_errc::bad_continuation_byte;
  316|  1.08k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.08k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  1.68k|        case 3:
  ------------------
  |  Branch (317:9): [True: 600, False: 414k]
  ------------------
  318|  1.68k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 11, False: 1.67k]
  ------------------
  319|     11|                return unicode_errc::bad_continuation_byte;
  320|  1.67k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.67k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  47.6k|        case 2:
  ------------------
  |  Branch (321:9): [True: 45.9k, False: 368k]
  ------------------
  322|  47.6k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 40, False: 47.5k]
  ------------------
  323|     40|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  47.5k|            switch (*it) 
  326|  47.5k|            {
  327|       |                // no fall-through in this inner switch
  328|    224|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 224, False: 47.3k]
  |  Branch (328:32): [True: 9, False: 215]
  ------------------
  329|    298|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 298, False: 47.2k]
  |  Branch (329:32): [True: 4, False: 294]
  ------------------
  330|    625|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 625, False: 46.9k]
  |  Branch (330:32): [True: 5, False: 620]
  ------------------
  331|    620|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 441, False: 47.1k]
  |  Branch (331:32): [True: 6, False: 435]
  ------------------
  332|  45.9k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 45.9k, False: 1.58k]
  |  Branch (332:32): [True: 0, False: 45.9k]
  ------------------
  333|  47.5k|            }
  334|       |
  335|  47.5k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  47.5k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|   414k|        case 1:
  ------------------
  |  Branch (336:9): [True: 367k, False: 47.6k]
  ------------------
  337|   414k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 47.6k, False: 367k]
  |  Branch (337:32): [True: 62, False: 47.5k]
  ------------------
  338|     62|                return unicode_errc::source_illegal;
  339|   414k|            break;
  340|   414k|        }
  341|   414k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 1, False: 414k]
  ------------------
  342|      1|            return unicode_errc::source_illegal;
  343|       |
  344|   414k|        return unicode_errc();
  345|   414k|    }

_ZN8jsoncons12from_integerIiNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS1_9enable_ifIXsr10ext_traits10is_integerIT_EE5valueEmE4typeES9_RT0_:
   42|  16.0k|{
   43|  16.0k|    using char_type = typename Result::value_type;
   44|       |
   45|  16.0k|    char_type buf[255];
   46|  16.0k|    char_type *p = buf;
   47|  16.0k|    const char_type* last = buf+255;
   48|       |
   49|  16.0k|    bool is_negative = value < 0;
   50|       |
   51|  16.0k|    if (value < 0)
  ------------------
  |  Branch (51:9): [True: 13.2k, False: 2.86k]
  ------------------
   52|  13.2k|    {
   53|  13.2k|        do
   54|  51.7k|        {
   55|  51.7k|            *p++ = static_cast<char_type>(48 - (value % 10));
   56|  51.7k|        }
   57|  51.7k|        while ((value /= 10) && (p < last));
  ------------------
  |  Branch (57:16): [True: 38.5k, False: 13.2k]
  |  Branch (57:33): [True: 38.5k, False: 0]
  ------------------
   58|  13.2k|    }
   59|  2.86k|    else
   60|  2.86k|    {
   61|       |
   62|  2.86k|        do
   63|  8.98k|        {
   64|  8.98k|            *p++ = static_cast<char_type>(48 + value % 10);
   65|  8.98k|        }
   66|  8.98k|        while ((value /= 10) && (p < last));
  ------------------
  |  Branch (66:16): [True: 6.12k, False: 2.86k]
  |  Branch (66:33): [True: 6.12k, False: 0]
  ------------------
   67|  2.86k|    }
   68|  16.0k|    JSONCONS_ASSERT(p != last);
  ------------------
  |  |   49|  16.0k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 16.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|  16.0k|    std::size_t count = (p - buf);
   71|  16.0k|    if (is_negative)
  ------------------
  |  Branch (71:9): [True: 13.2k, False: 2.86k]
  ------------------
   72|  13.2k|    {
   73|  13.2k|        result.push_back('-');
   74|  13.2k|        ++count;
   75|  13.2k|    }
   76|  76.7k|    while (--p >= buf)
  ------------------
  |  Branch (76:12): [True: 60.6k, False: 16.0k]
  ------------------
   77|  60.6k|    {
   78|  60.6k|        result.push_back(*p);
   79|  60.6k|    }
   80|       |
   81|  16.0k|    return count;
   82|  16.0k|}

_ZN8jsoncons4bson3TP1C2Ev:
   78|  20.3k|        constexpr TP1() : low(0), high(0) {}
_ZN8jsoncons4bson19decimal128_to_charsEPcS1_RKNS0_3TP1E:
  335|  20.3k|    {
  336|  20.3k|        static const std::string bson_decimal128_inf = "Infinity";
  337|  20.3k|        static const std::string bson_decimal128_nan = "NaN";
  338|       |
  339|  20.3k|        static constexpr uint32_t combination_mask = 0x1f;   /* Extract least significant 5 bits */
  340|  20.3k|        static constexpr uint32_t exponent_mask = 0x3fff;    /* Extract least significant 14 bits */
  341|  20.3k|        static constexpr uint32_t combination_infinity = 30; /* Value of combination field for Inf */
  342|  20.3k|        static constexpr uint32_t combination_nan = 31;      /* Value of combination field for NaN */
  343|  20.3k|        static constexpr uint32_t exponent_bias = 6176;      /* decimal128 exponent bias */
  344|       |
  345|  20.3k|        char* str_out = first;      /* output pointer in string */
  346|  20.3k|        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|  20.3k|        uint32_t high;                   /* bits 0 - 31 */
  351|  20.3k|        uint32_t midh;                   /* bits 32 - 63 */
  352|  20.3k|        uint32_t midl;                   /* bits 64 - 95 */
  353|  20.3k|        uint32_t low;                    /* bits 96 - 127 */
  354|  20.3k|        uint32_t combination;            /* bits 1 - 5 */
  355|  20.3k|        uint32_t biased_exponent;        /* decoded biased exponent (14 bits) */
  356|  20.3k|        uint32_t significand_digits = 0; /* the number of significand digits */
  357|  20.3k|        uint32_t significand[36] = {0};  /* the base-10 digits in the significand */
  358|  20.3k|        uint32_t *significand_read = significand; /* read pointer into significand */
  359|  20.3k|        int32_t exponent;                         /* unbiased exponent */
  360|  20.3k|        int32_t scientific_exponent; /* the exponent if scientific notation is
  361|       |                                      * used */
  362|  20.3k|        bool is_zero = false;        /* true if the number is zero */
  363|       | 
  364|  20.3k|        uint8_t significand_msb; /* the most signifcant significand bits (50-46) */
  365|  20.3k|        bson_uint128_t
  366|  20.3k|           significand128; /* temporary storage for significand decoding */
  367|       | 
  368|  20.3k|        memset (significand_str, 0, sizeof (significand_str));
  369|       | 
  370|  20.3k|        if ((int64_t) dec.high < 0) { /* negative */
  ------------------
  |  Branch (370:13): [True: 4.36k, False: 15.9k]
  ------------------
  371|  4.36k|           *(str_out++) = '-';
  372|  4.36k|        }
  373|       | 
  374|  20.3k|        low = (uint32_t) dec.low, midl = (uint32_t) (dec.low >> 32),
  375|  20.3k|        midh = (uint32_t) dec.high, high = (uint32_t) (dec.high >> 32);
  376|       | 
  377|       |        /* Decode combination field and exponent */
  378|  20.3k|        combination = (high >> 26) & combination_mask;
  379|       | 
  380|  20.3k|        if (JSONCONS_UNLIKELY ((combination >> 3) == 3)) {
  ------------------
  |  |   78|  20.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 3.96k, False: 16.3k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  3.96k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 1.14k, False: 2.82k]
  ------------------
  383|  1.14k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 1.14k, False: 0]
  ------------------
  384|  1.14k|               {
  385|  1.14k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  1.14k|                   str_out += bson_decimal128_inf.size();
  387|  1.14k|               }
  388|  1.14k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  1.14k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  2.82k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 882, False: 1.93k]
  ------------------
  392|       |               /* first, not str_out, to erase the sign */
  393|    882|               str_out = first;
  394|    882|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_nan.size())) 
  ------------------
  |  Branch (394:20): [True: 882, False: 0]
  ------------------
  395|    882|               {
  396|    882|                   std::memcpy(str_out, bson_decimal128_nan.data(), bson_decimal128_nan.size());
  397|    882|                   str_out += bson_decimal128_nan.size();
  398|    882|               }
  399|    882|               *str_out = 0;
  400|       |              //strcpy_s (first, last-first, bson_decimal128_nan.c_str());
  401|       |              /* we don't care about the NaN payload. */
  402|    882|               return decimal128_to_chars_result{str_out, std::errc{}};
  403|  1.93k|           } else {
  404|  1.93k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  1.93k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  1.93k|           }
  407|  16.3k|        } else {
  408|  16.3k|           significand_msb = (high >> 14) & 0x7;
  409|  16.3k|           biased_exponent = (high >> 17) & exponent_mask;
  410|  16.3k|        }
  411|       | 
  412|  18.3k|        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|  18.3k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|  18.3k|        significand128.parts[1] = midh;
  420|  18.3k|        significand128.parts[2] = midl;
  421|  18.3k|        significand128.parts[3] = low;
  422|       | 
  423|  18.3k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 3.89k, False: 14.4k]
  |  Branch (423:45): [True: 1.77k, False: 2.12k]
  ------------------
  424|  1.77k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 829, False: 942]
  |  Branch (424:45): [True: 198, False: 631]
  ------------------
  425|    198|           is_zero = true;
  426|  18.1k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 1.93k, False: 16.1k]
  ------------------
  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.93k|           is_zero = true;
  434|  16.1k|        } else {
  435|  80.8k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 64.6k, False: 16.1k]
  ------------------
  436|  64.6k|              uint32_t least_digits = 0;
  437|  64.6k|              detail::bson_uint128_divide1B (
  438|  64.6k|                 significand128, &significand128, &least_digits);
  439|       | 
  440|       |              /* We now have the 9 least significant digits (in base 2). */
  441|       |              /* Convert and output to string. */
  442|  64.6k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 3.17k, False: 61.5k]
  ------------------
  443|  3.17k|                 continue;
  444|  3.17k|              }
  445|       | 
  446|   615k|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 553k, False: 61.5k]
  ------------------
  447|   553k|                 significand[k * 9 + j] = least_digits % 10;
  448|   553k|                 least_digits /= 10;
  449|   553k|              }
  450|  61.5k|           }
  451|  16.1k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|  18.3k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 2.13k, False: 16.1k]
  ------------------
  458|  2.13k|           significand_digits = 1;
  459|  2.13k|           *significand_read = 0;
  460|  16.1k|        } else {
  461|  16.1k|           significand_digits = 36;
  462|  95.4k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 79.2k, False: 16.1k]
  ------------------
  463|  79.2k|              significand_digits--;
  464|  79.2k|              significand_read++;
  465|  79.2k|           }
  466|  16.1k|        }
  467|       | 
  468|  18.3k|        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|  18.3k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 13.2k, False: 5.09k]
  |  Branch (478:41): [True: 2.86k, False: 2.23k]
  ------------------
  479|       |           /* Scientific format */
  480|  16.0k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|  16.0k|           significand_digits--;
  482|       | 
  483|  16.0k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 14.2k, False: 1.85k]
  ------------------
  484|  14.2k|              *(str_out++) = '.';
  485|  14.2k|           }
  486|       | 
  487|   448k|           for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (487:36): [True: 432k, False: 15.9k]
  |  Branch (487:62): [True: 432k, False: 83]
  ------------------
  488|   432k|              *(str_out++) = char(*(significand_read++)) + '0';
  489|   432k|           }
  490|       |           /* Exponent */
  491|  16.0k|           *(str_out++) = 'E';
  492|       |
  493|  16.0k|           std::string s;
  494|  16.0k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 2.86k, False: 13.2k]
  ------------------
  495|  2.86k|               s.push_back('+');
  496|  2.86k|           }
  497|  16.0k|           jsoncons::from_integer(scientific_exponent, s);
  498|  16.0k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 15.0k, False: 1.05k]
  ------------------
  499|  15.0k|           {
  500|  15.0k|               std::memcpy(str_out, s.data(), s.size());
  501|  15.0k|           }
  502|  1.05k|           else
  503|  1.05k|           {
  504|  1.05k|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|  1.05k|           }
  506|  15.0k|           str_out += s.size();
  507|  15.0k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  2.23k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 644, False: 1.58k]
  ------------------
  510|  7.99k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 7.35k, False: 644]
  |  Branch (510:65): [True: 7.35k, False: 0]
  ------------------
  511|  7.35k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  7.35k|              }
  513|  1.58k|           } else {
  514|  1.58k|              int32_t radix_position = significand_digits + exponent;
  515|       | 
  516|  1.58k|              if (radix_position > 0) { /* non-zero digits before radix */
  ------------------
  |  Branch (516:19): [True: 758, False: 828]
  ------------------
  517|    758|                 for (int32_t i = 0;
  518|  4.14k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 3.38k, False: 758]
  |  Branch (518:45): [True: 3.38k, False: 0]
  ------------------
  519|  3.38k|                      i++) {
  520|  3.38k|                    *(str_out++) = char(*(significand_read++)) + '0';
  521|  3.38k|                 }
  522|    828|              } else { /* leading zero before radix point */
  523|    828|                 *(str_out++) = '0';
  524|    828|              }
  525|       | 
  526|  1.58k|              *(str_out++) = '.';
  527|  3.72k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 2.14k, False: 1.58k]
  ------------------
  528|  2.14k|                 *(str_out++) = '0';
  529|  2.14k|              }
  530|       | 
  531|  1.58k|              for (std::size_t i = 0;
  532|  47.2k|                   (i < significand_digits - (std::max) (radix_position - 1, 0)) &&
  ------------------
  |  Branch (532:20): [True: 45.6k, False: 1.58k]
  |  Branch (532:20): [True: 45.6k, False: 1.58k]
  ------------------
  533|  45.6k|                   (str_out < last);
  ------------------
  |  Branch (533:20): [True: 45.6k, False: 0]
  ------------------
  534|  45.6k|                   i++) {
  535|  45.6k|                 *(str_out++) = char(*(significand_read++)) + '0';
  536|  45.6k|              }
  537|  1.58k|           }
  538|  2.23k|        }
  539|  17.2k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|  18.3k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|  64.6k|        {
  179|  64.6k|            static constexpr uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|  64.6k|            uint64_t _rem = 0;
  181|  64.6k|            int i = 0;
  182|       |            
  183|  64.6k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 52.2k, False: 12.4k]
  |  Branch (183:36): [True: 37.2k, False: 15.0k]
  |  Branch (183:55): [True: 20.4k, False: 16.7k]
  ------------------
  184|  20.4k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 3.17k, False: 17.3k]
  ------------------
  185|  3.17k|               *quotient = value;
  186|  3.17k|               *rem = 0;
  187|  3.17k|               return;
  188|  3.17k|            }
  189|       |            
  190|   307k|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 246k, False: 61.5k]
  ------------------
  191|   246k|               _rem <<= 32; /* Adjust remainder to match value of next dividend */
  192|   246k|               _rem += value.parts[i]; /* Add the divided to _rem */
  193|   246k|               value.parts[i] = (uint32_t) (_rem / DIVISOR);
  194|   246k|               _rem %= DIVISOR; /* Store the remainder */
  195|   246k|            }
  196|       |            
  197|  61.5k|            *quotient = value;
  198|  61.5k|            *rem = (uint32_t) _rem;
  199|  61.5k|        }

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

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

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

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

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

