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|   467k|        {
  117|   467k|            return size_;
  118|   467k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2Ev:
   58|  50.1k|        {
   59|  50.1k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2EPS2_m:
   61|   105k|            : data_(data), size_(size)
   62|   105k|        {
   63|   105k|        }
_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4dataEv:
  111|   155k|        {
  112|   155k|            return data_;
  113|   155k|        }

_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|  5.38k|        {
  415|  5.38k|            visit_uint64(value, tag, context, ec);
  416|  5.38k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  5.38k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  417|  5.38k|        }
_ZN8jsoncons18basic_json_visitorIcE9end_arrayERKNS_11ser_contextERNSt3__110error_codeE:
  351|  2.15k|        {
  352|  2.15k|            visit_end_array(context, ec);
  353|  2.15k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  2.15k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  354|  2.15k|        }
_ZN8jsoncons18basic_json_visitorIcE11int64_valueElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  423|  46.2k|        {
  424|  46.2k|            visit_int64(value, tag, context, ec);
  425|  46.2k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  46.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  426|  46.2k|        }
_ZN8jsoncons18basic_json_visitorIcE12double_valueEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  441|  1.28k|        {
  442|  1.28k|            visit_double(value, tag, context, ec);
  443|  1.28k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.28k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  444|  1.28k|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  318|  75.9k|        {
  319|  75.9k|            visit_begin_object(tag, context, ec);
  320|  75.9k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  75.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  321|  75.9k|        }
_ZN8jsoncons18basic_json_visitorIcE3keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  357|   310k|        {
  358|   310k|            visit_key(name, context, ec);
  359|   310k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   310k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  360|   310k|        }
_ZN8jsoncons18basic_json_visitorIcE10end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  333|  15.3k|        {
  334|  15.3k|            visit_end_object(context, ec);
  335|  15.3k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  15.3k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  336|  15.3k|        }
_ZN8jsoncons18basic_json_visitorIcE12string_valueERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  383|   250k|        {
  384|   250k|            visit_string(value, tag, context, ec);
  385|   250k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   250k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  386|   250k|        }
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  339|   711k|        {
  340|   711k|            visit_begin_array(tag, context, ec);
  341|   711k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   711k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  342|   711k|        }
_ZN8jsoncons18basic_json_visitorIcE10null_valueENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  365|  4.07M|        {
  366|  4.07M|            visit_null(tag, context, ec);
  367|  4.07M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.07M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  368|  4.07M|        }
_ZN8jsoncons18basic_json_visitorIcE10bool_valueEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  374|  5.02k|        {
  375|  5.02k|            visit_bool(value, tag, context, ec);
  376|  5.02k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  5.02k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|  5.02k|        }
_ZN8jsoncons18basic_json_visitorIcE17byte_string_valueINS_16byte_string_viewEEEbRKT_mRKNS_11ser_contextERNSt3__110error_codeENSA_9enable_ifIXsr10ext_traits18is_bytes_view_likeIS4_EE5valueEiE4typeE:
  405|  58.0k|        {
  406|  58.0k|            visit_byte_string(byte_string_view(reinterpret_cast<const uint8_t*>(b.data()),b.size()), raw_tag, context, ec);
  407|  58.0k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  58.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  408|  58.0k|        }
_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|  5.57M|        {
  335|  5.57M|            buf_ptr->push_back(static_cast<value_type>(ch));
  336|  5.57M|        }
_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.7M|    {
  378|  34.7M|        std::size_t len = 0;
  379|  34.7M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 34.7M, False: 7.17k]
  ------------------
  380|  34.7M|        {
  381|  34.7M|            len = (std::min)(remaining_, length);
  382|  34.7M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  34.7M|            data_end_ += len;
  384|  34.7M|            remaining_ -= len;
  385|  34.7M|            position_ += len;
  386|  34.7M|        }
  387|  34.7M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 34.7M, False: 9.42k]
  ------------------
  388|  34.7M|        {
  389|  34.7M|            return len;
  390|  34.7M|        }
  391|  9.42k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 9.42k, False: 0]
  ------------------
  392|  9.42k|        {
  393|  9.42k|            data_end_ = chunk_;
  394|  9.42k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  9.42k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 7.01k, False: 2.40k]
  ------------------
  396|  7.01k|            {
  397|  7.01k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  7.01k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  7.01k|                data_end_ += len2;
  400|  7.01k|                remaining_ -= len2;
  401|  7.01k|                position_ += len2;
  402|  7.01k|                len += len2;
  403|  7.01k|            }
  404|  9.42k|            return len;
  405|  9.42k|        }
  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.7M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  10.2k|    {
  443|  10.2k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 2.42k, False: 7.85k]
  ------------------
  444|  2.42k|        {
  445|  2.42k|            return 0;
  446|  2.42k|        }
  447|       |
  448|  7.85k|        JSONCONS_TRY
  ------------------
  |  |   37|  7.85k|    #define JSONCONS_TRY try
  ------------------
  449|  7.85k|        {
  450|  7.85k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  7.85k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  7.85k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 3.19k, False: 4.65k]
  ------------------
  454|  3.19k|            {
  455|  3.19k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|  3.19k|            }
  457|  7.85k|            return length;
  458|  7.85k|        }
  459|  7.85k|        JSONCONS_CATCH(const std::exception&)     
  460|  7.85k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  7.85k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  97.8k|    {
  353|  97.8k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  97.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 1.68k, False: 96.1k]
  |  |  ------------------
  ------------------
  354|  1.68k|        {
  355|  1.68k|            return span<const value_type>{};
  356|  1.68k|        }
  357|  96.1k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 148, False: 95.9k]
  |  Branch (357:32): [True: 29, False: 119]
  ------------------
  358|     29|        {
  359|     29|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     29|            data_end_ = chunk_;
  361|     29|        }
  362|  96.1k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 487, False: 95.6k]
  ------------------
  363|    487|        {
  364|    487|            buffer.clear();
  365|    487|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    487|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    487|        }
  368|       |
  369|  95.6k|        const value_type* data = data_end_;
  370|  95.6k|        data_end_ += length;
  371|  95.6k|        remaining_ -= length;
  372|  95.6k|        position_ += length;
  373|  95.6k|        return span<const value_type>(data, length);
  374|  96.1k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  746|    487|    {
  747|    487|        std::size_t unread = length;
  748|       |
  749|  1.47k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.23k, False: 235]
  |  Branch (749:30): [True: 985, False: 252]
  ------------------
  750|    985|        {
  751|    985|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 329, False: 656]
  |  Branch (751:44): [True: 325, False: 4]
  ------------------
  752|    325|            {
  753|    325|                std::size_t n = source.chunk_size();
  754|    325|                std::size_t offset = buffer.size();
  755|    325|                buffer.resize(offset+n);
  756|    325|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    325|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    325|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 64, False: 261]
  |  |  ------------------
  ------------------
  758|     64|                {
  759|     64|                    buffer.resize(offset+actual);
  760|     64|                }
  761|    325|                unread -= actual;
  762|    325|            }
  763|    660|            else
  764|    660|            {
  765|    660|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|    660|                std::size_t offset = buffer.size();
  767|    660|                buffer.resize(offset+n);
  768|    660|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|    660|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|    660|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 120, False: 540]
  |  |  ------------------
  ------------------
  770|    120|                {
  771|    120|                    buffer.resize(offset + actual);
  772|    120|                }
  773|    660|                unread -= actual;
  774|    660|            }
  775|    985|        }
  776|    487|        return length - unread;
  777|    487|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  3.44k|    {
  272|  3.44k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 1.38k, False: 2.05k]
  |  Branch (272:35): [True: 581, False: 806]
  ------------------
  273|  3.44k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  2.86k|    {
  347|  2.86k|        return remaining_;
  348|  2.86k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  3.67k|    {
  262|  3.67k|        return chunk_size_;
  263|  3.67k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    800|    {
  436|    800|        auto len = fill_buffer(chunk, chunk_size);
  437|    800|        position_ += len;
  438|    800|        return len;
  439|    800|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  58.3k|    {
  353|  58.3k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  58.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 48.5k, False: 9.82k]
  |  |  ------------------
  ------------------
  354|  48.5k|        {
  355|  48.5k|            return span<const value_type>{};
  356|  48.5k|        }
  357|  9.82k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 136, False: 9.69k]
  |  Branch (357:32): [True: 25, False: 111]
  ------------------
  358|     25|        {
  359|     25|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     25|            data_end_ = chunk_;
  361|     25|        }
  362|  9.82k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 615, False: 9.21k]
  ------------------
  363|    615|        {
  364|    615|            buffer.clear();
  365|    615|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    615|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    615|        }
  368|       |
  369|  9.21k|        const value_type* data = data_end_;
  370|  9.21k|        data_end_ += length;
  371|  9.21k|        remaining_ -= length;
  372|  9.21k|        position_ += length;
  373|  9.21k|        return span<const value_type>(data, length);
  374|  9.82k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  746|    615|    {
  747|    615|        std::size_t unread = length;
  748|       |
  749|  2.49k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 2.20k, False: 286]
  |  Branch (749:30): [True: 1.87k, False: 329]
  ------------------
  750|  1.87k|        {
  751|  1.87k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 477, False: 1.40k]
  |  Branch (751:44): [True: 475, False: 2]
  ------------------
  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: 57, False: 418]
  |  |  ------------------
  ------------------
  758|     57|                {
  759|     57|                    buffer.resize(offset+actual);
  760|     57|                }
  761|    475|                unread -= actual;
  762|    475|            }
  763|  1.40k|            else
  764|  1.40k|            {
  765|  1.40k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|  1.40k|                std::size_t offset = buffer.size();
  767|  1.40k|                buffer.resize(offset+n);
  768|  1.40k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|  1.40k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   78|  1.40k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 204, False: 1.20k]
  |  |  ------------------
  ------------------
  770|    204|                {
  771|    204|                    buffer.resize(offset + actual);
  772|    204|                }
  773|  1.40k|                unread -= actual;
  774|  1.40k|            }
  775|  1.87k|        }
  776|    615|        return length - unread;
  777|    615|    }

_ZN8jsoncons6binary16native_to_littleIjNSt3__111__wrap_iterIPhEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrS9_6littleEvE4typeET_T0_:
  142|   169k|    {
  143|   169k|        uint8_t buf[sizeof(T)];
  144|   169k|        std::memcpy(buf, &val, sizeof(T));
  145|   169k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 678k, False: 169k]
  ------------------
  146|   678k|        {
  147|   678k|            *d_first++ = item;
  148|   678k|        }
  149|   169k|    }
_ZN8jsoncons6binary16native_to_littleIlNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  40.1k|    {
  143|  40.1k|        uint8_t buf[sizeof(T)];
  144|  40.1k|        std::memcpy(buf, &val, sizeof(T));
  145|  40.1k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 320k, False: 40.1k]
  ------------------
  146|   320k|        {
  147|   320k|            *d_first++ = item;
  148|   320k|        }
  149|  40.1k|    }
_ZN8jsoncons6binary16native_to_littleIjNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  7.28k|    {
  143|  7.28k|        uint8_t buf[sizeof(T)];
  144|  7.28k|        std::memcpy(buf, &val, sizeof(T));
  145|  7.28k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 29.1k, False: 7.28k]
  ------------------
  146|  29.1k|        {
  147|  29.1k|            *d_first++ = item;
  148|  29.1k|        }
  149|  7.28k|    }
_ZN8jsoncons6binary16native_to_littleImNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|   245k|    {
  143|   245k|        uint8_t buf[sizeof(T)];
  144|   245k|        std::memcpy(buf, &val, sizeof(T));
  145|   245k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 1.96M, False: 245k]
  ------------------
  146|  1.96M|        {
  147|  1.96M|            *d_first++ = item;
  148|  1.96M|        }
  149|   245k|    }
_ZN8jsoncons6binary16native_to_littleIdNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  1.28k|    {
  143|  1.28k|        uint8_t buf[sizeof(T)];
  144|  1.28k|        std::memcpy(buf, &val, sizeof(T));
  145|  1.28k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 10.2k, False: 1.28k]
  ------------------
  146|  10.2k|        {
  147|  10.2k|            *d_first++ = item;
  148|  10.2k|        }
  149|  1.28k|    }
_ZN8jsoncons6binary16little_to_nativeIiNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   948k|    {
  198|   948k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 948k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   948k|        T val;
  203|   948k|        std::memcpy(&val,first,sizeof(T));
  204|   948k|        return val;
  205|   948k|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  1.28k|    {
  198|  1.28k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 1.28k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  1.28k|        T val;
  203|  1.28k|        std::memcpy(&val,first,sizeof(T));
  204|  1.28k|        return val;
  205|  1.28k|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   251k|    {
  198|   251k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 251k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   251k|        T val;
  203|   251k|        std::memcpy(&val,first,sizeof(T));
  204|   251k|        return val;
  205|   251k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  41.2k|    {
  198|  41.2k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 41.2k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  41.2k|        T val;
  203|  41.2k|        std::memcpy(&val,first,sizeof(T));
  204|  41.2k|        return val;
  205|  41.2k|    }

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

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

_ZN8jsoncons10to_integerIicEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  557|   112k|{
  558|   112k|    n = 0;
  559|       |
  560|   112k|    if (length == 0)
  ------------------
  |  Branch (560:9): [True: 503, False: 111k]
  ------------------
  561|    503|    {
  562|    503|        return to_number_result<CharT>(s, std::errc::invalid_argument);
  563|    503|    }
  564|       |
  565|   111k|    bool is_negative = *s == '-' ? true : false;
  ------------------
  |  Branch (565:24): [True: 99.8k, False: 11.7k]
  ------------------
  566|   111k|    if (is_negative)
  ------------------
  |  Branch (566:9): [True: 99.8k, False: 11.7k]
  ------------------
  567|  99.8k|    {
  568|  99.8k|        ++s;
  569|  99.8k|        --length;
  570|  99.8k|    }
  571|       |
  572|   111k|    using U = typename ext_traits::make_unsigned<T>::type;
  573|       |
  574|   111k|    U u;
  575|   111k|    auto ru = to_integer(s, length, u);
  576|   111k|    if (ru.ec != std::errc{})
  ------------------
  |  Branch (576:9): [True: 0, False: 111k]
  ------------------
  577|      0|    {
  578|      0|        return to_number_result<CharT>(ru.ptr, ru.ec);
  579|      0|    }
  580|   111k|    if (is_negative)
  ------------------
  |  Branch (580:9): [True: 99.8k, False: 11.7k]
  ------------------
  581|  99.8k|    {
  582|  99.8k|        if (u > static_cast<U>(-((ext_traits::integer_limits<T>::lowest)()+T(1))) + U(1))
  ------------------
  |  Branch (582:13): [True: 0, False: 99.8k]
  ------------------
  583|      0|        {
  584|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  585|      0|        }
  586|  99.8k|        else
  587|  99.8k|        {
  588|  99.8k|            n = static_cast<T>(U(0) - u);
  589|  99.8k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  590|  99.8k|        }
  591|  99.8k|    }
  592|  11.7k|    else
  593|  11.7k|    {
  594|  11.7k|        if (u > static_cast<U>((ext_traits::integer_limits<T>::max)()))
  ------------------
  |  Branch (594:13): [True: 0, False: 11.7k]
  ------------------
  595|      0|        {
  596|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  597|      0|        }
  598|  11.7k|        else
  599|  11.7k|        {
  600|  11.7k|            n = static_cast<T>(u);
  601|  11.7k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  602|  11.7k|        }
  603|  11.7k|    }
  604|   111k|}
_ZN8jsoncons16to_number_resultIcEC2EPKcNSt3__14errcE:
  141|   223k|        : ptr(ptr_), ec(ec_)
  142|   223k|    {
  143|   223k|    }
_ZN8jsoncons10to_integerIjcEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedntsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  374|   111k|{
  375|   111k|    n = 0;
  376|       |
  377|   111k|    integer_chars_state state = integer_chars_state::initial;
  378|       |
  379|   111k|    const CharT* end = s + length; 
  380|   334k|    while (s < end)
  ------------------
  |  Branch (380:12): [True: 223k, False: 111k]
  ------------------
  381|   223k|    {
  382|   223k|        switch(state)
  383|   223k|        {
  384|   111k|            case integer_chars_state::initial:
  ------------------
  |  Branch (384:13): [True: 111k, False: 111k]
  ------------------
  385|   111k|            {
  386|   111k|                switch(*s)
  387|   111k|                {
  388|      0|                    case '0':
  ------------------
  |  Branch (388:21): [True: 0, False: 111k]
  ------------------
  389|      0|                        state = integer_chars_state::integer; // Could be binary, octal, hex 
  390|      0|                        ++s;
  391|      0|                        break;
  392|   111k|                    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: 749, False: 110k]
  |  Branch (392:30): [True: 1.28k, False: 110k]
  |  Branch (392:39): [True: 86.7k, False: 24.9k]
  |  Branch (392:48): [True: 6.65k, False: 104k]
  |  Branch (392:57): [True: 4.20k, False: 107k]
  |  Branch (392:66): [True: 3.71k, False: 107k]
  |  Branch (392:75): [True: 6.82k, False: 104k]
  |  Branch (392:84): [True: 843, False: 110k]
  |  Branch (392:94): [True: 647, False: 111k]
  ------------------
  393|   111k|                        state = integer_chars_state::decimal;
  394|   111k|                        break;
  395|      0|                    default:
  ------------------
  |  Branch (395:21): [True: 0, False: 111k]
  ------------------
  396|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  397|   111k|                }
  398|   111k|                break;
  399|   111k|            }
  400|   111k|            case integer_chars_state::integer:
  ------------------
  |  Branch (400:13): [True: 0, False: 223k]
  ------------------
  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: 223k]
  ------------------
  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: 223k]
  ------------------
  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|   111k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (482:13): [True: 111k, False: 111k]
  ------------------
  483|   111k|            {
  484|   111k|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  485|   111k|                static constexpr T max_value_div_10 = max_value / 10;
  486|   534k|                for (; s < end; ++s)
  ------------------
  |  Branch (486:24): [True: 423k, False: 111k]
  ------------------
  487|   423k|                {
  488|   423k|                    T x = 0;
  489|   423k|                    switch(*s)
  490|   423k|                    {
  491|   423k|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (491:25): [True: 64.4k, False: 358k]
  |  Branch (491:34): [True: 28.8k, False: 394k]
  |  Branch (491:43): [True: 65.2k, False: 358k]
  |  Branch (491:52): [True: 111k, False: 311k]
  |  Branch (491:61): [True: 14.4k, False: 408k]
  |  Branch (491:70): [True: 12.6k, False: 410k]
  |  Branch (491:79): [True: 10.5k, False: 412k]
  |  Branch (491:88): [True: 75.7k, False: 347k]
  |  Branch (491:97): [True: 31.6k, False: 391k]
  |  Branch (491:107): [True: 8.01k, False: 415k]
  ------------------
  492|   423k|                            x = static_cast<T>(*s) - static_cast<T>('0');
  493|   423k|                            break;
  494|      0|                        default:
  ------------------
  |  Branch (494:25): [True: 0, False: 423k]
  ------------------
  495|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  496|   423k|                    }
  497|   423k|                    if (n > max_value_div_10)
  ------------------
  |  Branch (497:25): [True: 0, False: 423k]
  ------------------
  498|      0|                    {
  499|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  500|      0|                    }
  501|   423k|                    n = n * 10;
  502|   423k|                    if (n > max_value - x)
  ------------------
  |  Branch (502:25): [True: 0, False: 423k]
  ------------------
  503|      0|                    {
  504|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  505|      0|                    }
  506|   423k|                    n += x;
  507|   423k|                }
  508|   111k|                break;
  509|   111k|            }
  510|   111k|            case integer_chars_state::base16:
  ------------------
  |  Branch (510:13): [True: 0, False: 223k]
  ------------------
  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: 223k]
  ------------------
  547|      0|                JSONCONS_UNREACHABLE();
  ------------------
  |  |   79|      0|#define JSONCONS_UNREACHABLE() __builtin_unreachable()
  ------------------
  548|      0|                break;
  549|   223k|        }
  550|   223k|    }
  551|   111k|    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: 111k]
  ------------------
  552|   111k|}

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|   499k|    {
 1148|   499k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|   499k|        const uint8_t* end = it + length;
 1150|       |
 1151|   499k|        unicode_errc  result{};
 1152|  1.32M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 822k, False: 499k]
  ------------------
 1153|   822k|        {
 1154|   822k|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 622k, False: 199k]
  ------------------
 1155|   622k|            {
 1156|  4.32M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  281|  1.24M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (281:32): [True: 621k, False: 1.59k]
  |  |  |  Branch (281:34): [True: 619k, False: 1.42k]
  |  |  |  Branch (281:36): [True: 618k, False: 1.54k]
  |  |  |  Branch (281:38): [True: 616k, False: 1.75k]
  |  |  |  Branch (281:40): [True: 615k, False: 1.16k]
  |  |  |  Branch (281:42): [True: 614k, False: 546]
  |  |  |  Branch (281:44): [True: 613k, False: 1.39k]
  |  |  |  Branch (281:46): [True: 612k, False: 1.02k]
  |  |  ------------------
  ------------------
 1157|   612k|                continue;
 1158|  4.32M|            }
 1159|   209k|    non_ascii:
 1160|   209k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|   209k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 35, False: 209k]
  ------------------
 1162|     35|            {
 1163|     35|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     35|            }
 1165|   209k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 144, False: 209k]
  ------------------
 1166|    144|            {
 1167|    144|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    144|            }
 1169|   209k|            it += len;
 1170|   209k|        }
 1171|   499k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|   499k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|   209k|    {
  306|   209k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|   209k|        const uint8_t* end = it+length;
  308|       |
  309|   209k|        uint8_t byte;
  310|   209k|        switch (length) {
  311|     32|        default:
  ------------------
  |  Branch (311:9): [True: 32, False: 209k]
  ------------------
  312|     32|            return unicode_errc::over_long_utf8_sequence;
  313|  1.14k|        case 4:
  ------------------
  |  Branch (313:9): [True: 1.14k, False: 208k]
  ------------------
  314|  1.14k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 11, False: 1.13k]
  ------------------
  315|     11|                return unicode_errc::bad_continuation_byte;
  316|  1.13k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.13k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  6.42k|        case 3:
  ------------------
  |  Branch (317:9): [True: 5.29k, False: 204k]
  ------------------
  318|  6.42k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 12, False: 6.41k]
  ------------------
  319|     12|                return unicode_errc::bad_continuation_byte;
  320|  6.41k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  6.41k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  10.6k|        case 2:
  ------------------
  |  Branch (321:9): [True: 4.25k, False: 205k]
  ------------------
  322|  10.6k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 24, False: 10.6k]
  ------------------
  323|     24|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  10.6k|            switch (*it) 
  326|  10.6k|            {
  327|       |                // no fall-through in this inner switch
  328|  2.56k|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 2.56k, False: 8.08k]
  |  Branch (328:32): [True: 7, False: 2.55k]
  ------------------
  329|  2.55k|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 253, False: 10.3k]
  |  Branch (329:32): [True: 3, False: 250]
  ------------------
  330|    336|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 336, False: 10.3k]
  |  Branch (330:32): [True: 5, False: 331]
  ------------------
  331|    548|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 548, False: 10.0k]
  |  Branch (331:32): [True: 2, False: 546]
  ------------------
  332|  6.94k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 6.94k, False: 3.69k]
  |  Branch (332:32): [True: 0, False: 6.94k]
  ------------------
  333|  10.6k|            }
  334|       |
  335|  10.6k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  10.6k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|   209k|        case 1:
  ------------------
  |  Branch (336:9): [True: 199k, False: 10.7k]
  ------------------
  337|   209k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 10.6k, False: 199k]
  |  Branch (337:32): [True: 47, False: 10.6k]
  ------------------
  338|     47|                return unicode_errc::source_illegal;
  339|   209k|            break;
  340|   209k|        }
  341|   209k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 1, False: 209k]
  ------------------
  342|      1|            return unicode_errc::source_illegal;
  343|       |
  344|   209k|        return unicode_errc();
  345|   209k|    }

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

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

_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.15k|    {
  219|  2.15k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  2.15k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 2.15k]
  |  |  ------------------
  |  |   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.15k|        --nesting_depth_;
  221|       |
  222|  2.15k|        buffer_.push_back(0x00);
  223|       |
  224|  2.15k|        std::size_t length = buffer_.size() - stack_.back().offset();
  225|  2.15k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  226|       |
  227|  2.15k|        stack_.pop_back();
  228|  2.15k|        if (stack_.empty())
  ------------------
  |  Branch (228:13): [True: 0, False: 2.15k]
  ------------------
  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.15k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  2.15k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  236|  2.15k|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item6offsetEv:
   66|  35.0k|        {
   67|  35.0k|            return offset_;
   68|  35.0k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  498|  5.38k|    {
  499|  5.38k|        static constexpr uint64_t max_value_div_1000 = (std::numeric_limits<uint64_t>::max)() / 1000;
  500|  5.38k|        if (stack_.empty())
  ------------------
  |  Branch (500:13): [True: 0, False: 5.38k]
  ------------------
  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|  5.38k|        switch (tag)
  507|  5.38k|        {
  508|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (508:13): [True: 0, False: 5.38k]
  ------------------
  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: 5.38k]
  ------------------
  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: 5.38k]
  ------------------
  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|  5.38k|            default:
  ------------------
  |  Branch (529:13): [True: 5.38k, False: 0]
  ------------------
  530|  5.38k|            {
  531|  5.38k|                if (val <= static_cast<uint64_t>((std::numeric_limits<int32_t>::max)()))
  ------------------
  |  Branch (531:21): [True: 1.18k, False: 4.20k]
  ------------------
  532|  1.18k|                {
  533|  1.18k|                    before_value(jsoncons::bson::bson_type::int32_type);
  534|  1.18k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  535|  1.18k|                }
  536|  4.20k|                else if (val <= static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()))
  ------------------
  |  Branch (536:26): [True: 3.17k, False: 1.02k]
  ------------------
  537|  3.17k|                {
  538|  3.17k|                    before_value(jsoncons::bson::bson_type::int64_type);
  539|  3.17k|                    binary::native_to_little(static_cast<uint64_t>(val),std::back_inserter(buffer_));
  540|  3.17k|                }
  541|  1.02k|                else
  542|  1.02k|                {
  543|  1.02k|                    ec = bson_errc::number_too_large;
  544|  1.02k|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.02k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  545|  1.02k|                }
  546|  4.36k|                break;
  547|  5.38k|            }
  548|  5.38k|        }
  549|  4.36k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.36k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  550|  5.38k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12before_valueEh:
  568|  4.55M|    {
  569|  4.55M|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  4.55M|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 4.55M]
  |  |  ------------------
  |  |   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.55M|        if (stack_.back().is_object())
  ------------------
  |  Branch (570:13): [True: 365k, False: 4.18M]
  ------------------
  571|   365k|        {
  572|   365k|            buffer_[stack_.back().member_offset()] = code;
  573|   365k|        }
  574|  4.18M|        else
  575|  4.18M|        {
  576|  4.18M|            buffer_.push_back(code);
  577|  4.18M|            std::string name = std::to_string(stack_.back().next_index());
  578|  4.18M|            buffer_.insert(buffer_.end(), name.begin(), name.end());
  579|  4.18M|            buffer_.push_back(0x00);
  580|  4.18M|        }
  581|  4.55M|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item9is_objectEv:
   86|  4.55M|        {
   87|  4.55M|            return type_ == jsoncons::bson::bson_container_type::document;
   88|  4.55M|        }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEv:
   71|   365k|        {
   72|   365k|            return name_offset_;
   73|   365k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item10next_indexEv:
   81|  4.18M|        {
   82|  4.18M|            return index_++;
   83|  4.18M|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  439|  46.2k|    {
  440|  46.2k|        static constexpr int64_t min_value_div_1000 = (std::numeric_limits<int64_t>::min)() / 1000;
  441|  46.2k|        static constexpr int64_t max_value_div_1000 = (std::numeric_limits<int64_t>::max)() / 1000;
  442|  46.2k|        if (stack_.empty())
  ------------------
  |  Branch (442:13): [True: 36, False: 46.2k]
  ------------------
  443|     36|        {
  444|     36|            ec = bson_errc::expected_bson_document;
  445|     36|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|     36|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  446|     36|        }
  447|       |
  448|  46.2k|        switch (tag)
  449|  46.2k|        {
  450|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (450:13): [True: 0, False: 46.2k]
  ------------------
  451|      0|                if (val < min_value_div_1000)
  ------------------
  |  Branch (451:21): [True: 0, False: 0]
  ------------------
  452|      0|                {
  453|      0|                    ec = bson_errc::datetime_too_small;
  454|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  455|      0|                }
  456|      0|                if (val > max_value_div_1000)
  ------------------
  |  Branch (456:21): [True: 0, False: 0]
  ------------------
  457|      0|                {
  458|      0|                    ec = bson_errc::datetime_too_large;
  459|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  460|      0|                }
  461|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  462|      0|                binary::native_to_little(val*millis_in_second,std::back_inserter(buffer_));
  463|      0|                break;
  464|  5.36k|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (464:13): [True: 5.36k, False: 40.8k]
  ------------------
  465|  5.36k|                before_value(jsoncons::bson::bson_type::datetime_type);
  466|  5.36k|                binary::native_to_little(val,std::back_inserter(buffer_));
  467|  5.36k|                break;
  468|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (468:13): [True: 0, False: 46.2k]
  ------------------
  469|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  470|      0|                if (val != 0)
  ------------------
  |  Branch (470:21): [True: 0, False: 0]
  ------------------
  471|      0|                {
  472|      0|                    val /= nanos_in_milli;
  473|      0|                }
  474|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  475|      0|                break;
  476|  40.8k|            default:
  ------------------
  |  Branch (476:13): [True: 40.8k, False: 5.36k]
  ------------------
  477|  40.8k|            {
  478|  40.8k|                if (val >= (std::numeric_limits<int32_t>::lowest)() && val <= (std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (478:21): [True: 40.4k, False: 375]
  |  Branch (478:72): [True: 6.10k, False: 34.3k]
  ------------------
  479|  6.10k|                {
  480|  6.10k|                    before_value(jsoncons::bson::bson_type::int32_type);
  481|  6.10k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  482|  6.10k|                }
  483|  34.7k|                else 
  484|  34.7k|                {
  485|  34.7k|                    before_value(jsoncons::bson::bson_type::int64_type);
  486|  34.7k|                    binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  487|  34.7k|                }
  488|  40.8k|                break;
  489|      0|            }
  490|  46.2k|        }
  491|  46.2k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  46.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  492|  46.2k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  556|  1.28k|    {
  557|  1.28k|        if (stack_.empty())
  ------------------
  |  Branch (557:13): [True: 0, False: 1.28k]
  ------------------
  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.28k|        before_value(jsoncons::bson::bson_type::double_type);
  563|  1.28k|        binary::native_to_little(val,std::back_inserter(buffer_));
  564|  1.28k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.28k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  565|  1.28k|    }
_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|  75.9k|    {
  154|  75.9k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|  75.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 15.5k, False: 60.3k]
  |  |  ------------------
  ------------------
  155|  15.5k|        {
  156|  15.5k|            ec = bson_errc::max_nesting_depth_exceeded;
  157|  15.5k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  15.5k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  158|  15.5k|        } 
  159|  60.3k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (159:13): [True: 57.1k, False: 3.22k]
  ------------------
  160|  57.1k|        {
  161|  57.1k|            if (stack_.empty())
  ------------------
  |  Branch (161:17): [True: 0, False: 57.1k]
  ------------------
  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|  57.1k|            before_value(jsoncons::bson::bson_type::document_type);
  167|  57.1k|        }
  168|       |
  169|  60.3k|        stack_.emplace_back(jsoncons::bson::bson_container_type::document, buffer_.size());
  170|  60.3k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  171|       |
  172|  60.3k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  60.3k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  173|  60.3k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_itemC2ENS0_19bson_container_typeEm:
   61|   118k|           : type_(type), offset_(offset)
   62|   118k|        {
   63|   118k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE16visit_end_objectERKNS_11ser_contextERNS3_10error_codeE:
  176|  15.3k|    {
  177|  15.3k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  15.3k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 15.3k]
  |  |  ------------------
  |  |   50|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   51|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  178|  15.3k|        --nesting_depth_;
  179|       |
  180|  15.3k|        buffer_.push_back(0x00);
  181|       |
  182|  15.3k|        std::size_t length = buffer_.size() - stack_.back().offset();
  183|  15.3k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  184|       |
  185|  15.3k|        stack_.pop_back();
  186|  15.3k|        if (stack_.empty())
  ------------------
  |  Branch (186:13): [True: 146, False: 15.2k]
  ------------------
  187|    146|        {
  188|    146|            for (auto c : buffer_)
  ------------------
  |  Branch (188:25): [True: 5.57M, False: 146]
  ------------------
  189|  5.57M|            {
  190|  5.57M|                sink_.push_back(c);
  191|  5.57M|            }
  192|    146|        }
  193|  15.3k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  15.3k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  194|  15.3k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  197|   711k|    {
  198|   711k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|   711k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 653k, False: 57.7k]
  |  |  ------------------
  ------------------
  199|   653k|        {
  200|   653k|            ec = bson_errc::max_nesting_depth_exceeded;
  201|   653k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   653k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  202|   653k|        } 
  203|  57.7k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (203:13): [True: 57.7k, False: 0]
  ------------------
  204|  57.7k|        {
  205|  57.7k|            if (stack_.empty())
  ------------------
  |  Branch (205:17): [True: 0, False: 57.7k]
  ------------------
  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|  57.7k|            before_value(jsoncons::bson::bson_type::array_type);
  211|  57.7k|        }
  212|  57.7k|        stack_.emplace_back(jsoncons::bson::bson_container_type::array, buffer_.size());
  213|  57.7k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  214|  57.7k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  57.7k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  215|  57.7k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9visit_keyERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEERKNS_11ser_contextERNS3_10error_codeE:
  239|   310k|    {
  240|   310k|        stack_.back().member_offset(buffer_.size());
  241|   310k|        buffer_.push_back(0x00); // reserve space for code
  242|   310k|        for (auto c : name)
  ------------------
  |  Branch (242:21): [True: 1.21M, False: 310k]
  ------------------
  243|  1.21M|        {
  244|  1.21M|            buffer_.push_back(c);
  245|  1.21M|        }
  246|   310k|        buffer_.push_back(0x00);
  247|   310k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   310k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  248|   310k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEm:
   76|   310k|        {
   77|   310k|            name_offset_ = offset;
   78|   310k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  251|  4.07M|    {
  252|  4.07M|        if (stack_.empty())
  ------------------
  |  Branch (252:13): [True: 171, False: 4.07M]
  ------------------
  253|    171|        {
  254|    171|            ec = bson_errc::expected_bson_document;
  255|    171|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    171|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  256|    171|        }
  257|  4.07M|        switch (tag)
  258|  4.07M|        {
  259|  1.32k|            case semantic_tag::undefined:
  ------------------
  |  Branch (259:13): [True: 1.32k, False: 4.07M]
  ------------------
  260|  1.32k|                before_value(jsoncons::bson::bson_type::undefined_type);
  261|  1.32k|                break;
  262|  4.07M|            default:
  ------------------
  |  Branch (262:13): [True: 4.07M, False: 1.32k]
  ------------------
  263|  4.07M|                before_value(jsoncons::bson::bson_type::null_type);
  264|  4.07M|                break;
  265|  4.07M|        }
  266|  4.07M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  4.07M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  267|  4.07M|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  270|  5.02k|    {
  271|  5.02k|        if (stack_.empty())
  ------------------
  |  Branch (271:13): [True: 0, False: 5.02k]
  ------------------
  272|      0|        {
  273|      0|            ec = bson_errc::expected_bson_document;
  274|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  275|      0|        }
  276|  5.02k|        before_value(jsoncons::bson::bson_type::bool_type);
  277|  5.02k|        if (val)
  ------------------
  |  Branch (277:13): [True: 3.50k, False: 1.51k]
  ------------------
  278|  3.50k|        {
  279|  3.50k|            buffer_.push_back(0x01);
  280|  3.50k|        }
  281|  1.51k|        else
  282|  1.51k|        {
  283|  1.51k|            buffer_.push_back(0x00);
  284|  1.51k|        }
  285|       |
  286|  5.02k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  5.02k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  287|  5.02k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_stringERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  290|   250k|    {
  291|   250k|        if (stack_.empty())
  ------------------
  |  Branch (291:13): [True: 89, False: 250k]
  ------------------
  292|     89|        {
  293|     89|            ec = bson_errc::expected_bson_document;
  294|     89|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|     89|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  295|     89|        }
  296|       |
  297|   250k|        switch (tag)
  298|   250k|        {
  299|   122k|            case semantic_tag::float128:
  ------------------
  |  Branch (299:13): [True: 122k, False: 127k]
  ------------------
  300|   122k|            {
  301|   122k|                before_value(jsoncons::bson::bson_type::decimal128_type);
  302|   122k|                decimal128_t dec;
  303|   122k|                auto rc = decimal128_from_chars(sv.data(), sv.data()+sv.size(), dec);
  304|   122k|                if (rc.ec != std::errc{})
  ------------------
  |  Branch (304:21): [True: 1.44k, False: 121k]
  ------------------
  305|  1.44k|                {
  306|  1.44k|                    ec = bson_errc::invalid_decimal128_string;
  307|  1.44k|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.44k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  308|  1.44k|                }
  309|   121k|                binary::native_to_little(dec.low,std::back_inserter(buffer_));
  310|   121k|                binary::native_to_little(dec.high,std::back_inserter(buffer_));
  311|   121k|                break;
  312|   122k|            }
  313|  28.9k|            case semantic_tag::id:
  ------------------
  |  Branch (313:13): [True: 28.9k, False: 221k]
  ------------------
  314|  28.9k|            {
  315|  28.9k|                before_value(jsoncons::bson::bson_type::object_id_type);
  316|  28.9k|                oid_t oid(sv);
  317|  28.9k|                for (auto b : oid)
  ------------------
  |  Branch (317:29): [True: 347k, False: 28.9k]
  ------------------
  318|   347k|                {
  319|   347k|                    buffer_.push_back(b);
  320|   347k|                }
  321|  28.9k|                break;
  322|   122k|            }
  323|  4.58k|            case semantic_tag::regex:
  ------------------
  |  Branch (323:13): [True: 4.58k, False: 245k]
  ------------------
  324|  4.58k|            {
  325|  4.58k|                before_value(jsoncons::bson::bson_type::regex_type);
  326|  4.58k|                std::size_t first = sv.find_first_of('/');
  327|  4.58k|                std::size_t last = sv.find_last_of('/');
  328|  4.58k|                if (first == string_view::npos || last == string_view::npos || first == last)
  ------------------
  |  Branch (328:21): [True: 0, False: 4.58k]
  |  Branch (328:51): [True: 0, False: 4.58k]
  |  Branch (328:80): [True: 0, False: 4.58k]
  ------------------
  329|      0|                {
  330|      0|                    ec = bson_errc::invalid_regex_string;
  331|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  332|      0|                }
  333|  4.58k|                string_view regex = sv.substr(first+1,last-1);
  334|  4.58k|                for (auto c : regex)
  ------------------
  |  Branch (334:29): [True: 4.68M, False: 4.58k]
  ------------------
  335|  4.68M|                {
  336|  4.68M|                    buffer_.push_back(c);
  337|  4.68M|                }
  338|  4.58k|                buffer_.push_back(0x00);
  339|  4.58k|                string_view options = sv.substr(last+1);
  340|  4.58k|                for (auto c : options)
  ------------------
  |  Branch (340:29): [True: 2.70M, False: 4.58k]
  ------------------
  341|  2.70M|                {
  342|  2.70M|                    buffer_.push_back(c);
  343|  2.70M|                }
  344|  4.58k|                buffer_.push_back(0x00);
  345|  4.58k|                break;
  346|  4.58k|            }
  347|  94.0k|            default:
  ------------------
  |  Branch (347:13): [True: 94.0k, False: 156k]
  ------------------
  348|  94.0k|                switch (tag)
  349|  94.0k|                {
  350|    577|                    case semantic_tag::code:
  ------------------
  |  Branch (350:21): [True: 577, False: 93.4k]
  ------------------
  351|    577|                        before_value(jsoncons::bson::bson_type::javascript_type);
  352|    577|                        break;
  353|  93.4k|                    default:
  ------------------
  |  Branch (353:21): [True: 93.4k, False: 577]
  ------------------
  354|  93.4k|                        before_value(jsoncons::bson::bson_type::string_type);
  355|  93.4k|                        break;
  356|  94.0k|                }
  357|  94.0k|                std::size_t offset = buffer_.size();
  358|  94.0k|                buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  359|  94.0k|                std::size_t string_offset = buffer_.size();
  360|  94.0k|                auto sink = unicode_traits::validate(sv.data(), sv.size());
  361|  94.0k|                if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (361:21): [True: 0, False: 94.0k]
  ------------------
  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|  94.0k|                for (auto c : sv)
  ------------------
  |  Branch (366:29): [True: 1.96M, False: 94.0k]
  ------------------
  367|  1.96M|                {
  368|  1.96M|                    buffer_.push_back(c);
  369|  1.96M|                }
  370|  94.0k|                buffer_.push_back(0x00);
  371|  94.0k|                std::size_t length = buffer_.size() - string_offset;
  372|  94.0k|                binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  373|  94.0k|                break;
  374|   250k|        }
  375|       |
  376|   248k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   248k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|   250k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_byte_stringERKNS_16byte_string_viewEmRKNS_11ser_contextERNS3_10error_codeE:
  411|  58.0k|    {
  412|  58.0k|        if (stack_.empty())
  ------------------
  |  Branch (412:13): [True: 22, False: 57.9k]
  ------------------
  413|     22|        {
  414|     22|            ec = bson_errc::expected_bson_document;
  415|     22|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|     22|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  416|     22|        }
  417|  57.9k|        before_value(jsoncons::bson::bson_type::binary_type);
  418|       |
  419|  57.9k|        std::size_t offset = buffer_.size();
  420|  57.9k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  421|  57.9k|        std::size_t string_offset = buffer_.size();
  422|       |
  423|  57.9k|        buffer_.push_back(static_cast<uint8_t>(raw_tag)); // default subtype
  424|       |
  425|  57.9k|        for (auto c : b)
  ------------------
  |  Branch (425:21): [True: 9.58M, False: 57.9k]
  ------------------
  426|  9.58M|        {
  427|  9.58M|            buffer_.push_back(c);
  428|  9.58M|        }
  429|  57.9k|        std::size_t length = buffer_.size() - string_offset - 1;
  430|  57.9k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  431|       |
  432|  57.9k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  57.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  433|  58.0k|    }
_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|   675k|{
   92|   675k|    return std::error_code(static_cast<int>(result),bson_error_category());
   93|   675k|}
_ZN8jsoncons4bson19bson_error_categoryEv:
   84|   675k|{
   85|   675k|  static bson_error_category_impl instance;
   86|   675k|  return instance;
   87|   675k|}

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

_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|  94.7k|        : mode(mode_), length(length_), pos(pos_), type(type_)
   49|  94.7k|    {
   50|  94.7k|    }
_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.73M|        while (!done_ && more_)
  ------------------
  |  Branch (177:16): [True: 6.73M, False: 5]
  |  Branch (177:26): [True: 6.73M, False: 1.56k]
  ------------------
  178|  6.73M|        {
  179|  6.73M|            switch (state_stack_.back().mode)
  ------------------
  |  Branch (179:21): [True: 6.73M, False: 0]
  ------------------
  180|  6.73M|            {
  181|  3.22k|                case parse_mode::root:
  ------------------
  |  Branch (181:17): [True: 3.22k, False: 6.73M]
  ------------------
  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.26M]
  ------------------
  186|  1.47M|                {
  187|  1.47M|                    uint8_t type;
  188|  1.47M|                    std::size_t n = source_.read(&type, 1);
  189|  1.47M|                    state_stack_.back().pos += n;
  190|  1.47M|                    if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|  1.47M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 1.41k, False: 1.47M]
  |  |  ------------------
  ------------------
  191|  1.41k|                    {
  192|  1.41k|                        ec = bson_errc::unexpected_eof;
  193|  1.41k|                        more_ = false;
  194|  1.41k|                        return;
  195|  1.41k|                    }
  196|  1.47M|                    if (type != 0x00)
  ------------------
  |  Branch (196:25): [True: 1.46M, False: 15.3k]
  ------------------
  197|  1.46M|                    {
  198|  1.46M|                        read_e_name(visitor,jsoncons::bson::bson_container_type::document,ec);
  199|  1.46M|                        state_stack_.back().mode = parse_mode::value;
  200|  1.46M|                        state_stack_.back().type = type;
  201|  1.46M|                    }
  202|  15.3k|                    else
  203|  15.3k|                    {
  204|  15.3k|                        end_document(visitor,ec);
  205|  15.3k|                    }
  206|  1.47M|                    break;
  207|  1.47M|                }
  208|  3.79M|                case parse_mode::array:
  ------------------
  |  Branch (208:17): [True: 3.79M, False: 2.94M]
  ------------------
  209|  3.79M|                {
  210|  3.79M|                    uint8_t type;
  211|  3.79M|                    std::size_t n = source_.read(&type, 1);
  212|  3.79M|                    state_stack_.back().pos += n;
  213|  3.79M|                    if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|  3.79M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 243, False: 3.79M]
  |  |  ------------------
  ------------------
  214|    243|                    {
  215|    243|                        ec = bson_errc::unexpected_eof;
  216|    243|                        more_ = false;
  217|    243|                        return;
  218|    243|                    }
  219|  3.79M|                    if (type != 0x00)
  ------------------
  |  Branch (219:25): [True: 3.79M, False: 2.15k]
  ------------------
  220|  3.79M|                    {
  221|  3.79M|                        read_e_name(visitor,jsoncons::bson::bson_container_type::array,ec);
  222|  3.79M|                        read_value(visitor, type, ec);
  223|  3.79M|                    }
  224|  2.15k|                    else
  225|  2.15k|                    {
  226|  2.15k|                        end_array(visitor,ec);
  227|  2.15k|                    }
  228|  3.79M|                    break;
  229|  3.79M|                }
  230|  1.46M|                case parse_mode::value:
  ------------------
  |  Branch (230:17): [True: 1.46M, False: 5.27M]
  ------------------
  231|  1.46M|                    state_stack_.back().mode = parse_mode::document;
  232|  1.46M|                    read_value(visitor,state_stack_.back().type,ec);
  233|  1.46M|                    break;
  234|      5|                case parse_mode::accept:
  ------------------
  |  Branch (234:17): [True: 5, False: 6.73M]
  ------------------
  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.73M|            }
  244|  6.73M|        }
  245|  3.22k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE14begin_documentERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  250|  75.9k|    {
  251|  75.9k|        if (JSONCONS_UNLIKELY(static_cast<int>(state_stack_.size()) > max_nesting_depth_))
  ------------------
  |  |   78|  75.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 4, False: 75.9k]
  |  |  ------------------
  ------------------
  252|      4|        {
  253|      4|            ec = bson_errc::max_nesting_depth_exceeded;
  254|      4|            more_ = false;
  255|      4|            return;
  256|      4|        } 
  257|       |
  258|  75.9k|        uint8_t buf[sizeof(int32_t)]; 
  259|  75.9k|        std::size_t n = source_.read(buf, sizeof(int32_t));
  260|  75.9k|        if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|  75.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 26, False: 75.9k]
  |  |  ------------------
  ------------------
  261|     26|        {
  262|     26|            ec = bson_errc::unexpected_eof;
  263|     26|            more_ = false;
  264|     26|            return;
  265|     26|        }
  266|       |
  267|  75.9k|        auto length = binary::little_to_native<int32_t>(buf, sizeof(buf));
  268|       |
  269|  75.9k|        visitor.begin_object(semantic_tag::none, *this, ec);
  270|  75.9k|        more_ = !cursor_mode_;
  271|  75.9k|        state_stack_.emplace_back(parse_mode::document,length,n);
  272|  75.9k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11read_e_nameERNS_18basic_json_visitorIcEENS0_19bson_container_typeERNS3_10error_codeE:
  344|  5.25M|    {
  345|  5.25M|        name_buffer_.clear();
  346|  5.25M|        read_cstring(name_buffer_, ec);
  347|  5.25M|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  5.25M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 1.18M, False: 4.07M]
  |  |  ------------------
  ------------------
  348|  1.18M|        {
  349|  1.18M|            return;
  350|  1.18M|        }
  351|  4.07M|        if (type == jsoncons::bson::bson_container_type::document)
  ------------------
  |  Branch (351:13): [True: 311k, False: 3.76M]
  ------------------
  352|   311k|        {
  353|   311k|            auto result = unicode_traits::validate(name_buffer_.data(),name_buffer_.size());
  354|   311k|            if (JSONCONS_UNLIKELY(result.ec != unicode_traits::unicode_errc()))
  ------------------
  |  |   78|   311k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 170, False: 310k]
  |  |  ------------------
  ------------------
  355|    170|            {
  356|    170|                ec = bson_errc::invalid_utf8_text_string;
  357|    170|                more_ = false;
  358|    170|                return;
  359|    170|            }
  360|   310k|            visitor.key(jsoncons::basic_string_view<char>(name_buffer_.data(),name_buffer_.length()), *this, ec);
  361|   310k|            more_ = !cursor_mode_;
  362|   310k|        }
  363|  4.07M|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE12read_cstringERNS3_12basic_stringIcNS3_11char_traitsIcEES7_EERNS3_10error_codeE:
  641|  5.29M|    {
  642|  5.29M|        uint8_t c = 0xff;
  643|  28.1M|        while (true)
  ------------------
  |  Branch (643:16): [True: 28.1M, Folded]
  ------------------
  644|  28.1M|        {
  645|  28.1M|            std::size_t n = source_.read(&c, 1);
  646|  28.1M|            state_stack_.back().pos += n;
  647|  28.1M|            if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|  28.1M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 266, False: 28.1M]
  |  |  ------------------
  ------------------
  648|    266|            {
  649|    266|                ec = bson_errc::unexpected_eof;
  650|    266|                more_ = false;
  651|    266|                return;
  652|    266|            }
  653|  28.1M|            if (c == 0)
  ------------------
  |  Branch (653:17): [True: 5.29M, False: 22.8M]
  ------------------
  654|  5.29M|            {
  655|  5.29M|                break;
  656|  5.29M|            }
  657|  22.8M|            buffer.push_back(c);
  658|  22.8M|        }
  659|  5.29M|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE12end_documentERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  275|  15.3k|    {
  276|  15.3k|        JSONCONS_ASSERT(state_stack_.size() >= 2);
  ------------------
  |  |   49|  15.3k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 15.3k]
  |  |  ------------------
  |  |   50|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   51|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  277|       |
  278|  15.3k|        visitor.end_object(*this,ec);
  279|  15.3k|        more_ = !cursor_mode_;
  280|  15.3k|        if (level() == mark_level_)
  ------------------
  |  Branch (280:13): [True: 0, False: 15.3k]
  ------------------
  281|      0|        {
  282|      0|            more_ = false;
  283|      0|        }
  284|  15.3k|        if (JSONCONS_UNLIKELY(state_stack_.back().pos != state_stack_.back().length))
  ------------------
  |  |   78|  15.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 170, False: 15.1k]
  |  |  ------------------
  ------------------
  285|    170|        {
  286|    170|            ec = bson_errc::size_mismatch;
  287|    170|            more_ = false;
  288|    170|            return;
  289|    170|        }
  290|  15.1k|        std::size_t pos = state_stack_.back().pos;
  291|  15.1k|        state_stack_.pop_back();
  292|  15.1k|        state_stack_.back().pos += pos;
  293|  15.1k|    }
_ZNK8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5levelEv:
  124|  17.5k|    {
  125|  17.5k|        return static_cast<int>(state_stack_.size());
  126|  17.5k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE10read_valueERNS_18basic_json_visitorIcEEhRNS3_10error_codeE:
  366|  5.25M|    {
  367|  5.25M|        switch (type)
  368|  5.25M|        {
  369|  1.29k|            case jsoncons::bson::bson_type::double_type:
  ------------------
  |  Branch (369:13): [True: 1.29k, False: 5.25M]
  ------------------
  370|  1.29k|            {
  371|  1.29k|                uint8_t buf[sizeof(double)]; 
  372|  1.29k|                std::size_t n = source_.read(buf, sizeof(double));
  373|  1.29k|                state_stack_.back().pos += n;
  374|  1.29k|                if (JSONCONS_UNLIKELY(n != sizeof(double)))
  ------------------
  |  |   78|  1.29k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 11, False: 1.28k]
  |  |  ------------------
  ------------------
  375|     11|                {
  376|     11|                    ec = bson_errc::unexpected_eof;
  377|     11|                    more_ = false;
  378|     11|                    return;
  379|     11|                }
  380|  1.28k|                double res = binary::little_to_native<double>(buf, sizeof(buf));
  381|  1.28k|                visitor.double_value(res, semantic_tag::none, *this, ec);
  382|  1.28k|                more_ = !cursor_mode_;
  383|  1.28k|                break;
  384|  1.29k|            }
  385|    427|            case jsoncons::bson::bson_type::symbol_type:
  ------------------
  |  Branch (385:13): [True: 427, False: 5.25M]
  ------------------
  386|  3.00k|            case jsoncons::bson::bson_type::min_key_type:
  ------------------
  |  Branch (386:13): [True: 2.57k, False: 5.25M]
  ------------------
  387|  5.69k|            case jsoncons::bson::bson_type::max_key_type:
  ------------------
  |  Branch (387:13): [True: 2.69k, False: 5.25M]
  ------------------
  388|  96.7k|            case jsoncons::bson::bson_type::string_type:
  ------------------
  |  Branch (388:13): [True: 91.1k, False: 5.16M]
  ------------------
  389|  96.7k|            {
  390|  96.7k|                auto sv = read_string(ec);
  391|  96.7k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  96.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 3.30k, False: 93.4k]
  |  |  ------------------
  ------------------
  392|  3.30k|                {
  393|  3.30k|                    return;
  394|  3.30k|                }
  395|  93.4k|                auto result = unicode_traits::validate(sv.data(), sv.size());
  396|  93.4k|                if (JSONCONS_UNLIKELY(result.ec != unicode_traits::unicode_errc()))
  ------------------
  |  |   78|  93.4k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 5, False: 93.4k]
  |  |  ------------------
  ------------------
  397|      5|                {
  398|      5|                    ec = bson_errc::invalid_utf8_text_string;
  399|      5|                    more_ = false;
  400|      5|                    return;
  401|      5|                }
  402|  93.4k|                visitor.string_value(sv, semantic_tag::none, *this, ec);
  403|  93.4k|                more_ = !cursor_mode_;
  404|  93.4k|                break;
  405|  93.4k|            }
  406|  1.10k|            case jsoncons::bson::bson_type::javascript_type:
  ------------------
  |  Branch (406:13): [True: 1.10k, False: 5.25M]
  ------------------
  407|  1.10k|            {
  408|  1.10k|                auto sv = read_string(ec);
  409|  1.10k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  1.10k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 524, False: 581]
  |  |  ------------------
  ------------------
  410|    524|                {
  411|    524|                    return;
  412|    524|                }
  413|    581|                auto result = unicode_traits::validate(sv.data(), sv.size());
  414|    581|                if (JSONCONS_UNLIKELY(result.ec != unicode_traits::unicode_errc()))
  ------------------
  |  |   78|    581|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 4, False: 577]
  |  |  ------------------
  ------------------
  415|      4|                {
  416|      4|                    ec = bson_errc::invalid_utf8_text_string;
  417|      4|                    more_ = false;
  418|      4|                    return;
  419|      4|                }
  420|    577|                visitor.string_value(sv, semantic_tag::code, *this, ec);
  421|    577|                more_ = !cursor_mode_;
  422|    577|                break;
  423|    581|            }
  424|  31.7k|            case jsoncons::bson::bson_type::regex_type:
  ------------------
  |  Branch (424:13): [True: 31.7k, False: 5.22M]
  ------------------
  425|  31.7k|            {
  426|  31.7k|                text_buffer_.clear();
  427|  31.7k|                text_buffer_.push_back('/');
  428|  31.7k|                read_cstring(text_buffer_, ec);
  429|  31.7k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  31.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 27.1k, False: 4.60k]
  |  |  ------------------
  ------------------
  430|  27.1k|                {
  431|  27.1k|                    return;
  432|  27.1k|                }
  433|  4.60k|                text_buffer_.push_back('/');
  434|  4.60k|                read_cstring(text_buffer_, ec);
  435|  4.60k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|  4.60k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 21, False: 4.58k]
  |  |  ------------------
  ------------------
  436|     21|                {
  437|     21|                    return;
  438|     21|                }
  439|  4.58k|                visitor.string_value(text_buffer_, semantic_tag::regex, *this, ec);
  440|  4.58k|                more_ = !cursor_mode_;
  441|  4.58k|                break;
  442|  4.60k|            }
  443|  72.7k|            case jsoncons::bson::bson_type::document_type: 
  ------------------
  |  Branch (443:13): [True: 72.7k, False: 5.18M]
  ------------------
  444|  72.7k|            {
  445|  72.7k|                begin_document(visitor,ec);
  446|  72.7k|                break;
  447|  4.60k|            }
  448|       |
  449|   711k|            case jsoncons::bson::bson_type::array_type: 
  ------------------
  |  Branch (449:13): [True: 711k, False: 4.54M]
  ------------------
  450|   711k|            {
  451|   711k|                begin_array(visitor,ec);
  452|   711k|                break;
  453|  4.60k|            }
  454|  1.32k|            case jsoncons::bson::bson_type::undefined_type: 
  ------------------
  |  Branch (454:13): [True: 1.32k, False: 5.25M]
  ------------------
  455|  1.32k|                {
  456|  1.32k|                    visitor.null_value(semantic_tag::undefined, *this, ec);
  457|  1.32k|                    more_ = !cursor_mode_;
  458|  1.32k|                    break;
  459|  4.60k|                }
  460|  4.07M|            case jsoncons::bson::bson_type::null_type: 
  ------------------
  |  Branch (460:13): [True: 4.07M, False: 1.18M]
  ------------------
  461|  4.07M|            {
  462|  4.07M|                visitor.null_value(semantic_tag::none, *this, ec);
  463|  4.07M|                more_ = !cursor_mode_;
  464|  4.07M|                break;
  465|  4.60k|            }
  466|  5.02k|            case jsoncons::bson::bson_type::bool_type:
  ------------------
  |  Branch (466:13): [True: 5.02k, False: 5.25M]
  ------------------
  467|  5.02k|            {
  468|  5.02k|                uint8_t c;
  469|  5.02k|                std::size_t n = source_.read(&c, 1);
  470|  5.02k|                state_stack_.back().pos += n;
  471|  5.02k|                if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|  5.02k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 3, False: 5.02k]
  |  |  ------------------
  ------------------
  472|      3|                {
  473|      3|                    ec = bson_errc::unexpected_eof;
  474|      3|                    more_ = false;
  475|      3|                    return;
  476|      3|                }
  477|  5.02k|                visitor.bool_value(c != 0, semantic_tag::none, *this, ec);
  478|  5.02k|                more_ = !cursor_mode_;
  479|  5.02k|                break;
  480|  5.02k|            }
  481|  5.03k|            case jsoncons::bson::bson_type::int32_type: 
  ------------------
  |  Branch (481:13): [True: 5.03k, False: 5.25M]
  ------------------
  482|  5.03k|            {
  483|  5.03k|                uint8_t buf[sizeof(int32_t)]; 
  484|  5.03k|                std::size_t n = source_.read(buf, sizeof(int32_t));
  485|  5.03k|                state_stack_.back().pos += n;
  486|  5.03k|                if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|  5.03k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 5, False: 5.02k]
  |  |  ------------------
  ------------------
  487|      5|                {
  488|      5|                    ec = bson_errc::unexpected_eof;
  489|      5|                    more_ = false;
  490|      5|                    return;
  491|      5|                }
  492|  5.02k|                auto val = binary::little_to_native<int32_t>(buf, sizeof(buf));
  493|  5.02k|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  494|  5.02k|                more_ = !cursor_mode_;
  495|  5.02k|                break;
  496|  5.03k|            }
  497|       |
  498|  5.39k|            case jsoncons::bson::bson_type::timestamp_type: 
  ------------------
  |  Branch (498:13): [True: 5.39k, False: 5.25M]
  ------------------
  499|  5.39k|            {
  500|  5.39k|                uint8_t buf[sizeof(uint64_t)]; 
  501|  5.39k|                std::size_t n = source_.read(buf, sizeof(uint64_t));
  502|  5.39k|                state_stack_.back().pos += n;
  503|  5.39k|                if (JSONCONS_UNLIKELY(n != sizeof(uint64_t)))
  ------------------
  |  |   78|  5.39k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 7, False: 5.38k]
  |  |  ------------------
  ------------------
  504|      7|                {
  505|      7|                    ec = bson_errc::unexpected_eof;
  506|      7|                    more_ = false;
  507|      7|                    return;
  508|      7|                }
  509|  5.38k|                auto val = binary::little_to_native<uint64_t>(buf, sizeof(buf));
  510|  5.38k|                visitor.uint64_value(val, semantic_tag::none, *this, ec);
  511|  5.38k|                more_ = !cursor_mode_;
  512|  5.38k|                break;
  513|  5.39k|            }
  514|       |
  515|  35.8k|            case jsoncons::bson::bson_type::int64_type: 
  ------------------
  |  Branch (515:13): [True: 35.8k, False: 5.21M]
  ------------------
  516|  35.8k|            {
  517|  35.8k|                uint8_t buf[sizeof(int64_t)]; 
  518|  35.8k|                std::size_t n = source_.read(buf, sizeof(int64_t));
  519|  35.8k|                state_stack_.back().pos += n;
  520|  35.8k|                if (JSONCONS_UNLIKELY(n != sizeof(int64_t)))
  ------------------
  |  |   78|  35.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 6, False: 35.8k]
  |  |  ------------------
  ------------------
  521|      6|                {
  522|      6|                    ec = bson_errc::unexpected_eof;
  523|      6|                    more_ = false;
  524|      6|                    return;
  525|      6|                }
  526|  35.8k|                auto val = binary::little_to_native<int64_t>(buf, sizeof(buf));
  527|  35.8k|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  528|  35.8k|                more_ = !cursor_mode_;
  529|  35.8k|                break;
  530|  35.8k|            }
  531|       |
  532|  5.37k|            case jsoncons::bson::bson_type::datetime_type: 
  ------------------
  |  Branch (532:13): [True: 5.37k, False: 5.25M]
  ------------------
  533|  5.37k|            {
  534|  5.37k|                uint8_t buf[sizeof(int64_t)]; 
  535|  5.37k|                std::size_t n = source_.read(buf, sizeof(int64_t));
  536|  5.37k|                state_stack_.back().pos += n;
  537|  5.37k|                if (JSONCONS_UNLIKELY(n != sizeof(int64_t)))
  ------------------
  |  |   78|  5.37k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 6, False: 5.36k]
  |  |  ------------------
  ------------------
  538|      6|                {
  539|      6|                    ec = bson_errc::unexpected_eof;
  540|      6|                    more_ = false;
  541|      6|                    return;
  542|      6|                }
  543|  5.36k|                auto val = binary::little_to_native<int64_t>(buf, sizeof(buf));
  544|  5.36k|                visitor.int64_value(val, semantic_tag::epoch_milli, *this, ec);
  545|  5.36k|                more_ = !cursor_mode_;
  546|  5.36k|                break;
  547|  5.37k|            }
  548|  58.3k|            case jsoncons::bson::bson_type::binary_type: 
  ------------------
  |  Branch (548:13): [True: 58.3k, False: 5.19M]
  ------------------
  549|  58.3k|            {
  550|  58.3k|                uint8_t buf[sizeof(int32_t)]; 
  551|  58.3k|                std::size_t n = source_.read(buf, sizeof(int32_t));
  552|  58.3k|                state_stack_.back().pos += n;
  553|  58.3k|                if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|  58.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 4, False: 58.3k]
  |  |  ------------------
  ------------------
  554|      4|                {
  555|      4|                    ec = bson_errc::unexpected_eof;
  556|      4|                    more_ = false;
  557|      4|                    return;
  558|      4|                }
  559|  58.3k|                const auto len = binary::little_to_native<int32_t>(buf, sizeof(buf));
  560|  58.3k|                if (JSONCONS_UNLIKELY(len < 0))
  ------------------
  |  |   78|  58.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 36, False: 58.3k]
  |  |  ------------------
  ------------------
  561|     36|                {
  562|     36|                    ec = bson_errc::length_is_negative;
  563|     36|                    more_ = false;
  564|     36|                    return;
  565|     36|                }
  566|  58.3k|                uint8_t subtype;
  567|  58.3k|                n = source_.read(&subtype, 1);
  568|  58.3k|                state_stack_.back().pos += n;
  569|  58.3k|                if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   78|  58.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 8, False: 58.3k]
  |  |  ------------------
  ------------------
  570|      8|                {
  571|      8|                    ec = bson_errc::unexpected_eof;
  572|      8|                    more_ = false;
  573|      8|                    return;
  574|      8|                }
  575|       |
  576|  58.3k|                auto data = source_.read_span(len, bytes_buffer_);
  577|  58.3k|                if (JSONCONS_UNLIKELY(data.size() != static_cast<std::size_t>(len)))
  ------------------
  |  |   78|  58.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 329, False: 58.0k]
  |  |  ------------------
  ------------------
  578|    329|                {
  579|    329|                    ec = bson_errc::unexpected_eof;
  580|    329|                    more_ = false;
  581|    329|                    return;
  582|    329|                }
  583|  58.0k|                state_stack_.back().pos += data.size();
  584|       |
  585|  58.0k|                visitor.byte_string_value(byte_string_view(data.data(), data.size()), subtype, *this, ec);
  586|  58.0k|                more_ = !cursor_mode_;
  587|  58.0k|                break;
  588|  58.3k|            }
  589|   122k|            case jsoncons::bson::bson_type::decimal128_type: 
  ------------------
  |  Branch (589:13): [True: 122k, False: 5.13M]
  ------------------
  590|   122k|            {
  591|   122k|                uint8_t buf[sizeof(uint64_t)*2]; 
  592|   122k|                std::size_t n = source_.read(buf, sizeof(buf));
  593|   122k|                state_stack_.back().pos += n;
  594|   122k|                if (JSONCONS_UNLIKELY(n != sizeof(buf)))
  ------------------
  |  |   78|   122k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 18, False: 122k]
  |  |  ------------------
  ------------------
  595|     18|                {
  596|     18|                    ec = bson_errc::unexpected_eof;
  597|     18|                    more_ = false;
  598|     18|                    return;
  599|     18|                }
  600|       |
  601|   122k|                decimal128_t dec;
  602|   122k|                dec.low = binary::little_to_native<uint64_t>(buf, sizeof(uint64_t));
  603|   122k|                dec.high = binary::little_to_native<uint64_t>(buf+sizeof(uint64_t), sizeof(uint64_t));
  604|       |
  605|   122k|                text_buffer_.clear();
  606|   122k|                text_buffer_.resize(bson::decimal128_limits::buf_size);
  607|   122k|                auto r = bson::decimal128_to_chars(&text_buffer_[0], &text_buffer_[0]+text_buffer_.size(), dec);
  608|   122k|                visitor.string_value(string_view(text_buffer_.data(),static_cast<std::size_t>(r.ptr-text_buffer_.data())), semantic_tag::float128, *this, ec);
  609|   122k|                more_ = !cursor_mode_;
  610|   122k|                break;
  611|   122k|            }
  612|  28.9k|            case jsoncons::bson::bson_type::object_id_type: 
  ------------------
  |  Branch (612:13): [True: 28.9k, False: 5.22M]
  ------------------
  613|  28.9k|            {
  614|  28.9k|                uint8_t buf[12]; 
  615|  28.9k|                std::size_t n = source_.read(buf, sizeof(buf));
  616|  28.9k|                state_stack_.back().pos += n;
  617|  28.9k|                if (JSONCONS_UNLIKELY(n != sizeof(buf)))
  ------------------
  |  |   78|  28.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 9, False: 28.9k]
  |  |  ------------------
  ------------------
  618|      9|                {
  619|      9|                    ec = bson_errc::unexpected_eof;
  620|      9|                    more_ = false;
  621|      9|                    return;
  622|      9|                }
  623|       |
  624|  28.9k|                oid_t oid(buf);
  625|  28.9k|                to_string(oid, text_buffer_);
  626|       |
  627|  28.9k|                visitor.string_value(text_buffer_, semantic_tag::id, *this, ec);
  628|  28.9k|                more_ = !cursor_mode_;
  629|  28.9k|                break;
  630|  28.9k|            }
  631|    119|            default:
  ------------------
  |  Branch (631:13): [True: 119, False: 5.25M]
  ------------------
  632|    119|            {
  633|    119|                ec = bson_errc::unknown_type;
  634|    119|                more_ = false;
  635|    119|                return;
  636|  28.9k|            }
  637|  5.25M|        }
  638|  5.25M|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11read_stringERNS3_10error_codeE:
  662|  97.9k|    {
  663|  97.9k|        std::size_t offset = 0;
  664|       |
  665|  97.9k|        uint8_t buf[sizeof(int32_t)]; 
  666|  97.9k|        std::size_t n = source_.read(buf, sizeof(int32_t));
  667|  97.9k|        if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|  97.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 56, False: 97.8k]
  |  |  ------------------
  ------------------
  668|     56|        {
  669|     56|            ec = bson_errc::unexpected_eof;
  670|     56|            more_ = false;
  671|     56|            return string_view{};
  672|     56|        }
  673|  97.8k|        offset += n;
  674|       |
  675|  97.8k|        auto len = binary::little_to_native<int32_t>(buf, sizeof(buf));
  676|  97.8k|        if (JSONCONS_UNLIKELY(len < 1))
  ------------------
  |  |   78|  97.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 33, False: 97.8k]
  |  |  ------------------
  ------------------
  677|     33|        {
  678|     33|            ec = bson_errc::string_length_is_non_positive;
  679|     33|            more_ = false;
  680|     33|            return string_view{};
  681|     33|        }
  682|       |
  683|  97.8k|        std::size_t size = static_cast<std::size_t>(len) - static_cast<std::size_t>(1);
  684|  97.8k|        auto data = source_.read_span(size, text_buffer_);
  685|  97.8k|        if (JSONCONS_UNLIKELY(data.size() != size))
  ------------------
  |  |   78|  97.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 252, False: 97.5k]
  |  |  ------------------
  ------------------
  686|    252|        {
  687|    252|            ec = bson_errc::unexpected_eof;
  688|    252|            more_ = false;
  689|    252|            return string_view{};
  690|    252|        }
  691|  97.5k|        offset += data.size();
  692|       |
  693|  97.5k|        uint8_t c;
  694|  97.5k|        if (JSONCONS_UNLIKELY(source_.read(&c, 1) != 1))
  ------------------
  |  |   78|  97.5k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 18, False: 97.5k]
  |  |  ------------------
  ------------------
  695|     18|        {
  696|     18|            ec = bson_errc::unexpected_eof;
  697|     18|            more_ = false;
  698|     18|            return string_view{};
  699|     18|        }
  700|  97.5k|        ++offset;
  701|       |
  702|  97.5k|        state_stack_.back().pos += offset;
  703|  97.5k|        return string_view{reinterpret_cast<const char*>(data.data()), data.size()};
  704|  97.5k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11begin_arrayERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  296|   711k|    {
  297|   711k|        if (JSONCONS_UNLIKELY(static_cast<int>(state_stack_.size()) > max_nesting_depth_))
  ------------------
  |  |   78|   711k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 1, False: 711k]
  |  |  ------------------
  ------------------
  298|      1|        {
  299|      1|            ec = bson_errc::max_nesting_depth_exceeded;
  300|      1|            more_ = false;
  301|      1|            return;
  302|      1|        } 
  303|   711k|        uint8_t buf[sizeof(int32_t)]; 
  304|   711k|        std::size_t n = source_.read(buf, sizeof(int32_t));
  305|   711k|        if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   78|   711k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 13, False: 711k]
  |  |  ------------------
  ------------------
  306|     13|        {
  307|     13|            ec = bson_errc::unexpected_eof;
  308|     13|            more_ = false;
  309|     13|            return;
  310|     13|        }
  311|   711k|        auto length = binary::little_to_native<int32_t>(buf, sizeof(buf));
  312|       |
  313|   711k|        visitor.begin_array(semantic_tag::none, *this, ec);
  314|   711k|        more_ = !cursor_mode_;
  315|   711k|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   78|   711k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 699k, False: 12.3k]
  |  |  ------------------
  ------------------
  316|   699k|        {
  317|   699k|            return;
  318|   699k|        }
  319|  12.3k|        state_stack_.emplace_back(parse_mode::array, length, n);
  320|  12.3k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE9end_arrayERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  323|  2.15k|    {
  324|  2.15k|        JSONCONS_ASSERT(state_stack_.size() >= 2);
  ------------------
  |  |   49|  2.15k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 2.15k]
  |  |  ------------------
  |  |   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.15k|        visitor.end_array(*this, ec);
  327|  2.15k|        more_ = !cursor_mode_;
  328|  2.15k|        if (level() == mark_level_)
  ------------------
  |  Branch (328:13): [True: 0, False: 2.15k]
  ------------------
  329|      0|        {
  330|      0|            more_ = false;
  331|      0|        }
  332|  2.15k|        if (JSONCONS_UNLIKELY(state_stack_.back().pos != state_stack_.back().length))
  ------------------
  |  |   78|  2.15k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 111, False: 2.04k]
  |  |  ------------------
  ------------------
  333|    111|        {
  334|    111|            ec = bson_errc::size_mismatch;
  335|    111|            more_ = false;
  336|    111|            return;
  337|    111|        }
  338|  2.04k|        std::size_t pos = state_stack_.back().pos;
  339|  2.04k|        state_stack_.pop_back();
  340|  2.04k|        state_stack_.back().pos += pos;
  341|  2.04k|    }

_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|    }

