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

_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4sizeEv:
  116|   140k|        {
  117|   140k|            return size_;
  118|   140k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2Ev:
   58|  43.3k|        {
   59|  43.3k|        }
_ZN8jsoncons6detail4spanIKhLm18446744073709551615EEC2EPS2_m:
   61|  3.54k|            : data_(data), size_(size)
   62|  3.54k|        {
   63|  3.54k|        }
_ZNK8jsoncons6detail4spanIKhLm18446744073709551615EE4dataEv:
  111|  46.6k|        {
  112|  46.6k|            return data_;
  113|  46.6k|        }

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

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

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|  2.99k|    {
  194|  2.99k|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 2.99k, False: 0]
  ------------------
  195|  2.99k|        {
  196|  2.99k|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|  2.99k|        }
  198|  2.99k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|  2.99k|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|  2.99k|          chunk_size_(default_max_chunk_size)
  178|  2.99k|    {
  179|  2.99k|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|  2.99k|        data_ = chunk_;
  181|  2.99k|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|  2.99k|      : std::basic_istream<CharT>(&nb_)
   58|  2.99k|    {
   59|  2.99k|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|  2.99k|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  2.99k|    {
  277|  2.99k|        return stream_ptr_->bad();  
  278|  2.99k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  372|  27.8M|    {
  373|  27.8M|        std::size_t len = 0;
  374|  27.8M|        if (count_ > 0)
  ------------------
  |  Branch (374:13): [True: 27.8M, False: 6.81k]
  ------------------
  375|  27.8M|        {
  376|  27.8M|            len = (std::min)(count_, length);
  377|  27.8M|            std::memcpy(p, data_, len*sizeof(value_type));
  378|  27.8M|            data_ += len;
  379|  27.8M|            count_ -= len;
  380|  27.8M|            position_ += len;
  381|  27.8M|        }
  382|  27.8M|        if (length - len == 0)
  ------------------
  |  Branch (382:13): [True: 27.8M, False: 8.36k]
  ------------------
  383|  27.8M|        {
  384|  27.8M|            return len;
  385|  27.8M|        }
  386|  8.36k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (386:18): [True: 8.36k, False: 0]
  ------------------
  387|  8.36k|        {
  388|  8.36k|            data_ = chunk_;
  389|  8.36k|            count_ = fill_buffer(chunk_, chunk_size_);
  390|  8.36k|            if (count_ > 0)
  ------------------
  |  Branch (390:17): [True: 5.90k, False: 2.46k]
  ------------------
  391|  5.90k|            {
  392|  5.90k|                std::size_t len2 = (std::min)(count_, length-len);
  393|  5.90k|                std::memcpy(p+len, data_, len2*sizeof(value_type));
  394|  5.90k|                data_ += len2;
  395|  5.90k|                count_ -= len2;
  396|  5.90k|                position_ += len2;
  397|  5.90k|                len += len2;
  398|  5.90k|            }
  399|  8.36k|            return len;
  400|  8.36k|        }
  401|      0|        else
  402|      0|        {
  403|      0|            if (stream_ptr_->eof())
  ------------------
  |  Branch (403:17): [True: 0, False: 0]
  ------------------
  404|      0|            {
  405|      0|                count_ = 0;
  406|      0|                return 0;
  407|      0|            }
  408|      0|            JSONCONS_TRY
  ------------------
  |  |   37|      0|    #define JSONCONS_TRY try
  ------------------
  409|      0|            {
  410|      0|                std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(p+len), length-len);
  411|      0|                std::size_t len2 = static_cast<std::size_t>(count);
  412|      0|                if (len2 < length-len)
  ------------------
  |  Branch (412:21): [True: 0, False: 0]
  ------------------
  413|      0|                {
  414|      0|                    stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  415|      0|                }
  416|      0|                len += len2;
  417|      0|                position_ += len2;
  418|      0|                return len;
  419|      0|            }
  420|      0|            JSONCONS_CATCH(const std::exception&)     
  421|      0|            {
  422|      0|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  423|      0|                return 0;
  424|      0|            }
  425|      0|        }
  426|  27.8M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  430|  8.71k|    {
  431|  8.71k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (431:13): [True: 2.45k, False: 6.26k]
  ------------------
  432|  2.45k|        {
  433|  2.45k|            return 0;
  434|  2.45k|        }
  435|       |
  436|  6.26k|        JSONCONS_TRY
  ------------------
  |  |   37|  6.26k|    #define JSONCONS_TRY try
  ------------------
  437|  6.26k|        {
  438|  6.26k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  439|  6.26k|            std::size_t length = static_cast<std::size_t>(count);
  440|       |
  441|  6.26k|            if (length < chunk_size)
  ------------------
  |  Branch (441:17): [True: 2.97k, False: 3.28k]
  ------------------
  442|  2.97k|            {
  443|  2.97k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  444|  2.97k|            }
  445|  6.26k|            return length;
  446|  6.26k|        }
  447|  6.26k|        JSONCONS_CATCH(const std::exception&)     
  448|  6.26k|        {
  449|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  450|      0|            return 0;
  451|      0|        }
  452|  6.26k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  3.87k|    {
  353|  3.87k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  3.87k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 2.16k, False: 1.71k]
  |  |  ------------------
  ------------------
  354|  2.16k|        {
  355|  2.16k|            return span<const value_type>{};
  356|  2.16k|        }
  357|  1.71k|        if (length > count_)
  ------------------
  |  Branch (357:13): [True: 190, False: 1.52k]
  ------------------
  358|    190|        {
  359|    190|            buffer.clear();
  360|    190|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  361|    190|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  362|    190|        }
  363|       |
  364|  1.52k|        const value_type* data = data_;
  365|  1.52k|        data_ += length;
  366|  1.52k|        count_ -= length;
  367|  1.52k|        position_ += length;
  368|  1.52k|        return span<const value_type>(data, length);
  369|  1.71k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  996|    190|    {
  997|    190|        std::size_t unread = length;
  998|       |
  999|    712|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (999:16): [True: 646, False: 66]
  |  Branch (999:30): [True: 522, False: 124]
  ------------------
 1000|    522|        {
 1001|    522|            if (source.count() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (1001:17): [True: 90, False: 432]
  |  Branch (1001:40): [True: 90, False: 0]
  ------------------
 1002|     90|            {
 1003|     90|                std::size_t n = source.chunk_size();
 1004|     90|                std::size_t offset = buffer.size();
 1005|     90|                buffer.resize(buffer.size()+n);
 1006|     90|                std::size_t actual = source.fill_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
 1007|     90|                unread -= actual;
 1008|     90|            }
 1009|    432|            else
 1010|    432|            {
 1011|    432|                std::size_t n = (std::min)(source.chunk_size(), unread);
 1012|    432|                std::size_t offset = buffer.size();
 1013|    432|                buffer.resize(buffer.size()+n);
 1014|    432|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
 1015|    432|                unread -= actual;
 1016|    432|            }
 1017|    522|        }
 1018|    190|        return length - unread;
 1019|    190|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  1.95k|    {
  272|  1.95k|        return count_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 668, False: 1.28k]
  |  Branch (272:31): [True: 318, False: 350]
  ------------------
  273|  1.95k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE5countEv:
  346|  1.63k|    {
  347|  1.63k|        return count_;
  348|  1.63k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  1.98k|    {
  262|  1.98k|        return chunk_size_;
  263|  1.98k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6detail4spanIKhLm18446744073709551615EEEmOT_:
  352|  43.0k|    {
  353|  43.0k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   78|  43.0k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 41.2k, False: 1.83k]
  |  |  ------------------
  ------------------
  354|  41.2k|        {
  355|  41.2k|            return span<const value_type>{};
  356|  41.2k|        }
  357|  1.83k|        if (length > count_)
  ------------------
  |  Branch (357:13): [True: 227, False: 1.60k]
  ------------------
  358|    227|        {
  359|    227|            buffer.clear();
  360|    227|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  361|    227|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  362|    227|        }
  363|       |
  364|  1.60k|        const value_type* data = data_;
  365|  1.60k|        data_ += length;
  366|  1.60k|        count_ -= length;
  367|  1.60k|        position_ += length;
  368|  1.60k|        return span<const value_type>(data, length);
  369|  1.83k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  996|    227|    {
  997|    227|        std::size_t unread = length;
  998|       |
  999|  1.34k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (999:16): [True: 1.31k, False: 33]
  |  Branch (999:30): [True: 1.11k, False: 194]
  ------------------
 1000|  1.11k|        {
 1001|  1.11k|            if (source.count() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (1001:17): [True: 260, False: 856]
  |  Branch (1001:40): [True: 260, False: 0]
  ------------------
 1002|    260|            {
 1003|    260|                std::size_t n = source.chunk_size();
 1004|    260|                std::size_t offset = buffer.size();
 1005|    260|                buffer.resize(buffer.size()+n);
 1006|    260|                std::size_t actual = source.fill_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
 1007|    260|                unread -= actual;
 1008|    260|            }
 1009|    856|            else
 1010|    856|            {
 1011|    856|                std::size_t n = (std::min)(source.chunk_size(), unread);
 1012|    856|                std::size_t offset = buffer.size();
 1013|    856|                buffer.resize(buffer.size()+n);
 1014|    856|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
 1015|    856|                unread -= actual;
 1016|    856|            }
 1017|  1.11k|        }
 1018|    227|        return length - unread;
 1019|    227|    }

_ZN8jsoncons6binary16native_to_littleIjNSt3__111__wrap_iterIPhEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrS9_6littleEvE4typeET_T0_:
  142|  61.0k|    {
  143|  61.0k|        uint8_t buf[sizeof(T)];
  144|  61.0k|        std::memcpy(buf, &val, sizeof(T));
  145|  61.0k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 244k, False: 61.0k]
  ------------------
  146|   244k|        {
  147|   244k|            *d_first++ = item;
  148|   244k|        }
  149|  61.0k|    }
_ZN8jsoncons6binary16native_to_littleIlNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  33.1k|    {
  143|  33.1k|        uint8_t buf[sizeof(T)];
  144|  33.1k|        std::memcpy(buf, &val, sizeof(T));
  145|  33.1k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 264k, False: 33.1k]
  ------------------
  146|   264k|        {
  147|   264k|            *d_first++ = item;
  148|   264k|        }
  149|  33.1k|    }
_ZN8jsoncons6binary16native_to_littleIjNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  4.83k|    {
  143|  4.83k|        uint8_t buf[sizeof(T)];
  144|  4.83k|        std::memcpy(buf, &val, sizeof(T));
  145|  4.83k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 19.3k, False: 4.83k]
  ------------------
  146|  19.3k|        {
  147|  19.3k|            *d_first++ = item;
  148|  19.3k|        }
  149|  4.83k|    }
_ZN8jsoncons6binary16native_to_littleImNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|   193k|    {
  143|   193k|        uint8_t buf[sizeof(T)];
  144|   193k|        std::memcpy(buf, &val, sizeof(T));
  145|   193k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 1.55M, False: 193k]
  ------------------
  146|  1.55M|        {
  147|  1.55M|            *d_first++ = item;
  148|  1.55M|        }
  149|   193k|    }
_ZN8jsoncons6binary16native_to_littleIdNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|    785|    {
  143|    785|        uint8_t buf[sizeof(T)];
  144|    785|        std::memcpy(buf, &val, sizeof(T));
  145|    785|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 6.28k, False: 785]
  ------------------
  146|  6.28k|        {
  147|  6.28k|            *d_first++ = item;
  148|  6.28k|        }
  149|    785|    }
_ZN8jsoncons6binary16little_to_nativeIiNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   818k|    {
  198|   818k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 818k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   818k|        T val;
  203|   818k|        std::memcpy(&val,first,sizeof(T));
  204|   818k|        return val;
  205|   818k|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|    785|    {
  198|    785|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 785]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|    785|        T val;
  203|    785|        std::memcpy(&val,first,sizeof(T));
  204|    785|        return val;
  205|    785|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   196k|    {
  198|   196k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 196k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   196k|        T val;
  203|   196k|        std::memcpy(&val,first,sizeof(T));
  204|   196k|        return val;
  205|   196k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  33.1k|    {
  198|  33.1k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 33.1k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  33.1k|        T val;
  203|  33.1k|        std::memcpy(&val,first,sizeof(T));
  204|  33.1k|        return val;
  205|  33.1k|    }

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

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

_ZN8jsoncons10to_integerIicEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  557|  90.8k|{
  558|  90.8k|    n = 0;
  559|       |
  560|  90.8k|    if (length == 0)
  ------------------
  |  Branch (560:9): [True: 215, False: 90.6k]
  ------------------
  561|    215|    {
  562|    215|        return to_number_result<CharT>(s, std::errc::invalid_argument);
  563|    215|    }
  564|       |
  565|  90.6k|    bool is_negative = *s == '-' ? true : false;
  ------------------
  |  Branch (565:24): [True: 80.8k, False: 9.76k]
  ------------------
  566|  90.6k|    if (is_negative)
  ------------------
  |  Branch (566:9): [True: 80.8k, False: 9.76k]
  ------------------
  567|  80.8k|    {
  568|  80.8k|        ++s;
  569|  80.8k|        --length;
  570|  80.8k|    }
  571|       |
  572|  90.6k|    using U = typename ext_traits::make_unsigned<T>::type;
  573|       |
  574|  90.6k|    U u;
  575|  90.6k|    auto ru = to_integer(s, length, u);
  576|  90.6k|    if (ru.ec != std::errc{})
  ------------------
  |  Branch (576:9): [True: 0, False: 90.6k]
  ------------------
  577|      0|    {
  578|      0|        return to_number_result<CharT>(ru.ptr, ru.ec);
  579|      0|    }
  580|  90.6k|    if (is_negative)
  ------------------
  |  Branch (580:9): [True: 80.8k, False: 9.76k]
  ------------------
  581|  80.8k|    {
  582|  80.8k|        if (u > static_cast<U>(-((ext_traits::integer_limits<T>::lowest)()+T(1))) + U(1))
  ------------------
  |  Branch (582:13): [True: 0, False: 80.8k]
  ------------------
  583|      0|        {
  584|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  585|      0|        }
  586|  80.8k|        else
  587|  80.8k|        {
  588|  80.8k|            n = static_cast<T>(U(0) - u);
  589|  80.8k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  590|  80.8k|        }
  591|  80.8k|    }
  592|  9.76k|    else
  593|  9.76k|    {
  594|  9.76k|        if (u > static_cast<U>((ext_traits::integer_limits<T>::max)()))
  ------------------
  |  Branch (594:13): [True: 0, False: 9.76k]
  ------------------
  595|      0|        {
  596|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  597|      0|        }
  598|  9.76k|        else
  599|  9.76k|        {
  600|  9.76k|            n = static_cast<T>(u);
  601|  9.76k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  602|  9.76k|        }
  603|  9.76k|    }
  604|  90.6k|}
_ZN8jsoncons16to_number_resultIcEC2EPKcNSt3__14errcE:
  141|   181k|        : ptr(ptr_), ec(ec_)
  142|   181k|    {
  143|   181k|    }
_ZN8jsoncons10to_integerIjcEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedntsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  374|  90.6k|{
  375|  90.6k|    n = 0;
  376|       |
  377|  90.6k|    integer_chars_state state = integer_chars_state::initial;
  378|       |
  379|  90.6k|    const CharT* end = s + length; 
  380|   271k|    while (s < end)
  ------------------
  |  Branch (380:12): [True: 181k, False: 90.6k]
  ------------------
  381|   181k|    {
  382|   181k|        switch(state)
  383|   181k|        {
  384|  90.6k|            case integer_chars_state::initial:
  ------------------
  |  Branch (384:13): [True: 90.6k, False: 90.6k]
  ------------------
  385|  90.6k|            {
  386|  90.6k|                switch(*s)
  387|  90.6k|                {
  388|      0|                    case '0':
  ------------------
  |  Branch (388:21): [True: 0, False: 90.6k]
  ------------------
  389|      0|                        state = integer_chars_state::integer; // Could be binary, octal, hex 
  390|      0|                        ++s;
  391|      0|                        break;
  392|  90.6k|                    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: 524, False: 90.0k]
  |  Branch (392:30): [True: 1.30k, False: 89.3k]
  |  Branch (392:39): [True: 71.8k, False: 18.7k]
  |  Branch (392:48): [True: 5.14k, False: 85.4k]
  |  Branch (392:57): [True: 2.51k, False: 88.1k]
  |  Branch (392:66): [True: 2.02k, False: 88.5k]
  |  Branch (392:75): [True: 6.25k, False: 84.3k]
  |  Branch (392:84): [True: 561, False: 90.0k]
  |  Branch (392:94): [True: 396, False: 90.2k]
  ------------------
  393|  90.6k|                        state = integer_chars_state::decimal;
  394|  90.6k|                        break;
  395|      0|                    default:
  ------------------
  |  Branch (395:21): [True: 0, False: 90.6k]
  ------------------
  396|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  397|  90.6k|                }
  398|  90.6k|                break;
  399|  90.6k|            }
  400|  90.6k|            case integer_chars_state::integer:
  ------------------
  |  Branch (400:13): [True: 0, False: 181k]
  ------------------
  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: 181k]
  ------------------
  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: 181k]
  ------------------
  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|  90.6k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (482:13): [True: 90.6k, False: 90.6k]
  ------------------
  483|  90.6k|            {
  484|  90.6k|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  485|  90.6k|                static constexpr T max_value_div_10 = max_value / 10;
  486|   432k|                for (; s < end; ++s)
  ------------------
  |  Branch (486:24): [True: 342k, False: 90.6k]
  ------------------
  487|   342k|                {
  488|   342k|                    T x = 0;
  489|   342k|                    switch(*s)
  490|   342k|                    {
  491|   342k|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (491:25): [True: 53.1k, False: 288k]
  |  Branch (491:34): [True: 22.6k, False: 319k]
  |  Branch (491:43): [True: 53.7k, False: 288k]
  |  Branch (491:52): [True: 93.3k, False: 248k]
  |  Branch (491:61): [True: 7.97k, False: 334k]
  |  Branch (491:70): [True: 8.91k, False: 333k]
  |  Branch (491:79): [True: 7.65k, False: 334k]
  |  Branch (491:88): [True: 63.1k, False: 278k]
  |  Branch (491:97): [True: 26.1k, False: 315k]
  |  Branch (491:107): [True: 5.40k, False: 336k]
  ------------------
  492|   342k|                            x = static_cast<T>(*s) - static_cast<T>('0');
  493|   342k|                            break;
  494|      0|                        default:
  ------------------
  |  Branch (494:25): [True: 0, False: 342k]
  ------------------
  495|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  496|   342k|                    }
  497|   342k|                    if (n > max_value_div_10)
  ------------------
  |  Branch (497:25): [True: 0, False: 342k]
  ------------------
  498|      0|                    {
  499|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  500|      0|                    }
  501|   342k|                    n = n * 10;
  502|   342k|                    if (n > max_value - x)
  ------------------
  |  Branch (502:25): [True: 0, False: 342k]
  ------------------
  503|      0|                    {
  504|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  505|      0|                    }
  506|   342k|                    n += x;
  507|   342k|                }
  508|  90.6k|                break;
  509|  90.6k|            }
  510|  90.6k|            case integer_chars_state::base16:
  ------------------
  |  Branch (510:13): [True: 0, False: 181k]
  ------------------
  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: 181k]
  ------------------
  547|      0|                JSONCONS_UNREACHABLE();
  ------------------
  |  |   79|      0|#define JSONCONS_UNREACHABLE() __builtin_unreachable()
  ------------------
  548|      0|                break;
  549|   181k|        }
  550|   181k|    }
  551|  90.6k|    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: 90.6k]
  ------------------
  552|  90.6k|}

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|   220k|    {
 1148|   220k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|   220k|        const uint8_t* end = it + length;
 1150|       |
 1151|   220k|        unicode_errc  result{};
 1152|   739k|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 519k, False: 220k]
  ------------------
 1153|   519k|        {
 1154|   519k|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 507k, False: 11.4k]
  ------------------
 1155|   507k|            {
 1156|  3.51M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  281|  1.01M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (281:32): [True: 506k, False: 1.61k]
  |  |  |  Branch (281:34): [True: 505k, False: 1.15k]
  |  |  |  Branch (281:36): [True: 503k, False: 1.55k]
  |  |  |  Branch (281:38): [True: 502k, False: 1.37k]
  |  |  |  Branch (281:40): [True: 501k, False: 690]
  |  |  |  Branch (281:42): [True: 501k, False: 468]
  |  |  |  Branch (281:44): [True: 500k, False: 975]
  |  |  |  Branch (281:46): [True: 499k, False: 1.00k]
  |  |  ------------------
  ------------------
 1157|   499k|                continue;
 1158|  3.51M|            }
 1159|  20.2k|    non_ascii:
 1160|  20.2k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|  20.2k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 38, False: 20.2k]
  ------------------
 1162|     38|            {
 1163|     38|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     38|            }
 1165|  20.2k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 145, False: 20.0k]
  ------------------
 1166|    145|            {
 1167|    145|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    145|            }
 1169|  20.0k|            it += len;
 1170|  20.0k|        }
 1171|   220k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|   220k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|  20.2k|    {
  306|  20.2k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|  20.2k|        const uint8_t* end = it+length;
  308|       |
  309|  20.2k|        uint8_t byte;
  310|  20.2k|        switch (length) {
  311|     31|        default:
  ------------------
  |  Branch (311:9): [True: 31, False: 20.2k]
  ------------------
  312|     31|            return unicode_errc::over_long_utf8_sequence;
  313|  1.03k|        case 4:
  ------------------
  |  Branch (313:9): [True: 1.03k, False: 19.1k]
  ------------------
  314|  1.03k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 9, False: 1.02k]
  ------------------
  315|      9|                return unicode_errc::bad_continuation_byte;
  316|  1.02k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.02k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  6.22k|        case 3:
  ------------------
  |  Branch (317:9): [True: 5.19k, False: 15.0k]
  ------------------
  318|  6.22k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 14, False: 6.21k]
  ------------------
  319|     14|                return unicode_errc::bad_continuation_byte;
  320|  6.21k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  6.21k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  9.42k|        case 2:
  ------------------
  |  Branch (321:9): [True: 3.21k, False: 17.0k]
  ------------------
  322|  9.42k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 27, False: 9.39k]
  ------------------
  323|     27|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  9.39k|            switch (*it) 
  326|  9.39k|            {
  327|       |                // no fall-through in this inner switch
  328|  1.82k|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 1.82k, False: 7.57k]
  |  Branch (328:32): [True: 8, False: 1.81k]
  ------------------
  329|  1.81k|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 296, False: 9.09k]
  |  Branch (329:32): [True: 5, False: 291]
  ------------------
  330|    303|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 303, False: 9.09k]
  |  Branch (330:32): [True: 7, False: 296]
  ------------------
  331|    505|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 505, False: 8.89k]
  |  Branch (331:32): [True: 3, False: 502]
  ------------------
  332|  6.46k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 6.46k, False: 2.92k]
  |  Branch (332:32): [True: 0, False: 6.46k]
  ------------------
  333|  9.39k|            }
  334|       |
  335|  9.37k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  9.37k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|  20.1k|        case 1:
  ------------------
  |  Branch (336:9): [True: 10.7k, False: 9.47k]
  ------------------
  337|  20.1k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 9.41k, False: 10.7k]
  |  Branch (337:32): [True: 40, False: 9.37k]
  ------------------
  338|     40|                return unicode_errc::source_illegal;
  339|  20.0k|            break;
  340|  20.2k|        }
  341|  20.0k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 1, False: 20.0k]
  ------------------
  342|      1|            return unicode_errc::source_illegal;
  343|       |
  344|  20.0k|        return unicode_errc();
  345|  20.0k|    }

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

_ZN8jsoncons4bson3TP1C2Ev:
   78|   194k|        constexpr TP1() : low(0), high(0) {}
_ZN8jsoncons4bson21decimal128_from_charsEPKcS2_RNS0_3TP1E:
  572|  97.2k|    {
  573|  97.2k|        static const string_view inf_str = "inf";
  574|  97.2k|        static const string_view infinity_str = "infinity";
  575|  97.2k|        static const string_view nan_str = "nan";
  576|       |
  577|  97.2k|        ptrdiff_t len = last - first;
  578|       |
  579|  97.2k|        bson_uint128_6464_t significand = {0,0};
  580|       | 
  581|  97.2k|        const char* str_read = first; /* Read pointer for consuming str. */
  582|       | 
  583|       |        /* Parsing state tracking */
  584|  97.2k|        bool is_negative = false;
  585|  97.2k|        bool saw_radix = false;
  586|  97.2k|        bool includes_sign = false; /* True if the input first contains a sign. */
  587|  97.2k|        bool found_nonzero = false;
  588|       | 
  589|  97.2k|        std::size_t significant_digits = 0; /* Total number of significant digits
  590|       |                                        * (no leading or trailing zero) */
  591|  97.2k|        std::size_t ndigits_read = 0;       /* Total number of significand digits read */
  592|  97.2k|        std::size_t ndigits = 0;        /* Total number of digits (no leading zeros) */
  593|  97.2k|        std::size_t radix_position = 0; /* The number of the digits after radix */
  594|  97.2k|        std::size_t first_nonzero = 0;  /* The index of the first non-zero in *str* */
  595|       | 
  596|  97.2k|        uint16_t digits[decimal128_limits::max_digits] = {0};
  597|  97.2k|        uint16_t ndigits_stored = 0;      /* The number of digits in digits */
  598|  97.2k|        uint16_t *digits_insert = digits; /* Insertion pointer for digits */
  599|  97.2k|        std::size_t first_digit = 0;           /* The index of the first non-zero digit */
  600|  97.2k|        std::size_t last_digit = 0;            /* The index of the last digit */
  601|       | 
  602|  97.2k|        int32_t exponent = 0;
  603|  97.2k|        uint64_t significand_high = 0; /* The high 17 digits of the significand */
  604|  97.2k|        uint64_t significand_low = 0;  /* The low 17 digits of the significand */
  605|  97.2k|        uint16_t biased_exponent = 0;  /* The biased exponent */
  606|       | 
  607|  97.2k|        dec.high = 0;
  608|  97.2k|        dec.low = 0;
  609|       | 
  610|  97.2k|        if (*str_read == '+' || *str_read == '-') {
  ------------------
  |  Branch (610:13): [True: 0, False: 97.2k]
  |  Branch (610:33): [True: 10.0k, False: 87.2k]
  ------------------
  611|  10.0k|           is_negative = *(str_read++) == '-';
  612|  10.0k|           includes_sign = true;
  613|  10.0k|        }
  614|       |
  615|       |        /* Check for Infinity or NaN */
  616|  97.2k|        if (!isdigit(*str_read) && *str_read != '.') {
  ------------------
  |  Branch (616:13): [True: 3.02k, False: 94.2k]
  |  Branch (616:36): [True: 3.02k, False: 0]
  ------------------
  617|  3.02k|           if (detail::dec128_istreq (str_read, last, inf_str.data(), inf_str.data()+inf_str.length()) ||
  ------------------
  |  Branch (617:16): [True: 0, False: 3.02k]
  ------------------
  618|  3.02k|               detail::dec128_istreq (str_read, last, infinity_str.data(), infinity_str.data()+infinity_str.length())) 
  ------------------
  |  Branch (618:16): [True: 2.22k, False: 799]
  ------------------
  619|  2.22k|           {
  620|  2.22k|               dec = is_negative ? decimal128_limits::neg_infinity() : decimal128_limits::infinity();
  ------------------
  |  Branch (620:22): [True: 1.79k, False: 428]
  ------------------
  621|  2.22k|              return decimal128_from_chars_result{str_read,std::errc{}};
  622|  2.22k|           } else if (detail::dec128_istreq (str_read, last, nan_str.data(), nan_str.data()+nan_str.length())) {
  ------------------
  |  Branch (622:23): [True: 799, False: 0]
  ------------------
  623|    799|              dec = decimal128_limits::nan();
  624|    799|              return decimal128_from_chars_result{str_read,std::errc{}};
  625|    799|           }
  626|       | 
  627|      0|           dec = decimal128_limits::nan();
  628|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  629|  3.02k|        }
  630|       | 
  631|       |        /* Read digits */
  632|  3.05M|        while (((isdigit (*str_read) || *str_read == '.')) &&
  ------------------
  |  Branch (632:18): [True: 2.87M, False: 180k]
  |  Branch (632:41): [True: 86.5k, False: 94.2k]
  ------------------
  633|  2.96M|               (len == -1 || str_read < first + len)) {
  ------------------
  |  Branch (633:17): [True: 0, False: 2.96M]
  |  Branch (633:30): [True: 2.96M, False: 0]
  ------------------
  634|  2.96M|           if (*str_read == '.') {
  ------------------
  |  Branch (634:16): [True: 86.5k, False: 2.87M]
  ------------------
  635|  86.5k|              if (saw_radix) {
  ------------------
  |  Branch (635:19): [True: 0, False: 86.5k]
  ------------------
  636|      0|                 dec = decimal128_limits::nan();
  637|      0|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  638|      0|              }
  639|       | 
  640|  86.5k|              saw_radix = true;
  641|  86.5k|              str_read++;
  642|  86.5k|              continue;
  643|  86.5k|           }
  644|       | 
  645|  2.87M|           if (ndigits_stored < 34) {
  ------------------
  |  Branch (645:16): [True: 2.87M, False: 1.52k]
  ------------------
  646|  2.87M|              if (*str_read != '0' || found_nonzero) {
  ------------------
  |  Branch (646:19): [True: 2.59M, False: 277k]
  |  Branch (646:39): [True: 267k, False: 10.4k]
  ------------------
  647|  2.86M|                 if (!found_nonzero) {
  ------------------
  |  Branch (647:22): [True: 86.9k, False: 2.77M]
  ------------------
  648|  86.9k|                    first_nonzero = ndigits_read;
  649|  86.9k|                 }
  650|       | 
  651|  2.86M|                 found_nonzero = true;
  652|  2.86M|                 *(digits_insert++) = *(str_read) - '0'; /* Only store 34 digits */
  653|  2.86M|                 ndigits_stored++;
  654|  2.86M|              }
  655|  2.87M|           }
  656|       | 
  657|  2.87M|           if (found_nonzero) {
  ------------------
  |  Branch (657:16): [True: 2.86M, False: 10.4k]
  ------------------
  658|  2.86M|              ndigits++;
  659|  2.86M|           }
  660|       | 
  661|  2.87M|           if (saw_radix) {
  ------------------
  |  Branch (661:16): [True: 2.76M, False: 109k]
  ------------------
  662|  2.76M|              radix_position++;
  663|  2.76M|           }
  664|       | 
  665|  2.87M|           ndigits_read++;
  666|  2.87M|           str_read++;
  667|  2.87M|        }
  668|       | 
  669|  94.2k|        if (saw_radix && !ndigits_read) {
  ------------------
  |  Branch (669:13): [True: 86.5k, False: 7.74k]
  |  Branch (669:26): [True: 0, False: 86.5k]
  ------------------
  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|  94.2k|        if (*str_read == 'e' || *str_read == 'E') {
  ------------------
  |  Branch (675:13): [True: 0, False: 94.2k]
  |  Branch (675:33): [True: 90.8k, False: 3.43k]
  ------------------
  676|  90.8k|           ++str_read;
  677|  90.8k|           if (*str_read == '+') {
  ------------------
  |  Branch (677:16): [True: 9.76k, False: 81.0k]
  ------------------
  678|  9.76k|               ++str_read;
  679|  9.76k|           }
  680|  90.8k|           auto result = jsoncons::to_integer(str_read, last - str_read, exponent);
  681|  90.8k|           if (result.ec != std::errc{}) 
  ------------------
  |  Branch (681:16): [True: 215, False: 90.6k]
  ------------------
  682|    215|           {
  683|    215|               dec = decimal128_limits::nan();
  684|    215|               return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  685|    215|           }
  686|  90.6k|           str_read = result.ptr;
  687|  90.6k|        }
  688|       |
  689|  94.0k|        if ((len == -1 || str_read < first + len) && *str_read) {
  ------------------
  |  Branch (689:14): [True: 0, False: 94.0k]
  |  Branch (689:27): [True: 0, False: 94.0k]
  |  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|  94.0k|        first_digit = 0;
  697|       | 
  698|  94.0k|        if (!ndigits_stored) { /* value is zero */
  ------------------
  |  Branch (698:13): [True: 7.31k, False: 86.7k]
  ------------------
  699|  7.31k|           first_digit = 0;
  700|  7.31k|           last_digit = 0;
  701|  7.31k|           digits[0] = 0;
  702|  7.31k|           ndigits = 1;
  703|  7.31k|           ndigits_stored = 1;
  704|  7.31k|           significant_digits = 0;
  705|  86.7k|        } else {
  706|  86.7k|           last_digit = ndigits_stored - 1;
  707|  86.7k|           significant_digits = ndigits;
  708|       |           /* Mark trailing zeros as non-significant */
  709|   102k|           while (first[first_nonzero + significant_digits - 1 + includes_sign +
  ------------------
  |  Branch (709:19): [True: 15.8k, False: 86.7k]
  ------------------
  710|   102k|                         saw_radix] == '0') {
  711|  15.8k|              significant_digits--;
  712|  15.8k|           }
  713|  86.7k|        }
  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|  94.0k|        if (exponent <= static_cast<int32_t>(radix_position) && static_cast<int32_t>(radix_position) - exponent > (1 << 14)) {
  ------------------
  |  Branch (722:13): [True: 84.2k, False: 9.76k]
  |  Branch (722:65): [True: 0, False: 84.2k]
  ------------------
  723|      0|           exponent = decimal128_limits::exponent_min;
  724|  94.0k|        } else {
  725|  94.0k|           exponent -= static_cast<int32_t>(radix_position);
  726|  94.0k|        }
  727|       | 
  728|       |        /* Attempt to normalize the exponent */
  729|  94.0k|        while (exponent > decimal128_limits::exponent_max) {
  ------------------
  |  Branch (729:16): [True: 0, False: 94.0k]
  ------------------
  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|  95.1k|        while (exponent < decimal128_limits::exponent_min || ndigits_stored < ndigits) {
  ------------------
  |  Branch (749:16): [True: 0, False: 95.1k]
  |  Branch (749:62): [True: 1.50k, False: 93.6k]
  ------------------
  750|       |           /* Shift last digit */
  751|  1.50k|           if (last_digit == 0) {
  ------------------
  |  Branch (751:16): [True: 0, False: 1.50k]
  ------------------
  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.50k|           if (ndigits_stored < ndigits) {
  ------------------
  |  Branch (762:16): [True: 1.50k, False: 0]
  ------------------
  763|  1.50k|              if (first[ndigits - 1 + includes_sign + saw_radix] - '0' != 0 &&
  ------------------
  |  Branch (763:19): [True: 366, False: 1.13k]
  ------------------
  764|    366|                  significant_digits != 0) {
  ------------------
  |  Branch (764:19): [True: 366, False: 0]
  ------------------
  765|    366|                 dec = decimal128_limits::nan();
  766|    366|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  767|    366|              }
  768|       | 
  769|  1.13k|              ndigits--; /* adjust to match digits not stored */
  770|  1.13k|           } 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.13k|           if (exponent < decimal128_limits::exponent_max) {
  ------------------
  |  Branch (781:16): [True: 1.13k, False: 0]
  ------------------
  782|  1.13k|              exponent++;
  783|  1.13k|           } else {
  784|      0|              dec = decimal128_limits::nan();
  785|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  786|      0|           }
  787|  1.13k|        }
  788|       | 
  789|       |        /* Round */
  790|       |        /* We've normalized the exponent, but might still need to round. */
  791|  93.6k|        if (last_digit - first_digit + 1 < significant_digits) {
  ------------------
  |  Branch (791:13): [True: 230, False: 93.4k]
  ------------------
  792|    230|           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|    230|           round_digit =
  797|    230|              first[first_nonzero + last_digit + includes_sign + saw_radix + 1] -
  798|    230|              '0';
  799|       | 
  800|    230|           if (round_digit != 0) {
  ------------------
  |  Branch (800:16): [True: 230, False: 0]
  ------------------
  801|       |              /* Inexact (non-zero) rounding is not allowed */
  802|    230|              dec = decimal128_limits::nan();
  803|    230|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  804|    230|           }
  805|    230|        }
  806|       | 
  807|       |        /* Encode significand */
  808|  93.4k|        significand_high = 0,   /* The high 17 digits of the significand */
  809|  93.4k|           significand_low = 0; /* The low 17 digits of the significand */
  810|       | 
  811|  93.4k|        if (significant_digits == 0) { /* read a zero */
  ------------------
  |  Branch (811:13): [True: 7.31k, False: 86.1k]
  ------------------
  812|  7.31k|           significand_high = 0;
  813|  7.31k|           significand_low = 0;
  814|  86.1k|        } else if (last_digit - first_digit < 17) {
  ------------------
  |  Branch (814:20): [True: 1.26k, False: 84.8k]
  ------------------
  815|  1.26k|           std::size_t d_idx = first_digit;
  816|  1.26k|           significand_low = digits[d_idx++];
  817|       | 
  818|  6.96k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (818:19): [True: 5.70k, False: 1.26k]
  ------------------
  819|  5.70k|              significand_low *= 10;
  820|  5.70k|              significand_low += digits[d_idx];
  821|  5.70k|              significand_high = 0;
  822|  5.70k|           }
  823|  84.8k|        } else {
  824|  84.8k|           std::size_t d_idx = first_digit;
  825|  84.8k|           significand_high = digits[d_idx++];
  826|       | 
  827|  1.38M|           for (; d_idx <= last_digit - 17; d_idx++) {
  ------------------
  |  Branch (827:19): [True: 1.30M, False: 84.8k]
  ------------------
  828|  1.30M|              significand_high *= 10;
  829|  1.30M|              significand_high += digits[d_idx];
  830|  1.30M|           }
  831|       | 
  832|  84.8k|           significand_low = digits[d_idx++];
  833|       | 
  834|  1.44M|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (834:19): [True: 1.35M, False: 84.8k]
  ------------------
  835|  1.35M|              significand_low *= 10;
  836|  1.35M|              significand_low += digits[d_idx];
  837|  1.35M|           }
  838|  84.8k|        }
  839|       | 
  840|  93.4k|        detail::mul_64x64 (significand_high, 100000000000000000ull, &significand);
  841|  93.4k|        significand.low += significand_low;
  842|       | 
  843|  93.4k|        if (significand.low < significand_low) {
  ------------------
  |  Branch (843:13): [True: 12.3k, False: 81.1k]
  ------------------
  844|  12.3k|           significand.high += 1;
  845|  12.3k|        }
  846|       | 
  847|       | 
  848|  93.4k|        biased_exponent = static_cast<uint16_t>(exponent + static_cast<int32_t>(decimal128_limits::exponent_bias));
  849|       | 
  850|       |        /* Encode combination, exponent, and significand. */
  851|  93.4k|        if ((significand.high >> 49) & 1) {
  ------------------
  |  Branch (851:13): [True: 0, False: 93.4k]
  ------------------
  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|  93.4k|        } else {
  857|  93.4k|           dec.high |= (biased_exponent & 0x3fffull) << 49;
  858|  93.4k|           dec.high |= significand.high & 0x1ffffffffffffull;
  859|  93.4k|        }
  860|       | 
  861|  93.4k|        dec.low = significand.low;
  862|       | 
  863|       |        /* Encode sign */
  864|  93.4k|        if (is_negative) {
  ------------------
  |  Branch (864:13): [True: 7.86k, False: 85.5k]
  ------------------
  865|  7.86k|           dec.high |= 0x8000000000000000ull;
  866|  7.86k|        }
  867|       | 
  868|  93.4k|        return decimal128_from_chars_result{str_read,std::errc{}};
  869|  93.6k|    }
_ZN8jsoncons4bson6detail13dec128_istreqEPKcS3_S3_S3_:
  289|  6.84k|        {
  290|  33.6k|            while (!(a == lasta && b == lastb)) 
  ------------------
  |  Branch (290:22): [True: 3.02k, False: 30.6k]
  |  Branch (290:36): [True: 3.02k, False: 0]
  ------------------
  291|  30.6k|            {
  292|       |               // strings are different lengths
  293|  30.6k|               if (a == lasta || b == lastb) 
  ------------------
  |  Branch (293:20): [True: 0, False: 30.6k]
  |  Branch (293:34): [True: 2.22k, False: 28.4k]
  ------------------
  294|  2.22k|               {
  295|  2.22k|                  return false;
  296|  2.22k|               }
  297|       |         
  298|  28.4k|               if (dec128_tolower (*a) != dec128_tolower (*b)) {
  ------------------
  |  Branch (298:20): [True: 1.59k, False: 26.8k]
  ------------------
  299|  1.59k|                  return false;
  300|  1.59k|               }
  301|       |         
  302|  26.8k|               a++;
  303|  26.8k|               b++;
  304|  26.8k|            }
  305|       |         
  306|  3.02k|            return true;
  307|  6.84k|        }
_ZN8jsoncons4bson6detail14dec128_tolowerEc:
  266|  56.8k|        {
  267|  56.8k|           if (isupper (c)) {
  ------------------
  |  Branch (267:16): [True: 7.64k, False: 49.2k]
  ------------------
  268|  7.64k|              c += 32;
  269|  7.64k|           }
  270|       |
  271|  56.8k|           return c;
  272|  56.8k|        }
_ZN8jsoncons4bson17decimal128_limits12neg_infinityEv:
  124|  1.79k|        static constexpr decimal128_t neg_infinity() {return decimal128_t(0x7800000000000000ull + 0x8000000000000000ull, 0);}
_ZN8jsoncons4bson3TP1C2Emm:
   79|  3.83k|        constexpr TP1(uint64_t hi, uint64_t lo) : low(lo), high(hi) {}
_ZN8jsoncons4bson17decimal128_limits8infinityEv:
  123|    428|        static constexpr decimal128_t infinity() {return decimal128_t(0x7800000000000000ull, 0);}
_ZN8jsoncons4bson17decimal128_limits3nanEv:
  122|  1.61k|        static constexpr decimal128_t nan() {return decimal128_t(0x7c00000000000000ull, 0);}
_ZN8jsoncons4bson6detail9mul_64x64EmmPNS0_19bson_uint128_6464_tE:
  221|  93.4k|        {
  222|  93.4k|            uint64_t left_high, left_low, right_high, right_low, product_high,
  223|  93.4k|               product_mid, product_mid2, product_low;
  224|  93.4k|            bson_uint128_6464_t rt = {0,0};
  225|       | 
  226|  93.4k|            if (!left && !right) {
  ------------------
  |  Branch (226:17): [True: 8.57k, False: 84.8k]
  |  Branch (226:26): [True: 0, False: 8.57k]
  ------------------
  227|      0|               *product = rt;
  228|      0|               return;
  229|      0|            }
  230|       | 
  231|  93.4k|            left_high = left >> 32;
  232|  93.4k|            left_low = (uint32_t) left;
  233|  93.4k|            right_high = right >> 32;
  234|  93.4k|            right_low = (uint32_t) right;
  235|       | 
  236|  93.4k|            product_high = left_high * right_high;
  237|  93.4k|            product_mid = left_high * right_low;
  238|  93.4k|            product_mid2 = left_low * right_high;
  239|  93.4k|            product_low = left_low * right_low;
  240|       | 
  241|  93.4k|            product_high += product_mid >> 32;
  242|  93.4k|            product_mid = (uint32_t) product_mid + product_mid2 + (product_low >> 32);
  243|       | 
  244|  93.4k|            product_high = product_high + (product_mid >> 32);
  245|  93.4k|            product_low = (product_mid << 32) + (uint32_t) product_low;
  246|       | 
  247|  93.4k|            rt.high = product_high;
  248|  93.4k|            rt.low = product_low;
  249|  93.4k|            *product = rt;
  250|  93.4k|        }
_ZN8jsoncons4bson19decimal128_to_charsEPcS1_RKNS0_3TP1E:
  335|  97.3k|    {
  336|  97.3k|        static const std::string bson_decimal128_inf = "Infinity";
  337|  97.3k|        static const std::string bson_decimal128_nan = "NaN";
  338|       |
  339|  97.3k|        static constexpr uint32_t combination_mask = 0x1f;   /* Extract least significant 5 bits */
  340|  97.3k|        static constexpr uint32_t exponent_mask = 0x3fff;    /* Extract least significant 14 bits */
  341|  97.3k|        static constexpr uint32_t combination_infinity = 30; /* Value of combination field for Inf */
  342|  97.3k|        static constexpr uint32_t combination_nan = 31;      /* Value of combination field for NaN */
  343|  97.3k|        static constexpr uint32_t exponent_bias = 6176;      /* decimal128 exponent bias */
  344|       |
  345|  97.3k|        char* str_out = first;      /* output pointer in string */
  346|  97.3k|        char significand_str[35]; /* decoded significand digits */
  347|       |
  348|       |        /* Note: bits in this routine are referred to starting at 0, */
  349|       |        /* from the sign bit, towards the coefficient. */
  350|  97.3k|        uint32_t high;                   /* bits 0 - 31 */
  351|  97.3k|        uint32_t midh;                   /* bits 32 - 63 */
  352|  97.3k|        uint32_t midl;                   /* bits 64 - 95 */
  353|  97.3k|        uint32_t low;                    /* bits 96 - 127 */
  354|  97.3k|        uint32_t combination;            /* bits 1 - 5 */
  355|  97.3k|        uint32_t biased_exponent;        /* decoded biased exponent (14 bits) */
  356|  97.3k|        uint32_t significand_digits = 0; /* the number of significand digits */
  357|  97.3k|        uint32_t significand[36] = {0};  /* the base-10 digits in the significand */
  358|  97.3k|        uint32_t *significand_read = significand; /* read pointer into significand */
  359|  97.3k|        int32_t exponent;                         /* unbiased exponent */
  360|  97.3k|        int32_t scientific_exponent; /* the exponent if scientific notation is
  361|       |                                      * used */
  362|  97.3k|        bool is_zero = false;        /* true if the number is zero */
  363|       | 
  364|  97.3k|        uint8_t significand_msb; /* the most signifcant significand bits (50-46) */
  365|  97.3k|        bson_uint128_t
  366|  97.3k|           significand128; /* temporary storage for significand decoding */
  367|       | 
  368|  97.3k|        memset (significand_str, 0, sizeof (significand_str));
  369|       | 
  370|  97.3k|        if ((int64_t) dec.high < 0) { /* negative */
  ------------------
  |  Branch (370:13): [True: 10.7k, False: 86.6k]
  ------------------
  371|  10.7k|           *(str_out++) = '-';
  372|  10.7k|        }
  373|       | 
  374|  97.3k|        low = (uint32_t) dec.low, midl = (uint32_t) (dec.low >> 32),
  375|  97.3k|        midh = (uint32_t) dec.high, high = (uint32_t) (dec.high >> 32);
  376|       | 
  377|       |        /* Decode combination field and exponent */
  378|  97.3k|        combination = (high >> 26) & combination_mask;
  379|       | 
  380|  97.3k|        if (JSONCONS_UNLIKELY ((combination >> 3) == 3)) {
  ------------------
  |  |   78|  97.3k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 10.0k, False: 87.3k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  10.0k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 2.22k, False: 7.81k]
  ------------------
  383|  2.22k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 2.22k, False: 0]
  ------------------
  384|  2.22k|               {
  385|  2.22k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  2.22k|                   str_out += bson_decimal128_inf.size();
  387|  2.22k|               }
  388|  2.22k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  2.22k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  7.81k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 799, False: 7.01k]
  ------------------
  392|       |               /* first, not str_out, to erase the sign */
  393|    799|               str_out = first;
  394|    799|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_nan.size())) 
  ------------------
  |  Branch (394:20): [True: 799, False: 0]
  ------------------
  395|    799|               {
  396|    799|                   std::memcpy(str_out, bson_decimal128_nan.data(), bson_decimal128_nan.size());
  397|    799|                   str_out += bson_decimal128_nan.size();
  398|    799|               }
  399|    799|               *str_out = 0;
  400|       |              //strcpy_s (first, last-first, bson_decimal128_nan.c_str());
  401|       |              /* we don't care about the NaN payload. */
  402|    799|               return decimal128_to_chars_result{str_out, std::errc{}};
  403|  7.01k|           } else {
  404|  7.01k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  7.01k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  7.01k|           }
  407|  87.3k|        } else {
  408|  87.3k|           significand_msb = (high >> 14) & 0x7;
  409|  87.3k|           biased_exponent = (high >> 17) & exponent_mask;
  410|  87.3k|        }
  411|       | 
  412|  94.3k|        exponent = biased_exponent - exponent_bias;
  413|       |        /* Create string of significand digits */
  414|       | 
  415|       |        /* Convert the 114-bit binary number represented by */
  416|       |        /* (high, midh, midl, low) to at most 34 decimal */
  417|       |        /* digits through modulo and division. */
  418|  94.3k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|  94.3k|        significand128.parts[1] = midh;
  420|  94.3k|        significand128.parts[2] = midl;
  421|  94.3k|        significand128.parts[3] = low;
  422|       | 
  423|  94.3k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 3.96k, False: 90.3k]
  |  Branch (423:45): [True: 2.80k, False: 1.15k]
  ------------------
  424|  2.80k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 1.37k, False: 1.43k]
  |  Branch (424:45): [True: 302, False: 1.07k]
  ------------------
  425|    302|           is_zero = true;
  426|  94.0k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 7.01k, False: 87.0k]
  ------------------
  427|       |           /* The significand is non-canonical or zero.
  428|       |            * In order to preserve compatibility with the densely packed decimal
  429|       |            * format, the maximum value for the significand of decimal128 is
  430|       |            * 1e34 - 1.  If the value is greater than 1e34 - 1, the IEEE 754
  431|       |            * standard dictates that the significand is interpreted as zero.
  432|       |            */
  433|  7.01k|           is_zero = true;
  434|  87.0k|        } else {
  435|   435k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 348k, False: 87.0k]
  ------------------
  436|   348k|              uint32_t least_digits = 0;
  437|   348k|              detail::bson_uint128_divide1B (
  438|   348k|                 significand128, &significand128, &least_digits);
  439|       | 
  440|       |              /* We now have the 9 least significant digits (in base 2). */
  441|       |              /* Convert and output to string. */
  442|   348k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 5.97k, False: 342k]
  ------------------
  443|  5.97k|                 continue;
  444|  5.97k|              }
  445|       | 
  446|  3.42M|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 3.07M, False: 342k]
  ------------------
  447|  3.07M|                 significand[k * 9 + j] = least_digits % 10;
  448|  3.07M|                 least_digits /= 10;
  449|  3.07M|              }
  450|   342k|           }
  451|  87.0k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|  94.3k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 7.31k, False: 87.0k]
  ------------------
  458|  7.31k|           significand_digits = 1;
  459|  7.31k|           *significand_read = 0;
  460|  87.0k|        } else {
  461|  87.0k|           significand_digits = 36;
  462|   350k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 263k, False: 87.0k]
  ------------------
  463|   263k|              significand_digits--;
  464|   263k|              significand_read++;
  465|   263k|           }
  466|  87.0k|        }
  467|       | 
  468|  94.3k|        scientific_exponent = significand_digits - 1 + exponent;
  469|       | 
  470|       |        /* The scientific exponent checks are dictated by the string conversion
  471|       |         * specification and are somewhat arbitrary cutoffs.
  472|       |         *
  473|       |         * We must check exponent > 0, because if this is the case, the number
  474|       |         * has trailing zeros.  However, we *cannot* output these trailing zeros,
  475|       |         * because doing so would change the precision of the value, and would
  476|       |         * change stored data if the string converted number is round tripped.
  477|       |         */
  478|  94.3k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 81.1k, False: 13.2k]
  |  Branch (478:41): [True: 9.77k, False: 3.43k]
  ------------------
  479|       |           /* Scientific format */
  480|  90.9k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|  90.9k|           significand_digits--;
  482|       | 
  483|  90.9k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 83.9k, False: 7.00k]
  ------------------
  484|  83.9k|              *(str_out++) = '.';
  485|  83.9k|           }
  486|       | 
  487|  2.79M|           for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (487:36): [True: 2.70M, False: 90.8k]
  |  Branch (487:62): [True: 2.70M, False: 96]
  ------------------
  488|  2.70M|              *(str_out++) = char(*(significand_read++)) + '0';
  489|  2.70M|           }
  490|       |           /* Exponent */
  491|  90.9k|           *(str_out++) = 'E';
  492|       |
  493|  90.9k|           std::string s;
  494|  90.9k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 9.77k, False: 81.1k]
  ------------------
  495|  9.77k|               s.push_back('+');
  496|  9.77k|           }
  497|  90.9k|           jsoncons::from_integer(scientific_exponent, s);
  498|  90.9k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 90.6k, False: 215]
  ------------------
  499|  90.6k|           {
  500|  90.6k|               std::memcpy(str_out, s.data(), s.size());
  501|  90.6k|           }
  502|    215|           else
  503|    215|           {
  504|    215|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|    215|           }
  506|  90.6k|           str_out += s.size();
  507|  90.6k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  3.43k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 749, False: 2.68k]
  ------------------
  510|  5.54k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 4.79k, False: 749]
  |  Branch (510:65): [True: 4.79k, False: 0]
  ------------------
  511|  4.79k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  4.79k|              }
  513|  2.68k|           } else {
  514|  2.68k|              int32_t radix_position = significand_digits + exponent;
  515|       | 
  516|  2.68k|              if (radix_position > 0) { /* non-zero digits before radix */
  ------------------
  |  Branch (516:19): [True: 1.50k, False: 1.17k]
  ------------------
  517|  1.50k|                 for (int32_t i = 0;
  518|  13.7k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 12.2k, False: 1.50k]
  |  Branch (518:45): [True: 12.2k, False: 0]
  ------------------
  519|  12.2k|                      i++) {
  520|  12.2k|                    *(str_out++) = char(*(significand_read++)) + '0';
  521|  12.2k|                 }
  522|  1.50k|              } else { /* leading zero before radix point */
  523|  1.17k|                 *(str_out++) = '0';
  524|  1.17k|              }
  525|       | 
  526|  2.68k|              *(str_out++) = '.';
  527|  4.62k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 1.94k, False: 2.68k]
  ------------------
  528|  1.94k|                 *(str_out++) = '0';
  529|  1.94k|              }
  530|       | 
  531|  2.68k|              for (std::size_t i = 0;
  532|  64.2k|                   (i < significand_digits - (std::max) (radix_position - 1, 0)) &&
  ------------------
  |  Branch (532:20): [True: 61.5k, False: 2.68k]
  |  Branch (532:20): [True: 61.5k, False: 2.68k]
  ------------------
  533|  61.5k|                   (str_out < last);
  ------------------
  |  Branch (533:20): [True: 61.5k, False: 0]
  ------------------
  534|  61.5k|                   i++) {
  535|  61.5k|                 *(str_out++) = char(*(significand_read++)) + '0';
  536|  61.5k|              }
  537|  2.68k|           }
  538|  3.43k|        }
  539|  94.1k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|  94.3k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|   348k|        {
  179|   348k|            static constexpr uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|   348k|            uint64_t _rem = 0;
  181|   348k|            int i = 0;
  182|       |            
  183|   348k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 264k, False: 83.3k]
  |  Branch (183:36): [True: 179k, False: 84.8k]
  |  Branch (183:55): [True: 93.7k, False: 86.2k]
  ------------------
  184|  93.7k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 5.94k, False: 87.7k]
  ------------------
  185|  5.94k|               *quotient = value;
  186|  5.94k|               *rem = 0;
  187|  5.94k|               return;
  188|  5.94k|            }
  189|       |            
  190|  1.71M|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 1.36M, False: 342k]
  ------------------
  191|  1.36M|               _rem <<= 32; /* Adjust remainder to match value of next dividend */
  192|  1.36M|               _rem += value.parts[i]; /* Add the divided to _rem */
  193|  1.36M|               value.parts[i] = (uint32_t) (_rem / DIVISOR);
  194|  1.36M|               _rem %= DIVISOR; /* Store the remainder */
  195|  1.36M|            }
  196|       |            
  197|   342k|            *quotient = value;
  198|   342k|            *rem = (uint32_t) _rem;
  199|   342k|        }

_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKS9_:
  108|  2.99k|       : basic_bson_encoder(std::forward<Sink>(sink),
  109|  2.99k|                            bson_encode_options(),
  110|  2.99k|                            alloc)
  111|  2.99k|    {
  112|  2.99k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKNS0_19bson_encode_optionsERKS9_:
  117|  2.99k|       : sink_(std::forward<Sink>(sink)),
  118|  2.99k|         max_nesting_depth_(options.max_nesting_depth()),
  119|  2.99k|         alloc_(alloc)
  120|  2.99k|    {
  121|  2.99k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE15visit_end_arrayERKNS_11ser_contextERNS3_10error_codeE:
  218|  1.88k|    {
  219|  1.88k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  1.88k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 1.88k]
  |  |  ------------------
  |  |   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|  1.88k|        --nesting_depth_;
  221|       |
  222|  1.88k|        buffer_.push_back(0x00);
  223|       |
  224|  1.88k|        std::size_t length = buffer_.size() - stack_.back().offset();
  225|  1.88k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  226|       |
  227|  1.88k|        stack_.pop_back();
  228|  1.88k|        if (stack_.empty())
  ------------------
  |  Branch (228:13): [True: 0, False: 1.88k]
  ------------------
  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|  1.88k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.88k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  236|  1.88k|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item6offsetEv:
   66|  30.3k|        {
   67|  30.3k|            return offset_;
   68|  30.3k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  498|  2.18k|    {
  499|  2.18k|        static constexpr uint64_t max_value_div_1000 = (std::numeric_limits<uint64_t>::max)() / 1000;
  500|  2.18k|        if (stack_.empty())
  ------------------
  |  Branch (500:13): [True: 0, False: 2.18k]
  ------------------
  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|  2.18k|        switch (tag)
  507|  2.18k|        {
  508|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (508:13): [True: 0, False: 2.18k]
  ------------------
  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: 2.18k]
  ------------------
  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: 2.18k]
  ------------------
  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|  2.18k|            default:
  ------------------
  |  Branch (529:13): [True: 2.18k, False: 0]
  ------------------
  530|  2.18k|            {
  531|  2.18k|                if (val <= static_cast<uint64_t>((std::numeric_limits<int32_t>::max)()))
  ------------------
  |  Branch (531:21): [True: 838, False: 1.34k]
  ------------------
  532|    838|                {
  533|    838|                    before_value(jsoncons::bson::bson_type::int32_type);
  534|    838|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  535|    838|                }
  536|  1.34k|                else if (val <= static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()))
  ------------------
  |  Branch (536:26): [True: 958, False: 384]
  ------------------
  537|    958|                {
  538|    958|                    before_value(jsoncons::bson::bson_type::int64_type);
  539|    958|                    binary::native_to_little(static_cast<uint64_t>(val),std::back_inserter(buffer_));
  540|    958|                }
  541|    384|                else
  542|    384|                {
  543|    384|                    ec = bson_errc::number_too_large;
  544|    384|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    384|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  545|    384|                }
  546|  1.79k|                break;
  547|  2.18k|            }
  548|  2.18k|        }
  549|  1.79k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  1.79k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  550|  2.18k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12before_valueEh:
  568|  4.30M|    {
  569|  4.30M|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  4.30M|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 4.30M]
  |  |  ------------------
  |  |   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.30M|        if (stack_.back().is_object())
  ------------------
  |  Branch (570:13): [True: 240k, False: 4.06M]
  ------------------
  571|   240k|        {
  572|   240k|            buffer_[stack_.back().member_offset()] = code;
  573|   240k|        }
  574|  4.06M|        else
  575|  4.06M|        {
  576|  4.06M|            buffer_.push_back(code);
  577|  4.06M|            std::string name = std::to_string(stack_.back().next_index());
  578|  4.06M|            buffer_.insert(buffer_.end(), name.begin(), name.end());
  579|  4.06M|            buffer_.push_back(0x00);
  580|  4.06M|        }
  581|  4.30M|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item9is_objectEv:
   86|  4.30M|        {
   87|  4.30M|            return type_ == jsoncons::bson::bson_container_type::document;
   88|  4.30M|        }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEv:
   71|   240k|        {
   72|   240k|            return name_offset_;
   73|   240k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item10next_indexEv:
   81|  4.06M|        {
   82|  4.06M|            return index_++;
   83|  4.06M|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  439|  37.1k|    {
  440|  37.1k|        static constexpr int64_t min_value_div_1000 = (std::numeric_limits<int64_t>::min)() / 1000;
  441|  37.1k|        static constexpr int64_t max_value_div_1000 = (std::numeric_limits<int64_t>::max)() / 1000;
  442|  37.1k|        if (stack_.empty())
  ------------------
  |  Branch (442:13): [True: 32, False: 37.1k]
  ------------------
  443|     32|        {
  444|     32|            ec = bson_errc::expected_bson_document;
  445|     32|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|     32|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  446|     32|        }
  447|       |
  448|  37.1k|        switch (tag)
  449|  37.1k|        {
  450|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (450:13): [True: 0, False: 37.1k]
  ------------------
  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|  4.04k|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (464:13): [True: 4.04k, False: 33.0k]
  ------------------
  465|  4.04k|                before_value(jsoncons::bson::bson_type::datetime_type);
  466|  4.04k|                binary::native_to_little(val,std::back_inserter(buffer_));
  467|  4.04k|                break;
  468|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (468:13): [True: 0, False: 37.1k]
  ------------------
  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|  33.0k|            default:
  ------------------
  |  Branch (476:13): [True: 33.0k, False: 4.04k]
  ------------------
  477|  33.0k|            {
  478|  33.0k|                if (val >= (std::numeric_limits<int32_t>::lowest)() && val <= (std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (478:21): [True: 32.7k, False: 290]
  |  Branch (478:72): [True: 3.99k, False: 28.7k]
  ------------------
  479|  3.99k|                {
  480|  3.99k|                    before_value(jsoncons::bson::bson_type::int32_type);
  481|  3.99k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  482|  3.99k|                }
  483|  29.0k|                else 
  484|  29.0k|                {
  485|  29.0k|                    before_value(jsoncons::bson::bson_type::int64_type);
  486|  29.0k|                    binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  487|  29.0k|                }
  488|  33.0k|                break;
  489|      0|            }
  490|  37.1k|        }
  491|  37.1k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  37.1k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  492|  37.1k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  556|    785|    {
  557|    785|        if (stack_.empty())
  ------------------
  |  Branch (557:13): [True: 0, False: 785]
  ------------------
  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|    785|        before_value(jsoncons::bson::bson_type::double_type);
  563|    785|        binary::native_to_little(val,std::back_inserter(buffer_));
  564|    785|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    785|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  565|    785|    }
_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|  66.0k|    {
  154|  66.0k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|  66.0k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 14.7k, False: 51.2k]
  |  |  ------------------
  ------------------
  155|  14.7k|        {
  156|  14.7k|            ec = bson_errc::max_nesting_depth_exceeded;
  157|  14.7k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  14.7k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  158|  14.7k|        } 
  159|  51.2k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (159:13): [True: 48.2k, False: 2.98k]
  ------------------
  160|  48.2k|        {
  161|  48.2k|            if (stack_.empty())
  ------------------
  |  Branch (161:17): [True: 0, False: 48.2k]
  ------------------
  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|  48.2k|            before_value(jsoncons::bson::bson_type::document_type);
  167|  48.2k|        }
  168|       |
  169|  51.2k|        stack_.emplace_back(jsoncons::bson::bson_container_type::document, buffer_.size());
  170|  51.2k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  171|       |
  172|  51.2k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  51.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  173|  51.2k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_itemC2ENS0_19bson_container_typeEm:
   61|   104k|           : type_(type), offset_(offset)
   62|   104k|        {
   63|   104k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE16visit_end_objectERKNS_11ser_contextERNS3_10error_codeE:
  176|  13.2k|    {
  177|  13.2k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   49|  13.2k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (49:32): [True: 0, False: 13.2k]
  |  |  ------------------
  |  |   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|  13.2k|        --nesting_depth_;
  179|       |
  180|  13.2k|        buffer_.push_back(0x00);
  181|       |
  182|  13.2k|        std::size_t length = buffer_.size() - stack_.back().offset();
  183|  13.2k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  184|       |
  185|  13.2k|        stack_.pop_back();
  186|  13.2k|        if (stack_.empty())
  ------------------
  |  Branch (186:13): [True: 153, False: 13.1k]
  ------------------
  187|    153|        {
  188|    153|            for (auto c : buffer_)
  ------------------
  |  Branch (188:25): [True: 5.32M, False: 153]
  ------------------
  189|  5.32M|            {
  190|  5.32M|                sink_.push_back(c);
  191|  5.32M|            }
  192|    153|        }
  193|  13.2k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  13.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  194|  13.2k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  197|   701k|    {
  198|   701k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|   701k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 648k, False: 52.9k]
  |  |  ------------------
  ------------------
  199|   648k|        {
  200|   648k|            ec = bson_errc::max_nesting_depth_exceeded;
  201|   648k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   648k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  202|   648k|        } 
  203|  52.9k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (203:13): [True: 52.9k, False: 0]
  ------------------
  204|  52.9k|        {
  205|  52.9k|            if (stack_.empty())
  ------------------
  |  Branch (205:17): [True: 0, False: 52.9k]
  ------------------
  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|  52.9k|            before_value(jsoncons::bson::bson_type::array_type);
  211|  52.9k|        }
  212|  52.9k|        stack_.emplace_back(jsoncons::bson::bson_container_type::array, buffer_.size());
  213|  52.9k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  214|  52.9k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  52.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  215|  52.9k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9visit_keyERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEERKNS_11ser_contextERNS3_10error_codeE:
  239|   214k|    {
  240|   214k|        stack_.back().member_offset(buffer_.size());
  241|   214k|        buffer_.push_back(0x00); // reserve space for code
  242|   214k|        for (auto c : name)
  ------------------
  |  Branch (242:21): [True: 1.06M, False: 214k]
  ------------------
  243|  1.06M|        {
  244|  1.06M|            buffer_.push_back(c);
  245|  1.06M|        }
  246|   214k|        buffer_.push_back(0x00);
  247|   214k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   214k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  248|   214k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEm:
   76|   214k|        {
   77|   214k|            name_offset_ = offset;
   78|   214k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  251|  3.99M|    {
  252|  3.99M|        if (stack_.empty())
  ------------------
  |  Branch (252:13): [True: 154, False: 3.99M]
  ------------------
  253|    154|        {
  254|    154|            ec = bson_errc::expected_bson_document;
  255|    154|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    154|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  256|    154|        }
  257|  3.99M|        switch (tag)
  258|  3.99M|        {
  259|    893|            case semantic_tag::undefined:
  ------------------
  |  Branch (259:13): [True: 893, False: 3.99M]
  ------------------
  260|    893|                before_value(jsoncons::bson::bson_type::undefined_type);
  261|    893|                break;
  262|  3.99M|            default:
  ------------------
  |  Branch (262:13): [True: 3.99M, False: 893]
  ------------------
  263|  3.99M|                before_value(jsoncons::bson::bson_type::null_type);
  264|  3.99M|                break;
  265|  3.99M|        }
  266|  3.99M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  3.99M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  267|  3.99M|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  270|    985|    {
  271|    985|        if (stack_.empty())
  ------------------
  |  Branch (271:13): [True: 0, False: 985]
  ------------------
  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|    985|        before_value(jsoncons::bson::bson_type::bool_type);
  277|    985|        if (val)
  ------------------
  |  Branch (277:13): [True: 513, False: 472]
  ------------------
  278|    513|        {
  279|    513|            buffer_.push_back(0x01);
  280|    513|        }
  281|    472|        else
  282|    472|        {
  283|    472|            buffer_.push_back(0x00);
  284|    472|        }
  285|       |
  286|    985|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    985|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  287|    985|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_stringERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  290|   120k|    {
  291|   120k|        if (stack_.empty())
  ------------------
  |  Branch (291:13): [True: 83, False: 120k]
  ------------------
  292|     83|        {
  293|     83|            ec = bson_errc::expected_bson_document;
  294|     83|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|     83|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  295|     83|        }
  296|       |
  297|   120k|        switch (tag)
  298|   120k|        {
  299|  97.2k|            case semantic_tag::float128:
  ------------------
  |  Branch (299:13): [True: 97.2k, False: 22.9k]
  ------------------
  300|  97.2k|            {
  301|  97.2k|                before_value(jsoncons::bson::bson_type::decimal128_type);
  302|  97.2k|                decimal128_t dec;
  303|  97.2k|                auto rc = decimal128_from_chars(sv.data(), sv.data()+sv.size(), dec);
  304|  97.2k|                if (rc.ec != std::errc{})
  ------------------
  |  Branch (304:21): [True: 811, False: 96.4k]
  ------------------
  305|    811|                {
  306|    811|                    ec = bson_errc::invalid_decimal128_string;
  307|    811|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|    811|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  308|    811|                }
  309|  96.4k|                binary::native_to_little(dec.low,std::back_inserter(buffer_));
  310|  96.4k|                binary::native_to_little(dec.high,std::back_inserter(buffer_));
  311|  96.4k|                break;
  312|  97.2k|            }
  313|  17.4k|            case semantic_tag::id:
  ------------------
  |  Branch (313:13): [True: 17.4k, False: 102k]
  ------------------
  314|  17.4k|            {
  315|  17.4k|                before_value(jsoncons::bson::bson_type::object_id_type);
  316|  17.4k|                oid_t oid(sv);
  317|  17.4k|                for (auto b : oid)
  ------------------
  |  Branch (317:29): [True: 209k, False: 17.4k]
  ------------------
  318|   209k|                {
  319|   209k|                    buffer_.push_back(b);
  320|   209k|                }
  321|  17.4k|                break;
  322|  97.2k|            }
  323|  2.44k|            case semantic_tag::regex:
  ------------------
  |  Branch (323:13): [True: 2.44k, False: 117k]
  ------------------
  324|  2.44k|            {
  325|  2.44k|                before_value(jsoncons::bson::bson_type::regex_type);
  326|  2.44k|                std::size_t first = sv.find_first_of('/');
  327|  2.44k|                std::size_t last = sv.find_last_of('/');
  328|  2.44k|                if (first == string_view::npos || last == string_view::npos || first == last)
  ------------------
  |  Branch (328:21): [True: 0, False: 2.44k]
  |  Branch (328:51): [True: 0, False: 2.44k]
  |  Branch (328:80): [True: 0, False: 2.44k]
  ------------------
  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|  2.44k|                string_view regex = sv.substr(first+1,last-1);
  334|  2.44k|                for (auto c : regex)
  ------------------
  |  Branch (334:29): [True: 4.73M, False: 2.44k]
  ------------------
  335|  4.73M|                {
  336|  4.73M|                    buffer_.push_back(c);
  337|  4.73M|                }
  338|  2.44k|                buffer_.push_back(0x00);
  339|  2.44k|                string_view options = sv.substr(last+1);
  340|  2.44k|                for (auto c : options)
  ------------------
  |  Branch (340:29): [True: 2.50M, False: 2.44k]
  ------------------
  341|  2.50M|                {
  342|  2.50M|                    buffer_.push_back(c);
  343|  2.50M|                }
  344|  2.44k|                buffer_.push_back(0x00);
  345|  2.44k|                break;
  346|  2.44k|            }
  347|  3.01k|            default:
  ------------------
  |  Branch (347:13): [True: 3.01k, False: 117k]
  ------------------
  348|  3.01k|                switch (tag)
  349|  3.01k|                {
  350|    741|                    case semantic_tag::code:
  ------------------
  |  Branch (350:21): [True: 741, False: 2.27k]
  ------------------
  351|    741|                        before_value(jsoncons::bson::bson_type::javascript_type);
  352|    741|                        break;
  353|  2.27k|                    default:
  ------------------
  |  Branch (353:21): [True: 2.27k, False: 741]
  ------------------
  354|  2.27k|                        before_value(jsoncons::bson::bson_type::string_type);
  355|  2.27k|                        break;
  356|  3.01k|                }
  357|  3.01k|                std::size_t offset = buffer_.size();
  358|  3.01k|                buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  359|  3.01k|                std::size_t string_offset = buffer_.size();
  360|  3.01k|                auto sink = unicode_traits::validate(sv.data(), sv.size());
  361|  3.01k|                if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (361:21): [True: 0, False: 3.01k]
  ------------------
  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|  3.01k|                for (auto c : sv)
  ------------------
  |  Branch (366:29): [True: 1.47M, False: 3.01k]
  ------------------
  367|  1.47M|                {
  368|  1.47M|                    buffer_.push_back(c);
  369|  1.47M|                }
  370|  3.01k|                buffer_.push_back(0x00);
  371|  3.01k|                std::size_t length = buffer_.size() - string_offset;
  372|  3.01k|                binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  373|  3.01k|                break;
  374|   120k|        }
  375|       |
  376|   119k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|   119k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|   120k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_byte_stringERKNS_16byte_string_viewEmRKNS_11ser_contextERNS3_10error_codeE:
  411|  42.9k|    {
  412|  42.9k|        if (stack_.empty())
  ------------------
  |  Branch (412:13): [True: 21, False: 42.9k]
  ------------------
  413|     21|        {
  414|     21|            ec = bson_errc::expected_bson_document;
  415|     21|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|     21|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  416|     21|        }
  417|  42.9k|        before_value(jsoncons::bson::bson_type::binary_type);
  418|       |
  419|  42.9k|        std::size_t offset = buffer_.size();
  420|  42.9k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  421|  42.9k|        std::size_t string_offset = buffer_.size();
  422|       |
  423|  42.9k|        buffer_.push_back(static_cast<uint8_t>(raw_tag)); // default subtype
  424|       |
  425|  42.9k|        for (auto c : b)
  ------------------
  |  Branch (425:21): [True: 6.60M, False: 42.9k]
  ------------------
  426|  6.60M|        {
  427|  6.60M|            buffer_.push_back(c);
  428|  6.60M|        }
  429|  42.9k|        std::size_t length = buffer_.size() - string_offset - 1;
  430|  42.9k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  431|       |
  432|  42.9k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  276|  42.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  433|  42.9k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEED2Ev:
  124|  2.99k|    {
  125|  2.99k|        sink_.flush();
  126|  2.99k|    }

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

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

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

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

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

