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

_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4sizeEv:
  116|   478k|        {
  117|   478k|            return size_;
  118|   478k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2Ev:
   58|  51.1k|        {
   59|  51.1k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2EPS2_m:
   61|   108k|            : data_(data), size_(size)
   62|   108k|        {
   63|   108k|        }
_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4dataEv:
  111|   159k|        {
  112|   159k|            return data_;
  113|   159k|        }

_ZN8jsoncons18basic_json_visitorIcEC2Ev:
  103|  3.21k|        basic_json_visitor() = default;
_ZN8jsoncons19typed_array_visitorD2Ev:
   33|  3.21k|        virtual ~typed_array_visitor() = default;
_ZN8jsoncons18basic_json_visitorIcE12uint64_valueEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  414|  4.56k|        {
  415|  4.56k|            visit_uint64(value, tag, context, ec);
  416|  4.56k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.56k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  417|  4.56k|        }
_ZN8jsoncons18basic_json_visitorIcE9end_arrayERKNS_11ser_contextERNSt3__110error_codeE:
  351|  2.01k|        {
  352|  2.01k|            visit_end_array(context, ec);
  353|  2.01k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  2.01k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  354|  2.01k|        }
_ZN8jsoncons18basic_json_visitorIcE11int64_valueElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  423|  47.2k|        {
  424|  47.2k|            visit_int64(value, tag, context, ec);
  425|  47.2k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  47.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  426|  47.2k|        }
_ZN8jsoncons18basic_json_visitorIcE12double_valueEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  441|  1.23k|        {
  442|  1.23k|            visit_double(value, tag, context, ec);
  443|  1.23k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.23k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  444|  1.23k|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  318|  73.3k|        {
  319|  73.3k|            visit_begin_object(tag, context, ec);
  320|  73.3k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  73.3k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  321|  73.3k|        }
_ZN8jsoncons18basic_json_visitorIcE3keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  357|   314k|        {
  358|   314k|            visit_key(name, context, ec);
  359|   314k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   314k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  360|   314k|        }
_ZN8jsoncons18basic_json_visitorIcE10end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  333|  15.6k|        {
  334|  15.6k|            visit_end_object(context, ec);
  335|  15.6k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  15.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  336|  15.6k|        }
_ZN8jsoncons18basic_json_visitorIcE12string_valueERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  383|   250k|        {
  384|   250k|            visit_string(value, tag, context, ec);
  385|   250k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   250k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  386|   250k|        }
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  339|   713k|        {
  340|   713k|            visit_begin_array(tag, context, ec);
  341|   713k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   713k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  342|   713k|        }
_ZN8jsoncons18basic_json_visitorIcE10null_valueENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  365|  4.02M|        {
  366|  4.02M|            visit_null(tag, context, ec);
  367|  4.02M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.02M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  368|  4.02M|        }
_ZN8jsoncons18basic_json_visitorIcE10bool_valueEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  374|  5.04k|        {
  375|  5.04k|            visit_bool(value, tag, context, ec);
  376|  5.04k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  5.04k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|  5.04k|        }
_ZN8jsoncons18basic_json_visitorIcE17byte_string_valueINS_16byte_string_viewEEEbRKT_mRKNS_11ser_contextERNSt3__110error_codeENSA_9enable_ifIXsr10ext_traits18is_bytes_view_likeIS4_EE5valueEiE4typeE:
  405|  59.0k|        {
  406|  59.0k|            visit_byte_string(byte_string_view(reinterpret_cast<const uint8_t*>(b.data()),b.size()), raw_tag, context, ec);
  407|  59.0k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  59.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  408|  59.0k|        }
_ZN8jsoncons18basic_json_visitorIcE5flushEv:
  108|      5|        {
  109|      5|            visit_flush();
  110|      5|        }

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

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|  3.21k|    {
  194|  3.21k|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 3.21k, False: 0]
  ------------------
  195|  3.21k|        {
  196|  3.21k|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|  3.21k|        }
  198|  3.21k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|  3.21k|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|  3.21k|          chunk_size_(default_max_chunk_size)
  178|  3.21k|    {
  179|  3.21k|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|  3.21k|        data_end_ = chunk_;
  181|  3.21k|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|  3.21k|      : std::basic_istream<CharT>(&nb_)
   58|  3.21k|    {
   59|  3.21k|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|  3.21k|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  3.21k|    {
  277|  3.21k|        return stream_ptr_->bad();  
  278|  3.21k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  377|  34.2M|    {
  378|  34.2M|        std::size_t len = 0;
  379|  34.2M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 34.1M, False: 7.13k]
  ------------------
  380|  34.1M|        {
  381|  34.1M|            len = (std::min)(remaining_, length);
  382|  34.1M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  34.1M|            data_end_ += len;
  384|  34.1M|            remaining_ -= len;
  385|  34.1M|            position_ += len;
  386|  34.1M|        }
  387|  34.2M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 34.1M, False: 9.30k]
  ------------------
  388|  34.1M|        {
  389|  34.1M|            return len;
  390|  34.1M|        }
  391|  9.30k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 9.30k, False: 0]
  ------------------
  392|  9.30k|        {
  393|  9.30k|            data_end_ = chunk_;
  394|  9.30k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  9.30k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 6.90k, False: 2.40k]
  ------------------
  396|  6.90k|            {
  397|  6.90k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  6.90k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  6.90k|                data_end_ += len2;
  400|  6.90k|                remaining_ -= len2;
  401|  6.90k|                position_ += len2;
  402|  6.90k|                len += len2;
  403|  6.90k|            }
  404|  9.30k|            return len;
  405|  9.30k|        }
  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|  34.2M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  10.1k|    {
  443|  10.1k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 2.42k, False: 7.74k]
  ------------------
  444|  2.42k|        {
  445|  2.42k|            return 0;
  446|  2.42k|        }
  447|       |
  448|  7.74k|        JSONCONS_TRY
  ------------------
  |  |   37|  7.74k|    #define JSONCONS_TRY try
  ------------------
  449|  7.74k|        {
  450|  7.74k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  7.74k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  7.74k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 3.19k, False: 4.55k]
  ------------------
  454|  3.19k|            {
  455|  3.19k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|  3.19k|            }
  457|  7.74k|            return length;
  458|  7.74k|        }
  459|  7.74k|        JSONCONS_CATCH(const std::exception&)     
  460|  7.74k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  7.74k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|   100k|    {
  353|   100k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|   100k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 1.68k, False: 99.0k]
  |  |  ------------------
  ------------------
  354|  1.68k|        {
  355|  1.68k|            return span<const value_type>{};
  356|  1.68k|        }
  357|  99.0k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 149, False: 98.8k]
  |  Branch (357:32): [True: 29, False: 120]
  ------------------
  358|     29|        {
  359|     29|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     29|            data_end_ = chunk_;
  361|     29|        }
  362|  99.0k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 464, False: 98.5k]
  ------------------
  363|    464|        {
  364|    464|            buffer.clear();
  365|    464|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    464|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    464|        }
  368|       |
  369|  98.5k|        const value_type* data = data_end_;
  370|  98.5k|        data_end_ += length;
  371|  98.5k|        remaining_ -= length;
  372|  98.5k|        position_ += length;
  373|  98.5k|        return span<const value_type>(data, length);
  374|  99.0k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  746|    464|    {
  747|    464|        std::size_t unread = length;
  748|       |
  749|  1.35k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.13k, False: 218]
  |  Branch (749:30): [True: 886, False: 246]
  ------------------
  750|    886|        {
  751|    886|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 336, False: 550]
  |  Branch (751:44): [True: 332, False: 4]
  ------------------
  752|    332|            {
  753|    332|                std::size_t n = source.chunk_size();
  754|    332|                std::size_t offset = buffer.size();
  755|    332|                buffer.resize(offset+n);
  756|    332|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    332|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    332|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 62, False: 270]
  |  |  ------------------
  ------------------
  758|     62|                {
  759|     62|                    buffer.resize(offset+actual);
  760|     62|                }
  761|    332|                unread -= actual;
  762|    332|            }
  763|    554|            else
  764|    554|            {
  765|    554|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|    554|                std::size_t offset = buffer.size();
  767|    554|                buffer.resize(offset+n);
  768|    554|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|    554|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    554|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 115, False: 439]
  |  |  ------------------
  ------------------
  770|    115|                {
  771|    115|                    buffer.resize(offset + actual);
  772|    115|                }
  773|    554|                unread -= actual;
  774|    554|            }
  775|    886|        }
  776|    464|        return length - unread;
  777|    464|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  3.34k|    {
  272|  3.34k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 1.39k, False: 1.95k]
  |  Branch (272:35): [True: 577, False: 814]
  ------------------
  273|  3.34k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  2.77k|    {
  347|  2.77k|        return remaining_;
  348|  2.77k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  3.58k|    {
  262|  3.58k|        return chunk_size_;
  263|  3.58k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    808|    {
  436|    808|        auto len = fill_buffer(chunk, chunk_size);
  437|    808|        position_ += len;
  438|    808|        return len;
  439|    808|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  59.3k|    {
  353|  59.3k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  59.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 49.4k, False: 9.89k]
  |  |  ------------------
  ------------------
  354|  49.4k|        {
  355|  49.4k|            return span<const value_type>{};
  356|  49.4k|        }
  357|  9.89k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 139, False: 9.75k]
  |  Branch (357:32): [True: 24, False: 115]
  ------------------
  358|     24|        {
  359|     24|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     24|            data_end_ = chunk_;
  361|     24|        }
  362|  9.89k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 633, False: 9.26k]
  ------------------
  363|    633|        {
  364|    633|            buffer.clear();
  365|    633|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    633|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    633|        }
  368|       |
  369|  9.26k|        const value_type* data = data_end_;
  370|  9.26k|        data_end_ += length;
  371|  9.26k|        remaining_ -= length;
  372|  9.26k|        position_ += length;
  373|  9.26k|        return span<const value_type>(data, length);
  374|  9.89k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  746|    633|    {
  747|    633|        std::size_t unread = length;
  748|       |
  749|  2.51k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 2.21k, False: 302]
  |  Branch (749:30): [True: 1.88k, False: 331]
  ------------------
  750|  1.88k|        {
  751|  1.88k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 478, False: 1.40k]
  |  Branch (751:44): [True: 476, False: 2]
  ------------------
  752|    476|            {
  753|    476|                std::size_t n = source.chunk_size();
  754|    476|                std::size_t offset = buffer.size();
  755|    476|                buffer.resize(offset+n);
  756|    476|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    476|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    476|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 57, False: 419]
  |  |  ------------------
  ------------------
  758|     57|                {
  759|     57|                    buffer.resize(offset+actual);
  760|     57|                }
  761|    476|                unread -= actual;
  762|    476|            }
  763|  1.40k|            else
  764|  1.40k|            {
  765|  1.40k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|  1.40k|                std::size_t offset = buffer.size();
  767|  1.40k|                buffer.resize(offset+n);
  768|  1.40k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|  1.40k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|  1.40k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 203, False: 1.20k]
  |  |  ------------------
  ------------------
  770|    203|                {
  771|    203|                    buffer.resize(offset + actual);
  772|    203|                }
  773|  1.40k|                unread -= actual;
  774|  1.40k|            }
  775|  1.88k|        }
  776|    633|        return length - unread;
  777|    633|    }

_ZN8jsoncons6binary16native_to_littleIjNSt3__111__wrap_iterIPhEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrS9_6littleEvE4typeET_T0_:
  142|   173k|    {
  143|   173k|        uint8_t buf[sizeof(T)];
  144|   173k|        std::memcpy(buf, &val, sizeof(T));
  145|   173k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 695k, False: 173k]
  ------------------
  146|   695k|        {
  147|   695k|            *d_first++ = item;
  148|   695k|        }
  149|   173k|    }
_ZN8jsoncons6binary16native_to_littleIlNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  41.1k|    {
  143|  41.1k|        uint8_t buf[sizeof(T)];
  144|  41.1k|        std::memcpy(buf, &val, sizeof(T));
  145|  41.1k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 329k, False: 41.1k]
  ------------------
  146|   329k|        {
  147|   329k|            *d_first++ = item;
  148|   329k|        }
  149|  41.1k|    }
_ZN8jsoncons6binary16native_to_littleIjNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  7.28k|    {
  143|  7.28k|        uint8_t buf[sizeof(T)];
  144|  7.28k|        std::memcpy(buf, &val, sizeof(T));
  145|  7.28k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 29.1k, False: 7.28k]
  ------------------
  146|  29.1k|        {
  147|  29.1k|            *d_first++ = item;
  148|  29.1k|        }
  149|  7.28k|    }
_ZN8jsoncons6binary16native_to_littleImNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|   245k|    {
  143|   245k|        uint8_t buf[sizeof(T)];
  144|   245k|        std::memcpy(buf, &val, sizeof(T));
  145|   245k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 1.96M, False: 245k]
  ------------------
  146|  1.96M|        {
  147|  1.96M|            *d_first++ = item;
  148|  1.96M|        }
  149|   245k|    }
_ZN8jsoncons6binary16native_to_littleIdNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  1.23k|    {
  143|  1.23k|        uint8_t buf[sizeof(T)];
  144|  1.23k|        std::memcpy(buf, &val, sizeof(T));
  145|  1.23k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 9.89k, False: 1.23k]
  ------------------
  146|  9.89k|        {
  147|  9.89k|            *d_first++ = item;
  148|  9.89k|        }
  149|  1.23k|    }
_ZN8jsoncons6binary16little_to_nativeIiNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   951k|    {
  198|   951k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 951k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   951k|        T val;
  203|   951k|        std::memcpy(&val,first,sizeof(T));
  204|   951k|        return val;
  205|   951k|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  1.23k|    {
  198|  1.23k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 1.23k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  1.23k|        T val;
  203|  1.23k|        std::memcpy(&val,first,sizeof(T));
  204|  1.23k|        return val;
  205|  1.23k|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   250k|    {
  198|   250k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 250k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   250k|        T val;
  203|   250k|        std::memcpy(&val,first,sizeof(T));
  204|   250k|        return val;
  205|   250k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  43.2k|    {
  198|  43.2k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 43.2k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  43.2k|        T val;
  203|  43.2k|        std::memcpy(&val,first,sizeof(T));
  204|  43.2k|        return val;
  205|  43.2k|    }

_ZNK8jsoncons16byte_string_view5beginEv:
  409|  58.9k|        {
  410|  58.9k|            return data_;
  411|  58.9k|        }
_ZNK8jsoncons16byte_string_view3endEv:
  413|  58.9k|        {
  414|  58.9k|            return data_ + size_;
  415|  58.9k|        }
_ZNK8jsoncons16byte_string_view4dataEv:
  399|  59.0k|        {
  400|  59.0k|            return data_;
  401|  59.0k|        }
_ZNK8jsoncons16byte_string_view4sizeEv:
  403|  59.0k|        {
  404|  59.0k|            return size_;
  405|  59.0k|        }
_ZN8jsoncons16byte_string_viewC2EPKhm:
  362|   118k|            : data_(data), size_(length)
  363|   118k|        {
  364|   118k|        }

_ZN8jsoncons10ext_traits14integer_limitsIivE6lowestEv:
  110|   100k|        {
  111|   100k|            return std::numeric_limits<T>::lowest();
  112|   100k|        }
_ZN8jsoncons10ext_traits14integer_limitsIivE3maxEv:
  102|  11.7k|        {
  103|  11.7k|            return (std::numeric_limits<T>::max)();
  104|  11.7k|        }

_ZN8jsoncons10to_integerIicEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  557|   113k|{
  558|   113k|    n = 0;
  559|       |
  560|   113k|    if (length == 0)
  ------------------
  |  Branch (560:9): [True: 458, False: 112k]
  ------------------
  561|    458|    {
  562|    458|        return to_number_result<CharT>(s, std::errc::invalid_argument);
  563|    458|    }
  564|       |
  565|   112k|    bool is_negative = *s == '-' ? true : false;
  ------------------
  |  Branch (565:24): [True: 100k, False: 11.7k]
  ------------------
  566|   112k|    if (is_negative)
  ------------------
  |  Branch (566:9): [True: 100k, False: 11.7k]
  ------------------
  567|   100k|    {
  568|   100k|        ++s;
  569|   100k|        --length;
  570|   100k|    }
  571|       |
  572|   112k|    using U = typename ext_traits::make_unsigned<T>::type;
  573|       |
  574|   112k|    U u;
  575|   112k|    auto ru = to_integer(s, length, u);
  576|   112k|    if (ru.ec != std::errc{})
  ------------------
  |  Branch (576:9): [True: 0, False: 112k]
  ------------------
  577|      0|    {
  578|      0|        return to_number_result<CharT>(ru.ptr, ru.ec);
  579|      0|    }
  580|   112k|    if (is_negative)
  ------------------
  |  Branch (580:9): [True: 100k, False: 11.7k]
  ------------------
  581|   100k|    {
  582|   100k|        if (u > static_cast<U>(-((ext_traits::integer_limits<T>::lowest)()+T(1))) + U(1))
  ------------------
  |  Branch (582:13): [True: 0, False: 100k]
  ------------------
  583|      0|        {
  584|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  585|      0|        }
  586|   100k|        else
  587|   100k|        {
  588|   100k|            n = static_cast<T>(U(0) - u);
  589|   100k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  590|   100k|        }
  591|   100k|    }
  592|  11.7k|    else
  593|  11.7k|    {
  594|  11.7k|        if (u > static_cast<U>((ext_traits::integer_limits<T>::max)()))
  ------------------
  |  Branch (594:13): [True: 0, False: 11.7k]
  ------------------
  595|      0|        {
  596|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  597|      0|        }
  598|  11.7k|        else
  599|  11.7k|        {
  600|  11.7k|            n = static_cast<T>(u);
  601|  11.7k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  602|  11.7k|        }
  603|  11.7k|    }
  604|   112k|}
_ZN8jsoncons16to_number_resultIcEC2EPKcNSt3__14errcE:
  141|   225k|        : ptr(ptr_), ec(ec_)
  142|   225k|    {
  143|   225k|    }
_ZN8jsoncons10to_integerIjcEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedntsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  374|   112k|{
  375|   112k|    n = 0;
  376|       |
  377|   112k|    integer_chars_state state = integer_chars_state::initial;
  378|       |
  379|   112k|    const CharT* end = s + length; 
  380|   337k|    while (s < end)
  ------------------
  |  Branch (380:12): [True: 225k, False: 112k]
  ------------------
  381|   225k|    {
  382|   225k|        switch(state)
  383|   225k|        {
  384|   112k|            case integer_chars_state::initial:
  ------------------
  |  Branch (384:13): [True: 112k, False: 112k]
  ------------------
  385|   112k|            {
  386|   112k|                switch(*s)
  387|   112k|                {
  388|      0|                    case '0':
  ------------------
  |  Branch (388:21): [True: 0, False: 112k]
  ------------------
  389|      0|                        state = integer_chars_state::integer; // Could be binary, octal, hex 
  390|      0|                        ++s;
  391|      0|                        break;
  392|   112k|                    case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9': // Must be decimal
  ------------------
  |  Branch (392:21): [True: 644, False: 111k]
  |  Branch (392:30): [True: 1.31k, False: 111k]
  |  Branch (392:39): [True: 88.1k, False: 24.4k]
  |  Branch (392:48): [True: 6.40k, False: 106k]
  |  Branch (392:57): [True: 4.04k, False: 108k]
  |  Branch (392:66): [True: 3.66k, False: 108k]
  |  Branch (392:75): [True: 6.89k, False: 105k]
  |  Branch (392:84): [True: 829, False: 111k]
  |  Branch (392:94): [True: 671, False: 111k]
  ------------------
  393|   112k|                        state = integer_chars_state::decimal;
  394|   112k|                        break;
  395|      0|                    default:
  ------------------
  |  Branch (395:21): [True: 0, False: 112k]
  ------------------
  396|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  397|   112k|                }
  398|   112k|                break;
  399|   112k|            }
  400|   112k|            case integer_chars_state::integer:
  ------------------
  |  Branch (400:13): [True: 0, False: 225k]
  ------------------
  401|      0|            {
  402|      0|                switch(*s)
  403|      0|                {
  404|      0|                    case 'b':case 'B':
  ------------------
  |  Branch (404:21): [True: 0, False: 0]
  |  Branch (404:30): [True: 0, False: 0]
  ------------------
  405|      0|                    {
  406|      0|                        state = integer_chars_state::binary;
  407|      0|                        ++s;
  408|      0|                        break;
  409|      0|                    }
  410|      0|                    case 'x':case 'X':
  ------------------
  |  Branch (410:21): [True: 0, False: 0]
  |  Branch (410:30): [True: 0, False: 0]
  ------------------
  411|      0|                    {
  412|      0|                        state = integer_chars_state::base16;
  413|      0|                        ++s;
  414|      0|                        break;
  415|      0|                    }
  416|      0|                    case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (416:21): [True: 0, False: 0]
  |  Branch (416:30): [True: 0, False: 0]
  |  Branch (416:39): [True: 0, False: 0]
  |  Branch (416:48): [True: 0, False: 0]
  |  Branch (416:57): [True: 0, False: 0]
  |  Branch (416:66): [True: 0, False: 0]
  |  Branch (416:75): [True: 0, False: 0]
  |  Branch (416:84): [True: 0, False: 0]
  |  Branch (416:93): [True: 0, False: 0]
  |  Branch (416:103): [True: 0, False: 0]
  ------------------
  417|      0|                    {
  418|      0|                        state = integer_chars_state::octal;
  419|      0|                        break;
  420|      0|                    }
  421|      0|                    default:
  ------------------
  |  Branch (421:21): [True: 0, False: 0]
  ------------------
  422|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  423|      0|                }
  424|      0|                break;
  425|      0|            }
  426|      0|            case integer_chars_state::binary:
  ------------------
  |  Branch (426:13): [True: 0, False: 225k]
  ------------------
  427|      0|            {
  428|      0|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  429|      0|                static constexpr T max_value_div_2 = max_value / 2;
  430|      0|                for (; s < end; ++s)
  ------------------
  |  Branch (430:24): [True: 0, False: 0]
  ------------------
  431|      0|                {
  432|      0|                    T x = 0;
  433|      0|                    switch(*s)
  434|      0|                    {
  435|      0|                        case '0':case '1':
  ------------------
  |  Branch (435:25): [True: 0, False: 0]
  |  Branch (435:34): [True: 0, False: 0]
  ------------------
  436|      0|                            x = static_cast<T>(*s) - static_cast<T>('0');
  437|      0|                            break;
  438|      0|                        default:
  ------------------
  |  Branch (438:25): [True: 0, False: 0]
  ------------------
  439|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  440|      0|                    }
  441|      0|                    if (n > max_value_div_2)
  ------------------
  |  Branch (441:25): [True: 0, False: 0]
  ------------------
  442|      0|                    {
  443|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  444|      0|                    }
  445|      0|                    n = n * 2;
  446|      0|                    if (n > max_value - x)
  ------------------
  |  Branch (446:25): [True: 0, False: 0]
  ------------------
  447|      0|                    {
  448|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  449|      0|                    }
  450|      0|                    n += x;
  451|      0|                }
  452|      0|                break;
  453|      0|            }
  454|      0|            case integer_chars_state::octal:
  ------------------
  |  Branch (454:13): [True: 0, False: 225k]
  ------------------
  455|      0|            {
  456|      0|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  457|      0|                static constexpr T max_value_div_8 = max_value / 8;
  458|      0|                for (; s < end; ++s)
  ------------------
  |  Branch (458:24): [True: 0, False: 0]
  ------------------
  459|      0|                {
  460|      0|                    T x = 0;
  461|      0|                    switch(*s)
  462|      0|                    {
  463|      0|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':
  ------------------
  |  Branch (463:25): [True: 0, False: 0]
  |  Branch (463:34): [True: 0, False: 0]
  |  Branch (463:43): [True: 0, False: 0]
  |  Branch (463:52): [True: 0, False: 0]
  |  Branch (463:61): [True: 0, False: 0]
  |  Branch (463:70): [True: 0, False: 0]
  |  Branch (463:79): [True: 0, False: 0]
  |  Branch (463:88): [True: 0, False: 0]
  ------------------
  464|      0|                            x = static_cast<T>(*s) - static_cast<T>('0');
  465|      0|                            break;
  466|      0|                        default:
  ------------------
  |  Branch (466:25): [True: 0, False: 0]
  ------------------
  467|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  468|      0|                    }
  469|      0|                    if (n > max_value_div_8)
  ------------------
  |  Branch (469:25): [True: 0, False: 0]
  ------------------
  470|      0|                    {
  471|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  472|      0|                    }
  473|      0|                    n = n * 8;
  474|      0|                    if (n > max_value - x)
  ------------------
  |  Branch (474:25): [True: 0, False: 0]
  ------------------
  475|      0|                    {
  476|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  477|      0|                    }
  478|      0|                    n += x;
  479|      0|                }
  480|      0|                break;
  481|      0|            }
  482|   112k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (482:13): [True: 112k, False: 112k]
  ------------------
  483|   112k|            {
  484|   112k|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  485|   112k|                static constexpr T max_value_div_10 = max_value / 10;
  486|   539k|                for (; s < end; ++s)
  ------------------
  |  Branch (486:24): [True: 426k, False: 112k]
  ------------------
  487|   426k|                {
  488|   426k|                    T x = 0;
  489|   426k|                    switch(*s)
  490|   426k|                    {
  491|   426k|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (491:25): [True: 65.4k, False: 361k]
  |  Branch (491:34): [True: 28.9k, False: 397k]
  |  Branch (491:43): [True: 66.4k, False: 360k]
  |  Branch (491:52): [True: 113k, False: 313k]
  |  Branch (491:61): [True: 14.0k, False: 412k]
  |  Branch (491:70): [True: 12.3k, False: 414k]
  |  Branch (491:79): [True: 10.2k, False: 416k]
  |  Branch (491:88): [True: 76.8k, False: 350k]
  |  Branch (491:97): [True: 31.4k, False: 395k]
  |  Branch (491:107): [True: 7.81k, False: 419k]
  ------------------
  492|   426k|                            x = static_cast<T>(*s) - static_cast<T>('0');
  493|   426k|                            break;
  494|      0|                        default:
  ------------------
  |  Branch (494:25): [True: 0, False: 426k]
  ------------------
  495|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  496|   426k|                    }
  497|   426k|                    if (n > max_value_div_10)
  ------------------
  |  Branch (497:25): [True: 0, False: 426k]
  ------------------
  498|      0|                    {
  499|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  500|      0|                    }
  501|   426k|                    n = n * 10;
  502|   426k|                    if (n > max_value - x)
  ------------------
  |  Branch (502:25): [True: 0, False: 426k]
  ------------------
  503|      0|                    {
  504|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  505|      0|                    }
  506|   426k|                    n += x;
  507|   426k|                }
  508|   112k|                break;
  509|   112k|            }
  510|   112k|            case integer_chars_state::base16:
  ------------------
  |  Branch (510:13): [True: 0, False: 225k]
  ------------------
  511|      0|            {
  512|      0|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  513|      0|                static constexpr T max_value_div_16 = max_value / 16;
  514|      0|                for (; s < end; ++s)
  ------------------
  |  Branch (514:24): [True: 0, False: 0]
  ------------------
  515|      0|                {
  516|      0|                    CharT c = *s;
  517|      0|                    T x = 0;
  518|      0|                    switch (c)
  519|      0|                    {
  520|      0|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (520:25): [True: 0, False: 0]
  |  Branch (520:34): [True: 0, False: 0]
  |  Branch (520:43): [True: 0, False: 0]
  |  Branch (520:52): [True: 0, False: 0]
  |  Branch (520:61): [True: 0, False: 0]
  |  Branch (520:70): [True: 0, False: 0]
  |  Branch (520:79): [True: 0, False: 0]
  |  Branch (520:88): [True: 0, False: 0]
  |  Branch (520:97): [True: 0, False: 0]
  |  Branch (520:107): [True: 0, False: 0]
  ------------------
  521|      0|                            x = static_cast<T>(c - '0');
  522|      0|                            break;
  523|      0|                        case 'a':case 'b':case 'c':case 'd':case 'e':case 'f':
  ------------------
  |  Branch (523:25): [True: 0, False: 0]
  |  Branch (523:34): [True: 0, False: 0]
  |  Branch (523:43): [True: 0, False: 0]
  |  Branch (523:52): [True: 0, False: 0]
  |  Branch (523:61): [True: 0, False: 0]
  |  Branch (523:70): [True: 0, False: 0]
  ------------------
  524|      0|                            x = static_cast<T>(c - ('a' - 10));
  525|      0|                            break;
  526|      0|                        case 'A':case 'B':case 'C':case 'D':case 'E':case 'F':
  ------------------
  |  Branch (526:25): [True: 0, False: 0]
  |  Branch (526:34): [True: 0, False: 0]
  |  Branch (526:43): [True: 0, False: 0]
  |  Branch (526:52): [True: 0, False: 0]
  |  Branch (526:61): [True: 0, False: 0]
  |  Branch (526:70): [True: 0, False: 0]
  ------------------
  527|      0|                            x = static_cast<T>(c - ('A' - 10));
  528|      0|                            break;
  529|      0|                        default:
  ------------------
  |  Branch (529:25): [True: 0, False: 0]
  ------------------
  530|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  531|      0|                    }
  532|      0|                    if (n > max_value_div_16)
  ------------------
  |  Branch (532:25): [True: 0, False: 0]
  ------------------
  533|      0|                    {
  534|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  535|      0|                    }
  536|      0|                    n = n * 16;
  537|      0|                    if (n > max_value - x)
  ------------------
  |  Branch (537:25): [True: 0, False: 0]
  ------------------
  538|      0|                    {
  539|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  540|      0|                    }
  541|       |
  542|      0|                    n += x;
  543|      0|                }
  544|      0|                break;
  545|      0|            }
  546|      0|            default:
  ------------------
  |  Branch (546:13): [True: 0, False: 225k]
  ------------------
  547|      0|                JSONCONS_UNREACHABLE();
  ------------------
  |  |   79|      0|#define JSONCONS_UNREACHABLE() __builtin_unreachable()
  ------------------
  548|      0|                break;
  549|   225k|        }
  550|   225k|    }
  551|   112k|    return (state == integer_chars_state::initial) ? to_number_result<CharT>(s, std::errc::invalid_argument) : to_number_result<CharT>(s, std::errc{});
  ------------------
  |  Branch (551:12): [True: 0, False: 112k]
  ------------------
  552|   112k|}

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|   509k|    {
 1148|   509k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|   509k|        const uint8_t* end = it + length;
 1150|       |
 1151|   509k|        unicode_errc  result{};
 1152|  1.36M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 855k, False: 508k]
  ------------------
 1153|   855k|        {
 1154|   855k|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 646k, False: 208k]
  ------------------
 1155|   646k|            {
 1156|  4.47M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  281|  1.29M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (281:32): [True: 644k, False: 1.97k]
  |  |  |  Branch (281:34): [True: 642k, False: 1.82k]
  |  |  |  Branch (281:36): [True: 640k, False: 2.05k]
  |  |  |  Branch (281:38): [True: 638k, False: 2.20k]
  |  |  |  Branch (281:40): [True: 637k, False: 1.40k]
  |  |  |  Branch (281:42): [True: 636k, False: 679]
  |  |  |  Branch (281:44): [True: 634k, False: 1.78k]
  |  |  |  Branch (281:46): [True: 633k, False: 1.15k]
  |  |  ------------------
  ------------------
 1157|   633k|                continue;
 1158|  4.47M|            }
 1159|   221k|    non_ascii:
 1160|   221k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|   221k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 34, False: 221k]
  ------------------
 1162|     34|            {
 1163|     34|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     34|            }
 1165|   221k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 147, False: 221k]
  ------------------
 1166|    147|            {
 1167|    147|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    147|            }
 1169|   221k|            it += len;
 1170|   221k|        }
 1171|   508k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|   509k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|   221k|    {
  306|   221k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|   221k|        const uint8_t* end = it+length;
  308|       |
  309|   221k|        uint8_t byte;
  310|   221k|        switch (length) {
  311|     33|        default:
  ------------------
  |  Branch (311:9): [True: 33, False: 221k]
  ------------------
  312|     33|            return unicode_errc::over_long_utf8_sequence;
  313|  1.21k|        case 4:
  ------------------
  |  Branch (313:9): [True: 1.21k, False: 220k]
  ------------------
  314|  1.21k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 9, False: 1.20k]
  ------------------
  315|      9|                return unicode_errc::bad_continuation_byte;
  316|  1.20k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.20k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  6.90k|        case 3:
  ------------------
  |  Branch (317:9): [True: 5.70k, False: 216k]
  ------------------
  318|  6.90k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 12, False: 6.89k]
  ------------------
  319|     12|                return unicode_errc::bad_continuation_byte;
  320|  6.89k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  6.89k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  13.3k|        case 2:
  ------------------
  |  Branch (321:9): [True: 6.50k, False: 215k]
  ------------------
  322|  13.3k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 27, False: 13.3k]
  ------------------
  323|     27|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  13.3k|            switch (*it) 
  326|  13.3k|            {
  327|       |                // no fall-through in this inner switch
  328|  2.98k|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 2.98k, False: 10.3k]
  |  Branch (328:32): [True: 6, False: 2.98k]
  ------------------
  329|  2.98k|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 253, False: 13.1k]
  |  Branch (329:32): [True: 3, False: 250]
  ------------------
  330|    326|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 326, False: 13.0k]
  |  Branch (330:32): [True: 6, False: 320]
  ------------------
  331|    499|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 499, False: 12.8k]
  |  Branch (331:32): [True: 3, False: 496]
  ------------------
  332|  9.30k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 9.30k, False: 4.06k]
  |  Branch (332:32): [True: 0, False: 9.30k]
  ------------------
  333|  13.3k|            }
  334|       |
  335|  13.3k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  13.3k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|   221k|        case 1:
  ------------------
  |  Branch (336:9): [True: 208k, False: 13.4k]
  ------------------
  337|   221k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 13.3k, False: 208k]
  |  Branch (337:32): [True: 46, False: 13.3k]
  ------------------
  338|     46|                return unicode_errc::source_illegal;
  339|   221k|            break;
  340|   221k|        }
  341|   221k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 2, False: 221k]
  ------------------
  342|      2|            return unicode_errc::source_illegal;
  343|       |
  344|   221k|        return unicode_errc();
  345|   221k|    }

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

_ZN8jsoncons4bson3TP1C2Ev:
   78|   245k|        constexpr TP1() : low(0), high(0) {}
_ZN8jsoncons4bson21decimal128_from_charsEPKcS2_RNS0_3TP1E:
  572|   122k|    {
  573|   122k|        static const string_view inf_str = "inf";
  574|   122k|        static const string_view infinity_str = "infinity";
  575|   122k|        static const string_view nan_str = "nan";
  576|       |
  577|   122k|        ptrdiff_t len = last - first;
  578|       |
  579|   122k|        bson_uint128_6464_t significand = {0,0};
  580|       | 
  581|   122k|        const char* str_read = first; /* Read pointer for consuming str. */
  582|       | 
  583|       |        /* Parsing state tracking */
  584|   122k|        bool is_negative = false;
  585|   122k|        bool saw_radix = false;
  586|   122k|        bool includes_sign = false; /* True if the input first contains a sign. */
  587|   122k|        bool found_nonzero = false;
  588|       | 
  589|   122k|        std::size_t significant_digits = 0; /* Total number of significant digits
  590|       |                                        * (no leading or trailing zero) */
  591|   122k|        std::size_t ndigits_read = 0;       /* Total number of significand digits read */
  592|   122k|        std::size_t ndigits = 0;        /* Total number of digits (no leading zeros) */
  593|   122k|        std::size_t radix_position = 0; /* The number of the digits after radix */
  594|   122k|        std::size_t first_nonzero = 0;  /* The index of the first non-zero in *str* */
  595|       | 
  596|   122k|        uint16_t digits[decimal128_limits::max_digits] = {0};
  597|   122k|        uint16_t ndigits_stored = 0;      /* The number of digits in digits */
  598|   122k|        uint16_t *digits_insert = digits; /* Insertion pointer for digits */
  599|   122k|        std::size_t first_digit = 0;           /* The index of the first non-zero digit */
  600|   122k|        std::size_t last_digit = 0;            /* The index of the last digit */
  601|       | 
  602|   122k|        int32_t exponent = 0;
  603|   122k|        uint64_t significand_high = 0; /* The high 17 digits of the significand */
  604|   122k|        uint64_t significand_low = 0;  /* The low 17 digits of the significand */
  605|   122k|        uint16_t biased_exponent = 0;  /* The biased exponent */
  606|       | 
  607|   122k|        dec.high = 0;
  608|   122k|        dec.low = 0;
  609|       | 
  610|   122k|        if (*str_read == '+' || *str_read == '-') {
  ------------------
  |  Branch (610:13): [True: 0, False: 122k]
  |  Branch (610:33): [True: 13.5k, False: 109k]
  ------------------
  611|  13.5k|           is_negative = *(str_read++) == '-';
  612|  13.5k|           includes_sign = true;
  613|  13.5k|        }
  614|       |
  615|       |        /* Check for Infinity or NaN */
  616|   122k|        if (!isdigit(*str_read) && *str_read != '.') {
  ------------------
  |  Branch (616:13): [True: 5.78k, False: 117k]
  |  Branch (616:36): [True: 5.78k, False: 0]
  ------------------
  617|  5.78k|           if (detail::dec128_istreq (str_read, last, inf_str.data(), inf_str.data()+inf_str.length()) ||
  ------------------
  |  Branch (617:16): [True: 0, False: 5.78k]
  ------------------
  618|  5.78k|               detail::dec128_istreq (str_read, last, infinity_str.data(), infinity_str.data()+infinity_str.length())) 
  ------------------
  |  Branch (618:16): [True: 4.49k, False: 1.28k]
  ------------------
  619|  4.49k|           {
  620|  4.49k|               dec = is_negative ? decimal128_limits::neg_infinity() : decimal128_limits::infinity();
  ------------------
  |  Branch (620:22): [True: 3.93k, False: 562]
  ------------------
  621|  4.49k|              return decimal128_from_chars_result{str_read,std::errc{}};
  622|  4.49k|           } else if (detail::dec128_istreq (str_read, last, nan_str.data(), nan_str.data()+nan_str.length())) {
  ------------------
  |  Branch (622:23): [True: 1.28k, False: 0]
  ------------------
  623|  1.28k|              dec = decimal128_limits::nan();
  624|  1.28k|              return decimal128_from_chars_result{str_read,std::errc{}};
  625|  1.28k|           }
  626|       | 
  627|      0|           dec = decimal128_limits::nan();
  628|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  629|  5.78k|        }
  630|       | 
  631|       |        /* Read digits */
  632|  3.81M|        while (((isdigit (*str_read) || *str_read == '.')) &&
  ------------------
  |  Branch (632:18): [True: 3.59M, False: 225k]
  |  Branch (632:41): [True: 108k, False: 117k]
  ------------------
  633|  3.70M|               (len == -1 || str_read < first + len)) {
  ------------------
  |  Branch (633:17): [True: 0, False: 3.70M]
  |  Branch (633:30): [True: 3.70M, False: 0]
  ------------------
  634|  3.70M|           if (*str_read == '.') {
  ------------------
  |  Branch (634:16): [True: 108k, False: 3.59M]
  ------------------
  635|   108k|              if (saw_radix) {
  ------------------
  |  Branch (635:19): [True: 0, False: 108k]
  ------------------
  636|      0|                 dec = decimal128_limits::nan();
  637|      0|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  638|      0|              }
  639|       | 
  640|   108k|              saw_radix = true;
  641|   108k|              str_read++;
  642|   108k|              continue;
  643|   108k|           }
  644|       | 
  645|  3.59M|           if (ndigits_stored < 34) {
  ------------------
  |  Branch (645:16): [True: 3.59M, False: 1.85k]
  ------------------
  646|  3.59M|              if (*str_read != '0' || found_nonzero) {
  ------------------
  |  Branch (646:19): [True: 3.24M, False: 341k]
  |  Branch (646:39): [True: 330k, False: 11.6k]
  ------------------
  647|  3.57M|                 if (!found_nonzero) {
  ------------------
  |  Branch (647:22): [True: 108k, False: 3.47M]
  ------------------
  648|   108k|                    first_nonzero = ndigits_read;
  649|   108k|                 }
  650|       | 
  651|  3.57M|                 found_nonzero = true;
  652|  3.57M|                 *(digits_insert++) = *(str_read) - '0'; /* Only store 34 digits */
  653|  3.57M|                 ndigits_stored++;
  654|  3.57M|              }
  655|  3.59M|           }
  656|       | 
  657|  3.59M|           if (found_nonzero) {
  ------------------
  |  Branch (657:16): [True: 3.58M, False: 11.6k]
  ------------------
  658|  3.58M|              ndigits++;
  659|  3.58M|           }
  660|       | 
  661|  3.59M|           if (saw_radix) {
  ------------------
  |  Branch (661:16): [True: 3.45M, False: 135k]
  ------------------
  662|  3.45M|              radix_position++;
  663|  3.45M|           }
  664|       | 
  665|  3.59M|           ndigits_read++;
  666|  3.59M|           str_read++;
  667|  3.59M|        }
  668|       | 
  669|   117k|        if (saw_radix && !ndigits_read) {
  ------------------
  |  Branch (669:13): [True: 108k, False: 8.97k]
  |  Branch (669:26): [True: 0, False: 108k]
  ------------------
  670|      0|           dec = decimal128_limits::nan();
  671|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  672|      0|        }
  673|       | 
  674|       |        /* Read exponent if exists */
  675|   117k|        if (*str_read == 'e' || *str_read == 'E') {
  ------------------
  |  Branch (675:13): [True: 0, False: 117k]
  |  Branch (675:33): [True: 113k, False: 4.02k]
  ------------------
  676|   113k|           ++str_read;
  677|   113k|           if (*str_read == '+') {
  ------------------
  |  Branch (677:16): [True: 11.7k, False: 101k]
  ------------------
  678|  11.7k|               ++str_read;
  679|  11.7k|           }
  680|   113k|           auto result = jsoncons::to_integer(str_read, last - str_read, exponent);
  681|   113k|           if (result.ec != std::errc{}) 
  ------------------
  |  Branch (681:16): [True: 458, False: 112k]
  ------------------
  682|    458|           {
  683|    458|               dec = decimal128_limits::nan();
  684|    458|               return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  685|    458|           }
  686|   112k|           str_read = result.ptr;
  687|   112k|        }
  688|       |
  689|   116k|        if ((len == -1 || str_read < first + len) && *str_read) {
  ------------------
  |  Branch (689:14): [True: 0, False: 116k]
  |  Branch (689:27): [True: 0, False: 116k]
  |  Branch (689:54): [True: 0, False: 0]
  ------------------
  690|      0|           dec = decimal128_limits::nan();
  691|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  692|      0|        }
  693|       | 
  694|       |        /* Done reading input. */
  695|       |        /* Find first non-zero digit in digits */
  696|   116k|        first_digit = 0;
  697|       | 
  698|   116k|        if (!ndigits_stored) { /* value is zero */
  ------------------
  |  Branch (698:13): [True: 8.44k, False: 108k]
  ------------------
  699|  8.44k|           first_digit = 0;
  700|  8.44k|           last_digit = 0;
  701|  8.44k|           digits[0] = 0;
  702|  8.44k|           ndigits = 1;
  703|  8.44k|           ndigits_stored = 1;
  704|  8.44k|           significant_digits = 0;
  705|   108k|        } else {
  706|   108k|           last_digit = ndigits_stored - 1;
  707|   108k|           significant_digits = ndigits;
  708|       |           /* Mark trailing zeros as non-significant */
  709|   127k|           while (first[first_nonzero + significant_digits - 1 + includes_sign +
  ------------------
  |  Branch (709:19): [True: 18.9k, False: 108k]
  ------------------
  710|   127k|                         saw_radix] == '0') {
  711|  18.9k|              significant_digits--;
  712|  18.9k|           }
  713|   108k|        }
  714|       | 
  715|       | 
  716|       |        /* Normalization of exponent */
  717|       |        /* Correct exponent based on radix position, and shift significand as needed
  718|       |         */
  719|       |        /* to represent user input */
  720|       | 
  721|       |        /* Overflow prevention */
  722|   116k|        if (exponent <= static_cast<int32_t>(radix_position) && static_cast<int32_t>(radix_position) - exponent > (1 << 14)) {
  ------------------
  |  Branch (722:13): [True: 104k, False: 11.7k]
  |  Branch (722:65): [True: 0, False: 104k]
  ------------------
  723|      0|           exponent = decimal128_limits::exponent_min;
  724|   116k|        } else {
  725|   116k|           exponent -= static_cast<int32_t>(radix_position);
  726|   116k|        }
  727|       | 
  728|       |        /* Attempt to normalize the exponent */
  729|   116k|        while (exponent > decimal128_limits::exponent_max) {
  ------------------
  |  Branch (729:16): [True: 0, False: 116k]
  ------------------
  730|       |           /* Shift exponent to significand and decrease */
  731|      0|           last_digit++;
  732|       | 
  733|      0|           if (last_digit - first_digit > decimal128_limits::max_digits) {
  ------------------
  |  Branch (733:16): [True: 0, False: 0]
  ------------------
  734|       |              /* The exponent is too great to shift into the significand. */
  735|      0|              if (significant_digits == 0) {
  ------------------
  |  Branch (735:19): [True: 0, False: 0]
  ------------------
  736|       |                 /* Value is zero, we are allowed to clamp the exponent. */
  737|      0|                 exponent = decimal128_limits::exponent_max;
  738|      0|                 break;
  739|      0|              }
  740|       | 
  741|       |              /* Overflow is not permitted, error. */
  742|      0|              dec = decimal128_limits::nan();
  743|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  744|      0|           }
  745|       | 
  746|      0|           exponent--;
  747|      0|        }
  748|       | 
  749|   117k|        while (exponent < decimal128_limits::exponent_min || ndigits_stored < ndigits) {
  ------------------
  |  Branch (749:16): [True: 0, False: 117k]
  |  Branch (749:62): [True: 1.65k, False: 116k]
  ------------------
  750|       |           /* Shift last digit */
  751|  1.65k|           if (last_digit == 0) {
  ------------------
  |  Branch (751:16): [True: 0, False: 1.65k]
  ------------------
  752|       |              /* underflow is not allowed, but zero clamping is */
  753|      0|              if (significant_digits == 0) {
  ------------------
  |  Branch (753:19): [True: 0, False: 0]
  ------------------
  754|      0|                 exponent = decimal128_limits::exponent_min;
  755|      0|                 break;
  756|      0|              }
  757|       | 
  758|      0|              dec = decimal128_limits::nan();
  759|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  760|      0|           }
  761|       | 
  762|  1.65k|           if (ndigits_stored < ndigits) {
  ------------------
  |  Branch (762:16): [True: 1.65k, False: 0]
  ------------------
  763|  1.65k|              if (first[ndigits - 1 + includes_sign + saw_radix] - '0' != 0 &&
  ------------------
  |  Branch (763:19): [True: 371, False: 1.28k]
  ------------------
  764|    371|                  significant_digits != 0) {
  ------------------
  |  Branch (764:19): [True: 371, False: 0]
  ------------------
  765|    371|                 dec = decimal128_limits::nan();
  766|    371|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  767|    371|              }
  768|       | 
  769|  1.28k|              ndigits--; /* adjust to match digits not stored */
  770|  1.28k|           } else {
  771|      0|              if (digits[last_digit] != 0) {
  ------------------
  |  Branch (771:19): [True: 0, False: 0]
  ------------------
  772|       |                 /* Inexact rounding is not allowed. */
  773|      0|                 dec = decimal128_limits::nan();
  774|      0|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  775|      0|              }
  776|       | 
  777|       | 
  778|      0|              last_digit--; /* adjust to round */
  779|      0|           }
  780|       | 
  781|  1.28k|           if (exponent < decimal128_limits::exponent_max) {
  ------------------
  |  Branch (781:16): [True: 1.28k, False: 0]
  ------------------
  782|  1.28k|              exponent++;
  783|  1.28k|           } else {
  784|      0|              dec = decimal128_limits::nan();
  785|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  786|      0|           }
  787|  1.28k|        }
  788|       | 
  789|       |        /* Round */
  790|       |        /* We've normalized the exponent, but might still need to round. */
  791|   116k|        if (last_digit - first_digit + 1 < significant_digits) {
  ------------------
  |  Branch (791:13): [True: 268, False: 115k]
  ------------------
  792|    268|           uint8_t round_digit;
  793|       | 
  794|       |           /* There are non-zero digits after last_digit that need rounding. */
  795|       |           /* We round to nearest, ties to even */
  796|    268|           round_digit =
  797|    268|              first[first_nonzero + last_digit + includes_sign + saw_radix + 1] -
  798|    268|              '0';
  799|       | 
  800|    268|           if (round_digit != 0) {
  ------------------
  |  Branch (800:16): [True: 268, False: 0]
  ------------------
  801|       |              /* Inexact (non-zero) rounding is not allowed */
  802|    268|              dec = decimal128_limits::nan();
  803|    268|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  804|    268|           }
  805|    268|        }
  806|       | 
  807|       |        /* Encode significand */
  808|   115k|        significand_high = 0,   /* The high 17 digits of the significand */
  809|   115k|           significand_low = 0; /* The low 17 digits of the significand */
  810|       | 
  811|   115k|        if (significant_digits == 0) { /* read a zero */
  ------------------
  |  Branch (811:13): [True: 8.44k, False: 107k]
  ------------------
  812|  8.44k|           significand_high = 0;
  813|  8.44k|           significand_low = 0;
  814|   107k|        } else if (last_digit - first_digit < 17) {
  ------------------
  |  Branch (814:20): [True: 1.47k, False: 106k]
  ------------------
  815|  1.47k|           std::size_t d_idx = first_digit;
  816|  1.47k|           significand_low = digits[d_idx++];
  817|       | 
  818|  9.07k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (818:19): [True: 7.60k, False: 1.47k]
  ------------------
  819|  7.60k|              significand_low *= 10;
  820|  7.60k|              significand_low += digits[d_idx];
  821|  7.60k|              significand_high = 0;
  822|  7.60k|           }
  823|   106k|        } else {
  824|   106k|           std::size_t d_idx = first_digit;
  825|   106k|           significand_high = digits[d_idx++];
  826|       | 
  827|  1.72M|           for (; d_idx <= last_digit - 17; d_idx++) {
  ------------------
  |  Branch (827:19): [True: 1.62M, False: 106k]
  ------------------
  828|  1.62M|              significand_high *= 10;
  829|  1.62M|              significand_high += digits[d_idx];
  830|  1.62M|           }
  831|       | 
  832|   106k|           significand_low = digits[d_idx++];
  833|       | 
  834|  1.80M|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (834:19): [True: 1.69M, False: 106k]
  ------------------
  835|  1.69M|              significand_low *= 10;
  836|  1.69M|              significand_low += digits[d_idx];
  837|  1.69M|           }
  838|   106k|        }
  839|       | 
  840|   115k|        detail::mul_64x64 (significand_high, 100000000000000000ull, &significand);
  841|   115k|        significand.low += significand_low;
  842|       | 
  843|   115k|        if (significand.low < significand_low) {
  ------------------
  |  Branch (843:13): [True: 14.7k, False: 101k]
  ------------------
  844|  14.7k|           significand.high += 1;
  845|  14.7k|        }
  846|       | 
  847|       | 
  848|   115k|        biased_exponent = static_cast<uint16_t>(exponent + static_cast<int32_t>(decimal128_limits::exponent_bias));
  849|       | 
  850|       |        /* Encode combination, exponent, and significand. */
  851|   115k|        if ((significand.high >> 49) & 1) {
  ------------------
  |  Branch (851:13): [True: 0, False: 115k]
  ------------------
  852|       |           /* Encode '11' into bits 1 to 3 */
  853|      0|           dec.high |= (0x3ull << 61);
  854|      0|           dec.high |= (biased_exponent & 0x3fffull) << 47;
  855|      0|           dec.high |= significand.high & 0x7fffffffffffull;
  856|   115k|        } else {
  857|   115k|           dec.high |= (biased_exponent & 0x3fffull) << 49;
  858|   115k|           dec.high |= significand.high & 0x1ffffffffffffull;
  859|   115k|        }
  860|       | 
  861|   115k|        dec.low = significand.low;
  862|       | 
  863|       |        /* Encode sign */
  864|   115k|        if (is_negative) {
  ------------------
  |  Branch (864:13): [True: 9.14k, False: 106k]
  ------------------
  865|  9.14k|           dec.high |= 0x8000000000000000ull;
  866|  9.14k|        }
  867|       | 
  868|   115k|        return decimal128_from_chars_result{str_read,std::errc{}};
  869|   116k|    }
_ZN8jsoncons4bson6detail13dec128_istreqEPKcS3_S3_S3_:
  289|  12.8k|        {
  290|  66.1k|            while (!(a == lasta && b == lastb)) 
  ------------------
  |  Branch (290:22): [True: 5.78k, False: 60.3k]
  |  Branch (290:36): [True: 5.78k, False: 0]
  ------------------
  291|  60.3k|            {
  292|       |               // strings are different lengths
  293|  60.3k|               if (a == lasta || b == lastb) 
  ------------------
  |  Branch (293:20): [True: 0, False: 60.3k]
  |  Branch (293:34): [True: 4.49k, False: 55.8k]
  ------------------
  294|  4.49k|               {
  295|  4.49k|                  return false;
  296|  4.49k|               }
  297|       |         
  298|  55.8k|               if (dec128_tolower (*a) != dec128_tolower (*b)) {
  ------------------
  |  Branch (298:20): [True: 2.57k, False: 53.2k]
  ------------------
  299|  2.57k|                  return false;
  300|  2.57k|               }
  301|       |         
  302|  53.2k|               a++;
  303|  53.2k|               b++;
  304|  53.2k|            }
  305|       |         
  306|  5.78k|            return true;
  307|  12.8k|        }
_ZN8jsoncons4bson6detail14dec128_tolowerEc:
  266|   111k|        {
  267|   111k|           if (isupper (c)) {
  ------------------
  |  Branch (267:16): [True: 14.1k, False: 97.6k]
  ------------------
  268|  14.1k|              c += 32;
  269|  14.1k|           }
  270|       |
  271|   111k|           return c;
  272|   111k|        }
_ZN8jsoncons4bson17decimal128_limits12neg_infinityEv:
  124|  3.93k|        static constexpr decimal128_t neg_infinity() {return decimal128_t(0x7800000000000000ull + 0x8000000000000000ull, 0);}
_ZN8jsoncons4bson3TP1C2Emm:
   79|  6.87k|        constexpr TP1(uint64_t hi, uint64_t lo) : low(lo), high(hi) {}
_ZN8jsoncons4bson17decimal128_limits8infinityEv:
  123|    562|        static constexpr decimal128_t infinity() {return decimal128_t(0x7800000000000000ull, 0);}
_ZN8jsoncons4bson17decimal128_limits3nanEv:
  122|  2.38k|        static constexpr decimal128_t nan() {return decimal128_t(0x7c00000000000000ull, 0);}
_ZN8jsoncons4bson6detail9mul_64x64EmmPNS0_19bson_uint128_6464_tE:
  221|   115k|        {
  222|   115k|            uint64_t left_high, left_low, right_high, right_low, product_high,
  223|   115k|               product_mid, product_mid2, product_low;
  224|   115k|            bson_uint128_6464_t rt = {0,0};
  225|       | 
  226|   115k|            if (!left && !right) {
  ------------------
  |  Branch (226:17): [True: 9.91k, False: 106k]
  |  Branch (226:26): [True: 0, False: 9.91k]
  ------------------
  227|      0|               *product = rt;
  228|      0|               return;
  229|      0|            }
  230|       | 
  231|   115k|            left_high = left >> 32;
  232|   115k|            left_low = (uint32_t) left;
  233|   115k|            right_high = right >> 32;
  234|   115k|            right_low = (uint32_t) right;
  235|       | 
  236|   115k|            product_high = left_high * right_high;
  237|   115k|            product_mid = left_high * right_low;
  238|   115k|            product_mid2 = left_low * right_high;
  239|   115k|            product_low = left_low * right_low;
  240|       | 
  241|   115k|            product_high += product_mid >> 32;
  242|   115k|            product_mid = (uint32_t) product_mid + product_mid2 + (product_low >> 32);
  243|       | 
  244|   115k|            product_high = product_high + (product_mid >> 32);
  245|   115k|            product_low = (product_mid << 32) + (uint32_t) product_low;
  246|       | 
  247|   115k|            rt.high = product_high;
  248|   115k|            rt.low = product_low;
  249|   115k|            *product = rt;
  250|   115k|        }
_ZN8jsoncons4bson19decimal128_to_charsEPcS1_RKNS0_3TP1E:
  335|   122k|    {
  336|   122k|        static const std::string bson_decimal128_inf = "Infinity";
  337|   122k|        static const std::string bson_decimal128_nan = "NaN";
  338|       |
  339|   122k|        static constexpr uint32_t combination_mask = 0x1f;   /* Extract least significant 5 bits */
  340|   122k|        static constexpr uint32_t exponent_mask = 0x3fff;    /* Extract least significant 14 bits */
  341|   122k|        static constexpr uint32_t combination_infinity = 30; /* Value of combination field for Inf */
  342|   122k|        static constexpr uint32_t combination_nan = 31;      /* Value of combination field for NaN */
  343|   122k|        static constexpr uint32_t exponent_bias = 6176;      /* decimal128 exponent bias */
  344|       |
  345|   122k|        char* str_out = first;      /* output pointer in string */
  346|   122k|        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|   122k|        uint32_t high;                   /* bits 0 - 31 */
  351|   122k|        uint32_t midh;                   /* bits 32 - 63 */
  352|   122k|        uint32_t midl;                   /* bits 64 - 95 */
  353|   122k|        uint32_t low;                    /* bits 96 - 127 */
  354|   122k|        uint32_t combination;            /* bits 1 - 5 */
  355|   122k|        uint32_t biased_exponent;        /* decoded biased exponent (14 bits) */
  356|   122k|        uint32_t significand_digits = 0; /* the number of significand digits */
  357|   122k|        uint32_t significand[36] = {0};  /* the base-10 digits in the significand */
  358|   122k|        uint32_t *significand_read = significand; /* read pointer into significand */
  359|   122k|        int32_t exponent;                         /* unbiased exponent */
  360|   122k|        int32_t scientific_exponent; /* the exponent if scientific notation is
  361|       |                                      * used */
  362|   122k|        bool is_zero = false;        /* true if the number is zero */
  363|       | 
  364|   122k|        uint8_t significand_msb; /* the most signifcant significand bits (50-46) */
  365|   122k|        bson_uint128_t
  366|   122k|           significand128; /* temporary storage for significand decoding */
  367|       | 
  368|   122k|        memset (significand_str, 0, sizeof (significand_str));
  369|       | 
  370|   122k|        if ((int64_t) dec.high < 0) { /* negative */
  ------------------
  |  Branch (370:13): [True: 14.3k, False: 108k]
  ------------------
  371|  14.3k|           *(str_out++) = '-';
  372|  14.3k|        }
  373|       | 
  374|   122k|        low = (uint32_t) dec.low, midl = (uint32_t) (dec.low >> 32),
  375|   122k|        midh = (uint32_t) dec.high, high = (uint32_t) (dec.high >> 32);
  376|       | 
  377|       |        /* Decode combination field and exponent */
  378|   122k|        combination = (high >> 26) & combination_mask;
  379|       | 
  380|   122k|        if (JSONCONS_UNLIKELY ((combination >> 3) == 3)) {
  ------------------
  |  |   78|   122k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 13.9k, False: 108k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  13.9k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 4.49k, False: 9.48k]
  ------------------
  383|  4.49k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 4.49k, False: 0]
  ------------------
  384|  4.49k|               {
  385|  4.49k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  4.49k|                   str_out += bson_decimal128_inf.size();
  387|  4.49k|               }
  388|  4.49k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  4.49k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  9.48k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 1.28k, False: 8.19k]
  ------------------
  392|       |               /* first, not str_out, to erase the sign */
  393|  1.28k|               str_out = first;
  394|  1.28k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_nan.size())) 
  ------------------
  |  Branch (394:20): [True: 1.28k, False: 0]
  ------------------
  395|  1.28k|               {
  396|  1.28k|                   std::memcpy(str_out, bson_decimal128_nan.data(), bson_decimal128_nan.size());
  397|  1.28k|                   str_out += bson_decimal128_nan.size();
  398|  1.28k|               }
  399|  1.28k|               *str_out = 0;
  400|       |              //strcpy_s (first, last-first, bson_decimal128_nan.c_str());
  401|       |              /* we don't care about the NaN payload. */
  402|  1.28k|               return decimal128_to_chars_result{str_out, std::errc{}};
  403|  8.19k|           } else {
  404|  8.19k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  8.19k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  8.19k|           }
  407|   108k|        } else {
  408|   108k|           significand_msb = (high >> 14) & 0x7;
  409|   108k|           biased_exponent = (high >> 17) & exponent_mask;
  410|   108k|        }
  411|       | 
  412|   117k|        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|   117k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|   117k|        significand128.parts[1] = midh;
  420|   117k|        significand128.parts[2] = midl;
  421|   117k|        significand128.parts[3] = low;
  422|       | 
  423|   117k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 4.91k, False: 112k]
  |  Branch (423:45): [True: 3.59k, False: 1.32k]
  ------------------
  424|  3.59k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 1.49k, False: 2.10k]
  |  Branch (424:45): [True: 259, False: 1.23k]
  ------------------
  425|    259|           is_zero = true;
  426|   116k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 8.19k, False: 108k]
  ------------------
  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|  8.19k|           is_zero = true;
  434|   108k|        } else {
  435|   543k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 434k, False: 108k]
  ------------------
  436|   434k|              uint32_t least_digits = 0;
  437|   434k|              detail::bson_uint128_divide1B (
  438|   434k|                 significand128, &significand128, &least_digits);
  439|       | 
  440|       |              /* We now have the 9 least significant digits (in base 2). */
  441|       |              /* Convert and output to string. */
  442|   434k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 7.09k, False: 427k]
  ------------------
  443|  7.09k|                 continue;
  444|  7.09k|              }
  445|       | 
  446|  4.27M|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 3.84M, False: 427k]
  ------------------
  447|  3.84M|                 significand[k * 9 + j] = least_digits % 10;
  448|  3.84M|                 least_digits /= 10;
  449|  3.84M|              }
  450|   427k|           }
  451|   108k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|   117k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 8.45k, False: 108k]
  ------------------
  458|  8.45k|           significand_digits = 1;
  459|  8.45k|           *significand_read = 0;
  460|   108k|        } else {
  461|   108k|           significand_digits = 36;
  462|   439k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 330k, False: 108k]
  ------------------
  463|   330k|              significand_digits--;
  464|   330k|              significand_read++;
  465|   330k|           }
  466|   108k|        }
  467|       | 
  468|   117k|        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|   117k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 101k, False: 15.8k]
  |  Branch (478:41): [True: 11.7k, False: 4.03k]
  ------------------
  479|       |           /* Scientific format */
  480|   113k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|   113k|           significand_digits--;
  482|       | 
  483|   113k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 105k, False: 7.74k]
  ------------------
  484|   105k|              *(str_out++) = '.';
  485|   105k|           }
  486|       | 
  487|  3.50M|           for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (487:36): [True: 3.39M, False: 113k]
  |  Branch (487:62): [True: 3.39M, False: 90]
  ------------------
  488|  3.39M|              *(str_out++) = char(*(significand_read++)) + '0';
  489|  3.39M|           }
  490|       |           /* Exponent */
  491|   113k|           *(str_out++) = 'E';
  492|       |
  493|   113k|           std::string s;
  494|   113k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 11.7k, False: 101k]
  ------------------
  495|  11.7k|               s.push_back('+');
  496|  11.7k|           }
  497|   113k|           jsoncons::from_integer(scientific_exponent, s);
  498|   113k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 112k, False: 459]
  ------------------
  499|   112k|           {
  500|   112k|               std::memcpy(str_out, s.data(), s.size());
  501|   112k|           }
  502|    459|           else
  503|    459|           {
  504|    459|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|    459|           }
  506|   112k|           str_out += s.size();
  507|   112k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  4.03k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 1.23k, False: 2.79k]
  ------------------
  510|  9.38k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 8.15k, False: 1.23k]
  |  Branch (510:65): [True: 8.15k, False: 0]
  ------------------
  511|  8.15k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  8.15k|              }
  513|  2.79k|           } else {
  514|  2.79k|              int32_t radix_position = significand_digits + exponent;
  515|       | 
  516|  2.79k|              if (radix_position > 0) { /* non-zero digits before radix */
  ------------------
  |  Branch (516:19): [True: 1.59k, False: 1.19k]
  ------------------
  517|  1.59k|                 for (int32_t i = 0;
  518|  14.2k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 12.6k, False: 1.59k]
  |  Branch (518:45): [True: 12.6k, False: 0]
  ------------------
  519|  12.6k|                      i++) {
  520|  12.6k|                    *(str_out++) = char(*(significand_read++)) + '0';
  521|  12.6k|                 }
  522|  1.59k|              } else { /* leading zero before radix point */
  523|  1.19k|                 *(str_out++) = '0';
  524|  1.19k|              }
  525|       | 
  526|  2.79k|              *(str_out++) = '.';
  527|  4.82k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 2.03k, False: 2.79k]
  ------------------
  528|  2.03k|                 *(str_out++) = '0';
  529|  2.03k|              }
  530|       | 
  531|  2.79k|              for (std::size_t i = 0;
  532|  68.0k|                   (i < significand_digits - (std::max) (radix_position - 1, 0)) &&
  ------------------
  |  Branch (532:20): [True: 65.2k, False: 2.79k]
  |  Branch (532:20): [True: 65.2k, False: 2.79k]
  ------------------
  533|  65.2k|                   (str_out < last);
  ------------------
  |  Branch (533:20): [True: 65.2k, False: 0]
  ------------------
  534|  65.2k|                   i++) {
  535|  65.2k|                 *(str_out++) = char(*(significand_read++)) + '0';
  536|  65.2k|              }
  537|  2.79k|           }
  538|  4.03k|        }
  539|   116k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|   117k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|   434k|        {
  179|   434k|            static constexpr uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|   434k|            uint64_t _rem = 0;
  181|   434k|            int i = 0;
  182|       |            
  183|   434k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 330k, False: 104k]
  |  Branch (183:36): [True: 225k, False: 105k]
  |  Branch (183:55): [True: 117k, False: 107k]
  ------------------
  184|   117k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 7.07k, False: 110k]
  ------------------
  185|  7.07k|               *quotient = value;
  186|  7.07k|               *rem = 0;
  187|  7.07k|               return;
  188|  7.07k|            }
  189|       |            
  190|  2.13M|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 1.71M, False: 427k]
  ------------------
  191|  1.71M|               _rem <<= 32; /* Adjust remainder to match value of next dividend */
  192|  1.71M|               _rem += value.parts[i]; /* Add the divided to _rem */
  193|  1.71M|               value.parts[i] = (uint32_t) (_rem / DIVISOR);
  194|  1.71M|               _rem %= DIVISOR; /* Store the remainder */
  195|  1.71M|            }
  196|       |            
  197|   427k|            *quotient = value;
  198|   427k|            *rem = (uint32_t) _rem;
  199|   427k|        }

_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKS9_:
  108|  3.21k|       : basic_bson_encoder(std::forward<Sink>(sink),
  109|  3.21k|                            bson_encode_options(),
  110|  3.21k|                            alloc)
  111|  3.21k|    {
  112|  3.21k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKNS0_19bson_encode_optionsERKS9_:
  117|  3.21k|       : sink_(std::forward<Sink>(sink)),
  118|  3.21k|         max_nesting_depth_(options.max_nesting_depth()),
  119|  3.21k|         alloc_(alloc)
  120|  3.21k|    {
  121|  3.21k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE15visit_end_arrayERKNS_11ser_contextERNS3_10error_codeE:
  218|  2.01k|    {
  219|  2.01k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  2.01k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 2.01k]
  |  |  ------------------
  |  |   50|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   51|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  220|  2.01k|        --nesting_depth_;
  221|       |
  222|  2.01k|        buffer_.push_back(0x00);
  223|       |
  224|  2.01k|        std::size_t length = buffer_.size() - stack_.back().offset();
  225|  2.01k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  226|       |
  227|  2.01k|        stack_.pop_back();
  228|  2.01k|        if (stack_.empty())
  ------------------
  |  Branch (228:13): [True: 0, False: 2.01k]
  ------------------
  229|      0|        {
  230|      0|            for (auto c : buffer_)
  ------------------
  |  Branch (230:25): [True: 0, False: 0]
  ------------------
  231|      0|            {
  232|      0|                sink_.push_back(c);
  233|      0|            }
  234|      0|        }
  235|  2.01k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  2.01k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  236|  2.01k|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item6offsetEv:
   66|  35.4k|        {
   67|  35.4k|            return offset_;
   68|  35.4k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  498|  4.56k|    {
  499|  4.56k|        static constexpr uint64_t max_value_div_1000 = (std::numeric_limits<uint64_t>::max)() / 1000;
  500|  4.56k|        if (stack_.empty())
  ------------------
  |  Branch (500:13): [True: 0, False: 4.56k]
  ------------------
  501|      0|        {
  502|      0|            ec = bson_errc::expected_bson_document;
  503|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  504|      0|        }
  505|       |
  506|  4.56k|        switch (tag)
  507|  4.56k|        {
  508|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (508:13): [True: 0, False: 4.56k]
  ------------------
  509|      0|                if (val > max_value_div_1000)
  ------------------
  |  Branch (509:21): [True: 0, False: 0]
  ------------------
  510|      0|                {
  511|      0|                    ec = bson_errc::datetime_too_large;
  512|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  513|      0|                }
  514|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  515|      0|                binary::native_to_little(static_cast<int64_t>(val*millis_in_second),std::back_inserter(buffer_));
  516|      0|                break;
  517|      0|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (517:13): [True: 0, False: 4.56k]
  ------------------
  518|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  519|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  520|      0|                break;
  521|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (521:13): [True: 0, False: 4.56k]
  ------------------
  522|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  523|      0|                if (val != 0)
  ------------------
  |  Branch (523:21): [True: 0, False: 0]
  ------------------
  524|      0|                {
  525|      0|                    val /= nanos_in_milli;
  526|      0|                }
  527|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  528|      0|                break;
  529|  4.56k|            default:
  ------------------
  |  Branch (529:13): [True: 4.56k, False: 0]
  ------------------
  530|  4.56k|            {
  531|  4.56k|                if (val <= static_cast<uint64_t>((std::numeric_limits<int32_t>::max)()))
  ------------------
  |  Branch (531:21): [True: 1.18k, False: 3.37k]
  ------------------
  532|  1.18k|                {
  533|  1.18k|                    before_value(jsoncons::bson::bson_type::int32_type);
  534|  1.18k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  535|  1.18k|                }
  536|  3.37k|                else if (val <= static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()))
  ------------------
  |  Branch (536:26): [True: 2.45k, False: 920]
  ------------------
  537|  2.45k|                {
  538|  2.45k|                    before_value(jsoncons::bson::bson_type::int64_type);
  539|  2.45k|                    binary::native_to_little(static_cast<uint64_t>(val),std::back_inserter(buffer_));
  540|  2.45k|                }
  541|    920|                else
  542|    920|                {
  543|    920|                    ec = bson_errc::number_too_large;
  544|    920|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    920|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  545|    920|                }
  546|  3.64k|                break;
  547|  4.56k|            }
  548|  4.56k|        }
  549|  3.64k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  3.64k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  550|  4.56k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12before_valueEh:
  568|  4.50M|    {
  569|  4.50M|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  4.50M|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 4.50M]
  |  |  ------------------
  |  |   50|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   51|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  570|  4.50M|        if (stack_.back().is_object())
  ------------------
  |  Branch (570:13): [True: 363k, False: 4.14M]
  ------------------
  571|   363k|        {
  572|   363k|            buffer_[stack_.back().member_offset()] = code;
  573|   363k|        }
  574|  4.14M|        else
  575|  4.14M|        {
  576|  4.14M|            buffer_.push_back(code);
  577|  4.14M|            std::string name = std::to_string(stack_.back().next_index());
  578|  4.14M|            buffer_.insert(buffer_.end(), name.begin(), name.end());
  579|  4.14M|            buffer_.push_back(0x00);
  580|  4.14M|        }
  581|  4.50M|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item9is_objectEv:
   86|  4.50M|        {
   87|  4.50M|            return type_ == jsoncons::bson::bson_container_type::document;
   88|  4.50M|        }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEv:
   71|   363k|        {
   72|   363k|            return name_offset_;
   73|   363k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item10next_indexEv:
   81|  4.14M|        {
   82|  4.14M|            return index_++;
   83|  4.14M|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  439|  47.2k|    {
  440|  47.2k|        static constexpr int64_t min_value_div_1000 = (std::numeric_limits<int64_t>::min)() / 1000;
  441|  47.2k|        static constexpr int64_t max_value_div_1000 = (std::numeric_limits<int64_t>::max)() / 1000;
  442|  47.2k|        if (stack_.empty())
  ------------------
  |  Branch (442:13): [True: 36, False: 47.2k]
  ------------------
  443|     36|        {
  444|     36|            ec = bson_errc::expected_bson_document;
  445|     36|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|     36|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  446|     36|        }
  447|       |
  448|  47.2k|        switch (tag)
  449|  47.2k|        {
  450|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (450:13): [True: 0, False: 47.2k]
  ------------------
  451|      0|                if (val < min_value_div_1000)
  ------------------
  |  Branch (451:21): [True: 0, False: 0]
  ------------------
  452|      0|                {
  453|      0|                    ec = bson_errc::datetime_too_small;
  454|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  455|      0|                }
  456|      0|                if (val > max_value_div_1000)
  ------------------
  |  Branch (456:21): [True: 0, False: 0]
  ------------------
  457|      0|                {
  458|      0|                    ec = bson_errc::datetime_too_large;
  459|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  460|      0|                }
  461|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  462|      0|                binary::native_to_little(val*millis_in_second,std::back_inserter(buffer_));
  463|      0|                break;
  464|  5.31k|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (464:13): [True: 5.31k, False: 41.9k]
  ------------------
  465|  5.31k|                before_value(jsoncons::bson::bson_type::datetime_type);
  466|  5.31k|                binary::native_to_little(val,std::back_inserter(buffer_));
  467|  5.31k|                break;
  468|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (468:13): [True: 0, False: 47.2k]
  ------------------
  469|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  470|      0|                if (val != 0)
  ------------------
  |  Branch (470:21): [True: 0, False: 0]
  ------------------
  471|      0|                {
  472|      0|                    val /= nanos_in_milli;
  473|      0|                }
  474|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  475|      0|                break;
  476|  41.9k|            default:
  ------------------
  |  Branch (476:13): [True: 41.9k, False: 5.31k]
  ------------------
  477|  41.9k|            {
  478|  41.9k|                if (val >= (std::numeric_limits<int32_t>::lowest)() && val <= (std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (478:21): [True: 41.5k, False: 368]
  |  Branch (478:72): [True: 6.09k, False: 35.4k]
  ------------------
  479|  6.09k|                {
  480|  6.09k|                    before_value(jsoncons::bson::bson_type::int32_type);
  481|  6.09k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  482|  6.09k|                }
  483|  35.8k|                else 
  484|  35.8k|                {
  485|  35.8k|                    before_value(jsoncons::bson::bson_type::int64_type);
  486|  35.8k|                    binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  487|  35.8k|                }
  488|  41.9k|                break;
  489|      0|            }
  490|  47.2k|        }
  491|  47.2k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  47.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  492|  47.2k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  556|  1.23k|    {
  557|  1.23k|        if (stack_.empty())
  ------------------
  |  Branch (557:13): [True: 0, False: 1.23k]
  ------------------
  558|      0|        {
  559|      0|            ec = bson_errc::expected_bson_document;
  560|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  561|      0|        }
  562|  1.23k|        before_value(jsoncons::bson::bson_type::double_type);
  563|  1.23k|        binary::native_to_little(val,std::back_inserter(buffer_));
  564|  1.23k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.23k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  565|  1.23k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_flushEv:
  148|      5|    {
  149|      5|        sink_.flush();
  150|      5|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE18visit_begin_objectENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  153|  73.3k|    {
  154|  73.3k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|  73.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 15.5k, False: 57.8k]
  |  |  ------------------
  ------------------
  155|  15.5k|        {
  156|  15.5k|            ec = bson_errc::max_nesting_depth_exceeded;
  157|  15.5k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  15.5k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  158|  15.5k|        } 
  159|  57.8k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (159:13): [True: 54.5k, False: 3.21k]
  ------------------
  160|  54.5k|        {
  161|  54.5k|            if (stack_.empty())
  ------------------
  |  Branch (161:17): [True: 0, False: 54.5k]
  ------------------
  162|      0|            {
  163|      0|                ec = bson_errc::expected_bson_document;
  164|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  165|      0|            }
  166|  54.5k|            before_value(jsoncons::bson::bson_type::document_type);
  167|  54.5k|        }
  168|       |
  169|  57.8k|        stack_.emplace_back(jsoncons::bson::bson_container_type::document, buffer_.size());
  170|  57.8k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  171|       |
  172|  57.8k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  57.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  173|  57.8k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_itemC2ENS0_19bson_container_typeEm:
   61|   117k|           : type_(type), offset_(offset)
   62|   117k|        {
   63|   117k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE16visit_end_objectERKNS_11ser_contextERNS3_10error_codeE:
  176|  15.6k|    {
  177|  15.6k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  15.6k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 15.6k]
  |  |  ------------------
  |  |   50|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   51|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  178|  15.6k|        --nesting_depth_;
  179|       |
  180|  15.6k|        buffer_.push_back(0x00);
  181|       |
  182|  15.6k|        std::size_t length = buffer_.size() - stack_.back().offset();
  183|  15.6k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  184|       |
  185|  15.6k|        stack_.pop_back();
  186|  15.6k|        if (stack_.empty())
  ------------------
  |  Branch (186:13): [True: 149, False: 15.5k]
  ------------------
  187|    149|        {
  188|    149|            for (auto c : buffer_)
  ------------------
  |  Branch (188:25): [True: 5.60M, False: 149]
  ------------------
  189|  5.60M|            {
  190|  5.60M|                sink_.push_back(c);
  191|  5.60M|            }
  192|    149|        }
  193|  15.6k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  15.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  194|  15.6k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  197|   713k|    {
  198|   713k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|   713k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 654k, False: 59.6k]
  |  |  ------------------
  ------------------
  199|   654k|        {
  200|   654k|            ec = bson_errc::max_nesting_depth_exceeded;
  201|   654k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   654k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  202|   654k|        } 
  203|  59.6k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (203:13): [True: 59.6k, False: 0]
  ------------------
  204|  59.6k|        {
  205|  59.6k|            if (stack_.empty())
  ------------------
  |  Branch (205:17): [True: 0, False: 59.6k]
  ------------------
  206|      0|            {
  207|      0|                ec = bson_errc::expected_bson_document;
  208|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  209|      0|            }
  210|  59.6k|            before_value(jsoncons::bson::bson_type::array_type);
  211|  59.6k|        }
  212|  59.6k|        stack_.emplace_back(jsoncons::bson::bson_container_type::array, buffer_.size());
  213|  59.6k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  214|  59.6k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  59.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  215|  59.6k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9visit_keyERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEERKNS_11ser_contextERNS3_10error_codeE:
  239|   314k|    {
  240|   314k|        stack_.back().member_offset(buffer_.size());
  241|   314k|        buffer_.push_back(0x00); // reserve space for code
  242|   314k|        for (auto c : name)
  ------------------
  |  Branch (242:21): [True: 1.34M, False: 314k]
  ------------------
  243|  1.34M|        {
  244|  1.34M|            buffer_.push_back(c);
  245|  1.34M|        }
  246|   314k|        buffer_.push_back(0x00);
  247|   314k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   314k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  248|   314k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEm:
   76|   314k|        {
   77|   314k|            name_offset_ = offset;
   78|   314k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  251|  4.02M|    {
  252|  4.02M|        if (stack_.empty())
  ------------------
  |  Branch (252:13): [True: 171, False: 4.02M]
  ------------------
  253|    171|        {
  254|    171|            ec = bson_errc::expected_bson_document;
  255|    171|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    171|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  256|    171|        }
  257|  4.02M|        switch (tag)
  258|  4.02M|        {
  259|  1.29k|            case semantic_tag::undefined:
  ------------------
  |  Branch (259:13): [True: 1.29k, False: 4.02M]
  ------------------
  260|  1.29k|                before_value(jsoncons::bson::bson_type::undefined_type);
  261|  1.29k|                break;
  262|  4.02M|            default:
  ------------------
  |  Branch (262:13): [True: 4.02M, False: 1.29k]
  ------------------
  263|  4.02M|                before_value(jsoncons::bson::bson_type::null_type);
  264|  4.02M|                break;
  265|  4.02M|        }
  266|  4.02M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.02M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  267|  4.02M|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  270|  5.04k|    {
  271|  5.04k|        if (stack_.empty())
  ------------------
  |  Branch (271:13): [True: 0, False: 5.04k]
  ------------------
  272|      0|        {
  273|      0|            ec = bson_errc::expected_bson_document;
  274|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  275|      0|        }
  276|  5.04k|        before_value(jsoncons::bson::bson_type::bool_type);
  277|  5.04k|        if (val)
  ------------------
  |  Branch (277:13): [True: 3.52k, False: 1.52k]
  ------------------
  278|  3.52k|        {
  279|  3.52k|            buffer_.push_back(0x01);
  280|  3.52k|        }
  281|  1.52k|        else
  282|  1.52k|        {
  283|  1.52k|            buffer_.push_back(0x00);
  284|  1.52k|        }
  285|       |
  286|  5.04k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  5.04k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  287|  5.04k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_stringERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  290|   250k|    {
  291|   250k|        if (stack_.empty())
  ------------------
  |  Branch (291:13): [True: 89, False: 250k]
  ------------------
  292|     89|        {
  293|     89|            ec = bson_errc::expected_bson_document;
  294|     89|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|     89|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  295|     89|        }
  296|       |
  297|   250k|        switch (tag)
  298|   250k|        {
  299|   122k|            case semantic_tag::float128:
  ------------------
  |  Branch (299:13): [True: 122k, False: 127k]
  ------------------
  300|   122k|            {
  301|   122k|                before_value(jsoncons::bson::bson_type::decimal128_type);
  302|   122k|                decimal128_t dec;
  303|   122k|                auto rc = decimal128_from_chars(sv.data(), sv.data()+sv.size(), dec);
  304|   122k|                if (rc.ec != std::errc{})
  ------------------
  |  Branch (304:21): [True: 1.09k, False: 121k]
  ------------------
  305|  1.09k|                {
  306|  1.09k|                    ec = bson_errc::invalid_decimal128_string;
  307|  1.09k|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.09k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  308|  1.09k|                }
  309|   121k|                binary::native_to_little(dec.low,std::back_inserter(buffer_));
  310|   121k|                binary::native_to_little(dec.high,std::back_inserter(buffer_));
  311|   121k|                break;
  312|   122k|            }
  313|  25.8k|            case semantic_tag::id:
  ------------------
  |  Branch (313:13): [True: 25.8k, False: 224k]
  ------------------
  314|  25.8k|            {
  315|  25.8k|                before_value(jsoncons::bson::bson_type::object_id_type);
  316|  25.8k|                oid_t oid(sv);
  317|  25.8k|                for (auto b : oid)
  ------------------
  |  Branch (317:29): [True: 310k, False: 25.8k]
  ------------------
  318|   310k|                {
  319|   310k|                    buffer_.push_back(b);
  320|   310k|                }
  321|  25.8k|                break;
  322|   122k|            }
  323|  4.48k|            case semantic_tag::regex:
  ------------------
  |  Branch (323:13): [True: 4.48k, False: 245k]
  ------------------
  324|  4.48k|            {
  325|  4.48k|                before_value(jsoncons::bson::bson_type::regex_type);
  326|  4.48k|                std::size_t first = sv.find_first_of('/');
  327|  4.48k|                std::size_t last = sv.find_last_of('/');
  328|  4.48k|                if (first == string_view::npos || last == string_view::npos || first == last)
  ------------------
  |  Branch (328:21): [True: 0, False: 4.48k]
  |  Branch (328:51): [True: 0, False: 4.48k]
  |  Branch (328:80): [True: 0, False: 4.48k]
  ------------------
  329|      0|                {
  330|      0|                    ec = bson_errc::invalid_regex_string;
  331|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  332|      0|                }
  333|  4.48k|                string_view regex = sv.substr(first+1,last-1);
  334|  4.48k|                for (auto c : regex)
  ------------------
  |  Branch (334:29): [True: 4.73M, False: 4.48k]
  ------------------
  335|  4.73M|                {
  336|  4.73M|                    buffer_.push_back(c);
  337|  4.73M|                }
  338|  4.48k|                buffer_.push_back(0x00);
  339|  4.48k|                string_view options = sv.substr(last+1);
  340|  4.48k|                for (auto c : options)
  ------------------
  |  Branch (340:29): [True: 2.74M, False: 4.48k]
  ------------------
  341|  2.74M|                {
  342|  2.74M|                    buffer_.push_back(c);
  343|  2.74M|                }
  344|  4.48k|                buffer_.push_back(0x00);
  345|  4.48k|                break;
  346|  4.48k|            }
  347|  97.1k|            default:
  ------------------
  |  Branch (347:13): [True: 97.1k, False: 153k]
  ------------------
  348|  97.1k|                switch (tag)
  349|  97.1k|                {
  350|    731|                    case semantic_tag::code:
  ------------------
  |  Branch (350:21): [True: 731, False: 96.3k]
  ------------------
  351|    731|                        before_value(jsoncons::bson::bson_type::javascript_type);
  352|    731|                        break;
  353|  96.3k|                    default:
  ------------------
  |  Branch (353:21): [True: 96.3k, False: 731]
  ------------------
  354|  96.3k|                        before_value(jsoncons::bson::bson_type::string_type);
  355|  96.3k|                        break;
  356|  97.1k|                }
  357|  97.1k|                std::size_t offset = buffer_.size();
  358|  97.1k|                buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  359|  97.1k|                std::size_t string_offset = buffer_.size();
  360|  97.1k|                auto sink = unicode_traits::validate(sv.data(), sv.size());
  361|  97.1k|                if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (361:21): [True: 0, False: 97.1k]
  ------------------
  362|      0|                {
  363|      0|                    ec = bson_errc::invalid_utf8_text_string;
  364|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  365|      0|                }
  366|  97.1k|                for (auto c : sv)
  ------------------
  |  Branch (366:29): [True: 1.98M, False: 97.1k]
  ------------------
  367|  1.98M|                {
  368|  1.98M|                    buffer_.push_back(c);
  369|  1.98M|                }
  370|  97.1k|                buffer_.push_back(0x00);
  371|  97.1k|                std::size_t length = buffer_.size() - string_offset;
  372|  97.1k|                binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  373|  97.1k|                break;
  374|   250k|        }
  375|       |
  376|   249k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   249k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|   250k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_byte_stringERKNS_16byte_string_viewEmRKNS_11ser_contextERNS3_10error_codeE:
  411|  59.0k|    {
  412|  59.0k|        if (stack_.empty())
  ------------------
  |  Branch (412:13): [True: 22, False: 58.9k]
  ------------------
  413|     22|        {
  414|     22|            ec = bson_errc::expected_bson_document;
  415|     22|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|     22|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  416|     22|        }
  417|  58.9k|        before_value(jsoncons::bson::bson_type::binary_type);
  418|       |
  419|  58.9k|        std::size_t offset = buffer_.size();
  420|  58.9k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  421|  58.9k|        std::size_t string_offset = buffer_.size();
  422|       |
  423|  58.9k|        buffer_.push_back(static_cast<uint8_t>(raw_tag)); // default subtype
  424|       |
  425|  58.9k|        for (auto c : b)
  ------------------
  |  Branch (425:21): [True: 9.91M, False: 58.9k]
  ------------------
  426|  9.91M|        {
  427|  9.91M|            buffer_.push_back(c);
  428|  9.91M|        }
  429|  58.9k|        std::size_t length = buffer_.size() - string_offset - 1;
  430|  58.9k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  431|       |
  432|  58.9k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  58.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  433|  59.0k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEED2Ev:
  124|  3.21k|    {
  125|  3.21k|        sink_.flush();
  126|  3.21k|    }

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

_ZN8jsoncons4bson5oid_tC2ERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   58|  25.8k|        {
   59|   336k|            for (std::size_t i = 0; i < bytes_.size(); i++) 
  ------------------
  |  Branch (59:37): [True: 310k, False: 25.8k]
  ------------------
   60|   310k|            {
   61|   310k|               bytes_[i] = ((parse_hex_char (str[2 * i]) << 4) |
   62|   310k|                           (parse_hex_char (str[2 * i + 1])));
   63|   310k|            }
   64|  25.8k|        }
_ZN8jsoncons4bson5oid_t14parse_hex_charEc:
   99|   621k|        {
  100|   621k|           switch (hex) {
  101|   320k|           case '0':
  ------------------
  |  Branch (101:12): [True: 320k, False: 300k]
  ------------------
  102|   320k|              return 0;
  103|  20.4k|           case '1':
  ------------------
  |  Branch (103:12): [True: 20.4k, False: 601k]
  ------------------
  104|  20.4k|              return 1;
  105|  15.4k|           case '2':
  ------------------
  |  Branch (105:12): [True: 15.4k, False: 606k]
  ------------------
  106|  15.4k|              return 2;
  107|  16.4k|           case '3':
  ------------------
  |  Branch (107:12): [True: 16.4k, False: 604k]
  ------------------
  108|  16.4k|              return 3;
  109|  7.73k|           case '4':
  ------------------
  |  Branch (109:12): [True: 7.73k, False: 613k]
  ------------------
  110|  7.73k|              return 4;
  111|  5.22k|           case '5':
  ------------------
  |  Branch (111:12): [True: 5.22k, False: 616k]
  ------------------
  112|  5.22k|              return 5;
  113|  6.30k|           case '6':
  ------------------
  |  Branch (113:12): [True: 6.30k, False: 615k]
  ------------------
  114|  6.30k|              return 6;
  115|   179k|           case '7':
  ------------------
  |  Branch (115:12): [True: 179k, False: 442k]
  ------------------
  116|   179k|              return 7;
  117|  1.97k|           case '8':
  ------------------
  |  Branch (117:12): [True: 1.97k, False: 619k]
  ------------------
  118|  1.97k|              return 8;
  119|  1.79k|           case '9':
  ------------------
  |  Branch (119:12): [True: 1.79k, False: 619k]
  ------------------
  120|  1.79k|              return 9;
  121|  9.72k|           case 'a':
  ------------------
  |  Branch (121:12): [True: 9.72k, False: 611k]
  ------------------
  122|  9.72k|           case 'A':
  ------------------
  |  Branch (122:12): [True: 0, False: 621k]
  ------------------
  123|  9.72k|              return 0xa;
  124|  3.35k|           case 'b':
  ------------------
  |  Branch (124:12): [True: 3.35k, False: 618k]
  ------------------
  125|  3.35k|           case 'B':
  ------------------
  |  Branch (125:12): [True: 0, False: 621k]
  ------------------
  126|  3.35k|              return 0xb;
  127|  1.37k|           case 'c':
  ------------------
  |  Branch (127:12): [True: 1.37k, False: 620k]
  ------------------
  128|  1.37k|           case 'C':
  ------------------
  |  Branch (128:12): [True: 0, False: 621k]
  ------------------
  129|  1.37k|              return 0xc;
  130|  2.72k|           case 'd':
  ------------------
  |  Branch (130:12): [True: 2.72k, False: 618k]
  ------------------
  131|  2.72k|           case 'D':
  ------------------
  |  Branch (131:12): [True: 0, False: 621k]
  ------------------
  132|  2.72k|              return 0xd;
  133|  3.45k|           case 'e':
  ------------------
  |  Branch (133:12): [True: 3.45k, False: 618k]
  ------------------
  134|  3.45k|           case 'E':
  ------------------
  |  Branch (134:12): [True: 0, False: 621k]
  ------------------
  135|  3.45k|              return 0xe;
  136|  25.5k|           case 'f':
  ------------------
  |  Branch (136:12): [True: 25.5k, False: 595k]
  ------------------
  137|  25.5k|           case 'F':
  ------------------
  |  Branch (137:12): [True: 0, False: 621k]
  ------------------
  138|  25.5k|              return 0xf;
  139|      0|           default:
  ------------------
  |  Branch (139:12): [True: 0, False: 621k]
  ------------------
  140|      0|              return 0;
  141|   621k|           }
  142|   621k|        }
_ZN8jsoncons4bson5oid_t5beginEv:
   77|  25.8k|        {
   78|  25.8k|            return bytes_.begin();
   79|  25.8k|        }
_ZN8jsoncons4bson5oid_t3endEv:
   82|  25.8k|        {
   83|  25.8k|            return bytes_.end();
   84|  25.8k|        }
_ZN8jsoncons4bson5oid_tC2EPh:
   53|  25.8k|        {
   54|  25.8k|            std::memcpy(bytes_.data(),data,12);
   55|  25.8k|        }
_ZN8jsoncons4bson9to_stringINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEvRKNS0_5oid_tERT_:
  236|  25.8k|    {
  237|  25.8k|        s.resize(24);
  238|  25.8k|        detail::init_hex_char_pairs(oid, reinterpret_cast<uint16_t*>(&s[0]));
  239|  25.8k|    }
_ZN8jsoncons4bson6detail19init_hex_char_pairsERKNS0_5oid_tEPt:
  213|  25.8k|        {
  214|  25.8k|            const uint8_t* bytes = oid.data();
  215|  25.8k|            const uint16_t* gHexCharPairs = get_hex_char_pairs(std::integral_constant<bool, jsoncons::endian::native == jsoncons::endian::big>());
  216|       |
  217|  25.8k|            data[0] = gHexCharPairs[bytes[0]];
  218|  25.8k|            data[1] = gHexCharPairs[bytes[1]];
  219|  25.8k|            data[2] = gHexCharPairs[bytes[2]];
  220|  25.8k|            data[3] = gHexCharPairs[bytes[3]];
  221|  25.8k|            data[4] = gHexCharPairs[bytes[4]];
  222|  25.8k|            data[5] = gHexCharPairs[bytes[5]];
  223|  25.8k|            data[6] = gHexCharPairs[bytes[6]];
  224|  25.8k|            data[7] = gHexCharPairs[bytes[7]];
  225|  25.8k|            data[8] = gHexCharPairs[bytes[8]];
  226|  25.8k|            data[9] = gHexCharPairs[bytes[9]];
  227|  25.8k|            data[10] = gHexCharPairs[bytes[10]];
  228|  25.8k|            data[11] = gHexCharPairs[bytes[11]];
  229|  25.8k|        }
_ZNK8jsoncons4bson5oid_t4dataEv:
   67|  25.8k|        {
   68|  25.8k|            return bytes_.data();
   69|  25.8k|        }
_ZN8jsoncons4bson6detail18get_hex_char_pairsENSt3__117integral_constantIbLb0EEE:
  181|  25.8k|        {
  182|  25.8k|            static constexpr uint16_t hex_char_pairs[] = {
  183|  25.8k|                12336, 12592, 12848, 13104, 13360, 13616, 13872, 14128, 14384, 14640, 24880,
  184|  25.8k|                25136, 25392, 25648, 25904, 26160, 12337, 12593, 12849, 13105, 13361, 13617,
  185|  25.8k|                13873, 14129, 14385, 14641, 24881, 25137, 25393, 25649, 25905, 26161, 12338,
  186|  25.8k|                12594, 12850, 13106, 13362, 13618, 13874, 14130, 14386, 14642, 24882, 25138,
  187|  25.8k|                25394, 25650, 25906, 26162, 12339, 12595, 12851, 13107, 13363, 13619, 13875,
  188|  25.8k|                14131, 14387, 14643, 24883, 25139, 25395, 25651, 25907, 26163, 12340, 12596,
  189|  25.8k|                12852, 13108, 13364, 13620, 13876, 14132, 14388, 14644, 24884, 25140, 25396,
  190|  25.8k|                25652, 25908, 26164, 12341, 12597, 12853, 13109, 13365, 13621, 13877, 14133,
  191|  25.8k|                14389, 14645, 24885, 25141, 25397, 25653, 25909, 26165, 12342, 12598, 12854,
  192|  25.8k|                13110, 13366, 13622, 13878, 14134, 14390, 14646, 24886, 25142, 25398, 25654,
  193|  25.8k|                25910, 26166, 12343, 12599, 12855, 13111, 13367, 13623, 13879, 14135, 14391,
  194|  25.8k|                14647, 24887, 25143, 25399, 25655, 25911, 26167, 12344, 12600, 12856, 13112,
  195|  25.8k|                13368, 13624, 13880, 14136, 14392, 14648, 24888, 25144, 25400, 25656, 25912,
  196|  25.8k|                26168, 12345, 12601, 12857, 13113, 13369, 13625, 13881, 14137, 14393, 14649,
  197|  25.8k|                24889, 25145, 25401, 25657, 25913, 26169, 12385, 12641, 12897, 13153, 13409,
  198|  25.8k|                13665, 13921, 14177, 14433, 14689, 24929, 25185, 25441, 25697, 25953, 26209,
  199|  25.8k|                12386, 12642, 12898, 13154, 13410, 13666, 13922, 14178, 14434, 14690, 24930,
  200|  25.8k|                25186, 25442, 25698, 25954, 26210, 12387, 12643, 12899, 13155, 13411, 13667,
  201|  25.8k|                13923, 14179, 14435, 14691, 24931, 25187, 25443, 25699, 25955, 26211, 12388,
  202|  25.8k|                12644, 12900, 13156, 13412, 13668, 13924, 14180, 14436, 14692, 24932, 25188,
  203|  25.8k|                25444, 25700, 25956, 26212, 12389, 12645, 12901, 13157, 13413, 13669, 13925,
  204|  25.8k|                14181, 14437, 14693, 24933, 25189, 25445, 25701, 25957, 26213, 12390, 12646,
  205|  25.8k|                12902, 13158, 13414, 13670, 13926, 14182, 14438, 14694, 24934, 25190, 25446,
  206|  25.8k|                25702, 25958, 26214};
  207|       |
  208|  25.8k|            return hex_char_pairs;
  209|  25.8k|        }

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

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

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

