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

_ZN8jsoncons18basic_json_visitorIcEC2Ev:
  103|  3.12k|        basic_json_visitor() = default;
_ZN8jsoncons19typed_array_visitorD2Ev:
   33|  3.12k|        virtual ~typed_array_visitor() = default;
_ZN8jsoncons18basic_json_visitorIcE12uint64_valueEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  414|  3.96k|        {
  415|  3.96k|            visit_uint64(value, tag, context, ec);
  416|  3.96k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.96k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  417|  3.96k|        }
_ZN8jsoncons18basic_json_visitorIcE9end_arrayERKNS_11ser_contextERNSt3__110error_codeE:
  351|  1.94k|        {
  352|  1.94k|            visit_end_array(context, ec);
  353|  1.94k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  1.94k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  354|  1.94k|        }
_ZN8jsoncons18basic_json_visitorIcE11int64_valueElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  423|  16.4k|        {
  424|  16.4k|            visit_int64(value, tag, context, ec);
  425|  16.4k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  16.4k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  426|  16.4k|        }
_ZN8jsoncons18basic_json_visitorIcE12double_valueEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  441|    992|        {
  442|    992|            visit_double(value, tag, context, ec);
  443|    992|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|    992|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  444|    992|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  318|  37.7k|        {
  319|  37.7k|            visit_begin_object(tag, context, ec);
  320|  37.7k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  37.7k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  321|  37.7k|        }
_ZN8jsoncons18basic_json_visitorIcE3keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  357|   306k|        {
  358|   306k|            visit_key(name, context, ec);
  359|   306k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   306k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  360|   306k|        }
_ZN8jsoncons18basic_json_visitorIcE10end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  333|  3.11k|        {
  334|  3.11k|            visit_end_object(context, ec);
  335|  3.11k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.11k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  336|  3.11k|        }
_ZN8jsoncons18basic_json_visitorIcE12string_valueERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  383|   176k|        {
  384|   176k|            visit_string(value, tag, context, ec);
  385|   176k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   176k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  386|   176k|        }
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  339|  12.8k|        {
  340|  12.8k|            visit_begin_array(tag, context, ec);
  341|  12.8k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  12.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  342|  12.8k|        }
_ZN8jsoncons18basic_json_visitorIcE10null_valueENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  365|  3.19M|        {
  366|  3.19M|            visit_null(tag, context, ec);
  367|  3.19M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.19M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  368|  3.19M|        }
_ZN8jsoncons18basic_json_visitorIcE10bool_valueEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  374|    621|        {
  375|    621|            visit_bool(value, tag, context, ec);
  376|    621|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|    621|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|    621|        }
_ZN8jsoncons18basic_json_visitorIcE17byte_string_valueINS_16byte_string_viewEEEbRKT_mRKNS_11ser_contextERNSt3__110error_codeENSA_9enable_ifIXsr6nonstd18is_bytes_view_likeIS4_EE5valueEiE4typeE:
  405|  18.3k|        {
  406|  18.3k|            visit_byte_string(byte_string_view(reinterpret_cast<const uint8_t*>(b.data()),b.size()), raw_tag, context, ec);
  407|  18.3k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  18.3k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  408|  18.3k|        }
_ZN8jsoncons18basic_json_visitorIcE5flushEv:
  108|      7|        {
  109|      7|            visit_flush();
  110|      7|        }

_ZN8jsoncons6nonstd14integer_limitsIivE6lowestEv:
  111|  21.8k|        {
  112|  21.8k|            return std::numeric_limits<T>::lowest();
  113|  21.8k|        }
_ZN8jsoncons6nonstd14integer_limitsIivE3maxEv:
  103|  6.48k|        {
  104|  6.48k|            return (std::numeric_limits<T>::max)();
  105|  6.48k|        }

_ZNK8jsoncons6nonstd4spanIKhLm18446744073709551615EE4sizeEv:
  116|   411k|        {
  117|   411k|            return size_;
  118|   411k|        }
_ZN8jsoncons6nonstd4spanIKhLm18446744073709551615EEC2Ev:
   58|  9.61k|        {
   59|  9.61k|        }
_ZN8jsoncons6nonstd4spanIKhLm18446744073709551615EEC2EPS2_m:
   61|   128k|            : data_(data), size_(size)
   62|   128k|        {
   63|   128k|        }
_ZNK8jsoncons6nonstd4spanIKhLm18446744073709551615EE4dataEv:
  111|   137k|        {
  112|   137k|            return data_;
  113|   137k|        }

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

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|  3.12k|    {
  194|  3.12k|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 3.12k, False: 0]
  ------------------
  195|  3.12k|        {
  196|  3.12k|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|  3.12k|        }
  198|  3.12k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|  3.12k|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|  3.12k|          chunk_size_(default_max_chunk_size)
  178|  3.12k|    {
  179|  3.12k|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|  3.12k|        data_end_ = chunk_;
  181|  3.12k|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|  3.12k|      : std::basic_istream<CharT>(&nb_)
   58|  3.12k|    {
   59|  3.12k|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|  3.12k|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  3.12k|    {
  277|  3.12k|        return stream_ptr_->bad();  
  278|  3.12k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  377|  26.0M|    {
  378|  26.0M|        std::size_t len = 0;
  379|  26.0M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 26.0M, False: 6.29k]
  ------------------
  380|  26.0M|        {
  381|  26.0M|            len = (std::min)(remaining_, length);
  382|  26.0M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  26.0M|            data_end_ += len;
  384|  26.0M|            remaining_ -= len;
  385|  26.0M|            position_ += len;
  386|  26.0M|        }
  387|  26.0M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 26.0M, False: 8.48k]
  ------------------
  388|  26.0M|        {
  389|  26.0M|            return len;
  390|  26.0M|        }
  391|  8.48k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 8.48k, False: 0]
  ------------------
  392|  8.48k|        {
  393|  8.48k|            data_end_ = chunk_;
  394|  8.48k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  8.48k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 6.36k, False: 2.11k]
  ------------------
  396|  6.36k|            {
  397|  6.36k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  6.36k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  6.36k|                data_end_ += len2;
  400|  6.36k|                remaining_ -= len2;
  401|  6.36k|                position_ += len2;
  402|  6.36k|                len += len2;
  403|  6.36k|            }
  404|  8.48k|            return len;
  405|  8.48k|        }
  406|      0|        else
  407|      0|        {
  408|      0|            if (stream_ptr_->eof())
  ------------------
  |  Branch (408:17): [True: 0, False: 0]
  ------------------
  409|      0|            {
  410|      0|                remaining_ = 0;
  411|      0|                return 0;
  412|      0|            }
  413|      0|            JSONCONS_TRY
  ------------------
  |  |   37|      0|    #define JSONCONS_TRY try
  ------------------
  414|      0|            {
  415|      0|                std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(p+len), length-len);
  416|      0|                std::size_t len2 = static_cast<std::size_t>(count);
  417|      0|                if (len2 < length-len)
  ------------------
  |  Branch (417:21): [True: 0, False: 0]
  ------------------
  418|      0|                {
  419|      0|                    stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  420|      0|                }
  421|      0|                len += len2;
  422|      0|                position_ += len2;
  423|      0|                return len;
  424|      0|            }
  425|      0|            JSONCONS_CATCH(const std::exception&)     
  426|      0|            {
  427|      0|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  428|      0|                return 0;
  429|      0|            }
  430|      0|        }
  431|  26.0M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  9.47k|    {
  443|  9.47k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 2.13k, False: 7.34k]
  ------------------
  444|  2.13k|        {
  445|  2.13k|            return 0;
  446|  2.13k|        }
  447|       |
  448|  7.34k|        JSONCONS_TRY
  ------------------
  |  |   37|  7.34k|    #define JSONCONS_TRY try
  ------------------
  449|  7.34k|        {
  450|  7.34k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  7.34k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  7.34k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 3.10k, False: 4.24k]
  ------------------
  454|  3.10k|            {
  455|  3.10k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|  3.10k|            }
  457|  7.34k|            return length;
  458|  7.34k|        }
  459|  7.34k|        JSONCONS_CATCH(const std::exception&)     
  460|  7.34k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  7.34k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6nonstd4spanIKhLm18446744073709551615EEEmOT_:
  352|   119k|    {
  353|   119k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   79|   119k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 1.48k, False: 117k]
  |  |  ------------------
  ------------------
  354|  1.48k|        {
  355|  1.48k|            return span<const value_type>{};
  356|  1.48k|        }
  357|   117k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 180, False: 117k]
  |  Branch (357:32): [True: 52, False: 128]
  ------------------
  358|     52|        {
  359|     52|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     52|            data_end_ = chunk_;
  361|     52|        }
  362|   117k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 440, False: 117k]
  ------------------
  363|    440|        {
  364|    440|            buffer.clear();
  365|    440|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    440|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    440|        }
  368|       |
  369|   117k|        const value_type* data = data_end_;
  370|   117k|        data_end_ += length;
  371|   117k|        remaining_ -= length;
  372|   117k|        position_ += length;
  373|   117k|        return span<const value_type>(data, length);
  374|   117k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr6nonstd7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  746|    440|    {
  747|    440|        std::size_t unread = length;
  748|       |
  749|  1.59k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.42k, False: 179]
  |  Branch (749:30): [True: 1.15k, False: 261]
  ------------------
  750|  1.15k|        {
  751|  1.15k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 432, False: 727]
  |  Branch (751:44): [True: 431, False: 1]
  ------------------
  752|    431|            {
  753|    431|                std::size_t n = source.chunk_size();
  754|    431|                std::size_t offset = buffer.size();
  755|    431|                buffer.resize(offset+n);
  756|    431|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    431|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    431|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 75, False: 356]
  |  |  ------------------
  ------------------
  758|     75|                {
  759|     75|                    buffer.resize(offset+actual);
  760|     75|                }
  761|    431|                unread -= actual;
  762|    431|            }
  763|    728|            else
  764|    728|            {
  765|    728|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|    728|                std::size_t offset = buffer.size();
  767|    728|                buffer.resize(offset+n);
  768|    728|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|    728|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    728|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 111, False: 617]
  |  |  ------------------
  ------------------
  770|    111|                {
  771|    111|                    buffer.resize(offset + actual);
  772|    111|                }
  773|    728|                unread -= actual;
  774|    728|            }
  775|  1.15k|        }
  776|    440|        return length - unread;
  777|    440|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  3.72k|    {
  272|  3.72k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 1.51k, False: 2.21k]
  |  Branch (272:35): [True: 592, False: 923]
  ------------------
  273|  3.72k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  3.13k|    {
  347|  3.13k|        return remaining_;
  348|  3.13k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  4.05k|    {
  262|  4.05k|        return chunk_size_;
  263|  4.05k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    918|    {
  436|    918|        auto len = fill_buffer(chunk, chunk_size);
  437|    918|        position_ += len;
  438|    918|        return len;
  439|    918|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6nonstd4spanIKhLm18446744073709551615EEEmOT_:
  352|  18.6k|    {
  353|  18.6k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   79|  18.6k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 8.13k, False: 10.5k]
  |  |  ------------------
  ------------------
  354|  8.13k|        {
  355|  8.13k|            return span<const value_type>{};
  356|  8.13k|        }
  357|  10.5k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 151, False: 10.3k]
  |  Branch (357:32): [True: 23, False: 128]
  ------------------
  358|     23|        {
  359|     23|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     23|            data_end_ = chunk_;
  361|     23|        }
  362|  10.5k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 670, False: 9.83k]
  ------------------
  363|    670|        {
  364|    670|            buffer.clear();
  365|    670|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    670|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    670|        }
  368|       |
  369|  9.83k|        const value_type* data = data_end_;
  370|  9.83k|        data_end_ += length;
  371|  9.83k|        remaining_ -= length;
  372|  9.83k|        position_ += length;
  373|  9.83k|        return span<const value_type>(data, length);
  374|  10.5k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr6nonstd7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  746|    670|    {
  747|    670|        std::size_t unread = length;
  748|       |
  749|  2.64k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 2.30k, False: 339]
  |  Branch (749:30): [True: 1.97k, False: 331]
  ------------------
  750|  1.97k|        {
  751|  1.97k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 491, False: 1.48k]
  |  Branch (751:44): [True: 487, False: 4]
  ------------------
  752|    487|            {
  753|    487|                std::size_t n = source.chunk_size();
  754|    487|                std::size_t offset = buffer.size();
  755|    487|                buffer.resize(offset+n);
  756|    487|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    487|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    487|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 74, False: 413]
  |  |  ------------------
  ------------------
  758|     74|                {
  759|     74|                    buffer.resize(offset+actual);
  760|     74|                }
  761|    487|                unread -= actual;
  762|    487|            }
  763|  1.48k|            else
  764|  1.48k|            {
  765|  1.48k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|  1.48k|                std::size_t offset = buffer.size();
  767|  1.48k|                buffer.resize(offset+n);
  768|  1.48k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|  1.48k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|  1.48k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 192, False: 1.29k]
  |  |  ------------------
  ------------------
  770|    192|                {
  771|    192|                    buffer.resize(offset + actual);
  772|    192|                }
  773|  1.48k|                unread -= actual;
  774|  1.48k|            }
  775|  1.97k|        }
  776|    670|        return length - unread;
  777|    670|    }

_ZN8jsoncons6binary16native_to_littleIjNSt3__111__wrap_iterIPhEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrS9_6littleEvE4typeET_T0_:
  142|   142k|    {
  143|   142k|        uint8_t buf[sizeof(T)];
  144|   142k|        std::memcpy(buf, &val, sizeof(T));
  145|   142k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 568k, False: 142k]
  ------------------
  146|   568k|        {
  147|   568k|            *d_first++ = item;
  148|   568k|        }
  149|   142k|    }
_ZN8jsoncons6binary16native_to_littleIlNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  8.38k|    {
  143|  8.38k|        uint8_t buf[sizeof(T)];
  144|  8.38k|        std::memcpy(buf, &val, sizeof(T));
  145|  8.38k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 67.0k, False: 8.38k]
  ------------------
  146|  67.0k|        {
  147|  67.0k|            *d_first++ = item;
  148|  67.0k|        }
  149|  8.38k|    }
_ZN8jsoncons6binary16native_to_littleIjNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  8.86k|    {
  143|  8.86k|        uint8_t buf[sizeof(T)];
  144|  8.86k|        std::memcpy(buf, &val, sizeof(T));
  145|  8.86k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 35.4k, False: 8.86k]
  ------------------
  146|  35.4k|        {
  147|  35.4k|            *d_first++ = item;
  148|  35.4k|        }
  149|  8.86k|    }
_ZN8jsoncons6binary16native_to_littleImNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  78.4k|    {
  143|  78.4k|        uint8_t buf[sizeof(T)];
  144|  78.4k|        std::memcpy(buf, &val, sizeof(T));
  145|  78.4k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 627k, False: 78.4k]
  ------------------
  146|   627k|        {
  147|   627k|            *d_first++ = item;
  148|   627k|        }
  149|  78.4k|    }
_ZN8jsoncons6binary16native_to_littleIdNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|    992|    {
  143|    992|        uint8_t buf[sizeof(T)];
  144|    992|        std::memcpy(buf, &val, sizeof(T));
  145|    992|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 7.93k, False: 992]
  ------------------
  146|  7.93k|        {
  147|  7.93k|            *d_first++ = item;
  148|  7.93k|        }
  149|    992|    }
_ZN8jsoncons6binary16little_to_nativeIiNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   195k|    {
  198|   195k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 195k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   195k|        T val;
  203|   195k|        std::memcpy(&val,first,sizeof(T));
  204|   195k|        return val;
  205|   195k|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|    992|    {
  198|    992|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 992]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|    992|        T val;
  203|    992|        std::memcpy(&val,first,sizeof(T));
  204|    992|        return val;
  205|    992|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  79.3k|    {
  198|  79.3k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 79.3k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  79.3k|        T val;
  203|  79.3k|        std::memcpy(&val,first,sizeof(T));
  204|  79.3k|        return val;
  205|  79.3k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  8.97k|    {
  198|  8.97k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 8.97k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  8.97k|        T val;
  203|  8.97k|        std::memcpy(&val,first,sizeof(T));
  204|  8.97k|        return val;
  205|  8.97k|    }

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

_ZN8jsoncons10to_integerIicEENSt3__19enable_ifIXaasr6nonstd14integer_limitsIT_EE14is_specializedsr6nonstd14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  580|  28.3k|{
  581|  28.3k|    n = 0;
  582|       |
  583|  28.3k|    if (length == 0)
  ------------------
  |  Branch (583:9): [True: 10, False: 28.3k]
  ------------------
  584|     10|    {
  585|     10|        return to_number_result<CharT>(s, std::errc::invalid_argument);
  586|     10|    }
  587|       |
  588|  28.3k|    bool is_negative = *s == '-' ? true : false;
  ------------------
  |  Branch (588:24): [True: 21.8k, False: 6.48k]
  ------------------
  589|  28.3k|    if (is_negative)
  ------------------
  |  Branch (589:9): [True: 21.8k, False: 6.48k]
  ------------------
  590|  21.8k|    {
  591|  21.8k|        ++s;
  592|  21.8k|        --length;
  593|  21.8k|    }
  594|       |
  595|  28.3k|    using U = typename nonstd::make_unsigned<T>::type;
  596|       |
  597|  28.3k|    U u;
  598|  28.3k|    auto ru = to_integer(s, length, u);
  599|  28.3k|    if (ru.ec != std::errc{})
  ------------------
  |  Branch (599:9): [True: 0, False: 28.3k]
  ------------------
  600|      0|    {
  601|      0|        return to_number_result<CharT>(ru.ptr, ru.ec);
  602|      0|    }
  603|  28.3k|    if (is_negative)
  ------------------
  |  Branch (603:9): [True: 21.8k, False: 6.48k]
  ------------------
  604|  21.8k|    {
  605|  21.8k|        if (u > static_cast<U>(-((nonstd::integer_limits<T>::lowest)()+T(1))) + U(1))
  ------------------
  |  Branch (605:13): [True: 0, False: 21.8k]
  ------------------
  606|      0|        {
  607|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  608|      0|        }
  609|  21.8k|        else
  610|  21.8k|        {
  611|  21.8k|            n = static_cast<T>(U(0) - u);
  612|  21.8k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  613|  21.8k|        }
  614|  21.8k|    }
  615|  6.48k|    else
  616|  6.48k|    {
  617|  6.48k|        if (u > static_cast<U>((nonstd::integer_limits<T>::max)()))
  ------------------
  |  Branch (617:13): [True: 0, False: 6.48k]
  ------------------
  618|      0|        {
  619|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  620|      0|        }
  621|  6.48k|        else
  622|  6.48k|        {
  623|  6.48k|            n = static_cast<T>(u);
  624|  6.48k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  625|  6.48k|        }
  626|  6.48k|    }
  627|  28.3k|}
_ZN8jsoncons16to_number_resultIcEC2EPKcNSt3__14errcE:
  164|  56.6k|        : ptr(ptr_), ec(ec_)
  165|  56.6k|    {
  166|  56.6k|    }
_ZN8jsoncons10to_integerIjcEENSt3__19enable_ifIXaasr6nonstd14integer_limitsIT_EE14is_specializedntsr6nonstd14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  397|  28.3k|{
  398|  28.3k|    n = 0;
  399|       |
  400|  28.3k|    integer_chars_state state = integer_chars_state::initial;
  401|       |
  402|  28.3k|    const CharT* end = s + length; 
  403|  84.9k|    while (s < end)
  ------------------
  |  Branch (403:12): [True: 56.6k, False: 28.3k]
  ------------------
  404|  56.6k|    {
  405|  56.6k|        switch(state)
  406|  56.6k|        {
  407|  28.3k|            case integer_chars_state::initial:
  ------------------
  |  Branch (407:13): [True: 28.3k, False: 28.3k]
  ------------------
  408|  28.3k|            {
  409|  28.3k|                switch(*s)
  410|  28.3k|                {
  411|      0|                    case '0':
  ------------------
  |  Branch (411:21): [True: 0, False: 28.3k]
  ------------------
  412|      0|                        state = integer_chars_state::integer; // Could be binary, octal, hex 
  413|      0|                        ++s;
  414|      0|                        break;
  415|  28.3k|                    case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9': // Must be decimal
  ------------------
  |  Branch (415:21): [True: 603, False: 27.6k]
  |  Branch (415:30): [True: 1.06k, False: 27.2k]
  |  Branch (415:39): [True: 15.3k, False: 12.9k]
  |  Branch (415:48): [True: 3.60k, False: 24.6k]
  |  Branch (415:57): [True: 1.77k, False: 26.5k]
  |  Branch (415:66): [True: 3.79k, False: 24.5k]
  |  Branch (415:75): [True: 689, False: 27.6k]
  |  Branch (415:84): [True: 618, False: 27.6k]
  |  Branch (415:94): [True: 840, False: 27.4k]
  ------------------
  416|  28.3k|                        state = integer_chars_state::decimal;
  417|  28.3k|                        break;
  418|      0|                    default:
  ------------------
  |  Branch (418:21): [True: 0, False: 28.3k]
  ------------------
  419|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  420|  28.3k|                }
  421|  28.3k|                break;
  422|  28.3k|            }
  423|  28.3k|            case integer_chars_state::integer:
  ------------------
  |  Branch (423:13): [True: 0, False: 56.6k]
  ------------------
  424|      0|            {
  425|      0|                switch(*s)
  426|      0|                {
  427|      0|                    case 'b':case 'B':
  ------------------
  |  Branch (427:21): [True: 0, False: 0]
  |  Branch (427:30): [True: 0, False: 0]
  ------------------
  428|      0|                    {
  429|      0|                        state = integer_chars_state::binary;
  430|      0|                        ++s;
  431|      0|                        break;
  432|      0|                    }
  433|      0|                    case 'x':case 'X':
  ------------------
  |  Branch (433:21): [True: 0, False: 0]
  |  Branch (433:30): [True: 0, False: 0]
  ------------------
  434|      0|                    {
  435|      0|                        state = integer_chars_state::base16;
  436|      0|                        ++s;
  437|      0|                        break;
  438|      0|                    }
  439|      0|                    case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (439:21): [True: 0, False: 0]
  |  Branch (439:30): [True: 0, False: 0]
  |  Branch (439:39): [True: 0, False: 0]
  |  Branch (439:48): [True: 0, False: 0]
  |  Branch (439:57): [True: 0, False: 0]
  |  Branch (439:66): [True: 0, False: 0]
  |  Branch (439:75): [True: 0, False: 0]
  |  Branch (439:84): [True: 0, False: 0]
  |  Branch (439:93): [True: 0, False: 0]
  |  Branch (439:103): [True: 0, False: 0]
  ------------------
  440|      0|                    {
  441|      0|                        state = integer_chars_state::octal;
  442|      0|                        break;
  443|      0|                    }
  444|      0|                    default:
  ------------------
  |  Branch (444:21): [True: 0, False: 0]
  ------------------
  445|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  446|      0|                }
  447|      0|                break;
  448|      0|            }
  449|      0|            case integer_chars_state::binary:
  ------------------
  |  Branch (449:13): [True: 0, False: 56.6k]
  ------------------
  450|      0|            {
  451|      0|                static constexpr T max_value = (nonstd::integer_limits<T>::max)();
  452|      0|                static constexpr T max_value_div_2 = max_value / 2;
  453|      0|                for (; s < end; ++s)
  ------------------
  |  Branch (453:24): [True: 0, False: 0]
  ------------------
  454|      0|                {
  455|      0|                    T x = 0;
  456|      0|                    switch(*s)
  457|      0|                    {
  458|      0|                        case '0':case '1':
  ------------------
  |  Branch (458:25): [True: 0, False: 0]
  |  Branch (458:34): [True: 0, False: 0]
  ------------------
  459|      0|                            x = static_cast<T>(*s) - static_cast<T>('0');
  460|      0|                            break;
  461|      0|                        default:
  ------------------
  |  Branch (461:25): [True: 0, False: 0]
  ------------------
  462|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  463|      0|                    }
  464|      0|                    if (n > max_value_div_2)
  ------------------
  |  Branch (464:25): [True: 0, False: 0]
  ------------------
  465|      0|                    {
  466|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  467|      0|                    }
  468|      0|                    n = n * 2;
  469|      0|                    if (n > max_value - x)
  ------------------
  |  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 += x;
  474|      0|                }
  475|      0|                break;
  476|      0|            }
  477|      0|            case integer_chars_state::octal:
  ------------------
  |  Branch (477:13): [True: 0, False: 56.6k]
  ------------------
  478|      0|            {
  479|      0|                static constexpr T max_value = (nonstd::integer_limits<T>::max)();
  480|      0|                static constexpr T max_value_div_8 = max_value / 8;
  481|      0|                for (; s < end; ++s)
  ------------------
  |  Branch (481:24): [True: 0, False: 0]
  ------------------
  482|      0|                {
  483|      0|                    T x = 0;
  484|      0|                    switch(*s)
  485|      0|                    {
  486|      0|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':
  ------------------
  |  Branch (486:25): [True: 0, False: 0]
  |  Branch (486:34): [True: 0, False: 0]
  |  Branch (486:43): [True: 0, False: 0]
  |  Branch (486:52): [True: 0, False: 0]
  |  Branch (486:61): [True: 0, False: 0]
  |  Branch (486:70): [True: 0, False: 0]
  |  Branch (486:79): [True: 0, False: 0]
  |  Branch (486:88): [True: 0, False: 0]
  ------------------
  487|      0|                            x = static_cast<T>(*s) - static_cast<T>('0');
  488|      0|                            break;
  489|      0|                        default:
  ------------------
  |  Branch (489:25): [True: 0, False: 0]
  ------------------
  490|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  491|      0|                    }
  492|      0|                    if (n > max_value_div_8)
  ------------------
  |  Branch (492:25): [True: 0, False: 0]
  ------------------
  493|      0|                    {
  494|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  495|      0|                    }
  496|      0|                    n = n * 8;
  497|      0|                    if (n > max_value - x)
  ------------------
  |  Branch (497:25): [True: 0, False: 0]
  ------------------
  498|      0|                    {
  499|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  500|      0|                    }
  501|      0|                    n += x;
  502|      0|                }
  503|      0|                break;
  504|      0|            }
  505|  28.3k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (505:13): [True: 28.3k, False: 28.3k]
  ------------------
  506|  28.3k|            {
  507|  28.3k|                static constexpr T max_value = (nonstd::integer_limits<T>::max)();
  508|  28.3k|                static constexpr T max_value_div_10 = max_value / 10;
  509|   135k|                for (; s < end; ++s)
  ------------------
  |  Branch (509:24): [True: 107k, False: 28.3k]
  ------------------
  510|   107k|                {
  511|   107k|                    T x = 0;
  512|   107k|                    switch(*s)
  513|   107k|                    {
  514|   107k|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (514:25): [True: 12.7k, False: 94.7k]
  |  Branch (514:34): [True: 8.68k, False: 98.8k]
  |  Branch (514:43): [True: 13.8k, False: 93.6k]
  |  Branch (514:52): [True: 20.5k, False: 86.9k]
  |  Branch (514:61): [True: 11.8k, False: 95.6k]
  |  Branch (514:70): [True: 5.17k, False: 102k]
  |  Branch (514:79): [True: 6.63k, False: 100k]
  |  Branch (514:88): [True: 15.1k, False: 92.3k]
  |  Branch (514:97): [True: 7.29k, False: 100k]
  |  Branch (514:107): [True: 5.52k, False: 102k]
  ------------------
  515|   107k|                            x = static_cast<T>(*s) - static_cast<T>('0');
  516|   107k|                            break;
  517|      0|                        default:
  ------------------
  |  Branch (517:25): [True: 0, False: 107k]
  ------------------
  518|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  519|   107k|                    }
  520|   107k|                    if (n > max_value_div_10)
  ------------------
  |  Branch (520:25): [True: 0, False: 107k]
  ------------------
  521|      0|                    {
  522|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  523|      0|                    }
  524|   107k|                    n = n * 10;
  525|   107k|                    if (n > max_value - x)
  ------------------
  |  Branch (525:25): [True: 0, False: 107k]
  ------------------
  526|      0|                    {
  527|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  528|      0|                    }
  529|   107k|                    n += x;
  530|   107k|                }
  531|  28.3k|                break;
  532|  28.3k|            }
  533|  28.3k|            case integer_chars_state::base16:
  ------------------
  |  Branch (533:13): [True: 0, False: 56.6k]
  ------------------
  534|      0|            {
  535|      0|                static constexpr T max_value = (nonstd::integer_limits<T>::max)();
  536|      0|                static constexpr T max_value_div_16 = max_value / 16;
  537|      0|                for (; s < end; ++s)
  ------------------
  |  Branch (537:24): [True: 0, False: 0]
  ------------------
  538|      0|                {
  539|      0|                    CharT c = *s;
  540|      0|                    T x = 0;
  541|      0|                    switch (c)
  542|      0|                    {
  543|      0|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (543:25): [True: 0, False: 0]
  |  Branch (543:34): [True: 0, False: 0]
  |  Branch (543:43): [True: 0, False: 0]
  |  Branch (543:52): [True: 0, False: 0]
  |  Branch (543:61): [True: 0, False: 0]
  |  Branch (543:70): [True: 0, False: 0]
  |  Branch (543:79): [True: 0, False: 0]
  |  Branch (543:88): [True: 0, False: 0]
  |  Branch (543:97): [True: 0, False: 0]
  |  Branch (543:107): [True: 0, False: 0]
  ------------------
  544|      0|                            x = static_cast<T>(c - '0');
  545|      0|                            break;
  546|      0|                        case 'a':case 'b':case 'c':case 'd':case 'e':case 'f':
  ------------------
  |  Branch (546:25): [True: 0, False: 0]
  |  Branch (546:34): [True: 0, False: 0]
  |  Branch (546:43): [True: 0, False: 0]
  |  Branch (546:52): [True: 0, False: 0]
  |  Branch (546:61): [True: 0, False: 0]
  |  Branch (546:70): [True: 0, False: 0]
  ------------------
  547|      0|                            x = static_cast<T>(c - ('a' - 10));
  548|      0|                            break;
  549|      0|                        case 'A':case 'B':case 'C':case 'D':case 'E':case 'F':
  ------------------
  |  Branch (549:25): [True: 0, False: 0]
  |  Branch (549:34): [True: 0, False: 0]
  |  Branch (549:43): [True: 0, False: 0]
  |  Branch (549:52): [True: 0, False: 0]
  |  Branch (549:61): [True: 0, False: 0]
  |  Branch (549:70): [True: 0, False: 0]
  ------------------
  550|      0|                            x = static_cast<T>(c - ('A' - 10));
  551|      0|                            break;
  552|      0|                        default:
  ------------------
  |  Branch (552:25): [True: 0, False: 0]
  ------------------
  553|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  554|      0|                    }
  555|      0|                    if (n > max_value_div_16)
  ------------------
  |  Branch (555:25): [True: 0, False: 0]
  ------------------
  556|      0|                    {
  557|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  558|      0|                    }
  559|      0|                    n = n * 16;
  560|      0|                    if (n > max_value - x)
  ------------------
  |  Branch (560:25): [True: 0, False: 0]
  ------------------
  561|      0|                    {
  562|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  563|      0|                    }
  564|       |
  565|      0|                    n += x;
  566|      0|                }
  567|      0|                break;
  568|      0|            }
  569|      0|            default:
  ------------------
  |  Branch (569:13): [True: 0, False: 56.6k]
  ------------------
  570|      0|                JSONCONS_UNREACHABLE();
  ------------------
  |  |   80|      0|#define JSONCONS_UNREACHABLE() __builtin_unreachable()
  ------------------
  571|      0|                break;
  572|  56.6k|        }
  573|  56.6k|    }
  574|  28.3k|    return (state == integer_chars_state::initial) ? to_number_result<CharT>(s, std::errc::invalid_argument) : to_number_result<CharT>(s, std::errc{});
  ------------------
  |  Branch (574:12): [True: 0, False: 28.3k]
  ------------------
  575|  28.3k|}

_ZN8jsoncons12from_integerIiNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEENS1_9enable_ifIXsr6nonstd10is_integerIT_EE5valueEmE4typeES9_RT0_:
   42|  28.3k|{
   43|  28.3k|    using char_type = typename Result::value_type;
   44|       |
   45|  28.3k|    char_type buf[255];
   46|  28.3k|    char_type *p = buf;
   47|  28.3k|    const char_type* last = buf+255;
   48|       |
   49|  28.3k|    bool is_negative = value < 0;
   50|       |
   51|  28.3k|    if (value < 0)
  ------------------
  |  Branch (51:9): [True: 21.8k, False: 6.49k]
  ------------------
   52|  21.8k|    {
   53|  21.8k|        do
   54|  86.7k|        {
   55|  86.7k|            *p++ = static_cast<char_type>(48 - (value % 10));
   56|  86.7k|        }
   57|  86.7k|        while ((value /= 10) && (p < last));
  ------------------
  |  Branch (57:16): [True: 64.9k, False: 21.8k]
  |  Branch (57:33): [True: 64.9k, False: 0]
  ------------------
   58|  21.8k|    }
   59|  6.49k|    else
   60|  6.49k|    {
   61|       |
   62|  6.49k|        do
   63|  20.8k|        {
   64|  20.8k|            *p++ = static_cast<char_type>(48 + value % 10);
   65|  20.8k|        }
   66|  20.8k|        while ((value /= 10) && (p < last));
  ------------------
  |  Branch (66:16): [True: 14.3k, False: 6.49k]
  |  Branch (66:33): [True: 14.3k, False: 0]
  ------------------
   67|  6.49k|    }
   68|  28.3k|    JSONCONS_ASSERT(p != last);
  ------------------
  |  |   54|  28.3k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (54:32): [True: 0, False: 28.3k]
  |  |  ------------------
  |  |   55|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   56|      0|            JSONCONS_STR( 0 ))); }
  ------------------
   69|       |
   70|  28.3k|    std::size_t count = (p - buf);
   71|  28.3k|    if (is_negative)
  ------------------
  |  Branch (71:9): [True: 21.8k, False: 6.49k]
  ------------------
   72|  21.8k|    {
   73|  21.8k|        result.push_back('-');
   74|  21.8k|        ++count;
   75|  21.8k|    }
   76|   135k|    while (--p >= buf)
  ------------------
  |  Branch (76:12): [True: 107k, False: 28.3k]
  ------------------
   77|   107k|    {
   78|   107k|        result.push_back(*p);
   79|   107k|    }
   80|       |
   81|  28.3k|    return count;
   82|  28.3k|}

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr6nonstd8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|   544k|    {
 1148|   544k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|   544k|        const uint8_t* end = it + length;
 1150|       |
 1151|   544k|        unicode_errc  result{};
 1152|  1.81M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 1.27M, False: 543k]
  ------------------
 1153|  1.27M|        {
 1154|  1.27M|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 1.01M, False: 261k]
  ------------------
 1155|  1.01M|            {
 1156|  7.05M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  326|  2.02M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (326:32): [True: 1.01M, False: 1.38k]
  |  |  |  Branch (326:34): [True: 1.01M, False: 813]
  |  |  |  Branch (326:36): [True: 1.00M, False: 670]
  |  |  |  Branch (326:38): [True: 1.00M, False: 1.25k]
  |  |  |  Branch (326:40): [True: 1.00M, False: 960]
  |  |  |  Branch (326:42): [True: 1.00M, False: 514]
  |  |  |  Branch (326:44): [True: 1.00M, False: 912]
  |  |  |  Branch (326:46): [True: 1.00M, False: 750]
  |  |  ------------------
  ------------------
 1157|  1.00M|                continue;
 1158|  7.05M|            }
 1159|   268k|    non_ascii:
 1160|   268k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|   268k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 43, False: 268k]
  ------------------
 1162|     43|            {
 1163|     43|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     43|            }
 1165|   268k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 138, False: 268k]
  ------------------
 1166|    138|            {
 1167|    138|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    138|            }
 1169|   268k|            it += len;
 1170|   268k|        }
 1171|   543k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|   544k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|   268k|    {
  306|   268k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|   268k|        const uint8_t* end = it+length;
  308|       |
  309|   268k|        uint8_t byte;
  310|   268k|        switch (length) {
  311|     35|        default:
  ------------------
  |  Branch (311:9): [True: 35, False: 268k]
  ------------------
  312|     35|            return unicode_errc::over_long_utf8_sequence;
  313|  1.46k|        case 4:
  ------------------
  |  Branch (313:9): [True: 1.46k, False: 267k]
  ------------------
  314|  1.46k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 8, False: 1.45k]
  ------------------
  315|      8|                return unicode_errc::bad_continuation_byte;
  316|  1.45k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  565|  1.45k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  3.55k|        case 3:
  ------------------
  |  Branch (317:9): [True: 2.09k, False: 266k]
  ------------------
  318|  3.55k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 10, False: 3.54k]
  ------------------
  319|     10|                return unicode_errc::bad_continuation_byte;
  320|  3.54k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  565|  3.54k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  7.40k|        case 2:
  ------------------
  |  Branch (321:9): [True: 3.86k, False: 264k]
  ------------------
  322|  7.40k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 19, False: 7.38k]
  ------------------
  323|     19|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  7.38k|            switch (*it) 
  326|  7.38k|            {
  327|       |                // no fall-through in this inner switch
  328|  1.72k|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 1.72k, False: 5.66k]
  |  Branch (328:32): [True: 7, False: 1.71k]
  ------------------
  329|  1.71k|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 250, False: 7.13k]
  |  Branch (329:32): [True: 3, False: 247]
  ------------------
  330|    322|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 322, False: 7.06k]
  |  Branch (330:32): [True: 5, False: 317]
  ------------------
  331|    794|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 794, False: 6.59k]
  |  Branch (331:32): [True: 4, False: 790]
  ------------------
  332|  4.30k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 4.30k, False: 3.08k]
  |  Branch (332:32): [True: 0, False: 4.30k]
  ------------------
  333|  7.38k|            }
  334|       |
  335|  7.36k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  565|  7.36k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|   268k|        case 1:
  ------------------
  |  Branch (336:9): [True: 261k, False: 7.45k]
  ------------------
  337|   268k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 7.41k, False: 261k]
  |  Branch (337:32): [True: 45, False: 7.36k]
  ------------------
  338|     45|                return unicode_errc::source_illegal;
  339|   268k|            break;
  340|   268k|        }
  341|   268k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 2, False: 268k]
  ------------------
  342|      2|            return unicode_errc::source_illegal;
  343|       |
  344|   268k|        return unicode_errc();
  345|   268k|    }

_ZN8jsoncons4bson3TP1C2Ev:
   78|  75.3k|        constexpr TP1() : low(0), high(0) {}
_ZN8jsoncons4bson21decimal128_from_charsEPKcS2_RNS0_3TP1E:
  572|  37.6k|    {
  573|  37.6k|        static const string_view inf_str = "inf";
  574|  37.6k|        static const string_view infinity_str = "infinity";
  575|  37.6k|        static const string_view nan_str = "nan";
  576|       |
  577|  37.6k|        ptrdiff_t len = last - first;
  578|       |
  579|  37.6k|        bson_uint128_6464_t significand = {0,0};
  580|       | 
  581|  37.6k|        const char* str_read = first; /* Read pointer for consuming str. */
  582|       | 
  583|       |        /* Parsing state tracking */
  584|  37.6k|        bool is_negative = false;
  585|  37.6k|        bool saw_radix = false;
  586|  37.6k|        bool includes_sign = false; /* True if the input first contains a sign. */
  587|  37.6k|        bool found_nonzero = false;
  588|       | 
  589|  37.6k|        std::size_t significant_digits = 0; /* Total number of significant digits
  590|       |                                        * (no leading or trailing zero) */
  591|  37.6k|        std::size_t ndigits_read = 0;       /* Total number of significand digits read */
  592|  37.6k|        std::size_t ndigits = 0;        /* Total number of digits (no leading zeros) */
  593|  37.6k|        std::size_t radix_position = 0; /* The number of the digits after radix */
  594|  37.6k|        std::size_t first_nonzero = 0;  /* The index of the first non-zero in *str* */
  595|       | 
  596|  37.6k|        uint16_t digits[decimal128_limits::max_digits] = {0};
  597|  37.6k|        uint16_t ndigits_stored = 0;      /* The number of digits in digits */
  598|  37.6k|        uint16_t *digits_insert = digits; /* Insertion pointer for digits */
  599|  37.6k|        std::size_t first_digit = 0;           /* The index of the first non-zero digit */
  600|  37.6k|        std::size_t last_digit = 0;            /* The index of the last digit */
  601|       | 
  602|  37.6k|        int32_t exponent = 0;
  603|  37.6k|        uint64_t significand_high = 0; /* The high 17 digits of the significand */
  604|  37.6k|        uint64_t significand_low = 0;  /* The low 17 digits of the significand */
  605|  37.6k|        uint16_t biased_exponent = 0;  /* The biased exponent */
  606|       | 
  607|  37.6k|        dec.high = 0;
  608|  37.6k|        dec.low = 0;
  609|       | 
  610|  37.6k|        if (*str_read == '+' || *str_read == '-') {
  ------------------
  |  Branch (610:13): [True: 0, False: 37.6k]
  |  Branch (610:33): [True: 8.24k, False: 29.4k]
  ------------------
  611|  8.24k|           is_negative = *(str_read++) == '-';
  612|  8.24k|           includes_sign = true;
  613|  8.24k|        }
  614|       |
  615|       |        /* Check for Infinity or NaN */
  616|  37.6k|        if (!isdigit(*str_read) && *str_read != '.') {
  ------------------
  |  Branch (616:13): [True: 6.46k, False: 31.2k]
  |  Branch (616:36): [True: 6.46k, False: 0]
  ------------------
  617|  6.46k|           if (detail::dec128_istreq (str_read, last, inf_str.data(), inf_str.data()+inf_str.length()) ||
  ------------------
  |  Branch (617:16): [True: 0, False: 6.46k]
  ------------------
  618|  6.46k|               detail::dec128_istreq (str_read, last, infinity_str.data(), infinity_str.data()+infinity_str.length())) 
  ------------------
  |  Branch (618:16): [True: 5.37k, False: 1.08k]
  ------------------
  619|  5.37k|           {
  620|  5.37k|               dec = is_negative ? decimal128_limits::neg_infinity() : decimal128_limits::infinity();
  ------------------
  |  Branch (620:22): [True: 4.93k, False: 441]
  ------------------
  621|  5.37k|              return decimal128_from_chars_result{str_read,std::errc{}};
  622|  5.37k|           } else if (detail::dec128_istreq (str_read, last, nan_str.data(), nan_str.data()+nan_str.length())) {
  ------------------
  |  Branch (622:23): [True: 1.08k, False: 0]
  ------------------
  623|  1.08k|              dec = decimal128_limits::nan();
  624|  1.08k|              return decimal128_from_chars_result{str_read,std::errc{}};
  625|  1.08k|           }
  626|       | 
  627|      0|           dec = decimal128_limits::nan();
  628|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  629|  6.46k|        }
  630|       | 
  631|       |        /* Read digits */
  632|   926k|        while (((isdigit (*str_read) || *str_read == '.')) &&
  ------------------
  |  Branch (632:18): [True: 867k, False: 58.8k]
  |  Branch (632:41): [True: 27.6k, False: 31.2k]
  ------------------
  633|   895k|               (len == -1 || str_read < first + len)) {
  ------------------
  |  Branch (633:17): [True: 0, False: 895k]
  |  Branch (633:30): [True: 895k, False: 0]
  ------------------
  634|   895k|           if (*str_read == '.') {
  ------------------
  |  Branch (634:16): [True: 27.6k, False: 867k]
  ------------------
  635|  27.6k|              if (saw_radix) {
  ------------------
  |  Branch (635:19): [True: 0, False: 27.6k]
  ------------------
  636|      0|                 dec = decimal128_limits::nan();
  637|      0|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  638|      0|              }
  639|       | 
  640|  27.6k|              saw_radix = true;
  641|  27.6k|              str_read++;
  642|  27.6k|              continue;
  643|  27.6k|           }
  644|       | 
  645|   867k|           if (ndigits_stored < 34) {
  ------------------
  |  Branch (645:16): [True: 866k, False: 952]
  ------------------
  646|   866k|              if (*str_read != '0' || found_nonzero) {
  ------------------
  |  Branch (646:19): [True: 789k, False: 77.8k]
  |  Branch (646:39): [True: 72.3k, False: 5.49k]
  ------------------
  647|   861k|                 if (!found_nonzero) {
  ------------------
  |  Branch (647:22): [True: 28.2k, False: 833k]
  ------------------
  648|  28.2k|                    first_nonzero = ndigits_read;
  649|  28.2k|                 }
  650|       | 
  651|   861k|                 found_nonzero = true;
  652|   861k|                 *(digits_insert++) = *(str_read) - '0'; /* Only store 34 digits */
  653|   861k|                 ndigits_stored++;
  654|   861k|              }
  655|   866k|           }
  656|       | 
  657|   867k|           if (found_nonzero) {
  ------------------
  |  Branch (657:16): [True: 862k, False: 5.49k]
  ------------------
  658|   862k|              ndigits++;
  659|   862k|           }
  660|       | 
  661|   867k|           if (saw_radix) {
  ------------------
  |  Branch (661:16): [True: 826k, False: 41.2k]
  ------------------
  662|   826k|              radix_position++;
  663|   826k|           }
  664|       | 
  665|   867k|           ndigits_read++;
  666|   867k|           str_read++;
  667|   867k|        }
  668|       | 
  669|  31.2k|        if (saw_radix && !ndigits_read) {
  ------------------
  |  Branch (669:13): [True: 27.6k, False: 3.59k]
  |  Branch (669:26): [True: 0, False: 27.6k]
  ------------------
  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|  31.2k|        if (*str_read == 'e' || *str_read == 'E') {
  ------------------
  |  Branch (675:13): [True: 0, False: 31.2k]
  |  Branch (675:33): [True: 28.3k, False: 2.89k]
  ------------------
  676|  28.3k|           ++str_read;
  677|  28.3k|           if (*str_read == '+') {
  ------------------
  |  Branch (677:16): [True: 6.48k, False: 21.8k]
  ------------------
  678|  6.48k|               ++str_read;
  679|  6.48k|           }
  680|  28.3k|           auto result = jsoncons::to_integer(str_read, last - str_read, exponent);
  681|  28.3k|           if (result.ec != std::errc{}) 
  ------------------
  |  Branch (681:16): [True: 10, False: 28.3k]
  ------------------
  682|     10|           {
  683|     10|               dec = decimal128_limits::nan();
  684|     10|               return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  685|     10|           }
  686|  28.3k|           str_read = result.ptr;
  687|  28.3k|        }
  688|       |
  689|  31.1k|        if ((len == -1 || str_read < first + len) && *str_read) {
  ------------------
  |  Branch (689:14): [True: 0, False: 31.1k]
  |  Branch (689:27): [True: 0, False: 31.1k]
  |  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|  31.1k|        first_digit = 0;
  697|       | 
  698|  31.1k|        if (!ndigits_stored) { /* value is zero */
  ------------------
  |  Branch (698:13): [True: 2.97k, False: 28.2k]
  ------------------
  699|  2.97k|           first_digit = 0;
  700|  2.97k|           last_digit = 0;
  701|  2.97k|           digits[0] = 0;
  702|  2.97k|           ndigits = 1;
  703|  2.97k|           ndigits_stored = 1;
  704|  2.97k|           significant_digits = 0;
  705|  28.2k|        } else {
  706|  28.2k|           last_digit = ndigits_stored - 1;
  707|  28.2k|           significant_digits = ndigits;
  708|       |           /* Mark trailing zeros as non-significant */
  709|  32.3k|           while (first[first_nonzero + significant_digits - 1 + includes_sign +
  ------------------
  |  Branch (709:19): [True: 4.09k, False: 28.2k]
  ------------------
  710|  32.3k|                         saw_radix] == '0') {
  711|  4.09k|              significant_digits--;
  712|  4.09k|           }
  713|  28.2k|        }
  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|  31.1k|        if (exponent <= static_cast<int32_t>(radix_position) && static_cast<int32_t>(radix_position) - exponent > (1 << 14)) {
  ------------------
  |  Branch (722:13): [True: 24.7k, False: 6.48k]
  |  Branch (722:65): [True: 0, False: 24.7k]
  ------------------
  723|      0|           exponent = decimal128_limits::exponent_min;
  724|  31.1k|        } else {
  725|  31.1k|           exponent -= static_cast<int32_t>(radix_position);
  726|  31.1k|        }
  727|       | 
  728|       |        /* Attempt to normalize the exponent */
  729|  31.1k|        while (exponent > decimal128_limits::exponent_max) {
  ------------------
  |  Branch (729:16): [True: 0, False: 31.1k]
  ------------------
  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|  32.1k|        while (exponent < decimal128_limits::exponent_min || ndigits_stored < ndigits) {
  ------------------
  |  Branch (749:16): [True: 0, False: 32.1k]
  |  Branch (749:62): [True: 948, False: 31.1k]
  ------------------
  750|       |           /* Shift last digit */
  751|    948|           if (last_digit == 0) {
  ------------------
  |  Branch (751:16): [True: 0, False: 948]
  ------------------
  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|    948|           if (ndigits_stored < ndigits) {
  ------------------
  |  Branch (762:16): [True: 948, False: 0]
  ------------------
  763|    948|              if (first[ndigits - 1 + includes_sign + saw_radix] - '0' != 0 &&
  ------------------
  |  Branch (763:19): [True: 5, False: 943]
  ------------------
  764|      5|                  significant_digits != 0) {
  ------------------
  |  Branch (764:19): [True: 5, False: 0]
  ------------------
  765|      5|                 dec = decimal128_limits::nan();
  766|      5|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  767|      5|              }
  768|       | 
  769|    943|              ndigits--; /* adjust to match digits not stored */
  770|    943|           } 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|    943|           if (exponent < decimal128_limits::exponent_max) {
  ------------------
  |  Branch (781:16): [True: 943, False: 0]
  ------------------
  782|    943|              exponent++;
  783|    943|           } else {
  784|      0|              dec = decimal128_limits::nan();
  785|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  786|      0|           }
  787|    943|        }
  788|       | 
  789|       |        /* Round */
  790|       |        /* We've normalized the exponent, but might still need to round. */
  791|  31.1k|        if (last_digit - first_digit + 1 < significant_digits) {
  ------------------
  |  Branch (791:13): [True: 4, False: 31.1k]
  ------------------
  792|      4|           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|      4|           round_digit =
  797|      4|              first[first_nonzero + last_digit + includes_sign + saw_radix + 1] -
  798|      4|              '0';
  799|       | 
  800|      4|           if (round_digit != 0) {
  ------------------
  |  Branch (800:16): [True: 4, False: 0]
  ------------------
  801|       |              /* Inexact (non-zero) rounding is not allowed */
  802|      4|              dec = decimal128_limits::nan();
  803|      4|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  804|      4|           }
  805|      4|        }
  806|       | 
  807|       |        /* Encode significand */
  808|  31.1k|        significand_high = 0,   /* The high 17 digits of the significand */
  809|  31.1k|           significand_low = 0; /* The low 17 digits of the significand */
  810|       | 
  811|  31.1k|        if (significant_digits == 0) { /* read a zero */
  ------------------
  |  Branch (811:13): [True: 2.97k, False: 28.2k]
  ------------------
  812|  2.97k|           significand_high = 0;
  813|  2.97k|           significand_low = 0;
  814|  28.2k|        } else if (last_digit - first_digit < 17) {
  ------------------
  |  Branch (814:20): [True: 1.38k, False: 26.8k]
  ------------------
  815|  1.38k|           std::size_t d_idx = first_digit;
  816|  1.38k|           significand_low = digits[d_idx++];
  817|       | 
  818|  7.46k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (818:19): [True: 6.08k, False: 1.38k]
  ------------------
  819|  6.08k|              significand_low *= 10;
  820|  6.08k|              significand_low += digits[d_idx];
  821|  6.08k|              significand_high = 0;
  822|  6.08k|           }
  823|  26.8k|        } else {
  824|  26.8k|           std::size_t d_idx = first_digit;
  825|  26.8k|           significand_high = digits[d_idx++];
  826|       | 
  827|   397k|           for (; d_idx <= last_digit - 17; d_idx++) {
  ------------------
  |  Branch (827:19): [True: 370k, False: 26.8k]
  ------------------
  828|   370k|              significand_high *= 10;
  829|   370k|              significand_high += digits[d_idx];
  830|   370k|           }
  831|       | 
  832|  26.8k|           significand_low = digits[d_idx++];
  833|       | 
  834|   456k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (834:19): [True: 429k, False: 26.8k]
  ------------------
  835|   429k|              significand_low *= 10;
  836|   429k|              significand_low += digits[d_idx];
  837|   429k|           }
  838|  26.8k|        }
  839|       | 
  840|  31.1k|        detail::mul_64x64 (significand_high, 100000000000000000ull, &significand);
  841|  31.1k|        significand.low += significand_low;
  842|       | 
  843|  31.1k|        if (significand.low < significand_low) {
  ------------------
  |  Branch (843:13): [True: 4.48k, False: 26.7k]
  ------------------
  844|  4.48k|           significand.high += 1;
  845|  4.48k|        }
  846|       | 
  847|       | 
  848|  31.1k|        biased_exponent = static_cast<uint16_t>(exponent + static_cast<int32_t>(decimal128_limits::exponent_bias));
  849|       | 
  850|       |        /* Encode combination, exponent, and significand. */
  851|  31.1k|        if ((significand.high >> 49) & 1) {
  ------------------
  |  Branch (851:13): [True: 0, False: 31.1k]
  ------------------
  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|  31.1k|        } else {
  857|  31.1k|           dec.high |= (biased_exponent & 0x3fffull) << 49;
  858|  31.1k|           dec.high |= significand.high & 0x1ffffffffffffull;
  859|  31.1k|        }
  860|       | 
  861|  31.1k|        dec.low = significand.low;
  862|       | 
  863|       |        /* Encode sign */
  864|  31.1k|        if (is_negative) {
  ------------------
  |  Branch (864:13): [True: 3.29k, False: 27.8k]
  ------------------
  865|  3.29k|           dec.high |= 0x8000000000000000ull;
  866|  3.29k|        }
  867|       | 
  868|  31.1k|        return decimal128_from_chars_result{str_read,std::errc{}};
  869|  31.1k|    }
_ZN8jsoncons4bson6detail13dec128_istreqEPKcS3_S3_S3_:
  289|  14.0k|        {
  290|  76.4k|            while (!(a == lasta && b == lastb)) 
  ------------------
  |  Branch (290:22): [True: 6.46k, False: 69.9k]
  |  Branch (290:36): [True: 6.46k, False: 0]
  ------------------
  291|  69.9k|            {
  292|       |               // strings are different lengths
  293|  69.9k|               if (a == lasta || b == lastb) 
  ------------------
  |  Branch (293:20): [True: 0, False: 69.9k]
  |  Branch (293:34): [True: 5.37k, False: 64.5k]
  ------------------
  294|  5.37k|               {
  295|  5.37k|                  return false;
  296|  5.37k|               }
  297|       |         
  298|  64.5k|               if (dec128_tolower (*a) != dec128_tolower (*b)) {
  ------------------
  |  Branch (298:20): [True: 2.17k, False: 62.4k]
  ------------------
  299|  2.17k|                  return false;
  300|  2.17k|               }
  301|       |         
  302|  62.4k|               a++;
  303|  62.4k|               b++;
  304|  62.4k|            }
  305|       |         
  306|  6.46k|            return true;
  307|  14.0k|        }
_ZN8jsoncons4bson6detail14dec128_tolowerEc:
  266|   129k|        {
  267|   129k|           if (isupper (c)) {
  ------------------
  |  Branch (267:16): [True: 15.1k, False: 114k]
  ------------------
  268|  15.1k|              c += 32;
  269|  15.1k|           }
  270|       |
  271|   129k|           return c;
  272|   129k|        }
_ZN8jsoncons4bson17decimal128_limits12neg_infinityEv:
  124|  4.93k|        static constexpr decimal128_t neg_infinity() {return decimal128_t(0x7800000000000000ull + 0x8000000000000000ull, 0);}
_ZN8jsoncons4bson3TP1C2Emm:
   79|  6.48k|        constexpr TP1(uint64_t hi, uint64_t lo) : low(lo), high(hi) {}
_ZN8jsoncons4bson17decimal128_limits8infinityEv:
  123|    441|        static constexpr decimal128_t infinity() {return decimal128_t(0x7800000000000000ull, 0);}
_ZN8jsoncons4bson17decimal128_limits3nanEv:
  122|  1.10k|        static constexpr decimal128_t nan() {return decimal128_t(0x7c00000000000000ull, 0);}
_ZN8jsoncons4bson6detail9mul_64x64EmmPNS0_19bson_uint128_6464_tE:
  221|  31.1k|        {
  222|  31.1k|            uint64_t left_high, left_low, right_high, right_low, product_high,
  223|  31.1k|               product_mid, product_mid2, product_low;
  224|  31.1k|            bson_uint128_6464_t rt = {0,0};
  225|       | 
  226|  31.1k|            if (!left && !right) {
  ------------------
  |  Branch (226:17): [True: 4.35k, False: 26.8k]
  |  Branch (226:26): [True: 0, False: 4.35k]
  ------------------
  227|      0|               *product = rt;
  228|      0|               return;
  229|      0|            }
  230|       | 
  231|  31.1k|            left_high = left >> 32;
  232|  31.1k|            left_low = (uint32_t) left;
  233|  31.1k|            right_high = right >> 32;
  234|  31.1k|            right_low = (uint32_t) right;
  235|       | 
  236|  31.1k|            product_high = left_high * right_high;
  237|  31.1k|            product_mid = left_high * right_low;
  238|  31.1k|            product_mid2 = left_low * right_high;
  239|  31.1k|            product_low = left_low * right_low;
  240|       | 
  241|  31.1k|            product_high += product_mid >> 32;
  242|  31.1k|            product_mid = (uint32_t) product_mid + product_mid2 + (product_low >> 32);
  243|       | 
  244|  31.1k|            product_high = product_high + (product_mid >> 32);
  245|  31.1k|            product_low = (product_mid << 32) + (uint32_t) product_low;
  246|       | 
  247|  31.1k|            rt.high = product_high;
  248|  31.1k|            rt.low = product_low;
  249|  31.1k|            *product = rt;
  250|  31.1k|        }
_ZN8jsoncons4bson19decimal128_to_charsEPcS1_RKNS0_3TP1E:
  335|  37.6k|    {
  336|  37.6k|        static const std::string bson_decimal128_inf = "Infinity";
  337|  37.6k|        static const std::string bson_decimal128_nan = "NaN";
  338|       |
  339|  37.6k|        static constexpr uint32_t combination_mask = 0x1f;   /* Extract least significant 5 bits */
  340|  37.6k|        static constexpr uint32_t exponent_mask = 0x3fff;    /* Extract least significant 14 bits */
  341|  37.6k|        static constexpr uint32_t combination_infinity = 30; /* Value of combination field for Inf */
  342|  37.6k|        static constexpr uint32_t combination_nan = 31;      /* Value of combination field for NaN */
  343|  37.6k|        static constexpr uint32_t exponent_bias = 6176;      /* decimal128 exponent bias */
  344|       |
  345|  37.6k|        char* str_out = first;      /* output pointer in string */
  346|  37.6k|        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|  37.6k|        uint32_t high;                   /* bits 0 - 31 */
  351|  37.6k|        uint32_t midh;                   /* bits 32 - 63 */
  352|  37.6k|        uint32_t midl;                   /* bits 64 - 95 */
  353|  37.6k|        uint32_t low;                    /* bits 96 - 127 */
  354|  37.6k|        uint32_t combination;            /* bits 1 - 5 */
  355|  37.6k|        uint32_t biased_exponent;        /* decoded biased exponent (14 bits) */
  356|  37.6k|        uint32_t significand_digits = 0; /* the number of significand digits */
  357|  37.6k|        uint32_t significand[36] = {0};  /* the base-10 digits in the significand */
  358|  37.6k|        uint32_t *significand_read = significand; /* read pointer into significand */
  359|  37.6k|        int32_t exponent;                         /* unbiased exponent */
  360|  37.6k|        int32_t scientific_exponent; /* the exponent if scientific notation is
  361|       |                                      * used */
  362|  37.6k|        bool is_zero = false;        /* true if the number is zero */
  363|       | 
  364|  37.6k|        uint8_t significand_msb; /* the most signifcant significand bits (50-46) */
  365|  37.6k|        bson_uint128_t
  366|  37.6k|           significand128; /* temporary storage for significand decoding */
  367|       | 
  368|  37.6k|        memset (significand_str, 0, sizeof (significand_str));
  369|       | 
  370|  37.6k|        if ((int64_t) dec.high < 0) { /* negative */
  ------------------
  |  Branch (370:13): [True: 9.18k, False: 28.4k]
  ------------------
  371|  9.18k|           *(str_out++) = '-';
  372|  9.18k|        }
  373|       | 
  374|  37.6k|        low = (uint32_t) dec.low, midl = (uint32_t) (dec.low >> 32),
  375|  37.6k|        midh = (uint32_t) dec.high, high = (uint32_t) (dec.high >> 32);
  376|       | 
  377|       |        /* Decode combination field and exponent */
  378|  37.6k|        combination = (high >> 26) & combination_mask;
  379|       | 
  380|  37.6k|        if (JSONCONS_UNLIKELY ((combination >> 3) == 3)) {
  ------------------
  |  |   79|  37.6k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 8.92k, False: 28.7k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  8.92k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 5.37k, False: 3.54k]
  ------------------
  383|  5.37k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 5.37k, False: 0]
  ------------------
  384|  5.37k|               {
  385|  5.37k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  5.37k|                   str_out += bson_decimal128_inf.size();
  387|  5.37k|               }
  388|  5.37k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  5.37k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  5.37k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 1.08k, False: 2.46k]
  ------------------
  392|       |               /* first, not str_out, to erase the sign */
  393|  1.08k|               str_out = first;
  394|  1.08k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_nan.size())) 
  ------------------
  |  Branch (394:20): [True: 1.08k, False: 0]
  ------------------
  395|  1.08k|               {
  396|  1.08k|                   std::memcpy(str_out, bson_decimal128_nan.data(), bson_decimal128_nan.size());
  397|  1.08k|                   str_out += bson_decimal128_nan.size();
  398|  1.08k|               }
  399|  1.08k|               *str_out = 0;
  400|       |              //strcpy_s (first, last-first, bson_decimal128_nan.c_str());
  401|       |              /* we don't care about the NaN payload. */
  402|  1.08k|               return decimal128_to_chars_result{str_out, std::errc{}};
  403|  2.46k|           } else {
  404|  2.46k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  2.46k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  2.46k|           }
  407|  28.7k|        } else {
  408|  28.7k|           significand_msb = (high >> 14) & 0x7;
  409|  28.7k|           biased_exponent = (high >> 17) & exponent_mask;
  410|  28.7k|        }
  411|       | 
  412|  31.2k|        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|  31.2k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|  31.2k|        significand128.parts[1] = midh;
  420|  31.2k|        significand128.parts[2] = midl;
  421|  31.2k|        significand128.parts[3] = low;
  422|       | 
  423|  31.2k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 5.67k, False: 25.5k]
  |  Branch (423:45): [True: 4.00k, False: 1.66k]
  ------------------
  424|  4.00k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 1.67k, False: 2.32k]
  |  Branch (424:45): [True: 512, False: 1.16k]
  ------------------
  425|    512|           is_zero = true;
  426|  30.6k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 2.46k, False: 28.2k]
  ------------------
  427|       |           /* The significand is non-canonical or zero.
  428|       |            * In order to preserve compatibility with the densely packed decimal
  429|       |            * format, the maximum value for the significand of decimal128 is
  430|       |            * 1e34 - 1.  If the value is greater than 1e34 - 1, the IEEE 754
  431|       |            * standard dictates that the significand is interpreted as zero.
  432|       |            */
  433|  2.46k|           is_zero = true;
  434|  28.2k|        } else {
  435|   141k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 112k, False: 28.2k]
  ------------------
  436|   112k|              uint32_t least_digits = 0;
  437|   112k|              detail::bson_uint128_divide1B (
  438|   112k|                 significand128, &significand128, &least_digits);
  439|       | 
  440|       |              /* We now have the 9 least significant digits (in base 2). */
  441|       |              /* Convert and output to string. */
  442|   112k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 7.44k, False: 105k]
  ------------------
  443|  7.44k|                 continue;
  444|  7.44k|              }
  445|       | 
  446|  1.05M|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 949k, False: 105k]
  ------------------
  447|   949k|                 significand[k * 9 + j] = least_digits % 10;
  448|   949k|                 least_digits /= 10;
  449|   949k|              }
  450|   105k|           }
  451|  28.2k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|  31.2k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 2.97k, False: 28.2k]
  ------------------
  458|  2.97k|           significand_digits = 1;
  459|  2.97k|           *significand_read = 0;
  460|  28.2k|        } else {
  461|  28.2k|           significand_digits = 36;
  462|   182k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 153k, False: 28.2k]
  ------------------
  463|   153k|              significand_digits--;
  464|   153k|              significand_read++;
  465|   153k|           }
  466|  28.2k|        }
  467|       | 
  468|  31.2k|        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|  31.2k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 21.8k, False: 9.38k]
  |  Branch (478:41): [True: 6.49k, False: 2.89k]
  ------------------
  479|       |           /* Scientific format */
  480|  28.3k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|  28.3k|           significand_digits--;
  482|       | 
  483|  28.3k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 26.3k, False: 1.96k]
  ------------------
  484|  26.3k|              *(str_out++) = '.';
  485|  26.3k|           }
  486|       | 
  487|   834k|           for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (487:36): [True: 806k, False: 28.2k]
  |  Branch (487:62): [True: 806k, False: 95]
  ------------------
  488|   806k|              *(str_out++) = char(*(significand_read++)) + '0';
  489|   806k|           }
  490|       |           /* Exponent */
  491|  28.3k|           *(str_out++) = 'E';
  492|       |
  493|  28.3k|           std::string s;
  494|  28.3k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 6.49k, False: 21.8k]
  ------------------
  495|  6.49k|               s.push_back('+');
  496|  6.49k|           }
  497|  28.3k|           jsoncons::from_integer(scientific_exponent, s);
  498|  28.3k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 28.3k, False: 10]
  ------------------
  499|  28.3k|           {
  500|  28.3k|               std::memcpy(str_out, s.data(), s.size());
  501|  28.3k|           }
  502|     10|           else
  503|     10|           {
  504|     10|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|     10|           }
  506|  28.3k|           str_out += s.size();
  507|  28.3k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  2.89k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 1.63k, False: 1.26k]
  ------------------
  510|  9.28k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 7.65k, False: 1.63k]
  |  Branch (510:65): [True: 7.65k, False: 0]
  ------------------
  511|  7.65k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  7.65k|              }
  513|  1.63k|           } else {
  514|  1.26k|              int32_t radix_position = significand_digits + exponent;
  515|       | 
  516|  1.26k|              if (radix_position > 0) { /* non-zero digits before radix */
  ------------------
  |  Branch (516:19): [True: 360, False: 908]
  ------------------
  517|    360|                 for (int32_t i = 0;
  518|  4.76k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 4.40k, False: 360]
  |  Branch (518:45): [True: 4.40k, False: 0]
  ------------------
  519|  4.40k|                      i++) {
  520|  4.40k|                    *(str_out++) = char(*(significand_read++)) + '0';
  521|  4.40k|                 }
  522|    908|              } else { /* leading zero before radix point */
  523|    908|                 *(str_out++) = '0';
  524|    908|              }
  525|       | 
  526|  1.26k|              *(str_out++) = '.';
  527|  2.88k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 1.61k, False: 1.26k]
  ------------------
  528|  1.61k|                 *(str_out++) = '0';
  529|  1.61k|              }
  530|       | 
  531|  1.26k|              for (std::size_t i = 0;
  532|  19.6k|                   (i < significand_digits - (std::max) (radix_position - 1, 0)) &&
  ------------------
  |  Branch (532:20): [True: 18.4k, False: 1.26k]
  |  Branch (532:20): [True: 18.4k, False: 1.26k]
  ------------------
  533|  18.4k|                   (str_out < last);
  ------------------
  |  Branch (533:20): [True: 18.4k, False: 0]
  ------------------
  534|  18.4k|                   i++) {
  535|  18.4k|                 *(str_out++) = char(*(significand_read++)) + '0';
  536|  18.4k|              }
  537|  1.26k|           }
  538|  2.89k|        }
  539|  31.1k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|  31.2k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|   112k|        {
  179|   112k|            static constexpr uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|   112k|            uint64_t _rem = 0;
  181|   112k|            int i = 0;
  182|       |            
  183|   112k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 89.8k, False: 23.0k]
  |  Branch (183:36): [True: 64.7k, False: 25.1k]
  |  Branch (183:55): [True: 37.4k, False: 27.3k]
  ------------------
  184|  37.4k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 7.42k, False: 29.9k]
  ------------------
  185|  7.42k|               *quotient = value;
  186|  7.42k|               *rem = 0;
  187|  7.42k|               return;
  188|  7.42k|            }
  189|       |            
  190|   527k|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 422k, False: 105k]
  ------------------
  191|   422k|               _rem <<= 32; /* Adjust remainder to match value of next dividend */
  192|   422k|               _rem += value.parts[i]; /* Add the divided to _rem */
  193|   422k|               value.parts[i] = (uint32_t) (_rem / DIVISOR);
  194|   422k|               _rem %= DIVISOR; /* Store the remainder */
  195|   422k|            }
  196|       |            
  197|   105k|            *quotient = value;
  198|   105k|            *rem = (uint32_t) _rem;
  199|   105k|        }

_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKS9_:
  110|  3.12k|       : basic_bson_encoder(std::forward<Sink>(sink),
  111|  3.12k|                            bson_encode_options(),
  112|  3.12k|                            alloc)
  113|  3.12k|    {
  114|  3.12k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKNS0_19bson_encode_optionsERKS9_:
  119|  3.12k|       : sink_(std::forward<Sink>(sink)),
  120|  3.12k|         max_nesting_depth_(static_cast<std::size_t>(options.max_nesting_depth())),
  121|  3.12k|         alloc_(alloc)
  122|  3.12k|    {
  123|  3.12k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE15visit_end_arrayERKNS_11ser_contextERNS3_10error_codeE:
  222|  1.94k|    {
  223|  1.94k|        if (JSONCONS_UNLIKELY(stack_.empty() || !stack_.back().is_array()))
  ------------------
  |  |   79|  3.88k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 1.94k]
  |  |  |  Branch (79:50): [True: 0, False: 1.94k]
  |  |  |  Branch (79:50): [True: 0, False: 1.94k]
  |  |  ------------------
  ------------------
  224|      0|        {
  225|      0|            ec = bson_errc::unmatched_end_array;
  226|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  227|      0|        }
  228|       |
  229|  1.94k|        buffer_.push_back(0x00);
  230|       |
  231|  1.94k|        std::size_t length = buffer_.size() - stack_.back().offset();
  232|  1.94k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  233|       |
  234|  1.94k|        stack_.pop_back();
  235|  1.94k|        if (stack_.empty())
  ------------------
  |  Branch (235:13): [True: 0, False: 1.94k]
  ------------------
  236|      0|        {
  237|      0|            for (auto c : buffer_)
  ------------------
  |  Branch (237:25): [True: 0, False: 0]
  ------------------
  238|      0|            {
  239|      0|                sink_.push_back(c);
  240|      0|            }
  241|      0|        }
  242|  1.94k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  1.94k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  243|  1.94k|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item8is_arrayEv:
   91|  1.94k|        {
   92|  1.94k|            return type_ == jsoncons::bson::container_type::array;
   93|  1.94k|        }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item6offsetEv:
   66|  10.1k|        {
   67|  10.1k|            return offset_;
   68|  10.1k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  505|  3.96k|    {
  506|  3.96k|        static constexpr uint64_t max_value_div_1000 = (std::numeric_limits<uint64_t>::max)() / 1000;
  507|  3.96k|        if (stack_.empty())
  ------------------
  |  Branch (507:13): [True: 0, False: 3.96k]
  ------------------
  508|      0|        {
  509|      0|            ec = bson_errc::expected_bson_document;
  510|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  511|      0|        }
  512|       |
  513|  3.96k|        switch (tag)
  514|  3.96k|        {
  515|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (515:13): [True: 0, False: 3.96k]
  ------------------
  516|      0|                if (val > max_value_div_1000)
  ------------------
  |  Branch (516:21): [True: 0, False: 0]
  ------------------
  517|      0|                {
  518|      0|                    ec = bson_errc::datetime_too_large;
  519|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  520|      0|                }
  521|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  522|      0|                binary::native_to_little(static_cast<int64_t>(val*millis_in_second),std::back_inserter(buffer_));
  523|      0|                break;
  524|      0|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (524:13): [True: 0, False: 3.96k]
  ------------------
  525|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  526|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  527|      0|                break;
  528|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (528:13): [True: 0, False: 3.96k]
  ------------------
  529|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  530|      0|                if (val != 0)
  ------------------
  |  Branch (530:21): [True: 0, False: 0]
  ------------------
  531|      0|                {
  532|      0|                    val /= nanos_in_milli;
  533|      0|                }
  534|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  535|      0|                break;
  536|  3.96k|            default:
  ------------------
  |  Branch (536:13): [True: 3.96k, False: 0]
  ------------------
  537|  3.96k|            {
  538|  3.96k|                if (val <= static_cast<uint64_t>((std::numeric_limits<int32_t>::max)()))
  ------------------
  |  Branch (538:21): [True: 761, False: 3.20k]
  ------------------
  539|    761|                {
  540|    761|                    before_value(jsoncons::bson::bson_type::int32_type);
  541|    761|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  542|    761|                }
  543|  3.20k|                else if (val <= static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()))
  ------------------
  |  Branch (543:26): [True: 3.12k, False: 80]
  ------------------
  544|  3.12k|                {
  545|  3.12k|                    before_value(jsoncons::bson::bson_type::int64_type);
  546|  3.12k|                    binary::native_to_little(static_cast<uint64_t>(val),std::back_inserter(buffer_));
  547|  3.12k|                }
  548|     80|                else
  549|     80|                {
  550|     80|                    ec = bson_errc::number_too_large;
  551|     80|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|     80|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  552|     80|                }
  553|  3.88k|                break;
  554|  3.96k|            }
  555|  3.96k|        }
  556|  3.88k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.88k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  557|  3.96k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12before_valueEh:
  575|  3.46M|    {
  576|  3.46M|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   54|  3.46M|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (54:32): [True: 0, False: 3.46M]
  |  |  ------------------
  |  |   55|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   56|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  577|  3.46M|        if (stack_.back().is_object())
  ------------------
  |  Branch (577:13): [True: 305k, False: 3.15M]
  ------------------
  578|   305k|        {
  579|   305k|            buffer_[stack_.back().member_offset()] = code;
  580|   305k|        }
  581|  3.15M|        else
  582|  3.15M|        {
  583|  3.15M|            buffer_.push_back(code);
  584|  3.15M|            std::string name = std::to_string(stack_.back().next_index());
  585|  3.15M|            buffer_.insert(buffer_.end(), name.begin(), name.end());
  586|  3.15M|            buffer_.push_back(0x00);
  587|  3.15M|        }
  588|  3.46M|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item9is_objectEv:
   86|  3.46M|        {
   87|  3.46M|            return type_ == jsoncons::bson::container_type::document;
   88|  3.46M|        }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEv:
   71|   305k|        {
   72|   305k|            return name_offset_;
   73|   305k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item10next_indexEv:
   81|  3.15M|        {
   82|  3.15M|            return index_++;
   83|  3.15M|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  446|  16.4k|    {
  447|  16.4k|        static constexpr int64_t min_value_div_1000 = (std::numeric_limits<int64_t>::min)() / 1000;
  448|  16.4k|        static constexpr int64_t max_value_div_1000 = (std::numeric_limits<int64_t>::max)() / 1000;
  449|  16.4k|        if (stack_.empty())
  ------------------
  |  Branch (449:13): [True: 0, False: 16.4k]
  ------------------
  450|      0|        {
  451|      0|            ec = bson_errc::expected_bson_document;
  452|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  453|      0|        }
  454|       |
  455|  16.4k|        switch (tag)
  456|  16.4k|        {
  457|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (457:13): [True: 0, False: 16.4k]
  ------------------
  458|      0|                if (val < min_value_div_1000)
  ------------------
  |  Branch (458:21): [True: 0, False: 0]
  ------------------
  459|      0|                {
  460|      0|                    ec = bson_errc::datetime_too_small;
  461|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  462|      0|                }
  463|      0|                if (val > max_value_div_1000)
  ------------------
  |  Branch (463:21): [True: 0, False: 0]
  ------------------
  464|      0|                {
  465|      0|                    ec = bson_errc::datetime_too_large;
  466|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  467|      0|                }
  468|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  469|      0|                binary::native_to_little(val*millis_in_second,std::back_inserter(buffer_));
  470|      0|                break;
  471|  2.51k|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (471:13): [True: 2.51k, False: 13.9k]
  ------------------
  472|  2.51k|                before_value(jsoncons::bson::bson_type::datetime_type);
  473|  2.51k|                binary::native_to_little(val,std::back_inserter(buffer_));
  474|  2.51k|                break;
  475|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (475:13): [True: 0, False: 16.4k]
  ------------------
  476|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  477|      0|                if (val != 0)
  ------------------
  |  Branch (477:21): [True: 0, False: 0]
  ------------------
  478|      0|                {
  479|      0|                    val /= nanos_in_milli;
  480|      0|                }
  481|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  482|      0|                break;
  483|  13.9k|            default:
  ------------------
  |  Branch (483:13): [True: 13.9k, False: 2.51k]
  ------------------
  484|  13.9k|            {
  485|  13.9k|                if (val >= (std::numeric_limits<int32_t>::lowest)() && val <= (std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (485:21): [True: 13.6k, False: 359]
  |  Branch (485:72): [True: 8.10k, False: 5.50k]
  ------------------
  486|  8.10k|                {
  487|  8.10k|                    before_value(jsoncons::bson::bson_type::int32_type);
  488|  8.10k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  489|  8.10k|                }
  490|  5.86k|                else 
  491|  5.86k|                {
  492|  5.86k|                    before_value(jsoncons::bson::bson_type::int64_type);
  493|  5.86k|                    binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  494|  5.86k|                }
  495|  13.9k|                break;
  496|      0|            }
  497|  16.4k|        }
  498|  16.4k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  16.4k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  499|  16.4k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  563|    992|    {
  564|    992|        if (stack_.empty())
  ------------------
  |  Branch (564:13): [True: 0, False: 992]
  ------------------
  565|      0|        {
  566|      0|            ec = bson_errc::expected_bson_document;
  567|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  568|      0|        }
  569|    992|        before_value(jsoncons::bson::bson_type::double_type);
  570|    992|        binary::native_to_little(val,std::back_inserter(buffer_));
  571|    992|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|    992|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  572|    992|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_flushEv:
  149|      7|    {
  150|      7|        sink_.flush();
  151|      7|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE18visit_begin_objectENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  154|  37.7k|    {
  155|  37.7k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  37.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 37.7k]
  |  |  ------------------
  ------------------
  156|      0|        {
  157|      0|            ec = bson_errc::max_nesting_depth_exceeded;
  158|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  159|      0|        } 
  160|  37.7k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (160:13): [True: 34.6k, False: 3.11k]
  ------------------
  161|  34.6k|        {
  162|  34.6k|            if (stack_.empty())
  ------------------
  |  Branch (162:17): [True: 0, False: 34.6k]
  ------------------
  163|      0|            {
  164|      0|                ec = bson_errc::expected_bson_document;
  165|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  166|      0|            }
  167|  34.6k|            before_value(jsoncons::bson::bson_type::document_type);
  168|  34.6k|        }
  169|       |
  170|  37.7k|        stack_.emplace_back(jsoncons::bson::container_type::document, buffer_.size());
  171|  37.7k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  172|       |
  173|  37.7k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  37.7k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  174|  37.7k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_itemC2ENS0_14container_typeEm:
   61|  50.6k|           : type_(type), offset_(offset)
   62|  50.6k|        {
   63|  50.6k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE16visit_end_objectERKNS_11ser_contextERNS3_10error_codeE:
  177|  3.11k|    {
  178|  3.11k|        if (JSONCONS_UNLIKELY(stack_.empty() || !stack_.back().is_object()))
  ------------------
  |  |   79|  6.22k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 3.11k]
  |  |  |  Branch (79:50): [True: 0, False: 3.11k]
  |  |  |  Branch (79:50): [True: 0, False: 3.11k]
  |  |  ------------------
  ------------------
  179|      0|        {
  180|      0|            ec = bson_errc::unmatched_end_object;
  181|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  182|      0|        }
  183|       |
  184|  3.11k|        buffer_.push_back(0x00);
  185|       |
  186|  3.11k|        std::size_t length = buffer_.size() - stack_.back().offset();
  187|  3.11k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  188|       |
  189|  3.11k|        stack_.pop_back();
  190|  3.11k|        if (stack_.empty())
  ------------------
  |  Branch (190:13): [True: 130, False: 2.98k]
  ------------------
  191|    130|        {
  192|    130|            for (auto c : buffer_)
  ------------------
  |  Branch (192:25): [True: 1.33M, False: 130]
  ------------------
  193|  1.33M|            {
  194|  1.33M|                sink_.push_back(c);
  195|  1.33M|            }
  196|    130|        }
  197|  3.11k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.11k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  198|  3.11k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  201|  12.8k|    {
  202|  12.8k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  12.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 12.8k]
  |  |  ------------------
  ------------------
  203|      0|        {
  204|      0|            ec = bson_errc::max_nesting_depth_exceeded;
  205|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  206|      0|        } 
  207|  12.8k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (207:13): [True: 12.8k, False: 0]
  ------------------
  208|  12.8k|        {
  209|  12.8k|            if (stack_.empty())
  ------------------
  |  Branch (209:17): [True: 0, False: 12.8k]
  ------------------
  210|      0|            {
  211|      0|                ec = bson_errc::expected_bson_document;
  212|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  213|      0|            }
  214|  12.8k|            before_value(jsoncons::bson::bson_type::array_type);
  215|  12.8k|        }
  216|  12.8k|        stack_.emplace_back(jsoncons::bson::container_type::array, buffer_.size());
  217|  12.8k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  218|  12.8k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  12.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  219|  12.8k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9visit_keyERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEERKNS_11ser_contextERNS3_10error_codeE:
  246|   306k|    {
  247|   306k|        stack_.back().member_offset(buffer_.size());
  248|   306k|        buffer_.push_back(0x00); // reserve space for code
  249|   306k|        for (auto c : name)
  ------------------
  |  Branch (249:21): [True: 849k, False: 306k]
  ------------------
  250|   849k|        {
  251|   849k|            buffer_.push_back(c);
  252|   849k|        }
  253|   306k|        buffer_.push_back(0x00);
  254|   306k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   306k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  255|   306k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEm:
   76|   306k|        {
   77|   306k|            name_offset_ = offset;
   78|   306k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  258|  3.19M|    {
  259|  3.19M|        if (stack_.empty())
  ------------------
  |  Branch (259:13): [True: 0, False: 3.19M]
  ------------------
  260|      0|        {
  261|      0|            ec = bson_errc::expected_bson_document;
  262|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  263|      0|        }
  264|  3.19M|        switch (tag)
  265|  3.19M|        {
  266|  1.24k|            case semantic_tag::undefined:
  ------------------
  |  Branch (266:13): [True: 1.24k, False: 3.19M]
  ------------------
  267|  1.24k|                before_value(jsoncons::bson::bson_type::undefined_type);
  268|  1.24k|                break;
  269|  3.19M|            default:
  ------------------
  |  Branch (269:13): [True: 3.19M, False: 1.24k]
  ------------------
  270|  3.19M|                before_value(jsoncons::bson::bson_type::null_type);
  271|  3.19M|                break;
  272|  3.19M|        }
  273|  3.19M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.19M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  274|  3.19M|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  277|    621|    {
  278|    621|        if (stack_.empty())
  ------------------
  |  Branch (278:13): [True: 0, False: 621]
  ------------------
  279|      0|        {
  280|      0|            ec = bson_errc::expected_bson_document;
  281|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  282|      0|        }
  283|    621|        before_value(jsoncons::bson::bson_type::bool_type);
  284|    621|        if (val)
  ------------------
  |  Branch (284:13): [True: 341, False: 280]
  ------------------
  285|    341|        {
  286|    341|            buffer_.push_back(0x01);
  287|    341|        }
  288|    280|        else
  289|    280|        {
  290|    280|            buffer_.push_back(0x00);
  291|    280|        }
  292|       |
  293|    621|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|    621|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  294|    621|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_stringERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  297|   176k|    {
  298|   176k|        if (stack_.empty())
  ------------------
  |  Branch (298:13): [True: 0, False: 176k]
  ------------------
  299|      0|        {
  300|      0|            ec = bson_errc::expected_bson_document;
  301|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  302|      0|        }
  303|       |
  304|   176k|        switch (tag)
  305|   176k|        {
  306|  37.6k|            case semantic_tag::float128:
  ------------------
  |  Branch (306:13): [True: 37.6k, False: 138k]
  ------------------
  307|  37.6k|            {
  308|  37.6k|                before_value(jsoncons::bson::bson_type::decimal128_type);
  309|  37.6k|                decimal128_t dec;
  310|  37.6k|                auto rc = decimal128_from_chars(sv.data(), sv.data()+sv.size(), dec);
  311|  37.6k|                if (rc.ec != std::errc{})
  ------------------
  |  Branch (311:21): [True: 19, False: 37.6k]
  ------------------
  312|     19|                {
  313|     19|                    ec = bson_errc::invalid_decimal128_string;
  314|     19|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|     19|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  315|     19|                }
  316|  37.6k|                binary::native_to_little(dec.low,std::back_inserter(buffer_));
  317|  37.6k|                binary::native_to_little(dec.high,std::back_inserter(buffer_));
  318|  37.6k|                break;
  319|  37.6k|            }
  320|  13.4k|            case semantic_tag::id:
  ------------------
  |  Branch (320:13): [True: 13.4k, False: 162k]
  ------------------
  321|  13.4k|            {
  322|  13.4k|                before_value(jsoncons::bson::bson_type::object_id_type);
  323|  13.4k|                oid_t oid(sv);
  324|  13.4k|                for (auto b : oid)
  ------------------
  |  Branch (324:29): [True: 161k, False: 13.4k]
  ------------------
  325|   161k|                {
  326|   161k|                    buffer_.push_back(b);
  327|   161k|                }
  328|  13.4k|                break;
  329|  37.6k|            }
  330|  6.11k|            case semantic_tag::regex:
  ------------------
  |  Branch (330:13): [True: 6.11k, False: 169k]
  ------------------
  331|  6.11k|            {
  332|  6.11k|                before_value(jsoncons::bson::bson_type::regex_type);
  333|  6.11k|                std::size_t first = sv.find_first_of('/');
  334|  6.11k|                std::size_t last = sv.find_last_of('/');
  335|  6.11k|                if (first == string_view::npos || last == string_view::npos || first == last)
  ------------------
  |  Branch (335:21): [True: 0, False: 6.11k]
  |  Branch (335:51): [True: 0, False: 6.11k]
  |  Branch (335:80): [True: 0, False: 6.11k]
  ------------------
  336|      0|                {
  337|      0|                    ec = bson_errc::bad_regex;
  338|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  339|      0|                }
  340|  6.11k|                string_view regex = sv.substr(first+1,last-1);
  341|  6.11k|                for (auto c : regex)
  ------------------
  |  Branch (341:29): [True: 4.72M, False: 6.11k]
  ------------------
  342|  4.72M|                {
  343|  4.72M|                    buffer_.push_back(c);
  344|  4.72M|                }
  345|  6.11k|                buffer_.push_back(0x00);
  346|  6.11k|                string_view options = sv.substr(last+1);
  347|  6.11k|                for (auto c : options)
  ------------------
  |  Branch (347:29): [True: 2.72M, False: 6.11k]
  ------------------
  348|  2.72M|                {
  349|  2.72M|                    buffer_.push_back(c);
  350|  2.72M|                }
  351|  6.11k|                buffer_.push_back(0x00);
  352|  6.11k|                break;
  353|  6.11k|            }
  354|   118k|            default:
  ------------------
  |  Branch (354:13): [True: 118k, False: 57.2k]
  ------------------
  355|   118k|                switch (tag)
  356|   118k|                {
  357|  1.09k|                    case semantic_tag::code:
  ------------------
  |  Branch (357:21): [True: 1.09k, False: 117k]
  ------------------
  358|  1.09k|                        before_value(jsoncons::bson::bson_type::javascript_type);
  359|  1.09k|                        break;
  360|   117k|                    default:
  ------------------
  |  Branch (360:21): [True: 117k, False: 1.09k]
  ------------------
  361|   117k|                        before_value(jsoncons::bson::bson_type::string_type);
  362|   117k|                        break;
  363|   118k|                }
  364|   118k|                std::size_t offset = buffer_.size();
  365|   118k|                buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  366|   118k|                std::size_t string_offset = buffer_.size();
  367|   118k|                auto sink = unicode_traits::validate(sv.data(), sv.size());
  368|   118k|                if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (368:21): [True: 0, False: 118k]
  ------------------
  369|      0|                {
  370|      0|                    ec = bson_errc::invalid_utf8_text_string;
  371|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  372|      0|                }
  373|   118k|                for (auto c : sv)
  ------------------
  |  Branch (373:29): [True: 3.73M, False: 118k]
  ------------------
  374|  3.73M|                {
  375|  3.73M|                    buffer_.push_back(c);
  376|  3.73M|                }
  377|   118k|                buffer_.push_back(0x00);
  378|   118k|                std::size_t length = buffer_.size() - string_offset;
  379|   118k|                binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  380|   118k|                break;
  381|   176k|        }
  382|       |
  383|   176k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   176k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  384|   176k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_byte_stringERKNS_16byte_string_viewEmRKNS_11ser_contextERNS3_10error_codeE:
  418|  18.3k|    {
  419|  18.3k|        if (stack_.empty())
  ------------------
  |  Branch (419:13): [True: 0, False: 18.3k]
  ------------------
  420|      0|        {
  421|      0|            ec = bson_errc::expected_bson_document;
  422|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  423|      0|        }
  424|  18.3k|        before_value(jsoncons::bson::bson_type::binary_type);
  425|       |
  426|  18.3k|        std::size_t offset = buffer_.size();
  427|  18.3k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  428|  18.3k|        std::size_t string_offset = buffer_.size();
  429|       |
  430|  18.3k|        buffer_.push_back(static_cast<uint8_t>(raw_tag)); // default subtype
  431|       |
  432|  18.3k|        for (auto c : b)
  ------------------
  |  Branch (432:21): [True: 10.3M, False: 18.3k]
  ------------------
  433|  10.3M|        {
  434|  10.3M|            buffer_.push_back(c);
  435|  10.3M|        }
  436|  18.3k|        std::size_t length = buffer_.size() - string_offset - 1;
  437|  18.3k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  438|       |
  439|  18.3k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  18.3k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  440|  18.3k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEED2Ev:
  126|  3.12k|    {
  127|  3.12k|        sink_.flush();
  128|  3.12k|    }

_ZN8jsoncons4bson15make_error_codeENS0_9bson_errcE:
  100|  3.11k|{
  101|  3.11k|    return std::error_code(static_cast<int>(result),bson_error_category());
  102|  3.11k|}
_ZN8jsoncons4bson19bson_error_categoryEv:
   93|  3.11k|{
   94|  3.11k|  static bson_error_category_impl instance;
   95|  3.11k|  return instance;
   96|  3.11k|}

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

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

_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEEC2IRNS3_19basic_istringstreamIcNS3_11char_traitsIcEES7_EEEEOT_RKNS0_19bson_decode_optionsERKS7_:
   85|  3.12k|       : source_(std::forward<Sourceable>(source)), 
   86|  3.12k|         max_nesting_depth_(options.max_nesting_depth()),
   87|  3.12k|         bytes_buffer_(temp_alloc),
   88|  3.12k|         name_buffer_(temp_alloc),
   89|  3.12k|         text_buffer_(temp_alloc),
   90|  3.12k|         state_stack_(temp_alloc)
   91|  3.12k|    {
   92|  3.12k|        state_stack_.emplace_back(parse_mode::root,0,0);
   93|  3.12k|    }
_ZN8jsoncons4bson11parse_stateC2ENS0_10parse_modeEmmh:
   48|  56.8k|        : mode(mode_), length(length_), pos(pos_), type(type_)
   49|  56.8k|    {
   50|  56.8k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5resetEv:
  101|  3.12k|    {
  102|  3.12k|        more_ = true;
  103|  3.12k|        done_ = false;
  104|  3.12k|        bytes_buffer_.clear();
  105|  3.12k|        name_buffer_.clear();
  106|  3.12k|        text_buffer_.clear();
  107|  3.12k|        state_stack_.clear();
  108|  3.12k|        state_stack_.emplace_back(parse_mode::root,0,0);
  109|  3.12k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5parseERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  169|  3.12k|    {
  170|  3.12k|        if (JSONCONS_UNLIKELY(source_.is_error()))
  ------------------
  |  |   79|  3.12k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 3.12k]
  |  |  ------------------
  ------------------
  171|      0|        {
  172|      0|            ec = bson_errc::source_error;
  173|      0|            more_ = false;
  174|      0|            return;
  175|      0|        }
  176|       |        
  177|  3.78M|        while (!done_ && more_)
  ------------------
  |  Branch (177:16): [True: 3.78M, False: 7]
  |  Branch (177:26): [True: 3.78M, False: 4]
  ------------------
  178|  3.78M|        {
  179|  3.78M|            switch (state_stack_.back().mode)
  ------------------
  |  Branch (179:21): [True: 3.78M, False: 0]
  ------------------
  180|  3.78M|            {
  181|  3.12k|                case parse_mode::root:
  ------------------
  |  Branch (181:17): [True: 3.12k, False: 3.77M]
  ------------------
  182|  3.12k|                    state_stack_.back().mode = parse_mode::accept;
  183|  3.12k|                    begin_document(visitor, ec);
  184|  3.12k|                    break;
  185|   310k|                case parse_mode::document:
  ------------------
  |  Branch (185:17): [True: 310k, False: 3.46M]
  ------------------
  186|   310k|                {
  187|   310k|                    uint8_t type;
  188|   310k|                    std::size_t n = source_.read(&type, 1);
  189|   310k|                    state_stack_.back().pos += n;
  190|   310k|                    if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   79|   310k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 1.27k, False: 309k]
  |  |  ------------------
  ------------------
  191|  1.27k|                    {
  192|  1.27k|                        ec = bson_errc::unexpected_eof;
  193|  1.27k|                        more_ = false;
  194|  1.27k|                        return;
  195|  1.27k|                    }
  196|   309k|                    if (type != 0x00)
  ------------------
  |  Branch (196:25): [True: 306k, False: 3.11k]
  ------------------
  197|   306k|                    {
  198|   306k|                        read_e_name(visitor,jsoncons::bson::container_type::document,ec);
  199|   306k|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|   306k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 229, False: 306k]
  |  |  ------------------
  ------------------
  200|    229|                        {
  201|    229|                            more_ = false;
  202|    229|                            return;
  203|    229|                        }
  204|   306k|                        state_stack_.back().mode = parse_mode::value;
  205|   306k|                        state_stack_.back().type = type;
  206|   306k|                    }
  207|  3.11k|                    else
  208|  3.11k|                    {
  209|  3.11k|                        end_document(visitor,ec);
  210|  3.11k|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  3.11k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 146, False: 2.96k]
  |  |  ------------------
  ------------------
  211|    146|                        {
  212|    146|                            more_ = false;
  213|    146|                            return;
  214|    146|                        }
  215|  3.11k|                    }
  216|   309k|                    break;
  217|   309k|                }
  218|  3.16M|                case parse_mode::array:
  ------------------
  |  Branch (218:17): [True: 3.16M, False: 620k]
  ------------------
  219|  3.16M|                {
  220|  3.16M|                    uint8_t type;
  221|  3.16M|                    std::size_t n = source_.read(&type, 1);
  222|  3.16M|                    state_stack_.back().pos += n;
  223|  3.16M|                    if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   79|  3.16M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 195, False: 3.16M]
  |  |  ------------------
  ------------------
  224|    195|                    {
  225|    195|                        ec = bson_errc::unexpected_eof;
  226|    195|                        more_ = false;
  227|    195|                        return;
  228|    195|                    }
  229|  3.16M|                    if (type != 0x00)
  ------------------
  |  Branch (229:25): [True: 3.15M, False: 1.94k]
  ------------------
  230|  3.15M|                    {
  231|  3.15M|                        read_e_name(visitor,jsoncons::bson::container_type::array,ec);
  232|  3.15M|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  3.15M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 74, False: 3.15M]
  |  |  ------------------
  ------------------
  233|     74|                        {
  234|     74|                            more_ = false;
  235|     74|                            return;
  236|     74|                        }
  237|  3.15M|                        read_value(visitor, type, ec);
  238|  3.15M|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  3.15M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 156, False: 3.15M]
  |  |  ------------------
  ------------------
  239|    156|                        {
  240|    156|                            more_ = false;
  241|    156|                            return;
  242|    156|                        }
  243|  3.15M|                    }
  244|  1.94k|                    else
  245|  1.94k|                    {
  246|  1.94k|                        end_array(visitor,ec);
  247|  1.94k|                        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  1.94k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 105, False: 1.83k]
  |  |  ------------------
  ------------------
  248|    105|                        {
  249|    105|                            more_ = false;
  250|    105|                            return;
  251|    105|                        }
  252|  1.94k|                    }
  253|  3.15M|                    break;
  254|  3.16M|                }
  255|  3.15M|                case parse_mode::value:
  ------------------
  |  Branch (255:17): [True: 306k, False: 3.47M]
  ------------------
  256|   306k|                    state_stack_.back().mode = parse_mode::document;
  257|   306k|                    read_value(visitor,state_stack_.back().type,ec);
  258|   306k|                    if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|   306k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 925, False: 305k]
  |  |  ------------------
  ------------------
  259|    925|                    {
  260|    925|                        more_ = false;
  261|    925|                        return;
  262|    925|                    }
  263|   305k|                    break;
  264|   305k|                case parse_mode::accept:
  ------------------
  |  Branch (264:17): [True: 7, False: 3.78M]
  ------------------
  265|      7|                {
  266|      7|                    JSONCONS_ASSERT(state_stack_.size() == 1);
  ------------------
  |  |   54|      7|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (54:32): [True: 0, False: 7]
  |  |  ------------------
  |  |   55|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   56|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  267|      7|                    state_stack_.clear();
  268|      7|                    more_ = false;
  269|      7|                    done_ = true;
  270|      7|                    visitor.flush();
  271|      7|                    break;
  272|      7|                }
  273|  3.78M|            }
  274|  3.78M|        }
  275|  3.12k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE14begin_documentERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  280|  37.7k|    {
  281|  37.7k|        if (JSONCONS_UNLIKELY(static_cast<int>(state_stack_.size()) > max_nesting_depth_))
  ------------------
  |  |   79|  37.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 1, False: 37.7k]
  |  |  ------------------
  ------------------
  282|      1|        {
  283|      1|            ec = bson_errc::max_nesting_depth_exceeded;
  284|      1|            more_ = false;
  285|      1|            return;
  286|      1|        } 
  287|       |
  288|  37.7k|        uint8_t buf[sizeof(int32_t)]; 
  289|  37.7k|        std::size_t n = source_.read(buf, sizeof(int32_t));
  290|  37.7k|        if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   79|  37.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 24, False: 37.7k]
  |  |  ------------------
  ------------------
  291|     24|        {
  292|     24|            ec = bson_errc::unexpected_eof;
  293|     24|            more_ = false;
  294|     24|            return;
  295|     24|        }
  296|       |
  297|  37.7k|        auto length = binary::little_to_native<int32_t>(buf, sizeof(buf));
  298|       |
  299|  37.7k|        visitor.begin_object(semantic_tag::none, *this, ec);
  300|  37.7k|        more_ = !cursor_mode_;
  301|  37.7k|        state_stack_.emplace_back(parse_mode::document,length,n);
  302|  37.7k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11read_e_nameERNS_18basic_json_visitorIcEENS0_14container_typeERNS3_10error_codeE:
  374|  3.46M|    {
  375|  3.46M|        name_buffer_.clear();
  376|  3.46M|        read_cstring(name_buffer_, ec);
  377|  3.46M|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  3.46M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 137, False: 3.46M]
  |  |  ------------------
  ------------------
  378|    137|        {
  379|    137|            return;
  380|    137|        }
  381|  3.46M|        if (type == jsoncons::bson::container_type::document)
  ------------------
  |  Branch (381:13): [True: 306k, False: 3.15M]
  ------------------
  382|   306k|        {
  383|   306k|            auto result = unicode_traits::validate(name_buffer_.data(),name_buffer_.size());
  384|   306k|            if (JSONCONS_UNLIKELY(result.ec != unicode_traits::unicode_errc()))
  ------------------
  |  |   79|   306k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 166, False: 306k]
  |  |  ------------------
  ------------------
  385|    166|            {
  386|    166|                ec = bson_errc::invalid_utf8_text_string;
  387|    166|                more_ = false;
  388|    166|                return;
  389|    166|            }
  390|   306k|            visitor.key(jsoncons::basic_string_view<char>(name_buffer_.data(),name_buffer_.length()), *this, ec);
  391|   306k|            more_ = !cursor_mode_;
  392|   306k|        }
  393|  3.46M|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE12read_cstringERNS3_12basic_stringIcNS3_11char_traitsIcEES7_EERNS3_10error_codeE:
  677|  3.47M|    {
  678|  3.47M|        uint8_t c = 0xff;
  679|  22.2M|        while (true)
  ------------------
  |  Branch (679:16): [True: 22.2M, Folded]
  ------------------
  680|  22.2M|        {
  681|  22.2M|            std::size_t n = source_.read(&c, 1);
  682|  22.2M|            state_stack_.back().pos += n;
  683|  22.2M|            if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   79|  22.2M|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 186, False: 22.2M]
  |  |  ------------------
  ------------------
  684|    186|            {
  685|    186|                ec = bson_errc::unexpected_eof;
  686|    186|                more_ = false;
  687|    186|                return;
  688|    186|            }
  689|  22.2M|            if (c == 0)
  ------------------
  |  Branch (689:17): [True: 3.47M, False: 18.7M]
  ------------------
  690|  3.47M|            {
  691|  3.47M|                break;
  692|  3.47M|            }
  693|  18.7M|            buffer.push_back(c);
  694|  18.7M|        }
  695|  3.47M|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE12end_documentERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  305|  3.11k|    {
  306|  3.11k|        JSONCONS_ASSERT(state_stack_.size() >= 2);
  ------------------
  |  |   54|  3.11k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (54:32): [True: 0, False: 3.11k]
  |  |  ------------------
  |  |   55|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   56|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  307|       |
  308|  3.11k|        visitor.end_object(*this,ec);
  309|  3.11k|        more_ = !cursor_mode_;
  310|  3.11k|        if (level() == mark_level_)
  ------------------
  |  Branch (310:13): [True: 0, False: 3.11k]
  ------------------
  311|      0|        {
  312|      0|            more_ = false;
  313|      0|        }
  314|  3.11k|        if (JSONCONS_UNLIKELY(state_stack_.back().pos != state_stack_.back().length))
  ------------------
  |  |   79|  3.11k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 146, False: 2.96k]
  |  |  ------------------
  ------------------
  315|    146|        {
  316|    146|            ec = bson_errc::size_mismatch;
  317|    146|            more_ = false;
  318|    146|            return;
  319|    146|        }
  320|  2.96k|        std::size_t pos = state_stack_.back().pos;
  321|  2.96k|        state_stack_.pop_back();
  322|  2.96k|        state_stack_.back().pos += pos;
  323|  2.96k|    }
_ZNK8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE5levelEv:
  124|  5.05k|    {
  125|  5.05k|        return static_cast<int>(state_stack_.size());
  126|  5.05k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE10read_valueERNS_18basic_json_visitorIcEEhRNS3_10error_codeE:
  396|  3.46M|    {
  397|  3.46M|        switch (type)
  398|  3.46M|        {
  399|    999|            case jsoncons::bson::bson_type::double_type:
  ------------------
  |  Branch (399:13): [True: 999, False: 3.46M]
  ------------------
  400|    999|            {
  401|    999|                uint8_t buf[sizeof(double)]; 
  402|    999|                std::size_t n = source_.read(buf, sizeof(double));
  403|    999|                state_stack_.back().pos += n;
  404|    999|                if (JSONCONS_UNLIKELY(n != sizeof(double)))
  ------------------
  |  |   79|    999|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 7, False: 992]
  |  |  ------------------
  ------------------
  405|      7|                {
  406|      7|                    ec = bson_errc::unexpected_eof;
  407|      7|                    more_ = false;
  408|      7|                    return;
  409|      7|                }
  410|    992|                double res = binary::little_to_native<double>(buf, sizeof(buf));
  411|    992|                visitor.double_value(res, semantic_tag::none, *this, ec);
  412|    992|                more_ = !cursor_mode_;
  413|    992|                break;
  414|    999|            }
  415|  1.27k|            case jsoncons::bson::bson_type::symbol_type:
  ------------------
  |  Branch (415:13): [True: 1.27k, False: 3.46M]
  ------------------
  416|  1.95k|            case jsoncons::bson::bson_type::min_key_type:
  ------------------
  |  Branch (416:13): [True: 678, False: 3.46M]
  ------------------
  417|  3.51k|            case jsoncons::bson::bson_type::max_key_type:
  ------------------
  |  Branch (417:13): [True: 1.55k, False: 3.46M]
  ------------------
  418|   118k|            case jsoncons::bson::bson_type::string_type:
  ------------------
  |  Branch (418:13): [True: 114k, False: 3.34M]
  ------------------
  419|   118k|            {
  420|   118k|                auto sv = read_string(ec);
  421|   118k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|   118k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 322, False: 117k]
  |  |  ------------------
  ------------------
  422|    322|                {
  423|    322|                    return;
  424|    322|                }
  425|   117k|                auto result = unicode_traits::validate(sv.data(), sv.size());
  426|   117k|                if (JSONCONS_UNLIKELY(result.ec != unicode_traits::unicode_errc()))
  ------------------
  |  |   79|   117k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 9, False: 117k]
  |  |  ------------------
  ------------------
  427|      9|                {
  428|      9|                    ec = bson_errc::invalid_utf8_text_string;
  429|      9|                    more_ = false;
  430|      9|                    return;
  431|      9|                }
  432|   117k|                visitor.string_value(sv, semantic_tag::none, *this, ec);
  433|   117k|                more_ = !cursor_mode_;
  434|   117k|                break;
  435|   117k|            }
  436|  1.14k|            case jsoncons::bson::bson_type::javascript_type:
  ------------------
  |  Branch (436:13): [True: 1.14k, False: 3.46M]
  ------------------
  437|  1.14k|            {
  438|  1.14k|                auto sv = read_string(ec);
  439|  1.14k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  1.14k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 41, False: 1.10k]
  |  |  ------------------
  ------------------
  440|     41|                {
  441|     41|                    return;
  442|     41|                }
  443|  1.10k|                auto result = unicode_traits::validate(sv.data(), sv.size());
  444|  1.10k|                if (JSONCONS_UNLIKELY(result.ec != unicode_traits::unicode_errc()))
  ------------------
  |  |   79|  1.10k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 6, False: 1.09k]
  |  |  ------------------
  ------------------
  445|      6|                {
  446|      6|                    ec = bson_errc::invalid_utf8_text_string;
  447|      6|                    more_ = false;
  448|      6|                    return;
  449|      6|                }
  450|  1.09k|                visitor.string_value(sv, semantic_tag::code, *this, ec);
  451|  1.09k|                more_ = !cursor_mode_;
  452|  1.09k|                break;
  453|  1.10k|            }
  454|  6.16k|            case jsoncons::bson::bson_type::regex_type:
  ------------------
  |  Branch (454:13): [True: 6.16k, False: 3.45M]
  ------------------
  455|  6.16k|            {
  456|  6.16k|                text_buffer_.clear();
  457|  6.16k|                text_buffer_.push_back('/');
  458|  6.16k|                read_cstring(text_buffer_, ec);
  459|  6.16k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  6.16k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 27, False: 6.13k]
  |  |  ------------------
  ------------------
  460|     27|                {
  461|     27|                    return;
  462|     27|                }
  463|  6.13k|                text_buffer_.push_back('/');
  464|  6.13k|                read_cstring(text_buffer_, ec);
  465|  6.13k|                if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  6.13k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 22, False: 6.11k]
  |  |  ------------------
  ------------------
  466|     22|                {
  467|     22|                    return;
  468|     22|                }
  469|  6.11k|                visitor.string_value(text_buffer_, semantic_tag::regex, *this, ec);
  470|  6.11k|                more_ = !cursor_mode_;
  471|  6.11k|                break;
  472|  6.13k|            }
  473|  34.6k|            case jsoncons::bson::bson_type::document_type: 
  ------------------
  |  Branch (473:13): [True: 34.6k, False: 3.42M]
  ------------------
  474|  34.6k|            {
  475|  34.6k|                begin_document(visitor,ec);
  476|  34.6k|                break;
  477|  6.13k|            }
  478|       |
  479|  12.9k|            case jsoncons::bson::bson_type::array_type: 
  ------------------
  |  Branch (479:13): [True: 12.9k, False: 3.45M]
  ------------------
  480|  12.9k|            {
  481|  12.9k|                begin_array(visitor,ec);
  482|  12.9k|                break;
  483|  6.13k|            }
  484|  1.24k|            case jsoncons::bson::bson_type::undefined_type: 
  ------------------
  |  Branch (484:13): [True: 1.24k, False: 3.46M]
  ------------------
  485|  1.24k|                {
  486|  1.24k|                    visitor.null_value(semantic_tag::undefined, *this, ec);
  487|  1.24k|                    more_ = !cursor_mode_;
  488|  1.24k|                    break;
  489|  6.13k|                }
  490|  3.19M|            case jsoncons::bson::bson_type::null_type: 
  ------------------
  |  Branch (490:13): [True: 3.19M, False: 266k]
  ------------------
  491|  3.19M|            {
  492|  3.19M|                visitor.null_value(semantic_tag::none, *this, ec);
  493|  3.19M|                more_ = !cursor_mode_;
  494|  3.19M|                break;
  495|  6.13k|            }
  496|    634|            case jsoncons::bson::bson_type::bool_type:
  ------------------
  |  Branch (496:13): [True: 634, False: 3.46M]
  ------------------
  497|    634|            {
  498|    634|                uint8_t c;
  499|    634|                std::size_t n = source_.read(&c, 1);
  500|    634|                state_stack_.back().pos += n;
  501|    634|                if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   79|    634|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 3, False: 631]
  |  |  ------------------
  ------------------
  502|      3|                {
  503|      3|                    ec = bson_errc::unexpected_eof;
  504|      3|                    more_ = false;
  505|      3|                    return;
  506|      3|                }
  507|    631|                if (JSONCONS_UNLIKELY(!(c == 0 || c == 1)))
  ------------------
  |  |   79|    982|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 10, False: 621]
  |  |  |  Branch (79:50): [True: 280, False: 351]
  |  |  |  Branch (79:50): [True: 341, False: 10]
  |  |  ------------------
  ------------------
  508|     10|                {
  509|     10|                    ec = bson_errc::expected_boolean;
  510|     10|                    more_ = false;
  511|     10|                    return;
  512|     10|                }
  513|    621|                visitor.bool_value(c != 0, semantic_tag::none, *this, ec);
  514|    621|                more_ = !cursor_mode_;
  515|    621|                break;
  516|    631|            }
  517|  7.51k|            case jsoncons::bson::bson_type::int32_type: 
  ------------------
  |  Branch (517:13): [True: 7.51k, False: 3.45M]
  ------------------
  518|  7.51k|            {
  519|  7.51k|                uint8_t buf[sizeof(int32_t)]; 
  520|  7.51k|                std::size_t n = source_.read(buf, sizeof(int32_t));
  521|  7.51k|                state_stack_.back().pos += n;
  522|  7.51k|                if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   79|  7.51k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 4, False: 7.50k]
  |  |  ------------------
  ------------------
  523|      4|                {
  524|      4|                    ec = bson_errc::unexpected_eof;
  525|      4|                    more_ = false;
  526|      4|                    return;
  527|      4|                }
  528|  7.50k|                auto val = binary::little_to_native<int32_t>(buf, sizeof(buf));
  529|  7.50k|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  530|  7.50k|                more_ = !cursor_mode_;
  531|  7.50k|                break;
  532|  7.51k|            }
  533|       |
  534|  3.97k|            case jsoncons::bson::bson_type::timestamp_type: 
  ------------------
  |  Branch (534:13): [True: 3.97k, False: 3.46M]
  ------------------
  535|  3.97k|            {
  536|  3.97k|                uint8_t buf[sizeof(uint64_t)]; 
  537|  3.97k|                std::size_t n = source_.read(buf, sizeof(uint64_t));
  538|  3.97k|                state_stack_.back().pos += n;
  539|  3.97k|                if (JSONCONS_UNLIKELY(n != sizeof(uint64_t)))
  ------------------
  |  |   79|  3.97k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 7, False: 3.96k]
  |  |  ------------------
  ------------------
  540|      7|                {
  541|      7|                    ec = bson_errc::unexpected_eof;
  542|      7|                    more_ = false;
  543|      7|                    return;
  544|      7|                }
  545|  3.96k|                auto val = binary::little_to_native<uint64_t>(buf, sizeof(buf));
  546|  3.96k|                visitor.uint64_value(val, semantic_tag::none, *this, ec);
  547|  3.96k|                more_ = !cursor_mode_;
  548|  3.96k|                break;
  549|  3.97k|            }
  550|       |
  551|  6.46k|            case jsoncons::bson::bson_type::int64_type: 
  ------------------
  |  Branch (551:13): [True: 6.46k, False: 3.45M]
  ------------------
  552|  6.46k|            {
  553|  6.46k|                uint8_t buf[sizeof(int64_t)]; 
  554|  6.46k|                std::size_t n = source_.read(buf, sizeof(int64_t));
  555|  6.46k|                state_stack_.back().pos += n;
  556|  6.46k|                if (JSONCONS_UNLIKELY(n != sizeof(int64_t)))
  ------------------
  |  |   79|  6.46k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 6, False: 6.45k]
  |  |  ------------------
  ------------------
  557|      6|                {
  558|      6|                    ec = bson_errc::unexpected_eof;
  559|      6|                    more_ = false;
  560|      6|                    return;
  561|      6|                }
  562|  6.45k|                auto val = binary::little_to_native<int64_t>(buf, sizeof(buf));
  563|  6.45k|                visitor.int64_value(val, semantic_tag::none, *this, ec);
  564|  6.45k|                more_ = !cursor_mode_;
  565|  6.45k|                break;
  566|  6.46k|            }
  567|       |
  568|  2.52k|            case jsoncons::bson::bson_type::datetime_type: 
  ------------------
  |  Branch (568:13): [True: 2.52k, False: 3.46M]
  ------------------
  569|  2.52k|            {
  570|  2.52k|                uint8_t buf[sizeof(int64_t)]; 
  571|  2.52k|                std::size_t n = source_.read(buf, sizeof(int64_t));
  572|  2.52k|                state_stack_.back().pos += n;
  573|  2.52k|                if (JSONCONS_UNLIKELY(n != sizeof(int64_t)))
  ------------------
  |  |   79|  2.52k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 7, False: 2.51k]
  |  |  ------------------
  ------------------
  574|      7|                {
  575|      7|                    ec = bson_errc::unexpected_eof;
  576|      7|                    more_ = false;
  577|      7|                    return;
  578|      7|                }
  579|  2.51k|                auto val = binary::little_to_native<int64_t>(buf, sizeof(buf));
  580|  2.51k|                visitor.int64_value(val, semantic_tag::epoch_milli, *this, ec);
  581|  2.51k|                more_ = !cursor_mode_;
  582|  2.51k|                break;
  583|  2.52k|            }
  584|  18.6k|            case jsoncons::bson::bson_type::binary_type: 
  ------------------
  |  Branch (584:13): [True: 18.6k, False: 3.44M]
  ------------------
  585|  18.6k|            {
  586|  18.6k|                uint8_t buf[sizeof(int32_t)]; 
  587|  18.6k|                std::size_t n = source_.read(buf, sizeof(int32_t));
  588|  18.6k|                state_stack_.back().pos += n;
  589|  18.6k|                if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   79|  18.6k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 3, False: 18.6k]
  |  |  ------------------
  ------------------
  590|      3|                {
  591|      3|                    ec = bson_errc::unexpected_eof;
  592|      3|                    more_ = false;
  593|      3|                    return;
  594|      3|                }
  595|  18.6k|                const auto len = binary::little_to_native<int32_t>(buf, sizeof(buf));
  596|  18.6k|                if (JSONCONS_UNLIKELY(len < 0))
  ------------------
  |  |   79|  18.6k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 40, False: 18.6k]
  |  |  ------------------
  ------------------
  597|     40|                {
  598|     40|                    ec = bson_errc::length_is_negative;
  599|     40|                    more_ = false;
  600|     40|                    return;
  601|     40|                }
  602|  18.6k|                uint8_t subtype;
  603|  18.6k|                n = source_.read(&subtype, 1);
  604|  18.6k|                state_stack_.back().pos += n;
  605|  18.6k|                if (JSONCONS_UNLIKELY(n != 1))
  ------------------
  |  |   79|  18.6k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 8, False: 18.6k]
  |  |  ------------------
  ------------------
  606|      8|                {
  607|      8|                    ec = bson_errc::unexpected_eof;
  608|      8|                    more_ = false;
  609|      8|                    return;
  610|      8|                }
  611|       |
  612|  18.6k|                auto data = source_.read_span(len, bytes_buffer_);
  613|  18.6k|                if (JSONCONS_UNLIKELY(data.size() != static_cast<std::size_t>(len)))
  ------------------
  |  |   79|  18.6k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 331, False: 18.3k]
  |  |  ------------------
  ------------------
  614|    331|                {
  615|    331|                    ec = bson_errc::unexpected_eof;
  616|    331|                    more_ = false;
  617|    331|                    return;
  618|    331|                }
  619|  18.3k|                state_stack_.back().pos += data.size();
  620|       |
  621|  18.3k|                visitor.byte_string_value(byte_string_view(data.data(), data.size()), subtype, *this, ec);
  622|  18.3k|                more_ = !cursor_mode_;
  623|  18.3k|                break;
  624|  18.6k|            }
  625|  37.6k|            case jsoncons::bson::bson_type::decimal128_type: 
  ------------------
  |  Branch (625:13): [True: 37.6k, False: 3.42M]
  ------------------
  626|  37.6k|            {
  627|  37.6k|                uint8_t buf[sizeof(uint64_t)*2]; 
  628|  37.6k|                std::size_t n = source_.read(buf, sizeof(buf));
  629|  37.6k|                state_stack_.back().pos += n;
  630|  37.6k|                if (JSONCONS_UNLIKELY(n != sizeof(buf)))
  ------------------
  |  |   79|  37.6k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 13, False: 37.6k]
  |  |  ------------------
  ------------------
  631|     13|                {
  632|     13|                    ec = bson_errc::unexpected_eof;
  633|     13|                    more_ = false;
  634|     13|                    return;
  635|     13|                }
  636|       |
  637|  37.6k|                decimal128_t dec;
  638|  37.6k|                dec.low = binary::little_to_native<uint64_t>(buf, sizeof(uint64_t));
  639|  37.6k|                dec.high = binary::little_to_native<uint64_t>(buf+sizeof(uint64_t), sizeof(uint64_t));
  640|       |
  641|  37.6k|                text_buffer_.clear();
  642|  37.6k|                text_buffer_.resize(bson::decimal128_limits::buf_size);
  643|  37.6k|                auto r = bson::decimal128_to_chars(&text_buffer_[0], &text_buffer_[0]+text_buffer_.size(), dec);
  644|  37.6k|                visitor.string_value(string_view(text_buffer_.data(),static_cast<std::size_t>(r.ptr-text_buffer_.data())), semantic_tag::float128, *this, ec);
  645|  37.6k|                more_ = !cursor_mode_;
  646|  37.6k|                break;
  647|  37.6k|            }
  648|  13.5k|            case jsoncons::bson::bson_type::object_id_type: 
  ------------------
  |  Branch (648:13): [True: 13.5k, False: 3.45M]
  ------------------
  649|  13.5k|            {
  650|  13.5k|                uint8_t buf[12]; 
  651|  13.5k|                std::size_t n = source_.read(buf, sizeof(buf));
  652|  13.5k|                state_stack_.back().pos += n;
  653|  13.5k|                if (JSONCONS_UNLIKELY(n != sizeof(buf)))
  ------------------
  |  |   79|  13.5k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 7, False: 13.4k]
  |  |  ------------------
  ------------------
  654|      7|                {
  655|      7|                    ec = bson_errc::unexpected_eof;
  656|      7|                    more_ = false;
  657|      7|                    return;
  658|      7|                }
  659|       |
  660|  13.4k|                oid_t oid(buf);
  661|  13.4k|                to_string(oid, text_buffer_);
  662|       |
  663|  13.4k|                visitor.string_value(text_buffer_, semantic_tag::id, *this, ec);
  664|  13.4k|                more_ = !cursor_mode_;
  665|  13.4k|                break;
  666|  13.5k|            }
  667|     78|            default:
  ------------------
  |  Branch (667:13): [True: 78, False: 3.46M]
  ------------------
  668|     78|            {
  669|     78|                ec = bson_errc::unknown_type;
  670|     78|                more_ = false;
  671|     78|                return;
  672|  13.5k|            }
  673|  3.46M|        }
  674|  3.46M|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11read_stringERNS3_10error_codeE:
  698|   119k|    {
  699|   119k|        std::size_t offset = 0;
  700|       |
  701|   119k|        uint8_t buf[sizeof(int32_t)]; 
  702|   119k|        std::size_t n = source_.read(buf, sizeof(int32_t));
  703|   119k|        if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   79|   119k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 45, False: 119k]
  |  |  ------------------
  ------------------
  704|     45|        {
  705|     45|            ec = bson_errc::unexpected_eof;
  706|     45|            more_ = false;
  707|     45|            return string_view{};
  708|     45|        }
  709|   119k|        offset += n;
  710|       |
  711|   119k|        auto len = binary::little_to_native<int32_t>(buf, sizeof(buf));
  712|   119k|        if (JSONCONS_UNLIKELY(len < 1))
  ------------------
  |  |   79|   119k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 38, False: 119k]
  |  |  ------------------
  ------------------
  713|     38|        {
  714|     38|            ec = bson_errc::string_length_is_non_positive;
  715|     38|            more_ = false;
  716|     38|            return string_view{};
  717|     38|        }
  718|       |
  719|   119k|        std::size_t size = static_cast<std::size_t>(len) - static_cast<std::size_t>(1);
  720|   119k|        auto data = source_.read_span(size, text_buffer_);
  721|   119k|        if (JSONCONS_UNLIKELY(data.size() != size))
  ------------------
  |  |   79|   119k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 261, False: 118k]
  |  |  ------------------
  ------------------
  722|    261|        {
  723|    261|            ec = bson_errc::unexpected_eof;
  724|    261|            more_ = false;
  725|    261|            return string_view{};
  726|    261|        }
  727|   118k|        offset += data.size();
  728|       |
  729|   118k|        uint8_t c;
  730|   118k|        if (JSONCONS_UNLIKELY(source_.read(&c, 1) != 1))
  ------------------
  |  |   79|   118k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 19, False: 118k]
  |  |  ------------------
  ------------------
  731|     19|        {
  732|     19|            ec = bson_errc::unexpected_eof;
  733|     19|            more_ = false;
  734|     19|            return string_view{};
  735|     19|        }
  736|   118k|        ++offset;
  737|       |
  738|   118k|        state_stack_.back().pos += offset;
  739|   118k|        return string_view{reinterpret_cast<const char*>(data.data()), data.size()};
  740|   118k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE11begin_arrayERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  326|  12.9k|    {
  327|  12.9k|        if (JSONCONS_UNLIKELY(static_cast<int>(state_stack_.size()) > max_nesting_depth_))
  ------------------
  |  |   79|  12.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 1, False: 12.9k]
  |  |  ------------------
  ------------------
  328|      1|        {
  329|      1|            ec = bson_errc::max_nesting_depth_exceeded;
  330|      1|            more_ = false;
  331|      1|            return;
  332|      1|        } 
  333|  12.9k|        uint8_t buf[sizeof(int32_t)]; 
  334|  12.9k|        std::size_t n = source_.read(buf, sizeof(int32_t));
  335|  12.9k|        if (JSONCONS_UNLIKELY(n != sizeof(int32_t)))
  ------------------
  |  |   79|  12.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 9, False: 12.8k]
  |  |  ------------------
  ------------------
  336|      9|        {
  337|      9|            ec = bson_errc::unexpected_eof;
  338|      9|            more_ = false;
  339|      9|            return;
  340|      9|        }
  341|  12.8k|        auto length = binary::little_to_native<int32_t>(buf, sizeof(buf));
  342|       |
  343|  12.8k|        visitor.begin_array(semantic_tag::none, *this, ec);
  344|  12.8k|        more_ = !cursor_mode_;
  345|  12.8k|        if (JSONCONS_UNLIKELY(ec))
  ------------------
  |  |   79|  12.8k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 12.8k]
  |  |  ------------------
  ------------------
  346|      0|        {
  347|      0|            return;
  348|      0|        }
  349|  12.8k|        state_stack_.emplace_back(parse_mode::array, length, n);
  350|  12.8k|    }
_ZN8jsoncons4bson17basic_bson_parserINS_13stream_sourceIhNSt3__19allocatorIhEEEENS4_IcEEE9end_arrayERNS_18basic_json_visitorIcEERNS3_10error_codeE:
  353|  1.94k|    {
  354|  1.94k|        JSONCONS_ASSERT(state_stack_.size() >= 2);
  ------------------
  |  |   54|  1.94k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (54:32): [True: 0, False: 1.94k]
  |  |  ------------------
  |  |   55|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   56|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  355|       |
  356|  1.94k|        visitor.end_array(*this, ec);
  357|  1.94k|        more_ = !cursor_mode_;
  358|  1.94k|        if (level() == mark_level_)
  ------------------
  |  Branch (358:13): [True: 0, False: 1.94k]
  ------------------
  359|      0|        {
  360|      0|            more_ = false;
  361|      0|        }
  362|  1.94k|        if (JSONCONS_UNLIKELY(state_stack_.back().pos != state_stack_.back().length))
  ------------------
  |  |   79|  1.94k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 105, False: 1.83k]
  |  |  ------------------
  ------------------
  363|    105|        {
  364|    105|            ec = bson_errc::size_mismatch;
  365|    105|            more_ = false;
  366|    105|            return;
  367|    105|        }
  368|  1.83k|        std::size_t pos = state_stack_.back().pos;
  369|  1.83k|        state_stack_.pop_back();
  370|  1.83k|        state_stack_.back().pos += pos;
  371|  1.83k|    }

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

