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

_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4sizeEv:
  116|   179k|        {
  117|   179k|            return size_;
  118|   179k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2Ev:
   58|  2.06k|        {
   59|  2.06k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2EPS2_m:
   61|  58.0k|            : data_(data), size_(size)
   62|  58.0k|        {
   63|  58.0k|        }
_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4dataEv:
  111|  59.5k|        {
  112|  59.5k|            return data_;
  113|  59.5k|        }

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

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|  2.03k|    {
  194|  2.03k|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 2.03k, False: 0]
  ------------------
  195|  2.03k|        {
  196|  2.03k|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|  2.03k|        }
  198|  2.03k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|  2.03k|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|  2.03k|          chunk_size_(default_max_chunk_size)
  178|  2.03k|    {
  179|  2.03k|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|  2.03k|        data_end_ = chunk_;
  181|  2.03k|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|  2.03k|      : std::basic_istream<CharT>(&nb_)
   58|  2.03k|    {
   59|  2.03k|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|  2.03k|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  2.03k|    {
  277|  2.03k|        return stream_ptr_->bad();  
  278|  2.03k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  377|  11.0M|    {
  378|  11.0M|        std::size_t len = 0;
  379|  11.0M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 11.0M, False: 3.37k]
  ------------------
  380|  11.0M|        {
  381|  11.0M|            len = (std::min)(remaining_, length);
  382|  11.0M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  11.0M|            data_end_ += len;
  384|  11.0M|            remaining_ -= len;
  385|  11.0M|            position_ += len;
  386|  11.0M|        }
  387|  11.0M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 11.0M, False: 5.37k]
  ------------------
  388|  11.0M|        {
  389|  11.0M|            return len;
  390|  11.0M|        }
  391|  5.37k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 5.37k, False: 0]
  ------------------
  392|  5.37k|        {
  393|  5.37k|            data_end_ = chunk_;
  394|  5.37k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  5.37k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 4.17k, False: 1.19k]
  ------------------
  396|  4.17k|            {
  397|  4.17k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  4.17k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  4.17k|                data_end_ += len2;
  400|  4.17k|                remaining_ -= len2;
  401|  4.17k|                position_ += len2;
  402|  4.17k|                len += len2;
  403|  4.17k|            }
  404|  5.37k|            return len;
  405|  5.37k|        }
  406|      0|        else
  407|      0|        {
  408|      0|            if (stream_ptr_->eof())
  ------------------
  |  Branch (408:17): [True: 0, False: 0]
  ------------------
  409|      0|            {
  410|      0|                remaining_ = 0;
  411|      0|                return 0;
  412|      0|            }
  413|      0|            JSONCONS_TRY
  ------------------
  |  |   37|      0|    #define JSONCONS_TRY try
  ------------------
  414|      0|            {
  415|      0|                std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(p+len), length-len);
  416|      0|                std::size_t len2 = static_cast<std::size_t>(count);
  417|      0|                if (len2 < length-len)
  ------------------
  |  Branch (417:21): [True: 0, False: 0]
  ------------------
  418|      0|                {
  419|      0|                    stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  420|      0|                }
  421|      0|                len += len2;
  422|      0|                position_ += len2;
  423|      0|                return len;
  424|      0|            }
  425|      0|            JSONCONS_CATCH(const std::exception&)     
  426|      0|            {
  427|      0|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  428|      0|                return 0;
  429|      0|            }
  430|      0|        }
  431|  11.0M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  6.18k|    {
  443|  6.18k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 1.21k, False: 4.97k]
  ------------------
  444|  1.21k|        {
  445|  1.21k|            return 0;
  446|  1.21k|        }
  447|       |
  448|  4.97k|        JSONCONS_TRY
  ------------------
  |  |   37|  4.97k|    #define JSONCONS_TRY try
  ------------------
  449|  4.97k|        {
  450|  4.97k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  4.97k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  4.97k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 2.01k, False: 2.96k]
  ------------------
  454|  2.01k|            {
  455|  2.01k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|  2.01k|            }
  457|  4.97k|            return length;
  458|  4.97k|        }
  459|  4.97k|        JSONCONS_CATCH(const std::exception&)     
  460|  4.97k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  4.97k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  52.4k|    {
  353|  52.4k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  52.4k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 1.83k, False: 50.6k]
  |  |  ------------------
  ------------------
  354|  1.83k|        {
  355|  1.83k|            return span<const value_type>{};
  356|  1.83k|        }
  357|  50.6k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 181, False: 50.4k]
  |  Branch (357:32): [True: 54, False: 127]
  ------------------
  358|     54|        {
  359|     54|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     54|            data_end_ = chunk_;
  361|     54|        }
  362|  50.6k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 547, False: 50.0k]
  ------------------
  363|    547|        {
  364|    547|            buffer.clear();
  365|    547|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    547|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    547|        }
  368|       |
  369|  50.0k|        const value_type* data = data_end_;
  370|  50.0k|        data_end_ += length;
  371|  50.0k|        remaining_ -= length;
  372|  50.0k|        position_ += length;
  373|  50.0k|        return span<const value_type>(data, length);
  374|  50.6k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  746|    547|    {
  747|    547|        std::size_t unread = length;
  748|       |
  749|  1.90k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.61k, False: 290]
  |  Branch (749:30): [True: 1.36k, False: 257]
  ------------------
  750|  1.36k|        {
  751|  1.36k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 369, False: 993]
  |  Branch (751:44): [True: 367, False: 2]
  ------------------
  752|    367|            {
  753|    367|                std::size_t n = source.chunk_size();
  754|    367|                std::size_t offset = buffer.size();
  755|    367|                buffer.resize(offset+n);
  756|    367|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    367|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    367|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 68, False: 299]
  |  |  ------------------
  ------------------
  758|     68|                {
  759|     68|                    buffer.resize(offset+actual);
  760|     68|                }
  761|    367|                unread -= actual;
  762|    367|            }
  763|    995|            else
  764|    995|            {
  765|    995|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|    995|                std::size_t offset = buffer.size();
  767|    995|                buffer.resize(offset+n);
  768|    995|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|    995|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    995|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 111, False: 884]
  |  |  ------------------
  ------------------
  770|    111|                {
  771|    111|                    buffer.resize(offset + actual);
  772|    111|                }
  773|    995|                unread -= actual;
  774|    995|            }
  775|  1.36k|        }
  776|    547|        return length - unread;
  777|    547|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  3.66k|    {
  272|  3.66k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 1.34k, False: 2.31k]
  |  Branch (272:35): [True: 599, False: 748]
  ------------------
  273|  3.66k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  3.06k|    {
  347|  3.06k|        return remaining_;
  348|  3.06k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  3.80k|    {
  262|  3.80k|        return chunk_size_;
  263|  3.80k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    742|    {
  436|    742|        auto len = fill_buffer(chunk, chunk_size);
  437|    742|        position_ += len;
  438|    742|        return len;
  439|    742|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  7.66k|    {
  353|  7.66k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  7.66k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 225, False: 7.44k]
  |  |  ------------------
  ------------------
  354|    225|        {
  355|    225|            return span<const value_type>{};
  356|    225|        }
  357|  7.44k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 153, False: 7.28k]
  |  Branch (357:32): [True: 22, False: 131]
  ------------------
  358|     22|        {
  359|     22|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     22|            data_end_ = chunk_;
  361|     22|        }
  362|  7.44k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 619, False: 6.82k]
  ------------------
  363|    619|        {
  364|    619|            buffer.clear();
  365|    619|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    619|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    619|        }
  368|       |
  369|  6.82k|        const value_type* data = data_end_;
  370|  6.82k|        data_end_ += length;
  371|  6.82k|        remaining_ -= length;
  372|  6.82k|        position_ += length;
  373|  6.82k|        return span<const value_type>(data, length);
  374|  7.44k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  746|    619|    {
  747|    619|        std::size_t unread = length;
  748|       |
  749|  2.31k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 2.04k, False: 277]
  |  Branch (749:30): [True: 1.69k, False: 342]
  ------------------
  750|  1.69k|        {
  751|  1.69k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 379, False: 1.32k]
  |  Branch (751:44): [True: 375, False: 4]
  ------------------
  752|    375|            {
  753|    375|                std::size_t n = source.chunk_size();
  754|    375|                std::size_t offset = buffer.size();
  755|    375|                buffer.resize(offset+n);
  756|    375|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    375|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    375|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 73, False: 302]
  |  |  ------------------
  ------------------
  758|     73|                {
  759|     73|                    buffer.resize(offset+actual);
  760|     73|                }
  761|    375|                unread -= actual;
  762|    375|            }
  763|  1.32k|            else
  764|  1.32k|            {
  765|  1.32k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|  1.32k|                std::size_t offset = buffer.size();
  767|  1.32k|                buffer.resize(offset+n);
  768|  1.32k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|  1.32k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|  1.32k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 200, False: 1.12k]
  |  |  ------------------
  ------------------
  770|    200|                {
  771|    200|                    buffer.resize(offset + actual);
  772|    200|                }
  773|  1.32k|                unread -= actual;
  774|  1.32k|            }
  775|  1.69k|        }
  776|    619|        return length - unread;
  777|    619|    }

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

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

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|  72.1k|    {
 1148|  72.1k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|  72.1k|        const uint8_t* end = it + length;
 1150|       |
 1151|  72.1k|        unicode_errc  result{};
 1152|   836k|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 764k, False: 71.9k]
  ------------------
 1153|   764k|        {
 1154|   764k|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 447k, False: 317k]
  ------------------
 1155|   447k|            {
 1156|  3.06M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  281|   894k|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (281:32): [True: 443k, False: 3.36k]
  |  |  |  Branch (281:34): [True: 439k, False: 3.99k]
  |  |  |  Branch (281:36): [True: 437k, False: 1.99k]
  |  |  |  Branch (281:38): [True: 436k, False: 781]
  |  |  |  Branch (281:40): [True: 436k, False: 723]
  |  |  |  Branch (281:42): [True: 434k, False: 2.17k]
  |  |  |  Branch (281:44): [True: 433k, False: 466]
  |  |  |  Branch (281:46): [True: 415k, False: 17.8k]
  |  |  ------------------
  ------------------
 1157|   415k|                continue;
 1158|  3.06M|            }
 1159|   349k|    non_ascii:
 1160|   349k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|   349k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 45, False: 349k]
  ------------------
 1162|     45|            {
 1163|     45|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     45|            }
 1165|   349k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 174, False: 349k]
  ------------------
 1166|    174|            {
 1167|    174|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    174|            }
 1169|   349k|            it += len;
 1170|   349k|        }
 1171|  71.9k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|  72.1k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|   349k|    {
  306|   349k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|   349k|        const uint8_t* end = it+length;
  308|       |
  309|   349k|        uint8_t byte;
  310|   349k|        switch (length) {
  311|     32|        default:
  ------------------
  |  Branch (311:9): [True: 32, False: 349k]
  ------------------
  312|     32|            return unicode_errc::over_long_utf8_sequence;
  313|  1.07k|        case 4:
  ------------------
  |  Branch (313:9): [True: 1.07k, False: 348k]
  ------------------
  314|  1.07k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 7, False: 1.06k]
  ------------------
  315|      7|                return unicode_errc::bad_continuation_byte;
  316|  1.06k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.06k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  1.95k|        case 3:
  ------------------
  |  Branch (317:9): [True: 886, False: 348k]
  ------------------
  318|  1.95k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 10, False: 1.94k]
  ------------------
  319|     10|                return unicode_errc::bad_continuation_byte;
  320|  1.94k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.94k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  31.3k|        case 2:
  ------------------
  |  Branch (321:9): [True: 29.4k, False: 319k]
  ------------------
  322|  31.3k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 36, False: 31.3k]
  ------------------
  323|     36|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  31.3k|            switch (*it) 
  326|  31.3k|            {
  327|       |                // no fall-through in this inner switch
  328|    205|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 205, False: 31.1k]
  |  Branch (328:32): [True: 7, False: 198]
  ------------------
  329|    587|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 587, False: 30.7k]
  |  Branch (329:32): [True: 3, False: 584]
  ------------------
  330|    731|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 731, False: 30.5k]
  |  Branch (330:32): [True: 6, False: 725]
  ------------------
  331|    725|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 305, False: 31.0k]
  |  Branch (331:32): [True: 3, False: 302]
  ------------------
  332|  29.4k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 29.4k, False: 1.82k]
  |  Branch (332:32): [True: 0, False: 29.4k]
  ------------------
  333|  31.3k|            }
  334|       |
  335|  31.3k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  31.3k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|   349k|        case 1:
  ------------------
  |  Branch (336:9): [True: 317k, False: 31.4k]
  ------------------
  337|   349k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 31.3k, False: 317k]
  |  Branch (337:32): [True: 69, False: 31.2k]
  ------------------
  338|     69|                return unicode_errc::source_illegal;
  339|   349k|            break;
  340|   349k|        }
  341|   349k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 1, False: 349k]
  ------------------
  342|      1|            return unicode_errc::source_illegal;
  343|       |
  344|   349k|        return unicode_errc();
  345|   349k|    }

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

_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.15k, False: 16.2k]
  ------------------
  371|  4.15k|           *(str_out++) = '-';
  372|  4.15k|        }
  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.97k, False: 16.4k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  3.97k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 1.03k, False: 2.93k]
  ------------------
  383|  1.03k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 1.03k, False: 0]
  ------------------
  384|  1.03k|               {
  385|  1.03k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  1.03k|                   str_out += bson_decimal128_inf.size();
  387|  1.03k|               }
  388|  1.03k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  1.03k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  2.93k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 763, False: 2.16k]
  ------------------
  392|       |               /* first, not str_out, to erase the sign */
  393|    763|               str_out = first;
  394|    763|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_nan.size())) 
  ------------------
  |  Branch (394:20): [True: 763, False: 0]
  ------------------
  395|    763|               {
  396|    763|                   std::memcpy(str_out, bson_decimal128_nan.data(), bson_decimal128_nan.size());
  397|    763|                   str_out += bson_decimal128_nan.size();
  398|    763|               }
  399|    763|               *str_out = 0;
  400|       |              //strcpy_s (first, last-first, bson_decimal128_nan.c_str());
  401|       |              /* we don't care about the NaN payload. */
  402|    763|               return decimal128_to_chars_result{str_out, std::errc{}};
  403|  2.16k|           } else {
  404|  2.16k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  2.16k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  2.16k|           }
  407|  16.4k|        } else {
  408|  16.4k|           significand_msb = (high >> 14) & 0x7;
  409|  16.4k|           biased_exponent = (high >> 17) & exponent_mask;
  410|  16.4k|        }
  411|       | 
  412|  18.5k|        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.5k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|  18.5k|        significand128.parts[1] = midh;
  420|  18.5k|        significand128.parts[2] = midl;
  421|  18.5k|        significand128.parts[3] = low;
  422|       | 
  423|  18.5k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 3.93k, False: 14.6k]
  |  Branch (423:45): [True: 1.70k, False: 2.23k]
  ------------------
  424|  1.70k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 875, False: 826]
  |  Branch (424:45): [True: 209, False: 666]
  ------------------
  425|    209|           is_zero = true;
  426|  18.3k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 2.16k, False: 16.2k]
  ------------------
  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|  2.16k|           is_zero = true;
  434|  16.2k|        } else {
  435|  81.0k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 64.8k, False: 16.2k]
  ------------------
  436|  64.8k|              uint32_t least_digits = 0;
  437|  64.8k|              detail::bson_uint128_divide1B (
  438|  64.8k|                 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.8k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 3.19k, False: 61.6k]
  ------------------
  443|  3.19k|                 continue;
  444|  3.19k|              }
  445|       | 
  446|   616k|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 554k, False: 61.6k]
  ------------------
  447|   554k|                 significand[k * 9 + j] = least_digits % 10;
  448|   554k|                 least_digits /= 10;
  449|   554k|              }
  450|  61.6k|           }
  451|  16.2k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|  18.5k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 2.37k, False: 16.2k]
  ------------------
  458|  2.37k|           significand_digits = 1;
  459|  2.37k|           *significand_read = 0;
  460|  16.2k|        } else {
  461|  16.2k|           significand_digits = 36;
  462|  94.8k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 78.6k, False: 16.2k]
  ------------------
  463|  78.6k|              significand_digits--;
  464|  78.6k|              significand_read++;
  465|  78.6k|           }
  466|  16.2k|        }
  467|       | 
  468|  18.5k|        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.5k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 13.3k, False: 5.21k]
  |  Branch (478:41): [True: 3.03k, False: 2.18k]
  ------------------
  479|       |           /* Scientific format */
  480|  16.3k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|  16.3k|           significand_digits--;
  482|       | 
  483|  16.3k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 14.2k, False: 2.19k]
  ------------------
  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: 16.3k]
  |  Branch (487:62): [True: 432k, False: 40]
  ------------------
  488|   432k|              *(str_out++) = char(*(significand_read++)) + '0';
  489|   432k|           }
  490|       |           /* Exponent */
  491|  16.3k|           *(str_out++) = 'E';
  492|       |
  493|  16.3k|           std::string s;
  494|  16.3k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 3.03k, False: 13.3k]
  ------------------
  495|  3.03k|               s.push_back('+');
  496|  3.03k|           }
  497|  16.3k|           jsoncons::from_integer(scientific_exponent, s);
  498|  16.3k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 15.3k, False: 1.02k]
  ------------------
  499|  15.3k|           {
  500|  15.3k|               std::memcpy(str_out, s.data(), s.size());
  501|  15.3k|           }
  502|  1.02k|           else
  503|  1.02k|           {
  504|  1.02k|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|  1.02k|           }
  506|  15.3k|           str_out += s.size();
  507|  15.3k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  2.18k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 524, False: 1.66k]
  ------------------
  510|  6.82k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 6.29k, False: 524]
  |  Branch (510:65): [True: 6.29k, False: 0]
  ------------------
  511|  6.29k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  6.29k|              }
  513|  1.66k|           } else {
  514|  1.66k|              int32_t radix_position = significand_digits + exponent;
  515|       | 
  516|  1.66k|              if (radix_position > 0) { /* non-zero digits before radix */
  ------------------
  |  Branch (516:19): [True: 830, False: 831]
  ------------------
  517|    830|                 for (int32_t i = 0;
  518|  4.59k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 3.76k, False: 830]
  |  Branch (518:45): [True: 3.76k, False: 0]
  ------------------
  519|  3.76k|                      i++) {
  520|  3.76k|                    *(str_out++) = char(*(significand_read++)) + '0';
  521|  3.76k|                 }
  522|    831|              } else { /* leading zero before radix point */
  523|    831|                 *(str_out++) = '0';
  524|    831|              }
  525|       | 
  526|  1.66k|              *(str_out++) = '.';
  527|  3.72k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 2.06k, False: 1.66k]
  ------------------
  528|  2.06k|                 *(str_out++) = '0';
  529|  2.06k|              }
  530|       | 
  531|  1.66k|              for (std::size_t i = 0;
  532|  49.5k|                   (i < significand_digits - (std::max) (radix_position - 1, 0)) &&
  ------------------
  |  Branch (532:20): [True: 47.9k, False: 1.66k]
  |  Branch (532:20): [True: 47.9k, False: 1.66k]
  ------------------
  533|  47.9k|                   (str_out < last);
  ------------------
  |  Branch (533:20): [True: 47.9k, False: 0]
  ------------------
  534|  47.9k|                   i++) {
  535|  47.9k|                 *(str_out++) = char(*(significand_read++)) + '0';
  536|  47.9k|              }
  537|  1.66k|           }
  538|  2.18k|        }
  539|  17.5k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|  18.5k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|  64.8k|        {
  179|  64.8k|            static constexpr uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|  64.8k|            uint64_t _rem = 0;
  181|  64.8k|            int i = 0;
  182|       |            
  183|  64.8k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 52.3k, False: 12.4k]
  |  Branch (183:36): [True: 37.2k, False: 15.1k]
  |  Branch (183:55): [True: 20.6k, False: 16.5k]
  ------------------
  184|  20.6k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 3.19k, False: 17.4k]
  ------------------
  185|  3.19k|               *quotient = value;
  186|  3.19k|               *rem = 0;
  187|  3.19k|               return;
  188|  3.19k|            }
  189|       |            
  190|   308k|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 246k, False: 61.6k]
  ------------------
  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.6k|            *quotient = value;
  198|  61.6k|            *rem = (uint32_t) _rem;
  199|  61.6k|        }

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

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

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

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

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

