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

_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4sizeEv:
  116|   583k|        {
  117|   583k|            return size_;
  118|   583k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2Ev:
   58|  47.6k|        {
   59|  47.6k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2EPS2_m:
   61|   147k|            : data_(data), size_(size)
   62|   147k|        {
   63|   147k|        }
_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4dataEv:
  111|   194k|        {
  112|   194k|            return data_;
  113|   194k|        }

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

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

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|  3.22k|    {
  194|  3.22k|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 3.22k, False: 0]
  ------------------
  195|  3.22k|        {
  196|  3.22k|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|  3.22k|        }
  198|  3.22k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|  3.22k|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|  3.22k|          chunk_size_(default_max_chunk_size)
  178|  3.22k|    {
  179|  3.22k|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|  3.22k|        data_end_ = chunk_;
  181|  3.22k|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|  3.22k|      : std::basic_istream<CharT>(&nb_)
   58|  3.22k|    {
   59|  3.22k|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|  3.22k|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  3.22k|    {
  277|  3.22k|        return stream_ptr_->bad();  
  278|  3.22k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  377|  34.4M|    {
  378|  34.4M|        std::size_t len = 0;
  379|  34.4M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 34.4M, False: 7.17k]
  ------------------
  380|  34.4M|        {
  381|  34.4M|            len = (std::min)(remaining_, length);
  382|  34.4M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  34.4M|            data_end_ += len;
  384|  34.4M|            remaining_ -= len;
  385|  34.4M|            position_ += len;
  386|  34.4M|        }
  387|  34.4M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 34.4M, False: 9.55k]
  ------------------
  388|  34.4M|        {
  389|  34.4M|            return len;
  390|  34.4M|        }
  391|  9.55k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 9.55k, False: 0]
  ------------------
  392|  9.55k|        {
  393|  9.55k|            data_end_ = chunk_;
  394|  9.55k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  9.55k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 7.11k, False: 2.43k]
  ------------------
  396|  7.11k|            {
  397|  7.11k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  7.11k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  7.11k|                data_end_ += len2;
  400|  7.11k|                remaining_ -= len2;
  401|  7.11k|                position_ += len2;
  402|  7.11k|                len += len2;
  403|  7.11k|            }
  404|  9.55k|            return len;
  405|  9.55k|        }
  406|      0|        else
  407|      0|        {
  408|      0|            if (stream_ptr_->eof())
  ------------------
  |  Branch (408:17): [True: 0, False: 0]
  ------------------
  409|      0|            {
  410|      0|                remaining_ = 0;
  411|      0|                return 0;
  412|      0|            }
  413|      0|            JSONCONS_TRY
  ------------------
  |  |   37|      0|    #define JSONCONS_TRY try
  ------------------
  414|      0|            {
  415|      0|                std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(p+len), length-len);
  416|      0|                std::size_t len2 = static_cast<std::size_t>(count);
  417|      0|                if (len2 < length-len)
  ------------------
  |  Branch (417:21): [True: 0, False: 0]
  ------------------
  418|      0|                {
  419|      0|                    stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  420|      0|                }
  421|      0|                len += len2;
  422|      0|                position_ += len2;
  423|      0|                return len;
  424|      0|            }
  425|      0|            JSONCONS_CATCH(const std::exception&)     
  426|      0|            {
  427|      0|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  428|      0|                return 0;
  429|      0|            }
  430|      0|        }
  431|  34.4M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  10.4k|    {
  443|  10.4k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 2.45k, False: 8.00k]
  ------------------
  444|  2.45k|        {
  445|  2.45k|            return 0;
  446|  2.45k|        }
  447|       |
  448|  8.00k|        JSONCONS_TRY
  ------------------
  |  |   37|  8.00k|    #define JSONCONS_TRY try
  ------------------
  449|  8.00k|        {
  450|  8.00k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  8.00k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  8.00k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 3.20k, False: 4.80k]
  ------------------
  454|  3.20k|            {
  455|  3.20k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|  3.20k|            }
  457|  8.00k|            return length;
  458|  8.00k|        }
  459|  8.00k|        JSONCONS_CATCH(const std::exception&)     
  460|  8.00k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  8.00k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|   138k|    {
  353|   138k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|   138k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 1.68k, False: 137k]
  |  |  ------------------
  ------------------
  354|  1.68k|        {
  355|  1.68k|            return span<const value_type>{};
  356|  1.68k|        }
  357|   137k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 166, False: 137k]
  |  Branch (357:32): [True: 51, False: 115]
  ------------------
  358|     51|        {
  359|     51|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     51|            data_end_ = chunk_;
  361|     51|        }
  362|   137k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 545, False: 136k]
  ------------------
  363|    545|        {
  364|    545|            buffer.clear();
  365|    545|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    545|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    545|        }
  368|       |
  369|   136k|        const value_type* data = data_end_;
  370|   136k|        data_end_ += length;
  371|   136k|        remaining_ -= length;
  372|   136k|        position_ += length;
  373|   136k|        return span<const value_type>(data, length);
  374|   137k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  746|    545|    {
  747|    545|        std::size_t unread = length;
  748|       |
  749|  1.65k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.35k, False: 300]
  |  Branch (749:30): [True: 1.11k, False: 245]
  ------------------
  750|  1.11k|        {
  751|  1.11k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 360, False: 752]
  |  Branch (751:44): [True: 356, False: 4]
  ------------------
  752|    356|            {
  753|    356|                std::size_t n = source.chunk_size();
  754|    356|                std::size_t offset = buffer.size();
  755|    356|                buffer.resize(offset+n);
  756|    356|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    356|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    356|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 69, False: 287]
  |  |  ------------------
  ------------------
  758|     69|                {
  759|     69|                    buffer.resize(offset+actual);
  760|     69|                }
  761|    356|                unread -= actual;
  762|    356|            }
  763|    756|            else
  764|    756|            {
  765|    756|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|    756|                std::size_t offset = buffer.size();
  767|    756|                buffer.resize(offset+n);
  768|    756|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|    756|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    756|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 114, False: 642]
  |  |  ------------------
  ------------------
  770|    114|                {
  771|    114|                    buffer.resize(offset + actual);
  772|    114|                }
  773|    756|                unread -= actual;
  774|    756|            }
  775|  1.11k|        }
  776|    545|        return length - unread;
  777|    545|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  3.62k|    {
  272|  3.62k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 1.40k, False: 2.21k]
  |  Branch (272:35): [True: 565, False: 838]
  ------------------
  273|  3.62k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  3.05k|    {
  347|  3.05k|        return remaining_;
  348|  3.05k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  3.89k|    {
  262|  3.89k|        return chunk_size_;
  263|  3.89k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    831|    {
  436|    831|        auto len = fill_buffer(chunk, chunk_size);
  437|    831|        position_ += len;
  438|    831|        return len;
  439|    831|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  55.8k|    {
  353|  55.8k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  55.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 45.9k, False: 9.90k]
  |  |  ------------------
  ------------------
  354|  45.9k|        {
  355|  45.9k|            return span<const value_type>{};
  356|  45.9k|        }
  357|  9.90k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 131, False: 9.77k]
  |  Branch (357:32): [True: 24, False: 107]
  ------------------
  358|     24|        {
  359|     24|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     24|            data_end_ = chunk_;
  361|     24|        }
  362|  9.90k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 625, False: 9.28k]
  ------------------
  363|    625|        {
  364|    625|            buffer.clear();
  365|    625|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    625|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    625|        }
  368|       |
  369|  9.28k|        const value_type* data = data_end_;
  370|  9.28k|        data_end_ += length;
  371|  9.28k|        remaining_ -= length;
  372|  9.28k|        position_ += length;
  373|  9.28k|        return span<const value_type>(data, length);
  374|  9.90k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  746|    625|    {
  747|    625|        std::size_t unread = length;
  748|       |
  749|  2.56k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 2.26k, False: 305]
  |  Branch (749:30): [True: 1.94k, False: 320]
  ------------------
  750|  1.94k|        {
  751|  1.94k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 478, False: 1.46k]
  |  Branch (751:44): [True: 475, False: 3]
  ------------------
  752|    475|            {
  753|    475|                std::size_t n = source.chunk_size();
  754|    475|                std::size_t offset = buffer.size();
  755|    475|                buffer.resize(offset+n);
  756|    475|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    475|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    475|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 59, False: 416]
  |  |  ------------------
  ------------------
  758|     59|                {
  759|     59|                    buffer.resize(offset+actual);
  760|     59|                }
  761|    475|                unread -= actual;
  762|    475|            }
  763|  1.46k|            else
  764|  1.46k|            {
  765|  1.46k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|  1.46k|                std::size_t offset = buffer.size();
  767|  1.46k|                buffer.resize(offset+n);
  768|  1.46k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|  1.46k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|  1.46k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 201, False: 1.26k]
  |  |  ------------------
  ------------------
  770|    201|                {
  771|    201|                    buffer.resize(offset + actual);
  772|    201|                }
  773|  1.46k|                unread -= actual;
  774|  1.46k|            }
  775|  1.94k|        }
  776|    625|        return length - unread;
  777|    625|    }

_ZN8jsoncons6binary16native_to_littleIjNSt3__111__wrap_iterIPhEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrS9_6littleEvE4typeET_T0_:
  142|   207k|    {
  143|   207k|        uint8_t buf[sizeof(T)];
  144|   207k|        std::memcpy(buf, &val, sizeof(T));
  145|   207k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 830k, False: 207k]
  ------------------
  146|   830k|        {
  147|   830k|            *d_first++ = item;
  148|   830k|        }
  149|   207k|    }
_ZN8jsoncons6binary16native_to_littleIlNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  37.9k|    {
  143|  37.9k|        uint8_t buf[sizeof(T)];
  144|  37.9k|        std::memcpy(buf, &val, sizeof(T));
  145|  37.9k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 303k, False: 37.9k]
  ------------------
  146|   303k|        {
  147|   303k|            *d_first++ = item;
  148|   303k|        }
  149|  37.9k|    }
_ZN8jsoncons6binary16native_to_littleIjNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  5.38k|    {
  143|  5.38k|        uint8_t buf[sizeof(T)];
  144|  5.38k|        std::memcpy(buf, &val, sizeof(T));
  145|  5.38k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 21.5k, False: 5.38k]
  ------------------
  146|  21.5k|        {
  147|  21.5k|            *d_first++ = item;
  148|  21.5k|        }
  149|  5.38k|    }
_ZN8jsoncons6binary16native_to_littleImNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|   230k|    {
  143|   230k|        uint8_t buf[sizeof(T)];
  144|   230k|        std::memcpy(buf, &val, sizeof(T));
  145|   230k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 1.84M, False: 230k]
  ------------------
  146|  1.84M|        {
  147|  1.84M|            *d_first++ = item;
  148|  1.84M|        }
  149|   230k|    }
_ZN8jsoncons6binary16native_to_littleIdNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  1.33k|    {
  143|  1.33k|        uint8_t buf[sizeof(T)];
  144|  1.33k|        std::memcpy(buf, &val, sizeof(T));
  145|  1.33k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 10.7k, False: 1.33k]
  ------------------
  146|  10.7k|        {
  147|  10.7k|            *d_first++ = item;
  148|  10.7k|        }
  149|  1.33k|    }
_ZN8jsoncons6binary16little_to_nativeIiNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   983k|    {
  198|   983k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 983k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   983k|        T val;
  203|   983k|        std::memcpy(&val,first,sizeof(T));
  204|   983k|        return val;
  205|   983k|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  1.33k|    {
  198|  1.33k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 1.33k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  1.33k|        T val;
  203|  1.33k|        std::memcpy(&val,first,sizeof(T));
  204|  1.33k|        return val;
  205|  1.33k|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   236k|    {
  198|   236k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 236k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   236k|        T val;
  203|   236k|        std::memcpy(&val,first,sizeof(T));
  204|   236k|        return val;
  205|   236k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  38.7k|    {
  198|  38.7k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 38.7k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  38.7k|        T val;
  203|  38.7k|        std::memcpy(&val,first,sizeof(T));
  204|  38.7k|        return val;
  205|  38.7k|    }

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

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

_ZN8jsoncons10to_integerIicEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  557|   106k|{
  558|   106k|    n = 0;
  559|       |
  560|   106k|    if (length == 0)
  ------------------
  |  Branch (560:9): [True: 600, False: 105k]
  ------------------
  561|    600|    {
  562|    600|        return to_number_result<CharT>(s, std::errc::invalid_argument);
  563|    600|    }
  564|       |
  565|   105k|    bool is_negative = *s == '-' ? true : false;
  ------------------
  |  Branch (565:24): [True: 94.4k, False: 11.4k]
  ------------------
  566|   105k|    if (is_negative)
  ------------------
  |  Branch (566:9): [True: 94.4k, False: 11.4k]
  ------------------
  567|  94.4k|    {
  568|  94.4k|        ++s;
  569|  94.4k|        --length;
  570|  94.4k|    }
  571|       |
  572|   105k|    using U = typename ext_traits::make_unsigned<T>::type;
  573|       |
  574|   105k|    U u;
  575|   105k|    auto ru = to_integer(s, length, u);
  576|   105k|    if (ru.ec != std::errc{})
  ------------------
  |  Branch (576:9): [True: 0, False: 105k]
  ------------------
  577|      0|    {
  578|      0|        return to_number_result<CharT>(ru.ptr, ru.ec);
  579|      0|    }
  580|   105k|    if (is_negative)
  ------------------
  |  Branch (580:9): [True: 94.4k, False: 11.4k]
  ------------------
  581|  94.4k|    {
  582|  94.4k|        if (u > static_cast<U>(-((ext_traits::integer_limits<T>::lowest)()+T(1))) + U(1))
  ------------------
  |  Branch (582:13): [True: 0, False: 94.4k]
  ------------------
  583|      0|        {
  584|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  585|      0|        }
  586|  94.4k|        else
  587|  94.4k|        {
  588|  94.4k|            n = static_cast<T>(U(0) - u);
  589|  94.4k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  590|  94.4k|        }
  591|  94.4k|    }
  592|  11.4k|    else
  593|  11.4k|    {
  594|  11.4k|        if (u > static_cast<U>((ext_traits::integer_limits<T>::max)()))
  ------------------
  |  Branch (594:13): [True: 0, False: 11.4k]
  ------------------
  595|      0|        {
  596|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  597|      0|        }
  598|  11.4k|        else
  599|  11.4k|        {
  600|  11.4k|            n = static_cast<T>(u);
  601|  11.4k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  602|  11.4k|        }
  603|  11.4k|    }
  604|   105k|}
_ZN8jsoncons16to_number_resultIcEC2EPKcNSt3__14errcE:
  141|   212k|        : ptr(ptr_), ec(ec_)
  142|   212k|    {
  143|   212k|    }
_ZN8jsoncons10to_integerIjcEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedntsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  374|   105k|{
  375|   105k|    n = 0;
  376|       |
  377|   105k|    integer_chars_state state = integer_chars_state::initial;
  378|       |
  379|   105k|    const CharT* end = s + length; 
  380|   317k|    while (s < end)
  ------------------
  |  Branch (380:12): [True: 211k, False: 105k]
  ------------------
  381|   211k|    {
  382|   211k|        switch(state)
  383|   211k|        {
  384|   105k|            case integer_chars_state::initial:
  ------------------
  |  Branch (384:13): [True: 105k, False: 105k]
  ------------------
  385|   105k|            {
  386|   105k|                switch(*s)
  387|   105k|                {
  388|      0|                    case '0':
  ------------------
  |  Branch (388:21): [True: 0, False: 105k]
  ------------------
  389|      0|                        state = integer_chars_state::integer; // Could be binary, octal, hex 
  390|      0|                        ++s;
  391|      0|                        break;
  392|   105k|                    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: 847, False: 105k]
  |  Branch (392:30): [True: 1.15k, False: 104k]
  |  Branch (392:39): [True: 82.7k, False: 23.1k]
  |  Branch (392:48): [True: 6.38k, False: 99.5k]
  |  Branch (392:57): [True: 3.56k, False: 102k]
  |  Branch (392:66): [True: 3.18k, False: 102k]
  |  Branch (392:75): [True: 6.61k, False: 99.3k]
  |  Branch (392:84): [True: 789, False: 105k]
  |  Branch (392:94): [True: 607, False: 105k]
  ------------------
  393|   105k|                        state = integer_chars_state::decimal;
  394|   105k|                        break;
  395|      0|                    default:
  ------------------
  |  Branch (395:21): [True: 0, False: 105k]
  ------------------
  396|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  397|   105k|                }
  398|   105k|                break;
  399|   105k|            }
  400|   105k|            case integer_chars_state::integer:
  ------------------
  |  Branch (400:13): [True: 0, False: 211k]
  ------------------
  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: 211k]
  ------------------
  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: 211k]
  ------------------
  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|   105k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (482:13): [True: 105k, False: 105k]
  ------------------
  483|   105k|            {
  484|   105k|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  485|   105k|                static constexpr T max_value_div_10 = max_value / 10;
  486|   507k|                for (; s < end; ++s)
  ------------------
  |  Branch (486:24): [True: 401k, False: 105k]
  ------------------
  487|   401k|                {
  488|   401k|                    T x = 0;
  489|   401k|                    switch(*s)
  490|   401k|                    {
  491|   401k|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (491:25): [True: 61.3k, False: 339k]
  |  Branch (491:34): [True: 26.9k, False: 374k]
  |  Branch (491:43): [True: 61.4k, False: 339k]
  |  Branch (491:52): [True: 106k, False: 294k]
  |  Branch (491:61): [True: 13.0k, False: 388k]
  |  Branch (491:70): [True: 11.1k, False: 390k]
  |  Branch (491:79): [True: 9.96k, False: 391k]
  |  Branch (491:88): [True: 72.2k, False: 328k]
  |  Branch (491:97): [True: 30.7k, False: 370k]
  |  Branch (491:107): [True: 7.43k, False: 393k]
  ------------------
  492|   401k|                            x = static_cast<T>(*s) - static_cast<T>('0');
  493|   401k|                            break;
  494|      0|                        default:
  ------------------
  |  Branch (494:25): [True: 0, False: 401k]
  ------------------
  495|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  496|   401k|                    }
  497|   401k|                    if (n > max_value_div_10)
  ------------------
  |  Branch (497:25): [True: 0, False: 401k]
  ------------------
  498|      0|                    {
  499|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  500|      0|                    }
  501|   401k|                    n = n * 10;
  502|   401k|                    if (n > max_value - x)
  ------------------
  |  Branch (502:25): [True: 0, False: 401k]
  ------------------
  503|      0|                    {
  504|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  505|      0|                    }
  506|   401k|                    n += x;
  507|   401k|                }
  508|   105k|                break;
  509|   105k|            }
  510|   105k|            case integer_chars_state::base16:
  ------------------
  |  Branch (510:13): [True: 0, False: 211k]
  ------------------
  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: 211k]
  ------------------
  547|      0|                JSONCONS_UNREACHABLE();
  ------------------
  |  |   79|      0|#define JSONCONS_UNREACHABLE() __builtin_unreachable()
  ------------------
  548|      0|                break;
  549|   211k|        }
  550|   211k|    }
  551|   105k|    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: 105k]
  ------------------
  552|   105k|}

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|   589k|    {
 1148|   589k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|   589k|        const uint8_t* end = it + length;
 1150|       |
 1151|   589k|        unicode_errc  result{};
 1152|  1.57M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 988k, False: 589k]
  ------------------
 1153|   988k|        {
 1154|   988k|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 708k, False: 280k]
  ------------------
 1155|   708k|            {
 1156|  4.92M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  281|  1.41M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (281:32): [True: 707k, False: 1.58k]
  |  |  |  Branch (281:34): [True: 705k, False: 1.34k]
  |  |  |  Branch (281:36): [True: 704k, False: 1.44k]
  |  |  |  Branch (281:38): [True: 702k, False: 1.82k]
  |  |  |  Branch (281:40): [True: 701k, False: 1.16k]
  |  |  |  Branch (281:42): [True: 700k, False: 522]
  |  |  |  Branch (281:44): [True: 699k, False: 1.13k]
  |  |  |  Branch (281:46): [True: 698k, False: 986]
  |  |  ------------------
  ------------------
 1157|   698k|                continue;
 1158|  4.92M|            }
 1159|   290k|    non_ascii:
 1160|   290k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|   290k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 34, False: 290k]
  ------------------
 1162|     34|            {
 1163|     34|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     34|            }
 1165|   290k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 150, False: 290k]
  ------------------
 1166|    150|            {
 1167|    150|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    150|            }
 1169|   290k|            it += len;
 1170|   290k|        }
 1171|   589k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|   589k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|   290k|    {
  306|   290k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|   290k|        const uint8_t* end = it+length;
  308|       |
  309|   290k|        uint8_t byte;
  310|   290k|        switch (length) {
  311|     35|        default:
  ------------------
  |  Branch (311:9): [True: 35, False: 290k]
  ------------------
  312|     35|            return unicode_errc::over_long_utf8_sequence;
  313|  1.08k|        case 4:
  ------------------
  |  Branch (313:9): [True: 1.08k, False: 289k]
  ------------------
  314|  1.08k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 11, False: 1.07k]
  ------------------
  315|     11|                return unicode_errc::bad_continuation_byte;
  316|  1.07k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.07k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  5.93k|        case 3:
  ------------------
  |  Branch (317:9): [True: 4.86k, False: 285k]
  ------------------
  318|  5.93k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 15, False: 5.91k]
  ------------------
  319|     15|                return unicode_errc::bad_continuation_byte;
  320|  5.91k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  5.91k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  10.1k|        case 2:
  ------------------
  |  Branch (321:9): [True: 4.26k, False: 286k]
  ------------------
  322|  10.1k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 24, False: 10.1k]
  ------------------
  323|     24|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  10.1k|            switch (*it) 
  326|  10.1k|            {
  327|       |                // no fall-through in this inner switch
  328|  2.18k|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 2.18k, False: 7.97k]
  |  Branch (328:32): [True: 7, False: 2.17k]
  ------------------
  329|  2.17k|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 254, False: 9.90k]
  |  Branch (329:32): [True: 4, False: 250]
  ------------------
  330|    318|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 318, False: 9.84k]
  |  Branch (330:32): [True: 6, False: 312]
  ------------------
  331|    485|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 485, False: 9.67k]
  |  Branch (331:32): [True: 3, False: 482]
  ------------------
  332|  6.92k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 6.92k, False: 3.24k]
  |  Branch (332:32): [True: 0, False: 6.92k]
  ------------------
  333|  10.1k|            }
  334|       |
  335|  10.1k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  10.1k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|   290k|        case 1:
  ------------------
  |  Branch (336:9): [True: 280k, False: 10.2k]
  ------------------
  337|   290k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 10.1k, False: 279k]
  |  Branch (337:32): [True: 43, False: 10.1k]
  ------------------
  338|     43|                return unicode_errc::source_illegal;
  339|   290k|            break;
  340|   290k|        }
  341|   290k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 2, False: 290k]
  ------------------
  342|      2|            return unicode_errc::source_illegal;
  343|       |
  344|   290k|        return unicode_errc();
  345|   290k|    }

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

_ZN8jsoncons4bson3TP1C2Ev:
   78|   231k|        constexpr TP1() : low(0), high(0) {}
_ZN8jsoncons4bson21decimal128_from_charsEPKcS2_RNS0_3TP1E:
  572|   115k|    {
  573|   115k|        static const string_view inf_str = "inf";
  574|   115k|        static const string_view infinity_str = "infinity";
  575|   115k|        static const string_view nan_str = "nan";
  576|       |
  577|   115k|        ptrdiff_t len = last - first;
  578|       |
  579|   115k|        bson_uint128_6464_t significand = {0,0};
  580|       | 
  581|   115k|        const char* str_read = first; /* Read pointer for consuming str. */
  582|       | 
  583|       |        /* Parsing state tracking */
  584|   115k|        bool is_negative = false;
  585|   115k|        bool saw_radix = false;
  586|   115k|        bool includes_sign = false; /* True if the input first contains a sign. */
  587|   115k|        bool found_nonzero = false;
  588|       | 
  589|   115k|        std::size_t significant_digits = 0; /* Total number of significant digits
  590|       |                                        * (no leading or trailing zero) */
  591|   115k|        std::size_t ndigits_read = 0;       /* Total number of significand digits read */
  592|   115k|        std::size_t ndigits = 0;        /* Total number of digits (no leading zeros) */
  593|   115k|        std::size_t radix_position = 0; /* The number of the digits after radix */
  594|   115k|        std::size_t first_nonzero = 0;  /* The index of the first non-zero in *str* */
  595|       | 
  596|   115k|        uint16_t digits[decimal128_limits::max_digits] = {0};
  597|   115k|        uint16_t ndigits_stored = 0;      /* The number of digits in digits */
  598|   115k|        uint16_t *digits_insert = digits; /* Insertion pointer for digits */
  599|   115k|        std::size_t first_digit = 0;           /* The index of the first non-zero digit */
  600|   115k|        std::size_t last_digit = 0;            /* The index of the last digit */
  601|       | 
  602|   115k|        int32_t exponent = 0;
  603|   115k|        uint64_t significand_high = 0; /* The high 17 digits of the significand */
  604|   115k|        uint64_t significand_low = 0;  /* The low 17 digits of the significand */
  605|   115k|        uint16_t biased_exponent = 0;  /* The biased exponent */
  606|       | 
  607|   115k|        dec.high = 0;
  608|   115k|        dec.low = 0;
  609|       | 
  610|   115k|        if (*str_read == '+' || *str_read == '-') {
  ------------------
  |  Branch (610:13): [True: 0, False: 115k]
  |  Branch (610:33): [True: 13.6k, False: 102k]
  ------------------
  611|  13.6k|           is_negative = *(str_read++) == '-';
  612|  13.6k|           includes_sign = true;
  613|  13.6k|        }
  614|       |
  615|       |        /* Check for Infinity or NaN */
  616|   115k|        if (!isdigit(*str_read) && *str_read != '.') {
  ------------------
  |  Branch (616:13): [True: 5.20k, False: 110k]
  |  Branch (616:36): [True: 5.20k, False: 0]
  ------------------
  617|  5.20k|           if (detail::dec128_istreq (str_read, last, inf_str.data(), inf_str.data()+inf_str.length()) ||
  ------------------
  |  Branch (617:16): [True: 0, False: 5.20k]
  ------------------
  618|  5.20k|               detail::dec128_istreq (str_read, last, infinity_str.data(), infinity_str.data()+infinity_str.length())) 
  ------------------
  |  Branch (618:16): [True: 3.92k, False: 1.28k]
  ------------------
  619|  3.92k|           {
  620|  3.92k|               dec = is_negative ? decimal128_limits::neg_infinity() : decimal128_limits::infinity();
  ------------------
  |  Branch (620:22): [True: 3.50k, False: 425]
  ------------------
  621|  3.92k|              return decimal128_from_chars_result{str_read,std::errc{}};
  622|  3.92k|           } 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.20k|        }
  630|       | 
  631|       |        /* Read digits */
  632|  3.60M|        while (((isdigit (*str_read) || *str_read == '.')) &&
  ------------------
  |  Branch (632:18): [True: 3.39M, False: 212k]
  |  Branch (632:41): [True: 102k, False: 110k]
  ------------------
  633|  3.49M|               (len == -1 || str_read < first + len)) {
  ------------------
  |  Branch (633:17): [True: 0, False: 3.49M]
  |  Branch (633:30): [True: 3.49M, False: 0]
  ------------------
  634|  3.49M|           if (*str_read == '.') {
  ------------------
  |  Branch (634:16): [True: 102k, False: 3.39M]
  ------------------
  635|   102k|              if (saw_radix) {
  ------------------
  |  Branch (635:19): [True: 0, False: 102k]
  ------------------
  636|      0|                 dec = decimal128_limits::nan();
  637|      0|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  638|      0|              }
  639|       | 
  640|   102k|              saw_radix = true;
  641|   102k|              str_read++;
  642|   102k|              continue;
  643|   102k|           }
  644|       | 
  645|  3.39M|           if (ndigits_stored < 34) {
  ------------------
  |  Branch (645:16): [True: 3.39M, False: 2.34k]
  ------------------
  646|  3.39M|              if (*str_read != '0' || found_nonzero) {
  ------------------
  |  Branch (646:19): [True: 3.06M, False: 325k]
  |  Branch (646:39): [True: 313k, False: 12.4k]
  ------------------
  647|  3.38M|                 if (!found_nonzero) {
  ------------------
  |  Branch (647:22): [True: 102k, False: 3.27M]
  ------------------
  648|   102k|                    first_nonzero = ndigits_read;
  649|   102k|                 }
  650|       | 
  651|  3.38M|                 found_nonzero = true;
  652|  3.38M|                 *(digits_insert++) = *(str_read) - '0'; /* Only store 34 digits */
  653|  3.38M|                 ndigits_stored++;
  654|  3.38M|              }
  655|  3.39M|           }
  656|       | 
  657|  3.39M|           if (found_nonzero) {
  ------------------
  |  Branch (657:16): [True: 3.38M, False: 12.4k]
  ------------------
  658|  3.38M|              ndigits++;
  659|  3.38M|           }
  660|       | 
  661|  3.39M|           if (saw_radix) {
  ------------------
  |  Branch (661:16): [True: 3.26M, False: 127k]
  ------------------
  662|  3.26M|              radix_position++;
  663|  3.26M|           }
  664|       | 
  665|  3.39M|           ndigits_read++;
  666|  3.39M|           str_read++;
  667|  3.39M|        }
  668|       | 
  669|   110k|        if (saw_radix && !ndigits_read) {
  ------------------
  |  Branch (669:13): [True: 102k, False: 8.47k]
  |  Branch (669:26): [True: 0, False: 102k]
  ------------------
  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|   110k|        if (*str_read == 'e' || *str_read == 'E') {
  ------------------
  |  Branch (675:13): [True: 0, False: 110k]
  |  Branch (675:33): [True: 106k, False: 4.18k]
  ------------------
  676|   106k|           ++str_read;
  677|   106k|           if (*str_read == '+') {
  ------------------
  |  Branch (677:16): [True: 11.4k, False: 95.0k]
  ------------------
  678|  11.4k|               ++str_read;
  679|  11.4k|           }
  680|   106k|           auto result = jsoncons::to_integer(str_read, last - str_read, exponent);
  681|   106k|           if (result.ec != std::errc{}) 
  ------------------
  |  Branch (681:16): [True: 600, False: 105k]
  ------------------
  682|    600|           {
  683|    600|               dec = decimal128_limits::nan();
  684|    600|               return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  685|    600|           }
  686|   105k|           str_read = result.ptr;
  687|   105k|        }
  688|       |
  689|   110k|        if ((len == -1 || str_read < first + len) && *str_read) {
  ------------------
  |  Branch (689:14): [True: 0, False: 110k]
  |  Branch (689:27): [True: 0, False: 110k]
  |  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|   110k|        first_digit = 0;
  697|       | 
  698|   110k|        if (!ndigits_stored) { /* value is zero */
  ------------------
  |  Branch (698:13): [True: 7.96k, False: 102k]
  ------------------
  699|  7.96k|           first_digit = 0;
  700|  7.96k|           last_digit = 0;
  701|  7.96k|           digits[0] = 0;
  702|  7.96k|           ndigits = 1;
  703|  7.96k|           ndigits_stored = 1;
  704|  7.96k|           significant_digits = 0;
  705|   102k|        } else {
  706|   102k|           last_digit = ndigits_stored - 1;
  707|   102k|           significant_digits = ndigits;
  708|       |           /* Mark trailing zeros as non-significant */
  709|   120k|           while (first[first_nonzero + significant_digits - 1 + includes_sign +
  ------------------
  |  Branch (709:19): [True: 18.1k, False: 102k]
  ------------------
  710|   120k|                         saw_radix] == '0') {
  711|  18.1k|              significant_digits--;
  712|  18.1k|           }
  713|   102k|        }
  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|   110k|        if (exponent <= static_cast<int32_t>(radix_position) && static_cast<int32_t>(radix_position) - exponent > (1 << 14)) {
  ------------------
  |  Branch (722:13): [True: 98.6k, False: 11.4k]
  |  Branch (722:65): [True: 0, False: 98.6k]
  ------------------
  723|      0|           exponent = decimal128_limits::exponent_min;
  724|   110k|        } else {
  725|   110k|           exponent -= static_cast<int32_t>(radix_position);
  726|   110k|        }
  727|       | 
  728|       |        /* Attempt to normalize the exponent */
  729|   110k|        while (exponent > decimal128_limits::exponent_max) {
  ------------------
  |  Branch (729:16): [True: 0, False: 110k]
  ------------------
  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|   111k|        while (exponent < decimal128_limits::exponent_min || ndigits_stored < ndigits) {
  ------------------
  |  Branch (749:16): [True: 0, False: 111k]
  |  Branch (749:62): [True: 1.99k, False: 109k]
  ------------------
  750|       |           /* Shift last digit */
  751|  1.99k|           if (last_digit == 0) {
  ------------------
  |  Branch (751:16): [True: 0, False: 1.99k]
  ------------------
  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.99k|           if (ndigits_stored < ndigits) {
  ------------------
  |  Branch (762:16): [True: 1.99k, False: 0]
  ------------------
  763|  1.99k|              if (first[ndigits - 1 + includes_sign + saw_radix] - '0' != 0 &&
  ------------------
  |  Branch (763:19): [True: 436, False: 1.55k]
  ------------------
  764|    436|                  significant_digits != 0) {
  ------------------
  |  Branch (764:19): [True: 436, False: 0]
  ------------------
  765|    436|                 dec = decimal128_limits::nan();
  766|    436|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  767|    436|              }
  768|       | 
  769|  1.55k|              ndigits--; /* adjust to match digits not stored */
  770|  1.55k|           } 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.55k|           if (exponent < decimal128_limits::exponent_max) {
  ------------------
  |  Branch (781:16): [True: 1.55k, False: 0]
  ------------------
  782|  1.55k|              exponent++;
  783|  1.55k|           } else {
  784|      0|              dec = decimal128_limits::nan();
  785|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  786|      0|           }
  787|  1.55k|        }
  788|       | 
  789|       |        /* Round */
  790|       |        /* We've normalized the exponent, but might still need to round. */
  791|   109k|        if (last_digit - first_digit + 1 < significant_digits) {
  ------------------
  |  Branch (791:13): [True: 568, False: 109k]
  ------------------
  792|    568|           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|    568|           round_digit =
  797|    568|              first[first_nonzero + last_digit + includes_sign + saw_radix + 1] -
  798|    568|              '0';
  799|       | 
  800|    568|           if (round_digit != 0) {
  ------------------
  |  Branch (800:16): [True: 568, False: 0]
  ------------------
  801|       |              /* Inexact (non-zero) rounding is not allowed */
  802|    568|              dec = decimal128_limits::nan();
  803|    568|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  804|    568|           }
  805|    568|        }
  806|       | 
  807|       |        /* Encode significand */
  808|   109k|        significand_high = 0,   /* The high 17 digits of the significand */
  809|   109k|           significand_low = 0; /* The low 17 digits of the significand */
  810|       | 
  811|   109k|        if (significant_digits == 0) { /* read a zero */
  ------------------
  |  Branch (811:13): [True: 7.96k, False: 101k]
  ------------------
  812|  7.96k|           significand_high = 0;
  813|  7.96k|           significand_low = 0;
  814|   101k|        } else if (last_digit - first_digit < 17) {
  ------------------
  |  Branch (814:20): [True: 1.34k, False: 99.8k]
  ------------------
  815|  1.34k|           std::size_t d_idx = first_digit;
  816|  1.34k|           significand_low = digits[d_idx++];
  817|       | 
  818|  8.82k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (818:19): [True: 7.47k, False: 1.34k]
  ------------------
  819|  7.47k|              significand_low *= 10;
  820|  7.47k|              significand_low += digits[d_idx];
  821|  7.47k|              significand_high = 0;
  822|  7.47k|           }
  823|  99.8k|        } else {
  824|  99.8k|           std::size_t d_idx = first_digit;
  825|  99.8k|           significand_high = digits[d_idx++];
  826|       | 
  827|  1.62M|           for (; d_idx <= last_digit - 17; d_idx++) {
  ------------------
  |  Branch (827:19): [True: 1.52M, False: 99.8k]
  ------------------
  828|  1.52M|              significand_high *= 10;
  829|  1.52M|              significand_high += digits[d_idx];
  830|  1.52M|           }
  831|       | 
  832|  99.8k|           significand_low = digits[d_idx++];
  833|       | 
  834|  1.69M|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (834:19): [True: 1.59M, False: 99.8k]
  ------------------
  835|  1.59M|              significand_low *= 10;
  836|  1.59M|              significand_low += digits[d_idx];
  837|  1.59M|           }
  838|  99.8k|        }
  839|       | 
  840|   109k|        detail::mul_64x64 (significand_high, 100000000000000000ull, &significand);
  841|   109k|        significand.low += significand_low;
  842|       | 
  843|   109k|        if (significand.low < significand_low) {
  ------------------
  |  Branch (843:13): [True: 14.3k, False: 94.8k]
  ------------------
  844|  14.3k|           significand.high += 1;
  845|  14.3k|        }
  846|       | 
  847|       | 
  848|   109k|        biased_exponent = static_cast<uint16_t>(exponent + static_cast<int32_t>(decimal128_limits::exponent_bias));
  849|       | 
  850|       |        /* Encode combination, exponent, and significand. */
  851|   109k|        if ((significand.high >> 49) & 1) {
  ------------------
  |  Branch (851:13): [True: 0, False: 109k]
  ------------------
  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|   109k|        } else {
  857|   109k|           dec.high |= (biased_exponent & 0x3fffull) << 49;
  858|   109k|           dec.high |= significand.high & 0x1ffffffffffffull;
  859|   109k|        }
  860|       | 
  861|   109k|        dec.low = significand.low;
  862|       | 
  863|       |        /* Encode sign */
  864|   109k|        if (is_negative) {
  ------------------
  |  Branch (864:13): [True: 9.25k, False: 99.8k]
  ------------------
  865|  9.25k|           dec.high |= 0x8000000000000000ull;
  866|  9.25k|        }
  867|       | 
  868|   109k|        return decimal128_from_chars_result{str_read,std::errc{}};
  869|   109k|    }
_ZN8jsoncons4bson6detail13dec128_istreqEPKcS3_S3_S3_:
  289|  11.7k|        {
  290|  58.7k|            while (!(a == lasta && b == lastb)) 
  ------------------
  |  Branch (290:22): [True: 5.20k, False: 53.5k]
  |  Branch (290:36): [True: 5.20k, False: 0]
  ------------------
  291|  53.5k|            {
  292|       |               // strings are different lengths
  293|  53.5k|               if (a == lasta || b == lastb) 
  ------------------
  |  Branch (293:20): [True: 0, False: 53.5k]
  |  Branch (293:34): [True: 3.92k, False: 49.6k]
  ------------------
  294|  3.92k|               {
  295|  3.92k|                  return false;
  296|  3.92k|               }
  297|       |         
  298|  49.6k|               if (dec128_tolower (*a) != dec128_tolower (*b)) {
  ------------------
  |  Branch (298:20): [True: 2.56k, False: 47.0k]
  ------------------
  299|  2.56k|                  return false;
  300|  2.56k|               }
  301|       |         
  302|  47.0k|               a++;
  303|  47.0k|               b++;
  304|  47.0k|            }
  305|       |         
  306|  5.20k|            return true;
  307|  11.7k|        }
_ZN8jsoncons4bson6detail14dec128_tolowerEc:
  266|  99.2k|        {
  267|  99.2k|           if (isupper (c)) {
  ------------------
  |  Branch (267:16): [True: 12.9k, False: 86.2k]
  ------------------
  268|  12.9k|              c += 32;
  269|  12.9k|           }
  270|       |
  271|  99.2k|           return c;
  272|  99.2k|        }
_ZN8jsoncons4bson17decimal128_limits12neg_infinityEv:
  124|  3.50k|        static constexpr decimal128_t neg_infinity() {return decimal128_t(0x7800000000000000ull + 0x8000000000000000ull, 0);}
_ZN8jsoncons4bson3TP1C2Emm:
   79|  6.81k|        constexpr TP1(uint64_t hi, uint64_t lo) : low(lo), high(hi) {}
_ZN8jsoncons4bson17decimal128_limits8infinityEv:
  123|    425|        static constexpr decimal128_t infinity() {return decimal128_t(0x7800000000000000ull, 0);}
_ZN8jsoncons4bson17decimal128_limits3nanEv:
  122|  2.88k|        static constexpr decimal128_t nan() {return decimal128_t(0x7c00000000000000ull, 0);}
_ZN8jsoncons4bson6detail9mul_64x64EmmPNS0_19bson_uint128_6464_tE:
  221|   109k|        {
  222|   109k|            uint64_t left_high, left_low, right_high, right_low, product_high,
  223|   109k|               product_mid, product_mid2, product_low;
  224|   109k|            bson_uint128_6464_t rt = {0,0};
  225|       | 
  226|   109k|            if (!left && !right) {
  ------------------
  |  Branch (226:17): [True: 9.31k, False: 99.8k]
  |  Branch (226:26): [True: 0, False: 9.31k]
  ------------------
  227|      0|               *product = rt;
  228|      0|               return;
  229|      0|            }
  230|       | 
  231|   109k|            left_high = left >> 32;
  232|   109k|            left_low = (uint32_t) left;
  233|   109k|            right_high = right >> 32;
  234|   109k|            right_low = (uint32_t) right;
  235|       | 
  236|   109k|            product_high = left_high * right_high;
  237|   109k|            product_mid = left_high * right_low;
  238|   109k|            product_mid2 = left_low * right_high;
  239|   109k|            product_low = left_low * right_low;
  240|       | 
  241|   109k|            product_high += product_mid >> 32;
  242|   109k|            product_mid = (uint32_t) product_mid + product_mid2 + (product_low >> 32);
  243|       | 
  244|   109k|            product_high = product_high + (product_mid >> 32);
  245|   109k|            product_low = (product_mid << 32) + (uint32_t) product_low;
  246|       | 
  247|   109k|            rt.high = product_high;
  248|   109k|            rt.low = product_low;
  249|   109k|            *product = rt;
  250|   109k|        }
_ZN8jsoncons4bson19decimal128_to_charsEPcS1_RKNS0_3TP1E:
  335|   116k|    {
  336|   116k|        static const std::string bson_decimal128_inf = "Infinity";
  337|   116k|        static const std::string bson_decimal128_nan = "NaN";
  338|       |
  339|   116k|        static constexpr uint32_t combination_mask = 0x1f;   /* Extract least significant 5 bits */
  340|   116k|        static constexpr uint32_t exponent_mask = 0x3fff;    /* Extract least significant 14 bits */
  341|   116k|        static constexpr uint32_t combination_infinity = 30; /* Value of combination field for Inf */
  342|   116k|        static constexpr uint32_t combination_nan = 31;      /* Value of combination field for NaN */
  343|   116k|        static constexpr uint32_t exponent_bias = 6176;      /* decimal128 exponent bias */
  344|       |
  345|   116k|        char* str_out = first;      /* output pointer in string */
  346|   116k|        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|   116k|        uint32_t high;                   /* bits 0 - 31 */
  351|   116k|        uint32_t midh;                   /* bits 32 - 63 */
  352|   116k|        uint32_t midl;                   /* bits 64 - 95 */
  353|   116k|        uint32_t low;                    /* bits 96 - 127 */
  354|   116k|        uint32_t combination;            /* bits 1 - 5 */
  355|   116k|        uint32_t biased_exponent;        /* decoded biased exponent (14 bits) */
  356|   116k|        uint32_t significand_digits = 0; /* the number of significand digits */
  357|   116k|        uint32_t significand[36] = {0};  /* the base-10 digits in the significand */
  358|   116k|        uint32_t *significand_read = significand; /* read pointer into significand */
  359|   116k|        int32_t exponent;                         /* unbiased exponent */
  360|   116k|        int32_t scientific_exponent; /* the exponent if scientific notation is
  361|       |                                      * used */
  362|   116k|        bool is_zero = false;        /* true if the number is zero */
  363|       | 
  364|   116k|        uint8_t significand_msb; /* the most signifcant significand bits (50-46) */
  365|   116k|        bson_uint128_t
  366|   116k|           significand128; /* temporary storage for significand decoding */
  367|       | 
  368|   116k|        memset (significand_str, 0, sizeof (significand_str));
  369|       | 
  370|   116k|        if ((int64_t) dec.high < 0) { /* negative */
  ------------------
  |  Branch (370:13): [True: 14.4k, False: 101k]
  ------------------
  371|  14.4k|           *(str_out++) = '-';
  372|  14.4k|        }
  373|       | 
  374|   116k|        low = (uint32_t) dec.low, midl = (uint32_t) (dec.low >> 32),
  375|   116k|        midh = (uint32_t) dec.high, high = (uint32_t) (dec.high >> 32);
  376|       | 
  377|       |        /* Decode combination field and exponent */
  378|   116k|        combination = (high >> 26) & combination_mask;
  379|       | 
  380|   116k|        if (JSONCONS_UNLIKELY ((combination >> 3) == 3)) {
  ------------------
  |  |   78|   116k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 12.9k, False: 103k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  12.9k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 3.92k, False: 9.04k]
  ------------------
  383|  3.92k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 3.92k, False: 0]
  ------------------
  384|  3.92k|               {
  385|  3.92k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  3.92k|                   str_out += bson_decimal128_inf.size();
  387|  3.92k|               }
  388|  3.92k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  3.92k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  9.04k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 1.28k, False: 7.75k]
  ------------------
  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|  7.75k|           } else {
  404|  7.75k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  7.75k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  7.75k|           }
  407|   103k|        } else {
  408|   103k|           significand_msb = (high >> 14) & 0x7;
  409|   103k|           biased_exponent = (high >> 17) & exponent_mask;
  410|   103k|        }
  411|       | 
  412|   110k|        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|   110k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|   110k|        significand128.parts[1] = midh;
  420|   110k|        significand128.parts[2] = midl;
  421|   110k|        significand128.parts[3] = low;
  422|       | 
  423|   110k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 4.97k, False: 105k]
  |  Branch (423:45): [True: 3.42k, False: 1.55k]
  ------------------
  424|  3.42k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 1.25k, False: 2.16k]
  |  Branch (424:45): [True: 212, False: 1.04k]
  ------------------
  425|    212|           is_zero = true;
  426|   110k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 7.75k, False: 102k]
  ------------------
  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|  7.75k|           is_zero = true;
  434|   102k|        } else {
  435|   514k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 411k, False: 102k]
  ------------------
  436|   411k|              uint32_t least_digits = 0;
  437|   411k|              detail::bson_uint128_divide1B (
  438|   411k|                 significand128, &significand128, &least_digits);
  439|       | 
  440|       |              /* We now have the 9 least significant digits (in base 2). */
  441|       |              /* Convert and output to string. */
  442|   411k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 7.03k, False: 404k]
  ------------------
  443|  7.03k|                 continue;
  444|  7.03k|              }
  445|       | 
  446|  4.04M|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 3.63M, False: 404k]
  ------------------
  447|  3.63M|                 significand[k * 9 + j] = least_digits % 10;
  448|  3.63M|                 least_digits /= 10;
  449|  3.63M|              }
  450|   404k|           }
  451|   102k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|   110k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 7.97k, False: 102k]
  ------------------
  458|  7.97k|           significand_digits = 1;
  459|  7.97k|           *significand_read = 0;
  460|   102k|        } else {
  461|   102k|           significand_digits = 36;
  462|   417k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 314k, False: 102k]
  ------------------
  463|   314k|              significand_digits--;
  464|   314k|              significand_read++;
  465|   314k|           }
  466|   102k|        }
  467|       | 
  468|   110k|        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|   110k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 95.0k, False: 15.7k]
  |  Branch (478:41): [True: 11.5k, False: 4.19k]
  ------------------
  479|       |           /* Scientific format */
  480|   106k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|   106k|           significand_digits--;
  482|       | 
  483|   106k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 99.1k, False: 7.44k]
  ------------------
  484|  99.1k|              *(str_out++) = '.';
  485|  99.1k|           }
  486|       | 
  487|  3.29M|           for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (487:36): [True: 3.19M, False: 106k]
  |  Branch (487:62): [True: 3.19M, False: 125]
  ------------------
  488|  3.19M|              *(str_out++) = char(*(significand_read++)) + '0';
  489|  3.19M|           }
  490|       |           /* Exponent */
  491|   106k|           *(str_out++) = 'E';
  492|       |
  493|   106k|           std::string s;
  494|   106k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 11.5k, False: 95.0k]
  ------------------
  495|  11.5k|               s.push_back('+');
  496|  11.5k|           }
  497|   106k|           jsoncons::from_integer(scientific_exponent, s);
  498|   106k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 106k, False: 601]
  ------------------
  499|   106k|           {
  500|   106k|               std::memcpy(str_out, s.data(), s.size());
  501|   106k|           }
  502|    601|           else
  503|    601|           {
  504|    601|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|    601|           }
  506|   106k|           str_out += s.size();
  507|   106k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  4.19k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 1.02k, False: 3.16k]
  ------------------
  510|  7.23k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 6.21k, False: 1.02k]
  |  Branch (510:65): [True: 6.21k, False: 0]
  ------------------
  511|  6.21k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  6.21k|              }
  513|  3.16k|           } else {
  514|  3.16k|              int32_t radix_position = significand_digits + exponent;
  515|       | 
  516|  3.16k|              if (radix_position > 0) { /* non-zero digits before radix */
  ------------------
  |  Branch (516:19): [True: 1.55k, False: 1.61k]
  ------------------
  517|  1.55k|                 for (int32_t i = 0;
  518|  14.2k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 12.6k, False: 1.55k]
  |  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.61k|              } else { /* leading zero before radix point */
  523|  1.61k|                 *(str_out++) = '0';
  524|  1.61k|              }
  525|       | 
  526|  3.16k|              *(str_out++) = '.';
  527|  6.02k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 2.86k, False: 3.16k]
  ------------------
  528|  2.86k|                 *(str_out++) = '0';
  529|  2.86k|              }
  530|       | 
  531|  3.16k|              for (std::size_t i = 0;
  532|  82.2k|                   (i < significand_digits - (std::max) (radix_position - 1, 0)) &&
  ------------------
  |  Branch (532:20): [True: 79.0k, False: 3.16k]
  |  Branch (532:20): [True: 79.0k, False: 3.16k]
  ------------------
  533|  79.0k|                   (str_out < last);
  ------------------
  |  Branch (533:20): [True: 79.0k, False: 0]
  ------------------
  534|  79.0k|                   i++) {
  535|  79.0k|                 *(str_out++) = char(*(significand_read++)) + '0';
  536|  79.0k|              }
  537|  3.16k|           }
  538|  4.19k|        }
  539|   110k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|   110k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|   411k|        {
  179|   411k|            static constexpr uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|   411k|            uint64_t _rem = 0;
  181|   411k|            int i = 0;
  182|       |            
  183|   411k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 313k, False: 98.0k]
  |  Branch (183:36): [True: 213k, False: 99.9k]
  |  Branch (183:55): [True: 111k, False: 102k]
  ------------------
  184|   111k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 7.01k, False: 104k]
  ------------------
  185|  7.01k|               *quotient = value;
  186|  7.01k|               *rem = 0;
  187|  7.01k|               return;
  188|  7.01k|            }
  189|       |            
  190|  2.02M|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 1.61M, False: 404k]
  ------------------
  191|  1.61M|               _rem <<= 32; /* Adjust remainder to match value of next dividend */
  192|  1.61M|               _rem += value.parts[i]; /* Add the divided to _rem */
  193|  1.61M|               value.parts[i] = (uint32_t) (_rem / DIVISOR);
  194|  1.61M|               _rem %= DIVISOR; /* Store the remainder */
  195|  1.61M|            }
  196|       |            
  197|   404k|            *quotient = value;
  198|   404k|            *rem = (uint32_t) _rem;
  199|   404k|        }

_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKS9_:
  108|  3.22k|       : basic_bson_encoder(std::forward<Sink>(sink),
  109|  3.22k|                            bson_encode_options(),
  110|  3.22k|                            alloc)
  111|  3.22k|    {
  112|  3.22k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKNS0_19bson_encode_optionsERKS9_:
  117|  3.22k|       : sink_(std::forward<Sink>(sink)),
  118|  3.22k|         max_nesting_depth_(options.max_nesting_depth()),
  119|  3.22k|         alloc_(alloc)
  120|  3.22k|    {
  121|  3.22k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE15visit_end_arrayERKNS_11ser_contextERNS3_10error_codeE:
  218|  2.11k|    {
  219|  2.11k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  2.11k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 2.11k]
  |  |  ------------------
  |  |   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.11k|        --nesting_depth_;
  221|       |
  222|  2.11k|        buffer_.push_back(0x00);
  223|       |
  224|  2.11k|        std::size_t length = buffer_.size() - stack_.back().offset();
  225|  2.11k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  226|       |
  227|  2.11k|        stack_.pop_back();
  228|  2.11k|        if (stack_.empty())
  ------------------
  |  Branch (228:13): [True: 0, False: 2.11k]
  ------------------
  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.11k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  2.11k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  236|  2.11k|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item6offsetEv:
   66|  33.6k|        {
   67|  33.6k|            return offset_;
   68|  33.6k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  498|  4.37k|    {
  499|  4.37k|        static constexpr uint64_t max_value_div_1000 = (std::numeric_limits<uint64_t>::max)() / 1000;
  500|  4.37k|        if (stack_.empty())
  ------------------
  |  Branch (500:13): [True: 0, False: 4.37k]
  ------------------
  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.37k|        switch (tag)
  507|  4.37k|        {
  508|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (508:13): [True: 0, False: 4.37k]
  ------------------
  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.37k]
  ------------------
  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.37k]
  ------------------
  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.37k|            default:
  ------------------
  |  Branch (529:13): [True: 4.37k, False: 0]
  ------------------
  530|  4.37k|            {
  531|  4.37k|                if (val <= static_cast<uint64_t>((std::numeric_limits<int32_t>::max)()))
  ------------------
  |  Branch (531:21): [True: 1.27k, False: 3.09k]
  ------------------
  532|  1.27k|                {
  533|  1.27k|                    before_value(jsoncons::bson::bson_type::int32_type);
  534|  1.27k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  535|  1.27k|                }
  536|  3.09k|                else if (val <= static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()))
  ------------------
  |  Branch (536:26): [True: 2.19k, False: 904]
  ------------------
  537|  2.19k|                {
  538|  2.19k|                    before_value(jsoncons::bson::bson_type::int64_type);
  539|  2.19k|                    binary::native_to_little(static_cast<uint64_t>(val),std::back_inserter(buffer_));
  540|  2.19k|                }
  541|    904|                else
  542|    904|                {
  543|    904|                    ec = bson_errc::number_too_large;
  544|    904|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    904|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  545|    904|                }
  546|  3.47k|                break;
  547|  4.37k|            }
  548|  4.37k|        }
  549|  3.47k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  3.47k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  550|  4.37k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12before_valueEh:
  568|  4.36M|    {
  569|  4.36M|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  4.36M|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 4.36M]
  |  |  ------------------
  |  |   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.36M|        if (stack_.back().is_object())
  ------------------
  |  Branch (570:13): [True: 372k, False: 3.99M]
  ------------------
  571|   372k|        {
  572|   372k|            buffer_[stack_.back().member_offset()] = code;
  573|   372k|        }
  574|  3.99M|        else
  575|  3.99M|        {
  576|  3.99M|            buffer_.push_back(code);
  577|  3.99M|            std::string name = std::to_string(stack_.back().next_index());
  578|  3.99M|            buffer_.insert(buffer_.end(), name.begin(), name.end());
  579|  3.99M|            buffer_.push_back(0x00);
  580|  3.99M|        }
  581|  4.36M|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item9is_objectEv:
   86|  4.36M|        {
   87|  4.36M|            return type_ == jsoncons::bson::bson_container_type::document;
   88|  4.36M|        }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEv:
   71|   372k|        {
   72|   372k|            return name_offset_;
   73|   372k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item10next_indexEv:
   81|  3.99M|        {
   82|  3.99M|            return index_++;
   83|  3.99M|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  439|  42.0k|    {
  440|  42.0k|        static constexpr int64_t min_value_div_1000 = (std::numeric_limits<int64_t>::min)() / 1000;
  441|  42.0k|        static constexpr int64_t max_value_div_1000 = (std::numeric_limits<int64_t>::max)() / 1000;
  442|  42.0k|        if (stack_.empty())
  ------------------
  |  Branch (442:13): [True: 36, False: 42.0k]
  ------------------
  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|  42.0k|        switch (tag)
  449|  42.0k|        {
  450|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (450:13): [True: 0, False: 42.0k]
  ------------------
  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.05k|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (464:13): [True: 5.05k, False: 36.9k]
  ------------------
  465|  5.05k|                before_value(jsoncons::bson::bson_type::datetime_type);
  466|  5.05k|                binary::native_to_little(val,std::back_inserter(buffer_));
  467|  5.05k|                break;
  468|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (468:13): [True: 0, False: 42.0k]
  ------------------
  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|  36.9k|            default:
  ------------------
  |  Branch (476:13): [True: 36.9k, False: 5.05k]
  ------------------
  477|  36.9k|            {
  478|  36.9k|                if (val >= (std::numeric_limits<int32_t>::lowest)() && val <= (std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (478:21): [True: 36.6k, False: 309]
  |  Branch (478:72): [True: 4.10k, False: 32.5k]
  ------------------
  479|  4.10k|                {
  480|  4.10k|                    before_value(jsoncons::bson::bson_type::int32_type);
  481|  4.10k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  482|  4.10k|                }
  483|  32.8k|                else 
  484|  32.8k|                {
  485|  32.8k|                    before_value(jsoncons::bson::bson_type::int64_type);
  486|  32.8k|                    binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  487|  32.8k|                }
  488|  36.9k|                break;
  489|      0|            }
  490|  42.0k|        }
  491|  42.0k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  42.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  492|  42.0k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  556|  1.33k|    {
  557|  1.33k|        if (stack_.empty())
  ------------------
  |  Branch (557:13): [True: 0, False: 1.33k]
  ------------------
  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.33k|        before_value(jsoncons::bson::bson_type::double_type);
  563|  1.33k|        binary::native_to_little(val,std::back_inserter(buffer_));
  564|  1.33k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.33k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  565|  1.33k|    }
_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|  81.1k|    {
  154|  81.1k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|  81.1k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 16.4k, False: 64.6k]
  |  |  ------------------
  ------------------
  155|  16.4k|        {
  156|  16.4k|            ec = bson_errc::max_nesting_depth_exceeded;
  157|  16.4k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  16.4k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  158|  16.4k|        } 
  159|  64.6k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (159:13): [True: 61.4k, False: 3.21k]
  ------------------
  160|  61.4k|        {
  161|  61.4k|            if (stack_.empty())
  ------------------
  |  Branch (161:17): [True: 0, False: 61.4k]
  ------------------
  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|  61.4k|            before_value(jsoncons::bson::bson_type::document_type);
  167|  61.4k|        }
  168|       |
  169|  64.6k|        stack_.emplace_back(jsoncons::bson::bson_container_type::document, buffer_.size());
  170|  64.6k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  171|       |
  172|  64.6k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  64.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  173|  64.6k|    }
_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|  14.6k|    {
  177|  14.6k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  14.6k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 14.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|  14.6k|        --nesting_depth_;
  179|       |
  180|  14.6k|        buffer_.push_back(0x00);
  181|       |
  182|  14.6k|        std::size_t length = buffer_.size() - stack_.back().offset();
  183|  14.6k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  184|       |
  185|  14.6k|        stack_.pop_back();
  186|  14.6k|        if (stack_.empty())
  ------------------
  |  Branch (186:13): [True: 145, False: 14.5k]
  ------------------
  187|    145|        {
  188|    145|            for (auto c : buffer_)
  ------------------
  |  Branch (188:25): [True: 6.21M, False: 145]
  ------------------
  189|  6.21M|            {
  190|  6.21M|                sink_.push_back(c);
  191|  6.21M|            }
  192|    145|        }
  193|  14.6k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  14.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  194|  14.6k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  197|   703k|    {
  198|   703k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|   703k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 650k, False: 53.0k]
  |  |  ------------------
  ------------------
  199|   650k|        {
  200|   650k|            ec = bson_errc::max_nesting_depth_exceeded;
  201|   650k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   650k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  202|   650k|        } 
  203|  53.0k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (203:13): [True: 53.0k, False: 0]
  ------------------
  204|  53.0k|        {
  205|  53.0k|            if (stack_.empty())
  ------------------
  |  Branch (205:17): [True: 0, False: 53.0k]
  ------------------
  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|  53.0k|            before_value(jsoncons::bson::bson_type::array_type);
  211|  53.0k|        }
  212|  53.0k|        stack_.emplace_back(jsoncons::bson::bson_container_type::array, buffer_.size());
  213|  53.0k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  214|  53.0k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  53.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  215|  53.0k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9visit_keyERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEERKNS_11ser_contextERNS3_10error_codeE:
  239|   319k|    {
  240|   319k|        stack_.back().member_offset(buffer_.size());
  241|   319k|        buffer_.push_back(0x00); // reserve space for code
  242|   319k|        for (auto c : name)
  ------------------
  |  Branch (242:21): [True: 1.13M, False: 319k]
  ------------------
  243|  1.13M|        {
  244|  1.13M|            buffer_.push_back(c);
  245|  1.13M|        }
  246|   319k|        buffer_.push_back(0x00);
  247|   319k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   319k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  248|   319k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEm:
   76|   319k|        {
   77|   319k|            name_offset_ = offset;
   78|   319k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  251|  3.86M|    {
  252|  3.86M|        if (stack_.empty())
  ------------------
  |  Branch (252:13): [True: 171, False: 3.86M]
  ------------------
  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|  3.86M|        switch (tag)
  258|  3.86M|        {
  259|  1.16k|            case semantic_tag::undefined:
  ------------------
  |  Branch (259:13): [True: 1.16k, False: 3.86M]
  ------------------
  260|  1.16k|                before_value(jsoncons::bson::bson_type::undefined_type);
  261|  1.16k|                break;
  262|  3.86M|            default:
  ------------------
  |  Branch (262:13): [True: 3.86M, False: 1.16k]
  ------------------
  263|  3.86M|                before_value(jsoncons::bson::bson_type::null_type);
  264|  3.86M|                break;
  265|  3.86M|        }
  266|  3.86M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  3.86M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  267|  3.86M|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  270|  4.63k|    {
  271|  4.63k|        if (stack_.empty())
  ------------------
  |  Branch (271:13): [True: 0, False: 4.63k]
  ------------------
  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|  4.63k|        before_value(jsoncons::bson::bson_type::bool_type);
  277|  4.63k|        if (val)
  ------------------
  |  Branch (277:13): [True: 3.21k, False: 1.41k]
  ------------------
  278|  3.21k|        {
  279|  3.21k|            buffer_.push_back(0x01);
  280|  3.21k|        }
  281|  1.41k|        else
  282|  1.41k|        {
  283|  1.41k|            buffer_.push_back(0x00);
  284|  1.41k|        }
  285|       |
  286|  4.63k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.63k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  287|  4.63k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_stringERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  290|   281k|    {
  291|   281k|        if (stack_.empty())
  ------------------
  |  Branch (291:13): [True: 89, False: 281k]
  ------------------
  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|   281k|        switch (tag)
  298|   281k|        {
  299|   115k|            case semantic_tag::float128:
  ------------------
  |  Branch (299:13): [True: 115k, False: 165k]
  ------------------
  300|   115k|            {
  301|   115k|                before_value(jsoncons::bson::bson_type::decimal128_type);
  302|   115k|                decimal128_t dec;
  303|   115k|                auto rc = decimal128_from_chars(sv.data(), sv.data()+sv.size(), dec);
  304|   115k|                if (rc.ec != std::errc{})
  ------------------
  |  Branch (304:21): [True: 1.60k, False: 114k]
  ------------------
  305|  1.60k|                {
  306|  1.60k|                    ec = bson_errc::invalid_decimal128_string;
  307|  1.60k|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.60k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  308|  1.60k|                }
  309|   114k|                binary::native_to_little(dec.low,std::back_inserter(buffer_));
  310|   114k|                binary::native_to_little(dec.high,std::back_inserter(buffer_));
  311|   114k|                break;
  312|   115k|            }
  313|  25.8k|            case semantic_tag::id:
  ------------------
  |  Branch (313:13): [True: 25.8k, False: 255k]
  ------------------
  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|   115k|            }
  323|  3.95k|            case semantic_tag::regex:
  ------------------
  |  Branch (323:13): [True: 3.95k, False: 277k]
  ------------------
  324|  3.95k|            {
  325|  3.95k|                before_value(jsoncons::bson::bson_type::regex_type);
  326|  3.95k|                std::size_t first = sv.find_first_of('/');
  327|  3.95k|                std::size_t last = sv.find_last_of('/');
  328|  3.95k|                if (first == string_view::npos || last == string_view::npos || first == last)
  ------------------
  |  Branch (328:21): [True: 0, False: 3.95k]
  |  Branch (328:51): [True: 0, False: 3.95k]
  |  Branch (328:80): [True: 0, False: 3.95k]
  ------------------
  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|  3.95k|                string_view regex = sv.substr(first+1,last-1);
  334|  3.95k|                for (auto c : regex)
  ------------------
  |  Branch (334:29): [True: 5.07M, False: 3.95k]
  ------------------
  335|  5.07M|                {
  336|  5.07M|                    buffer_.push_back(c);
  337|  5.07M|                }
  338|  3.95k|                buffer_.push_back(0x00);
  339|  3.95k|                string_view options = sv.substr(last+1);
  340|  3.95k|                for (auto c : options)
  ------------------
  |  Branch (340:29): [True: 2.51M, False: 3.95k]
  ------------------
  341|  2.51M|                {
  342|  2.51M|                    buffer_.push_back(c);
  343|  2.51M|                }
  344|  3.95k|                buffer_.push_back(0x00);
  345|  3.95k|                break;
  346|  3.95k|            }
  347|   135k|            default:
  ------------------
  |  Branch (347:13): [True: 135k, False: 145k]
  ------------------
  348|   135k|                switch (tag)
  349|   135k|                {
  350|    532|                    case semantic_tag::code:
  ------------------
  |  Branch (350:21): [True: 532, False: 134k]
  ------------------
  351|    532|                        before_value(jsoncons::bson::bson_type::javascript_type);
  352|    532|                        break;
  353|   134k|                    default:
  ------------------
  |  Branch (353:21): [True: 134k, False: 532]
  ------------------
  354|   134k|                        before_value(jsoncons::bson::bson_type::string_type);
  355|   134k|                        break;
  356|   135k|                }
  357|   135k|                std::size_t offset = buffer_.size();
  358|   135k|                buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  359|   135k|                std::size_t string_offset = buffer_.size();
  360|   135k|                auto sink = unicode_traits::validate(sv.data(), sv.size());
  361|   135k|                if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (361:21): [True: 0, False: 135k]
  ------------------
  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|   135k|                for (auto c : sv)
  ------------------
  |  Branch (366:29): [True: 2.38M, False: 135k]
  ------------------
  367|  2.38M|                {
  368|  2.38M|                    buffer_.push_back(c);
  369|  2.38M|                }
  370|   135k|                buffer_.push_back(0x00);
  371|   135k|                std::size_t length = buffer_.size() - string_offset;
  372|   135k|                binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  373|   135k|                break;
  374|   281k|        }
  375|       |
  376|   279k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   279k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|   281k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_byte_stringERKNS_16byte_string_viewEmRKNS_11ser_contextERNS3_10error_codeE:
  411|  55.5k|    {
  412|  55.5k|        if (stack_.empty())
  ------------------
  |  Branch (412:13): [True: 22, False: 55.5k]
  ------------------
  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|  55.5k|        before_value(jsoncons::bson::bson_type::binary_type);
  418|       |
  419|  55.5k|        std::size_t offset = buffer_.size();
  420|  55.5k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  421|  55.5k|        std::size_t string_offset = buffer_.size();
  422|       |
  423|  55.5k|        buffer_.push_back(static_cast<uint8_t>(raw_tag)); // default subtype
  424|       |
  425|  55.5k|        for (auto c : b)
  ------------------
  |  Branch (425:21): [True: 9.49M, False: 55.5k]
  ------------------
  426|  9.49M|        {
  427|  9.49M|            buffer_.push_back(c);
  428|  9.49M|        }
  429|  55.5k|        std::size_t length = buffer_.size() - string_offset - 1;
  430|  55.5k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  431|       |
  432|  55.5k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  55.5k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  433|  55.5k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEED2Ev:
  124|  3.22k|    {
  125|  3.22k|        sink_.flush();
  126|  3.22k|    }

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

_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|   315k|           case '0':
  ------------------
  |  Branch (101:12): [True: 315k, False: 305k]
  ------------------
  102|   315k|              return 0;
  103|  20.4k|           case '1':
  ------------------
  |  Branch (103:12): [True: 20.4k, False: 600k]
  ------------------
  104|  20.4k|              return 1;
  105|  15.2k|           case '2':
  ------------------
  |  Branch (105:12): [True: 15.2k, False: 605k]
  ------------------
  106|  15.2k|              return 2;
  107|  15.9k|           case '3':
  ------------------
  |  Branch (107:12): [True: 15.9k, False: 605k]
  ------------------
  108|  15.9k|              return 3;
  109|  7.88k|           case '4':
  ------------------
  |  Branch (109:12): [True: 7.88k, False: 613k]
  ------------------
  110|  7.88k|              return 4;
  111|  10.4k|           case '5':
  ------------------
  |  Branch (111:12): [True: 10.4k, False: 610k]
  ------------------
  112|  10.4k|              return 5;
  113|  6.75k|           case '6':
  ------------------
  |  Branch (113:12): [True: 6.75k, False: 614k]
  ------------------
  114|  6.75k|              return 6;
  115|   176k|           case '7':
  ------------------
  |  Branch (115:12): [True: 176k, False: 444k]
  ------------------
  116|   176k|              return 7;
  117|  2.89k|           case '8':
  ------------------
  |  Branch (117:12): [True: 2.89k, False: 618k]
  ------------------
  118|  2.89k|              return 8;
  119|  2.81k|           case '9':
  ------------------
  |  Branch (119:12): [True: 2.81k, False: 618k]
  ------------------
  120|  2.81k|              return 9;
  121|  10.1k|           case 'a':
  ------------------
  |  Branch (121:12): [True: 10.1k, False: 610k]
  ------------------
  122|  10.1k|           case 'A':
  ------------------
  |  Branch (122:12): [True: 0, False: 621k]
  ------------------
  123|  10.1k|              return 0xa;
  124|  2.10k|           case 'b':
  ------------------
  |  Branch (124:12): [True: 2.10k, False: 618k]
  ------------------
  125|  2.10k|           case 'B':
  ------------------
  |  Branch (125:12): [True: 0, False: 621k]
  ------------------
  126|  2.10k|              return 0xb;
  127|  1.26k|           case 'c':
  ------------------
  |  Branch (127:12): [True: 1.26k, False: 619k]
  ------------------
  128|  1.26k|           case 'C':
  ------------------
  |  Branch (128:12): [True: 0, False: 621k]
  ------------------
  129|  1.26k|              return 0xc;
  130|  3.00k|           case 'd':
  ------------------
  |  Branch (130:12): [True: 3.00k, False: 618k]
  ------------------
  131|  3.00k|           case 'D':
  ------------------
  |  Branch (131:12): [True: 0, False: 621k]
  ------------------
  132|  3.00k|              return 0xd;
  133|  3.82k|           case 'e':
  ------------------
  |  Branch (133:12): [True: 3.82k, False: 617k]
  ------------------
  134|  3.82k|           case 'E':
  ------------------
  |  Branch (134:12): [True: 0, False: 621k]
  ------------------
  135|  3.82k|              return 0xe;
  136|  26.5k|           case 'f':
  ------------------
  |  Branch (136:12): [True: 26.5k, False: 594k]
  ------------------
  137|  26.5k|           case 'F':
  ------------------
  |  Branch (137:12): [True: 0, False: 621k]
  ------------------
  138|  26.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.22k|    bson_decode_options() = default;
_ZN8jsoncons4bson19bson_options_commonC2Ev:
   23|  6.44k|    bson_options_common() = default;
_ZN8jsoncons4bson19bson_options_commonD2Ev:
   25|  6.44k|    virtual ~bson_options_common() = default;
_ZN8jsoncons4bson19bson_encode_optionsC1Ev:
   50|  3.22k|    bson_encode_options() = default;
_ZNK8jsoncons4bson19bson_options_common17max_nesting_depthEv:
   31|  6.44k|    {
   32|  6.44k|        return max_nesting_depth_;
   33|  6.44k|    }

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

_ZN8jsoncons4bson17basic_bson_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEEC2IRNS3_19basic_istringstreamIcNS3_11char_traitsIcEES7_EEEEOT_RNS_18basic_json_visitorIcEERKNS0_19bson_decode_optionsERKS7_:
   46|  3.22k|       : parser_(std::forward<Sourceable>(source), options, temp_alloc),
   47|  3.22k|         visitor_(visitor)
   48|  3.22k|    {
   49|  3.22k|    }
_ZN8jsoncons4bson17basic_bson_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE4readERNS3_10error_codeE:
   62|  3.22k|    {
   63|  3.22k|        parser_.reset();
   64|  3.22k|        parser_.parse(visitor_, ec);
   65|  3.22k|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  3.22k|#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.22k|    }

