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

_ZN8jsoncons18basic_json_visitorIcEC2Ev:
  103|  3.06k|        basic_json_visitor() = default;
_ZN8jsoncons19typed_array_visitorD2Ev:
   33|  3.06k|        virtual ~typed_array_visitor() = default;
_ZN8jsoncons18basic_json_visitorIcE12uint64_valueEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  414|  3.94k|        {
  415|  3.94k|            visit_uint64(value, tag, context, ec);
  416|  3.94k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.94k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  417|  3.94k|        }
_ZN8jsoncons18basic_json_visitorIcE9end_arrayERKNS_11ser_contextERNSt3__110error_codeE:
  351|  1.93k|        {
  352|  1.93k|            visit_end_array(context, ec);
  353|  1.93k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  1.93k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  354|  1.93k|        }
_ZN8jsoncons18basic_json_visitorIcE11int64_valueElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  423|  14.9k|        {
  424|  14.9k|            visit_int64(value, tag, context, ec);
  425|  14.9k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  14.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  426|  14.9k|        }
_ZN8jsoncons18basic_json_visitorIcE12double_valueEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  441|    943|        {
  442|    943|            visit_double(value, tag, context, ec);
  443|    943|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|    943|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  444|    943|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  318|  37.4k|        {
  319|  37.4k|            visit_begin_object(tag, context, ec);
  320|  37.4k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  37.4k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  321|  37.4k|        }
_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|  2.87k|        {
  334|  2.87k|            visit_end_object(context, ec);
  335|  2.87k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.87k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  336|  2.87k|        }
_ZN8jsoncons18basic_json_visitorIcE12string_valueERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  383|   171k|        {
  384|   171k|            visit_string(value, tag, context, ec);
  385|   171k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   171k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  386|   171k|        }
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  339|  12.2k|        {
  340|  12.2k|            visit_begin_array(tag, context, ec);
  341|  12.2k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  12.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  342|  12.2k|        }
_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|  17.0k|        {
  406|  17.0k|            visit_byte_string(byte_string_view(reinterpret_cast<const uint8_t*>(b.data()),b.size()), raw_tag, context, ec);
  407|  17.0k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  17.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  408|  17.0k|        }
_ZN8jsoncons18basic_json_visitorIcE5flushEv:
  108|      7|        {
  109|      7|            visit_flush();
  110|      7|        }

_ZN8jsoncons6nonstd14integer_limitsIivE6lowestEv:
  110|  19.4k|        {
  111|  19.4k|            return std::numeric_limits<T>::lowest();
  112|  19.4k|        }
_ZN8jsoncons6nonstd14integer_limitsIivE3maxEv:
  102|  5.86k|        {
  103|  5.86k|            return (std::numeric_limits<T>::max)();
  104|  5.86k|        }

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

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

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|  3.06k|    {
  194|  3.06k|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 3.06k, False: 0]
  ------------------
  195|  3.06k|        {
  196|  3.06k|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|  3.06k|        }
  198|  3.06k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|  3.06k|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|  3.06k|          chunk_size_(default_max_chunk_size)
  178|  3.06k|    {
  179|  3.06k|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|  3.06k|        data_end_ = chunk_;
  181|  3.06k|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|  3.06k|      : std::basic_istream<CharT>(&nb_)
   58|  3.06k|    {
   59|  3.06k|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|  3.06k|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  3.06k|    {
  277|  3.06k|        return stream_ptr_->bad();  
  278|  3.06k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  377|  25.6M|    {
  378|  25.6M|        std::size_t len = 0;
  379|  25.6M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 25.6M, False: 6.19k]
  ------------------
  380|  25.6M|        {
  381|  25.6M|            len = (std::min)(remaining_, length);
  382|  25.6M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  25.6M|            data_end_ += len;
  384|  25.6M|            remaining_ -= len;
  385|  25.6M|            position_ += len;
  386|  25.6M|        }
  387|  25.6M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 25.6M, False: 8.28k]
  ------------------
  388|  25.6M|        {
  389|  25.6M|            return len;
  390|  25.6M|        }
  391|  8.28k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 8.28k, False: 0]
  ------------------
  392|  8.28k|        {
  393|  8.28k|            data_end_ = chunk_;
  394|  8.28k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  8.28k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 6.19k, False: 2.08k]
  ------------------
  396|  6.19k|            {
  397|  6.19k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  6.19k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  6.19k|                data_end_ += len2;
  400|  6.19k|                remaining_ -= len2;
  401|  6.19k|                position_ += len2;
  402|  6.19k|                len += len2;
  403|  6.19k|            }
  404|  8.28k|            return len;
  405|  8.28k|        }
  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|  25.6M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  9.30k|    {
  443|  9.30k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 2.10k, False: 7.20k]
  ------------------
  444|  2.10k|        {
  445|  2.10k|            return 0;
  446|  2.10k|        }
  447|       |
  448|  7.20k|        JSONCONS_TRY
  ------------------
  |  |   37|  7.20k|    #define JSONCONS_TRY try
  ------------------
  449|  7.20k|        {
  450|  7.20k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  7.20k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  7.20k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 3.04k, False: 4.16k]
  ------------------
  454|  3.04k|            {
  455|  3.04k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|  3.04k|            }
  457|  7.20k|            return length;
  458|  7.20k|        }
  459|  7.20k|        JSONCONS_CATCH(const std::exception&)     
  460|  7.20k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  7.20k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6nonstd4spanIKhLm18446744073709551615EEEmOT_:
  352|   121k|    {
  353|   121k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   79|   121k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 1.48k, False: 119k]
  |  |  ------------------
  ------------------
  354|  1.48k|        {
  355|  1.48k|            return span<const value_type>{};
  356|  1.48k|        }
  357|   119k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 182, False: 119k]
  |  Branch (357:32): [True: 51, False: 131]
  ------------------
  358|     51|        {
  359|     51|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     51|            data_end_ = chunk_;
  361|     51|        }
  362|   119k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 442, False: 119k]
  ------------------
  363|    442|        {
  364|    442|            buffer.clear();
  365|    442|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    442|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    442|        }
  368|       |
  369|   119k|        const value_type* data = data_end_;
  370|   119k|        data_end_ += length;
  371|   119k|        remaining_ -= length;
  372|   119k|        position_ += length;
  373|   119k|        return span<const value_type>(data, length);
  374|   119k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr6nonstd7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  746|    442|    {
  747|    442|        std::size_t unread = length;
  748|       |
  749|  1.61k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 1.43k, False: 179]
  |  Branch (749:30): [True: 1.17k, False: 263]
  ------------------
  750|  1.17k|        {
  751|  1.17k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 449, False: 727]
  |  Branch (751:44): [True: 448, False: 1]
  ------------------
  752|    448|            {
  753|    448|                std::size_t n = source.chunk_size();
  754|    448|                std::size_t offset = buffer.size();
  755|    448|                buffer.resize(offset+n);
  756|    448|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    448|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    448|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 76, False: 372]
  |  |  ------------------
  ------------------
  758|     76|                {
  759|     76|                    buffer.resize(offset+actual);
  760|     76|                }
  761|    448|                unread -= actual;
  762|    448|            }
  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.17k|        }
  776|    442|        return length - unread;
  777|    442|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  3.65k|    {
  272|  3.65k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 1.55k, False: 2.10k]
  |  Branch (272:35): [True: 591, False: 960]
  ------------------
  273|  3.65k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  3.06k|    {
  347|  3.06k|        return remaining_;
  348|  3.06k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  4.02k|    {
  262|  4.02k|        return chunk_size_;
  263|  4.02k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    955|    {
  436|    955|        auto len = fill_buffer(chunk, chunk_size);
  437|    955|        position_ += len;
  438|    955|        return len;
  439|    955|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6nonstd4spanIKhLm18446744073709551615EEEmOT_:
  352|  17.4k|    {
  353|  17.4k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   79|  17.4k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 7.34k, False: 10.0k]
  |  |  ------------------
  ------------------
  354|  7.34k|        {
  355|  7.34k|            return span<const value_type>{};
  356|  7.34k|        }
  357|  10.0k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 151, False: 9.91k]
  |  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.0k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 621, False: 9.44k]
  ------------------
  363|    621|        {
  364|    621|            buffer.clear();
  365|    621|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    621|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    621|        }
  368|       |
  369|  9.44k|        const value_type* data = data_end_;
  370|  9.44k|        data_end_ += length;
  371|  9.44k|        remaining_ -= length;
  372|  9.44k|        position_ += length;
  373|  9.44k|        return span<const value_type>(data, length);
  374|  10.0k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr6nonstd7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  746|    621|    {
  747|    621|        std::size_t unread = length;
  748|       |
  749|  2.51k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (749:16): [True: 2.22k, False: 293]
  |  Branch (749:30): [True: 1.89k, False: 328]
  ------------------
  750|  1.89k|        {
  751|  1.89k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (751:17): [True: 511, False: 1.38k]
  |  Branch (751:44): [True: 507, False: 4]
  ------------------
  752|    507|            {
  753|    507|                std::size_t n = source.chunk_size();
  754|    507|                std::size_t offset = buffer.size();
  755|    507|                buffer.resize(offset+n);
  756|    507|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  757|    507|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    507|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 74, False: 433]
  |  |  ------------------
  ------------------
  758|     74|                {
  759|     74|                    buffer.resize(offset+actual);
  760|     74|                }
  761|    507|                unread -= actual;
  762|    507|            }
  763|  1.38k|            else
  764|  1.38k|            {
  765|  1.38k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  766|  1.38k|                std::size_t offset = buffer.size();
  767|  1.38k|                buffer.resize(offset+n);
  768|  1.38k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  769|  1.38k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|  1.38k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 189, False: 1.19k]
  |  |  ------------------
  ------------------
  770|    189|                {
  771|    189|                    buffer.resize(offset + actual);
  772|    189|                }
  773|  1.38k|                unread -= actual;
  774|  1.38k|            }
  775|  1.89k|        }
  776|    621|        return length - unread;
  777|    621|    }

_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: 570k, False: 142k]
  ------------------
  146|   570k|        {
  147|   570k|            *d_first++ = item;
  148|   570k|        }
  149|   142k|    }
_ZN8jsoncons6binary16native_to_littleIlNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  7.74k|    {
  143|  7.74k|        uint8_t buf[sizeof(T)];
  144|  7.74k|        std::memcpy(buf, &val, sizeof(T));
  145|  7.74k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 61.9k, False: 7.74k]
  ------------------
  146|  61.9k|        {
  147|  61.9k|            *d_first++ = item;
  148|  61.9k|        }
  149|  7.74k|    }
_ZN8jsoncons6binary16native_to_littleIjNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  7.98k|    {
  143|  7.98k|        uint8_t buf[sizeof(T)];
  144|  7.98k|        std::memcpy(buf, &val, sizeof(T));
  145|  7.98k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 31.9k, False: 7.98k]
  ------------------
  146|  31.9k|        {
  147|  31.9k|            *d_first++ = item;
  148|  31.9k|        }
  149|  7.98k|    }
_ZN8jsoncons6binary16native_to_littleImNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  70.5k|    {
  143|  70.5k|        uint8_t buf[sizeof(T)];
  144|  70.5k|        std::memcpy(buf, &val, sizeof(T));
  145|  70.5k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 564k, False: 70.5k]
  ------------------
  146|   564k|        {
  147|   564k|            *d_first++ = item;
  148|   564k|        }
  149|  70.5k|    }
_ZN8jsoncons6binary16native_to_littleIdNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|    943|    {
  143|    943|        uint8_t buf[sizeof(T)];
  144|    943|        std::memcpy(buf, &val, sizeof(T));
  145|    943|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 7.54k, False: 943]
  ------------------
  146|  7.54k|        {
  147|  7.54k|            *d_first++ = item;
  148|  7.54k|        }
  149|    943|    }
_ZN8jsoncons6binary16little_to_nativeIiNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   194k|    {
  198|   194k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 194k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   194k|        T val;
  203|   194k|        std::memcpy(&val,first,sizeof(T));
  204|   194k|        return val;
  205|   194k|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|    943|    {
  198|    943|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 943]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|    943|        T val;
  203|    943|        std::memcpy(&val,first,sizeof(T));
  204|    943|        return val;
  205|    943|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  71.4k|    {
  198|  71.4k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 71.4k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  71.4k|        T val;
  203|  71.4k|        std::memcpy(&val,first,sizeof(T));
  204|  71.4k|        return val;
  205|  71.4k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  8.33k|    {
  198|  8.33k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 8.33k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  8.33k|        T val;
  203|  8.33k|        std::memcpy(&val,first,sizeof(T));
  204|  8.33k|        return val;
  205|  8.33k|    }

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

_ZN8jsoncons10to_integerIicEENSt3__19enable_ifIXaasr6nonstd14integer_limitsIT_EE14is_specializedsr6nonstd14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  580|  25.2k|{
  581|  25.2k|    n = 0;
  582|       |
  583|  25.2k|    if (length == 0)
  ------------------
  |  Branch (583:9): [True: 9, False: 25.2k]
  ------------------
  584|      9|    {
  585|      9|        return to_number_result<CharT>(s, std::errc::invalid_argument);
  586|      9|    }
  587|       |
  588|  25.2k|    bool is_negative = *s == '-' ? true : false;
  ------------------
  |  Branch (588:24): [True: 19.4k, False: 5.86k]
  ------------------
  589|  25.2k|    if (is_negative)
  ------------------
  |  Branch (589:9): [True: 19.4k, False: 5.86k]
  ------------------
  590|  19.4k|    {
  591|  19.4k|        ++s;
  592|  19.4k|        --length;
  593|  19.4k|    }
  594|       |
  595|  25.2k|    using U = typename nonstd::make_unsigned<T>::type;
  596|       |
  597|  25.2k|    U u;
  598|  25.2k|    auto ru = to_integer(s, length, u);
  599|  25.2k|    if (ru.ec != std::errc{})
  ------------------
  |  Branch (599:9): [True: 0, False: 25.2k]
  ------------------
  600|      0|    {
  601|      0|        return to_number_result<CharT>(ru.ptr, ru.ec);
  602|      0|    }
  603|  25.2k|    if (is_negative)
  ------------------
  |  Branch (603:9): [True: 19.4k, False: 5.86k]
  ------------------
  604|  19.4k|    {
  605|  19.4k|        if (u > static_cast<U>(-((nonstd::integer_limits<T>::lowest)()+T(1))) + U(1))
  ------------------
  |  Branch (605:13): [True: 0, False: 19.4k]
  ------------------
  606|      0|        {
  607|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  608|      0|        }
  609|  19.4k|        else
  610|  19.4k|        {
  611|  19.4k|            n = static_cast<T>(U(0) - u);
  612|  19.4k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  613|  19.4k|        }
  614|  19.4k|    }
  615|  5.86k|    else
  616|  5.86k|    {
  617|  5.86k|        if (u > static_cast<U>((nonstd::integer_limits<T>::max)()))
  ------------------
  |  Branch (617:13): [True: 0, False: 5.86k]
  ------------------
  618|      0|        {
  619|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  620|      0|        }
  621|  5.86k|        else
  622|  5.86k|        {
  623|  5.86k|            n = static_cast<T>(u);
  624|  5.86k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  625|  5.86k|        }
  626|  5.86k|    }
  627|  25.2k|}
_ZN8jsoncons16to_number_resultIcEC2EPKcNSt3__14errcE:
  164|  50.5k|        : ptr(ptr_), ec(ec_)
  165|  50.5k|    {
  166|  50.5k|    }
_ZN8jsoncons10to_integerIjcEENSt3__19enable_ifIXaasr6nonstd14integer_limitsIT_EE14is_specializedntsr6nonstd14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  397|  25.2k|{
  398|  25.2k|    n = 0;
  399|       |
  400|  25.2k|    integer_chars_state state = integer_chars_state::initial;
  401|       |
  402|  25.2k|    const CharT* end = s + length; 
  403|  75.8k|    while (s < end)
  ------------------
  |  Branch (403:12): [True: 50.5k, False: 25.2k]
  ------------------
  404|  50.5k|    {
  405|  50.5k|        switch(state)
  406|  50.5k|        {
  407|  25.2k|            case integer_chars_state::initial:
  ------------------
  |  Branch (407:13): [True: 25.2k, False: 25.2k]
  ------------------
  408|  25.2k|            {
  409|  25.2k|                switch(*s)
  410|  25.2k|                {
  411|      0|                    case '0':
  ------------------
  |  Branch (411:21): [True: 0, False: 25.2k]
  ------------------
  412|      0|                        state = integer_chars_state::integer; // Could be binary, octal, hex 
  413|      0|                        ++s;
  414|      0|                        break;
  415|  25.2k|                    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: 590, False: 24.6k]
  |  Branch (415:30): [True: 1.05k, False: 24.2k]
  |  Branch (415:39): [True: 13.5k, False: 11.7k]
  |  Branch (415:48): [True: 3.11k, False: 22.1k]
  |  Branch (415:57): [True: 1.59k, False: 23.6k]
  |  Branch (415:66): [True: 3.42k, False: 21.8k]
  |  Branch (415:75): [True: 683, False: 24.5k]
  |  Branch (415:84): [True: 573, False: 24.7k]
  |  Branch (415:94): [True: 735, False: 24.5k]
  ------------------
  416|  25.2k|                        state = integer_chars_state::decimal;
  417|  25.2k|                        break;
  418|      0|                    default:
  ------------------
  |  Branch (418:21): [True: 0, False: 25.2k]
  ------------------
  419|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  420|  25.2k|                }
  421|  25.2k|                break;
  422|  25.2k|            }
  423|  25.2k|            case integer_chars_state::integer:
  ------------------
  |  Branch (423:13): [True: 0, False: 50.5k]
  ------------------
  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: 50.5k]
  ------------------
  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: 50.5k]
  ------------------
  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|  25.2k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (505:13): [True: 25.2k, False: 25.2k]
  ------------------
  506|  25.2k|            {
  507|  25.2k|                static constexpr T max_value = (nonstd::integer_limits<T>::max)();
  508|  25.2k|                static constexpr T max_value_div_10 = max_value / 10;
  509|   121k|                for (; s < end; ++s)
  ------------------
  |  Branch (509:24): [True: 96.1k, False: 25.2k]
  ------------------
  510|  96.1k|                {
  511|  96.1k|                    T x = 0;
  512|  96.1k|                    switch(*s)
  513|  96.1k|                    {
  514|  96.1k|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (514:25): [True: 11.4k, False: 84.7k]
  |  Branch (514:34): [True: 7.93k, False: 88.1k]
  |  Branch (514:43): [True: 12.3k, False: 83.7k]
  |  Branch (514:52): [True: 18.3k, False: 77.7k]
  |  Branch (514:61): [True: 10.2k, False: 85.8k]
  |  Branch (514:70): [True: 4.67k, False: 91.4k]
  |  Branch (514:79): [True: 6.12k, False: 89.9k]
  |  Branch (514:88): [True: 13.3k, False: 82.7k]
  |  Branch (514:97): [True: 6.73k, False: 89.3k]
  |  Branch (514:107): [True: 4.86k, False: 91.2k]
  ------------------
  515|  96.1k|                            x = static_cast<T>(*s) - static_cast<T>('0');
  516|  96.1k|                            break;
  517|      0|                        default:
  ------------------
  |  Branch (517:25): [True: 0, False: 96.1k]
  ------------------
  518|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  519|  96.1k|                    }
  520|  96.1k|                    if (n > max_value_div_10)
  ------------------
  |  Branch (520:25): [True: 0, False: 96.1k]
  ------------------
  521|      0|                    {
  522|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  523|      0|                    }
  524|  96.1k|                    n = n * 10;
  525|  96.1k|                    if (n > max_value - x)
  ------------------
  |  Branch (525:25): [True: 0, False: 96.1k]
  ------------------
  526|      0|                    {
  527|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  528|      0|                    }
  529|  96.1k|                    n += x;
  530|  96.1k|                }
  531|  25.2k|                break;
  532|  25.2k|            }
  533|  25.2k|            case integer_chars_state::base16:
  ------------------
  |  Branch (533:13): [True: 0, False: 50.5k]
  ------------------
  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: 50.5k]
  ------------------
  570|      0|                JSONCONS_UNREACHABLE();
  ------------------
  |  |   80|      0|#define JSONCONS_UNREACHABLE() __builtin_unreachable()
  ------------------
  571|      0|                break;
  572|  50.5k|        }
  573|  50.5k|    }
  574|  25.2k|    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: 25.2k]
  ------------------
  575|  25.2k|}

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

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr6nonstd8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|   547k|    {
 1148|   547k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|   547k|        const uint8_t* end = it + length;
 1150|       |
 1151|   547k|        unicode_errc  result{};
 1152|  1.80M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 1.25M, False: 547k]
  ------------------
 1153|  1.25M|        {
 1154|  1.25M|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 992k, False: 265k]
  ------------------
 1155|   992k|            {
 1156|  6.91M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  326|  1.98M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (326:32): [True: 990k, False: 1.37k]
  |  |  |  Branch (326:34): [True: 989k, False: 792]
  |  |  |  Branch (326:36): [True: 989k, False: 650]
  |  |  |  Branch (326:38): [True: 988k, False: 1.22k]
  |  |  |  Branch (326:40): [True: 987k, False: 958]
  |  |  |  Branch (326:42): [True: 986k, False: 503]
  |  |  |  Branch (326:44): [True: 985k, False: 884]
  |  |  |  Branch (326:46): [True: 984k, False: 731]
  |  |  ------------------
  ------------------
 1157|   984k|                continue;
 1158|  6.91M|            }
 1159|   272k|    non_ascii:
 1160|   272k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|   272k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 37, False: 272k]
  ------------------
 1162|     37|            {
 1163|     37|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     37|            }
 1165|   272k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 134, False: 272k]
  ------------------
 1166|    134|            {
 1167|    134|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    134|            }
 1169|   272k|            it += len;
 1170|   272k|        }
 1171|   547k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|   547k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|   272k|    {
  306|   272k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|   272k|        const uint8_t* end = it+length;
  308|       |
  309|   272k|        uint8_t byte;
  310|   272k|        switch (length) {
  311|     35|        default:
  ------------------
  |  Branch (311:9): [True: 35, False: 272k]
  ------------------
  312|     35|            return unicode_errc::over_long_utf8_sequence;
  313|  1.41k|        case 4:
  ------------------
  |  Branch (313:9): [True: 1.41k, False: 271k]
  ------------------
  314|  1.41k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 8, False: 1.40k]
  ------------------
  315|      8|                return unicode_errc::bad_continuation_byte;
  316|  1.40k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  565|  1.40k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  3.41k|        case 3:
  ------------------
  |  Branch (317:9): [True: 2.01k, False: 270k]
  ------------------
  318|  3.41k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 10, False: 3.40k]
  ------------------
  319|     10|                return unicode_errc::bad_continuation_byte;
  320|  3.40k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  565|  3.40k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  7.27k|        case 2:
  ------------------
  |  Branch (321:9): [True: 3.86k, False: 268k]
  ------------------
  322|  7.27k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 21, False: 7.25k]
  ------------------
  323|     21|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  7.25k|            switch (*it) 
  326|  7.25k|            {
  327|       |                // no fall-through in this inner switch
  328|  1.64k|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 1.64k, False: 5.61k]
  |  Branch (328:32): [True: 7, False: 1.63k]
  ------------------
  329|  1.63k|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 251, False: 6.99k]
  |  Branch (329:32): [True: 2, False: 249]
  ------------------
  330|    318|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 318, False: 6.93k]
  |  Branch (330:32): [True: 6, False: 312]
  ------------------
  331|    793|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 793, False: 6.45k]
  |  Branch (331:32): [True: 3, False: 790]
  ------------------
  332|  4.24k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 4.24k, False: 3.00k]
  |  Branch (332:32): [True: 0, False: 4.24k]
  ------------------
  333|  7.25k|            }
  334|       |
  335|  7.23k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  565|  7.23k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|   272k|        case 1:
  ------------------
  |  Branch (336:9): [True: 265k, False: 7.32k]
  ------------------
  337|   272k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 7.27k, False: 265k]
  |  Branch (337:32): [True: 41, False: 7.23k]
  ------------------
  338|     41|                return unicode_errc::source_illegal;
  339|   272k|            break;
  340|   272k|        }
  341|   272k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 1, False: 272k]
  ------------------
  342|      1|            return unicode_errc::source_illegal;
  343|       |
  344|   272k|        return unicode_errc();
  345|   272k|    }

_ZN8jsoncons4bson3TP1C2Ev:
   78|  67.4k|        constexpr TP1() : low(0), high(0) {}
_ZN8jsoncons4bson21decimal128_from_charsEPKcS2_RNS0_3TP1E:
  572|  33.7k|    {
  573|  33.7k|        static const string_view inf_str = "inf";
  574|  33.7k|        static const string_view infinity_str = "infinity";
  575|  33.7k|        static const string_view nan_str = "nan";
  576|       |
  577|  33.7k|        ptrdiff_t len = last - first;
  578|       |
  579|  33.7k|        bson_uint128_6464_t significand = {0,0};
  580|       | 
  581|  33.7k|        const char* str_read = first; /* Read pointer for consuming str. */
  582|       | 
  583|       |        /* Parsing state tracking */
  584|  33.7k|        bool is_negative = false;
  585|  33.7k|        bool saw_radix = false;
  586|  33.7k|        bool includes_sign = false; /* True if the input first contains a sign. */
  587|  33.7k|        bool found_nonzero = false;
  588|       | 
  589|  33.7k|        std::size_t significant_digits = 0; /* Total number of significant digits
  590|       |                                        * (no leading or trailing zero) */
  591|  33.7k|        std::size_t ndigits_read = 0;       /* Total number of significand digits read */
  592|  33.7k|        std::size_t ndigits = 0;        /* Total number of digits (no leading zeros) */
  593|  33.7k|        std::size_t radix_position = 0; /* The number of the digits after radix */
  594|  33.7k|        std::size_t first_nonzero = 0;  /* The index of the first non-zero in *str* */
  595|       | 
  596|  33.7k|        uint16_t digits[decimal128_limits::max_digits] = {0};
  597|  33.7k|        uint16_t ndigits_stored = 0;      /* The number of digits in digits */
  598|  33.7k|        uint16_t *digits_insert = digits; /* Insertion pointer for digits */
  599|  33.7k|        std::size_t first_digit = 0;           /* The index of the first non-zero digit */
  600|  33.7k|        std::size_t last_digit = 0;            /* The index of the last digit */
  601|       | 
  602|  33.7k|        int32_t exponent = 0;
  603|  33.7k|        uint64_t significand_high = 0; /* The high 17 digits of the significand */
  604|  33.7k|        uint64_t significand_low = 0;  /* The low 17 digits of the significand */
  605|  33.7k|        uint16_t biased_exponent = 0;  /* The biased exponent */
  606|       | 
  607|  33.7k|        dec.high = 0;
  608|  33.7k|        dec.low = 0;
  609|       | 
  610|  33.7k|        if (*str_read == '+' || *str_read == '-') {
  ------------------
  |  Branch (610:13): [True: 0, False: 33.7k]
  |  Branch (610:33): [True: 7.21k, False: 26.5k]
  ------------------
  611|  7.21k|           is_negative = *(str_read++) == '-';
  612|  7.21k|           includes_sign = true;
  613|  7.21k|        }
  614|       |
  615|       |        /* Check for Infinity or NaN */
  616|  33.7k|        if (!isdigit(*str_read) && *str_read != '.') {
  ------------------
  |  Branch (616:13): [True: 5.70k, False: 28.0k]
  |  Branch (616:36): [True: 5.70k, False: 0]
  ------------------
  617|  5.70k|           if (detail::dec128_istreq (str_read, last, inf_str.data(), inf_str.data()+inf_str.length()) ||
  ------------------
  |  Branch (617:16): [True: 0, False: 5.70k]
  ------------------
  618|  5.70k|               detail::dec128_istreq (str_read, last, infinity_str.data(), infinity_str.data()+infinity_str.length())) 
  ------------------
  |  Branch (618:16): [True: 4.67k, False: 1.02k]
  ------------------
  619|  4.67k|           {
  620|  4.67k|               dec = is_negative ? decimal128_limits::neg_infinity() : decimal128_limits::infinity();
  ------------------
  |  Branch (620:22): [True: 4.24k, False: 434]
  ------------------
  621|  4.67k|              return decimal128_from_chars_result{str_read,std::errc{}};
  622|  4.67k|           } else if (detail::dec128_istreq (str_read, last, nan_str.data(), nan_str.data()+nan_str.length())) {
  ------------------
  |  Branch (622:23): [True: 1.02k, False: 0]
  ------------------
  623|  1.02k|              dec = decimal128_limits::nan();
  624|  1.02k|              return decimal128_from_chars_result{str_read,std::errc{}};
  625|  1.02k|           }
  626|       | 
  627|      0|           dec = decimal128_limits::nan();
  628|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  629|  5.70k|        }
  630|       | 
  631|       |        /* Read digits */
  632|   825k|        while (((isdigit (*str_read) || *str_read == '.')) &&
  ------------------
  |  Branch (632:18): [True: 772k, False: 52.7k]
  |  Branch (632:41): [True: 24.6k, False: 28.0k]
  ------------------
  633|   797k|               (len == -1 || str_read < first + len)) {
  ------------------
  |  Branch (633:17): [True: 0, False: 797k]
  |  Branch (633:30): [True: 797k, False: 0]
  ------------------
  634|   797k|           if (*str_read == '.') {
  ------------------
  |  Branch (634:16): [True: 24.6k, False: 772k]
  ------------------
  635|  24.6k|              if (saw_radix) {
  ------------------
  |  Branch (635:19): [True: 0, False: 24.6k]
  ------------------
  636|      0|                 dec = decimal128_limits::nan();
  637|      0|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  638|      0|              }
  639|       | 
  640|  24.6k|              saw_radix = true;
  641|  24.6k|              str_read++;
  642|  24.6k|              continue;
  643|  24.6k|           }
  644|       | 
  645|   772k|           if (ndigits_stored < 34) {
  ------------------
  |  Branch (645:16): [True: 771k, False: 938]
  ------------------
  646|   771k|              if (*str_read != '0' || found_nonzero) {
  ------------------
  |  Branch (646:19): [True: 701k, False: 70.6k]
  |  Branch (646:39): [True: 65.3k, False: 5.23k]
  ------------------
  647|   766k|                 if (!found_nonzero) {
  ------------------
  |  Branch (647:22): [True: 25.2k, False: 741k]
  ------------------
  648|  25.2k|                    first_nonzero = ndigits_read;
  649|  25.2k|                 }
  650|       | 
  651|   766k|                 found_nonzero = true;
  652|   766k|                 *(digits_insert++) = *(str_read) - '0'; /* Only store 34 digits */
  653|   766k|                 ndigits_stored++;
  654|   766k|              }
  655|   771k|           }
  656|       | 
  657|   772k|           if (found_nonzero) {
  ------------------
  |  Branch (657:16): [True: 767k, False: 5.23k]
  ------------------
  658|   767k|              ndigits++;
  659|   767k|           }
  660|       | 
  661|   772k|           if (saw_radix) {
  ------------------
  |  Branch (661:16): [True: 735k, False: 37.7k]
  ------------------
  662|   735k|              radix_position++;
  663|   735k|           }
  664|       | 
  665|   772k|           ndigits_read++;
  666|   772k|           str_read++;
  667|   772k|        }
  668|       | 
  669|  28.0k|        if (saw_radix && !ndigits_read) {
  ------------------
  |  Branch (669:13): [True: 24.6k, False: 3.37k]
  |  Branch (669:26): [True: 0, False: 24.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|  28.0k|        if (*str_read == 'e' || *str_read == 'E') {
  ------------------
  |  Branch (675:13): [True: 0, False: 28.0k]
  |  Branch (675:33): [True: 25.2k, False: 2.75k]
  ------------------
  676|  25.2k|           ++str_read;
  677|  25.2k|           if (*str_read == '+') {
  ------------------
  |  Branch (677:16): [True: 5.86k, False: 19.4k]
  ------------------
  678|  5.86k|               ++str_read;
  679|  5.86k|           }
  680|  25.2k|           auto result = jsoncons::to_integer(str_read, last - str_read, exponent);
  681|  25.2k|           if (result.ec != std::errc{}) 
  ------------------
  |  Branch (681:16): [True: 9, False: 25.2k]
  ------------------
  682|      9|           {
  683|      9|               dec = decimal128_limits::nan();
  684|      9|               return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  685|      9|           }
  686|  25.2k|           str_read = result.ptr;
  687|  25.2k|        }
  688|       |
  689|  28.0k|        if ((len == -1 || str_read < first + len) && *str_read) {
  ------------------
  |  Branch (689:14): [True: 0, False: 28.0k]
  |  Branch (689:27): [True: 0, False: 28.0k]
  |  Branch (689:54): [True: 0, False: 0]
  ------------------
  690|      0|           dec = decimal128_limits::nan();
  691|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  692|      0|        }
  693|       | 
  694|       |        /* Done reading input. */
  695|       |        /* Find first non-zero digit in digits */
  696|  28.0k|        first_digit = 0;
  697|       | 
  698|  28.0k|        if (!ndigits_stored) { /* value is zero */
  ------------------
  |  Branch (698:13): [True: 2.75k, False: 25.2k]
  ------------------
  699|  2.75k|           first_digit = 0;
  700|  2.75k|           last_digit = 0;
  701|  2.75k|           digits[0] = 0;
  702|  2.75k|           ndigits = 1;
  703|  2.75k|           ndigits_stored = 1;
  704|  2.75k|           significant_digits = 0;
  705|  25.2k|        } else {
  706|  25.2k|           last_digit = ndigits_stored - 1;
  707|  25.2k|           significant_digits = ndigits;
  708|       |           /* Mark trailing zeros as non-significant */
  709|  29.1k|           while (first[first_nonzero + significant_digits - 1 + includes_sign +
  ------------------
  |  Branch (709:19): [True: 3.89k, False: 25.2k]
  ------------------
  710|  29.1k|                         saw_radix] == '0') {
  711|  3.89k|              significant_digits--;
  712|  3.89k|           }
  713|  25.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|  28.0k|        if (exponent <= static_cast<int32_t>(radix_position) && static_cast<int32_t>(radix_position) - exponent > (1 << 14)) {
  ------------------
  |  Branch (722:13): [True: 22.1k, False: 5.86k]
  |  Branch (722:65): [True: 0, False: 22.1k]
  ------------------
  723|      0|           exponent = decimal128_limits::exponent_min;
  724|  28.0k|        } else {
  725|  28.0k|           exponent -= static_cast<int32_t>(radix_position);
  726|  28.0k|        }
  727|       | 
  728|       |        /* Attempt to normalize the exponent */
  729|  28.0k|        while (exponent > decimal128_limits::exponent_max) {
  ------------------
  |  Branch (729:16): [True: 0, False: 28.0k]
  ------------------
  730|       |           /* Shift exponent to significand and decrease */
  731|      0|           last_digit++;
  732|       | 
  733|      0|           if (last_digit - first_digit > decimal128_limits::max_digits) {
  ------------------
  |  Branch (733:16): [True: 0, False: 0]
  ------------------
  734|       |              /* The exponent is too great to shift into the significand. */
  735|      0|              if (significant_digits == 0) {
  ------------------
  |  Branch (735:19): [True: 0, False: 0]
  ------------------
  736|       |                 /* Value is zero, we are allowed to clamp the exponent. */
  737|      0|                 exponent = decimal128_limits::exponent_max;
  738|      0|                 break;
  739|      0|              }
  740|       | 
  741|       |              /* Overflow is not permitted, error. */
  742|      0|              dec = decimal128_limits::nan();
  743|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  744|      0|           }
  745|       | 
  746|      0|           exponent--;
  747|      0|        }
  748|       | 
  749|  28.9k|        while (exponent < decimal128_limits::exponent_min || ndigits_stored < ndigits) {
  ------------------
  |  Branch (749:16): [True: 0, False: 28.9k]
  |  Branch (749:62): [True: 934, False: 28.0k]
  ------------------
  750|       |           /* Shift last digit */
  751|    934|           if (last_digit == 0) {
  ------------------
  |  Branch (751:16): [True: 0, False: 934]
  ------------------
  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|    934|           if (ndigits_stored < ndigits) {
  ------------------
  |  Branch (762:16): [True: 934, False: 0]
  ------------------
  763|    934|              if (first[ndigits - 1 + includes_sign + saw_radix] - '0' != 0 &&
  ------------------
  |  Branch (763:19): [True: 5, False: 929]
  ------------------
  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|    929|              ndigits--; /* adjust to match digits not stored */
  770|    929|           } 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|    929|           if (exponent < decimal128_limits::exponent_max) {
  ------------------
  |  Branch (781:16): [True: 929, False: 0]
  ------------------
  782|    929|              exponent++;
  783|    929|           } else {
  784|      0|              dec = decimal128_limits::nan();
  785|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  786|      0|           }
  787|    929|        }
  788|       | 
  789|       |        /* Round */
  790|       |        /* We've normalized the exponent, but might still need to round. */
  791|  28.0k|        if (last_digit - first_digit + 1 < significant_digits) {
  ------------------
  |  Branch (791:13): [True: 4, False: 28.0k]
  ------------------
  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|  28.0k|        significand_high = 0,   /* The high 17 digits of the significand */
  809|  28.0k|           significand_low = 0; /* The low 17 digits of the significand */
  810|       | 
  811|  28.0k|        if (significant_digits == 0) { /* read a zero */
  ------------------
  |  Branch (811:13): [True: 2.75k, False: 25.2k]
  ------------------
  812|  2.75k|           significand_high = 0;
  813|  2.75k|           significand_low = 0;
  814|  25.2k|        } else if (last_digit - first_digit < 17) {
  ------------------
  |  Branch (814:20): [True: 1.38k, False: 23.8k]
  ------------------
  815|  1.38k|           std::size_t d_idx = first_digit;
  816|  1.38k|           significand_low = digits[d_idx++];
  817|       | 
  818|  7.51k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (818:19): [True: 6.12k, False: 1.38k]
  ------------------
  819|  6.12k|              significand_low *= 10;
  820|  6.12k|              significand_low += digits[d_idx];
  821|  6.12k|              significand_high = 0;
  822|  6.12k|           }
  823|  23.8k|        } else {
  824|  23.8k|           std::size_t d_idx = first_digit;
  825|  23.8k|           significand_high = digits[d_idx++];
  826|       | 
  827|   352k|           for (; d_idx <= last_digit - 17; d_idx++) {
  ------------------
  |  Branch (827:19): [True: 328k, False: 23.8k]
  ------------------
  828|   328k|              significand_high *= 10;
  829|   328k|              significand_high += digits[d_idx];
  830|   328k|           }
  831|       | 
  832|  23.8k|           significand_low = digits[d_idx++];
  833|       | 
  834|   405k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (834:19): [True: 382k, False: 23.8k]
  ------------------
  835|   382k|              significand_low *= 10;
  836|   382k|              significand_low += digits[d_idx];
  837|   382k|           }
  838|  23.8k|        }
  839|       | 
  840|  28.0k|        detail::mul_64x64 (significand_high, 100000000000000000ull, &significand);
  841|  28.0k|        significand.low += significand_low;
  842|       | 
  843|  28.0k|        if (significand.low < significand_low) {
  ------------------
  |  Branch (843:13): [True: 4.02k, False: 24.0k]
  ------------------
  844|  4.02k|           significand.high += 1;
  845|  4.02k|        }
  846|       | 
  847|       | 
  848|  28.0k|        biased_exponent = static_cast<uint16_t>(exponent + static_cast<int32_t>(decimal128_limits::exponent_bias));
  849|       | 
  850|       |        /* Encode combination, exponent, and significand. */
  851|  28.0k|        if ((significand.high >> 49) & 1) {
  ------------------
  |  Branch (851:13): [True: 0, False: 28.0k]
  ------------------
  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|  28.0k|        } else {
  857|  28.0k|           dec.high |= (biased_exponent & 0x3fffull) << 49;
  858|  28.0k|           dec.high |= significand.high & 0x1ffffffffffffull;
  859|  28.0k|        }
  860|       | 
  861|  28.0k|        dec.low = significand.low;
  862|       | 
  863|       |        /* Encode sign */
  864|  28.0k|        if (is_negative) {
  ------------------
  |  Branch (864:13): [True: 2.96k, False: 25.0k]
  ------------------
  865|  2.96k|           dec.high |= 0x8000000000000000ull;
  866|  2.96k|        }
  867|       | 
  868|  28.0k|        return decimal128_from_chars_result{str_read,std::errc{}};
  869|  28.0k|    }
_ZN8jsoncons4bson6detail13dec128_istreqEPKcS3_S3_S3_:
  289|  12.4k|        {
  290|  66.9k|            while (!(a == lasta && b == lastb)) 
  ------------------
  |  Branch (290:22): [True: 5.70k, False: 61.2k]
  |  Branch (290:36): [True: 5.70k, False: 0]
  ------------------
  291|  61.2k|            {
  292|       |               // strings are different lengths
  293|  61.2k|               if (a == lasta || b == lastb) 
  ------------------
  |  Branch (293:20): [True: 0, False: 61.2k]
  |  Branch (293:34): [True: 4.67k, False: 56.5k]
  ------------------
  294|  4.67k|               {
  295|  4.67k|                  return false;
  296|  4.67k|               }
  297|       |         
  298|  56.5k|               if (dec128_tolower (*a) != dec128_tolower (*b)) {
  ------------------
  |  Branch (298:20): [True: 2.04k, False: 54.5k]
  ------------------
  299|  2.04k|                  return false;
  300|  2.04k|               }
  301|       |         
  302|  54.5k|               a++;
  303|  54.5k|               b++;
  304|  54.5k|            }
  305|       |         
  306|  5.70k|            return true;
  307|  12.4k|        }
_ZN8jsoncons4bson6detail14dec128_tolowerEc:
  266|   113k|        {
  267|   113k|           if (isupper (c)) {
  ------------------
  |  Branch (267:16): [True: 13.4k, False: 99.7k]
  ------------------
  268|  13.4k|              c += 32;
  269|  13.4k|           }
  270|       |
  271|   113k|           return c;
  272|   113k|        }
_ZN8jsoncons4bson17decimal128_limits12neg_infinityEv:
  124|  4.24k|        static constexpr decimal128_t neg_infinity() {return decimal128_t(0x7800000000000000ull + 0x8000000000000000ull, 0);}
_ZN8jsoncons4bson3TP1C2Emm:
   79|  5.72k|        constexpr TP1(uint64_t hi, uint64_t lo) : low(lo), high(hi) {}
_ZN8jsoncons4bson17decimal128_limits8infinityEv:
  123|    434|        static constexpr decimal128_t infinity() {return decimal128_t(0x7800000000000000ull, 0);}
_ZN8jsoncons4bson17decimal128_limits3nanEv:
  122|  1.04k|        static constexpr decimal128_t nan() {return decimal128_t(0x7c00000000000000ull, 0);}
_ZN8jsoncons4bson6detail9mul_64x64EmmPNS0_19bson_uint128_6464_tE:
  221|  28.0k|        {
  222|  28.0k|            uint64_t left_high, left_low, right_high, right_low, product_high,
  223|  28.0k|               product_mid, product_mid2, product_low;
  224|  28.0k|            bson_uint128_6464_t rt = {0,0};
  225|       | 
  226|  28.0k|            if (!left && !right) {
  ------------------
  |  Branch (226:17): [True: 4.14k, False: 23.8k]
  |  Branch (226:26): [True: 0, False: 4.14k]
  ------------------
  227|      0|               *product = rt;
  228|      0|               return;
  229|      0|            }
  230|       | 
  231|  28.0k|            left_high = left >> 32;
  232|  28.0k|            left_low = (uint32_t) left;
  233|  28.0k|            right_high = right >> 32;
  234|  28.0k|            right_low = (uint32_t) right;
  235|       | 
  236|  28.0k|            product_high = left_high * right_high;
  237|  28.0k|            product_mid = left_high * right_low;
  238|  28.0k|            product_mid2 = left_low * right_high;
  239|  28.0k|            product_low = left_low * right_low;
  240|       | 
  241|  28.0k|            product_high += product_mid >> 32;
  242|  28.0k|            product_mid = (uint32_t) product_mid + product_mid2 + (product_low >> 32);
  243|       | 
  244|  28.0k|            product_high = product_high + (product_mid >> 32);
  245|  28.0k|            product_low = (product_mid << 32) + (uint32_t) product_low;
  246|       | 
  247|  28.0k|            rt.high = product_high;
  248|  28.0k|            rt.low = product_low;
  249|  28.0k|            *product = rt;
  250|  28.0k|        }
_ZN8jsoncons4bson19decimal128_to_charsEPcS1_RKNS0_3TP1E:
  335|  33.7k|    {
  336|  33.7k|        static const std::string bson_decimal128_inf = "Infinity";
  337|  33.7k|        static const std::string bson_decimal128_nan = "NaN";
  338|       |
  339|  33.7k|        static constexpr uint32_t combination_mask = 0x1f;   /* Extract least significant 5 bits */
  340|  33.7k|        static constexpr uint32_t exponent_mask = 0x3fff;    /* Extract least significant 14 bits */
  341|  33.7k|        static constexpr uint32_t combination_infinity = 30; /* Value of combination field for Inf */
  342|  33.7k|        static constexpr uint32_t combination_nan = 31;      /* Value of combination field for NaN */
  343|  33.7k|        static constexpr uint32_t exponent_bias = 6176;      /* decimal128 exponent bias */
  344|       |
  345|  33.7k|        char* str_out = first;      /* output pointer in string */
  346|  33.7k|        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|  33.7k|        uint32_t high;                   /* bits 0 - 31 */
  351|  33.7k|        uint32_t midh;                   /* bits 32 - 63 */
  352|  33.7k|        uint32_t midl;                   /* bits 64 - 95 */
  353|  33.7k|        uint32_t low;                    /* bits 96 - 127 */
  354|  33.7k|        uint32_t combination;            /* bits 1 - 5 */
  355|  33.7k|        uint32_t biased_exponent;        /* decoded biased exponent (14 bits) */
  356|  33.7k|        uint32_t significand_digits = 0; /* the number of significand digits */
  357|  33.7k|        uint32_t significand[36] = {0};  /* the base-10 digits in the significand */
  358|  33.7k|        uint32_t *significand_read = significand; /* read pointer into significand */
  359|  33.7k|        int32_t exponent;                         /* unbiased exponent */
  360|  33.7k|        int32_t scientific_exponent; /* the exponent if scientific notation is
  361|       |                                      * used */
  362|  33.7k|        bool is_zero = false;        /* true if the number is zero */
  363|       | 
  364|  33.7k|        uint8_t significand_msb; /* the most signifcant significand bits (50-46) */
  365|  33.7k|        bson_uint128_t
  366|  33.7k|           significand128; /* temporary storage for significand decoding */
  367|       | 
  368|  33.7k|        memset (significand_str, 0, sizeof (significand_str));
  369|       | 
  370|  33.7k|        if ((int64_t) dec.high < 0) { /* negative */
  ------------------
  |  Branch (370:13): [True: 8.09k, False: 25.6k]
  ------------------
  371|  8.09k|           *(str_out++) = '-';
  372|  8.09k|        }
  373|       | 
  374|  33.7k|        low = (uint32_t) dec.low, midl = (uint32_t) (dec.low >> 32),
  375|  33.7k|        midh = (uint32_t) dec.high, high = (uint32_t) (dec.high >> 32);
  376|       | 
  377|       |        /* Decode combination field and exponent */
  378|  33.7k|        combination = (high >> 26) & combination_mask;
  379|       | 
  380|  33.7k|        if (JSONCONS_UNLIKELY ((combination >> 3) == 3)) {
  ------------------
  |  |   79|  33.7k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 7.95k, False: 25.7k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  7.95k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 4.67k, False: 3.27k]
  ------------------
  383|  4.67k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 4.67k, False: 0]
  ------------------
  384|  4.67k|               {
  385|  4.67k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  4.67k|                   str_out += bson_decimal128_inf.size();
  387|  4.67k|               }
  388|  4.67k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  4.67k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  4.67k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 1.02k, False: 2.25k]
  ------------------
  392|       |               /* first, not str_out, to erase the sign */
  393|  1.02k|               str_out = first;
  394|  1.02k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_nan.size())) 
  ------------------
  |  Branch (394:20): [True: 1.02k, False: 0]
  ------------------
  395|  1.02k|               {
  396|  1.02k|                   std::memcpy(str_out, bson_decimal128_nan.data(), bson_decimal128_nan.size());
  397|  1.02k|                   str_out += bson_decimal128_nan.size();
  398|  1.02k|               }
  399|  1.02k|               *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.02k|               return decimal128_to_chars_result{str_out, std::errc{}};
  403|  2.25k|           } else {
  404|  2.25k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  2.25k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  2.25k|           }
  407|  25.7k|        } else {
  408|  25.7k|           significand_msb = (high >> 14) & 0x7;
  409|  25.7k|           biased_exponent = (high >> 17) & exponent_mask;
  410|  25.7k|        }
  411|       | 
  412|  28.0k|        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|  28.0k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|  28.0k|        significand128.parts[1] = midh;
  420|  28.0k|        significand128.parts[2] = midl;
  421|  28.0k|        significand128.parts[3] = low;
  422|       | 
  423|  28.0k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 5.39k, False: 22.6k]
  |  Branch (423:45): [True: 3.77k, False: 1.61k]
  ------------------
  424|  3.77k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 1.67k, False: 2.09k]
  |  Branch (424:45): [True: 507, False: 1.17k]
  ------------------
  425|    507|           is_zero = true;
  426|  27.5k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 2.25k, False: 25.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.25k|           is_zero = true;
  434|  25.2k|        } else {
  435|   126k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 101k, False: 25.2k]
  ------------------
  436|   101k|              uint32_t least_digits = 0;
  437|   101k|              detail::bson_uint128_divide1B (
  438|   101k|                 significand128, &significand128, &least_digits);
  439|       | 
  440|       |              /* We now have the 9 least significant digits (in base 2). */
  441|       |              /* Convert and output to string. */
  442|   101k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 7.16k, False: 93.9k]
  ------------------
  443|  7.16k|                 continue;
  444|  7.16k|              }
  445|       | 
  446|   939k|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 845k, False: 93.9k]
  ------------------
  447|   845k|                 significand[k * 9 + j] = least_digits % 10;
  448|   845k|                 least_digits /= 10;
  449|   845k|              }
  450|  93.9k|           }
  451|  25.2k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|  28.0k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 2.75k, False: 25.2k]
  ------------------
  458|  2.75k|           significand_digits = 1;
  459|  2.75k|           *significand_read = 0;
  460|  25.2k|        } else {
  461|  25.2k|           significand_digits = 36;
  462|   167k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 142k, False: 25.2k]
  ------------------
  463|   142k|              significand_digits--;
  464|   142k|              significand_read++;
  465|   142k|           }
  466|  25.2k|        }
  467|       | 
  468|  28.0k|        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|  28.0k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 19.4k, False: 8.62k]
  |  Branch (478:41): [True: 5.87k, False: 2.75k]
  ------------------
  479|       |           /* Scientific format */
  480|  25.2k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|  25.2k|           significand_digits--;
  482|       | 
  483|  25.2k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 23.4k, False: 1.88k]
  ------------------
  484|  23.4k|              *(str_out++) = '.';
  485|  23.4k|           }
  486|       | 
  487|   740k|           for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (487:36): [True: 715k, False: 25.1k]
  |  Branch (487:62): [True: 715k, False: 94]
  ------------------
  488|   715k|              *(str_out++) = char(*(significand_read++)) + '0';
  489|   715k|           }
  490|       |           /* Exponent */
  491|  25.2k|           *(str_out++) = 'E';
  492|       |
  493|  25.2k|           std::string s;
  494|  25.2k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 5.87k, False: 19.4k]
  ------------------
  495|  5.87k|               s.push_back('+');
  496|  5.87k|           }
  497|  25.2k|           jsoncons::from_integer(scientific_exponent, s);
  498|  25.2k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 25.2k, False: 9]
  ------------------
  499|  25.2k|           {
  500|  25.2k|               std::memcpy(str_out, s.data(), s.size());
  501|  25.2k|           }
  502|      9|           else
  503|      9|           {
  504|      9|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|      9|           }
  506|  25.2k|           str_out += s.size();
  507|  25.2k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  2.75k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 1.49k, False: 1.26k]
  ------------------
  510|  8.61k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 7.12k, False: 1.49k]
  |  Branch (510:65): [True: 7.12k, False: 0]
  ------------------
  511|  7.12k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  7.12k|              }
  513|  1.49k|           } 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: 364, False: 900]
  ------------------
  517|    364|                 for (int32_t i = 0;
  518|  4.78k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 4.42k, False: 364]
  |  Branch (518:45): [True: 4.42k, False: 0]
  ------------------
  519|  4.42k|                      i++) {
  520|  4.42k|                    *(str_out++) = char(*(significand_read++)) + '0';
  521|  4.42k|                 }
  522|    900|              } else { /* leading zero before radix point */
  523|    900|                 *(str_out++) = '0';
  524|    900|              }
  525|       | 
  526|  1.26k|              *(str_out++) = '.';
  527|  2.83k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 1.57k, False: 1.26k]
  ------------------
  528|  1.57k|                 *(str_out++) = '0';
  529|  1.57k|              }
  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.75k|        }
  539|  28.0k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|  28.0k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|   101k|        {
  179|   101k|            static constexpr uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|   101k|            uint64_t _rem = 0;
  181|   101k|            int i = 0;
  182|       |            
  183|   101k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 80.7k, False: 20.4k]
  |  Branch (183:36): [True: 58.3k, False: 22.4k]
  |  Branch (183:55): [True: 33.9k, False: 24.3k]
  ------------------
  184|  33.9k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 7.14k, False: 26.8k]
  ------------------
  185|  7.14k|               *quotient = value;
  186|  7.14k|               *rem = 0;
  187|  7.14k|               return;
  188|  7.14k|            }
  189|       |            
  190|   469k|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 375k, False: 93.9k]
  ------------------
  191|   375k|               _rem <<= 32; /* Adjust remainder to match value of next dividend */
  192|   375k|               _rem += value.parts[i]; /* Add the divided to _rem */
  193|   375k|               value.parts[i] = (uint32_t) (_rem / DIVISOR);
  194|   375k|               _rem %= DIVISOR; /* Store the remainder */
  195|   375k|            }
  196|       |            
  197|  93.9k|            *quotient = value;
  198|  93.9k|            *rem = (uint32_t) _rem;
  199|  93.9k|        }

_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKS9_:
  110|  3.06k|       : basic_bson_encoder(std::forward<Sink>(sink),
  111|  3.06k|                            bson_encode_options(),
  112|  3.06k|                            alloc)
  113|  3.06k|    {
  114|  3.06k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKNS0_19bson_encode_optionsERKS9_:
  119|  3.06k|       : sink_(std::forward<Sink>(sink)),
  120|  3.06k|         max_nesting_depth_(static_cast<std::size_t>(options.max_nesting_depth())),
  121|  3.06k|         alloc_(alloc)
  122|  3.06k|    {
  123|  3.06k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE15visit_end_arrayERKNS_11ser_contextERNS3_10error_codeE:
  222|  1.93k|    {
  223|  1.93k|        if (JSONCONS_UNLIKELY(stack_.empty() || !stack_.back().is_array()))
  ------------------
  |  |   79|  3.87k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 1.93k]
  |  |  |  Branch (79:50): [True: 0, False: 1.93k]
  |  |  |  Branch (79:50): [True: 0, False: 1.93k]
  |  |  ------------------
  ------------------
  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.93k|        buffer_.push_back(0x00);
  230|       |
  231|  1.93k|        std::size_t length = buffer_.size() - stack_.back().offset();
  232|  1.93k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  233|       |
  234|  1.93k|        stack_.pop_back();
  235|  1.93k|        if (stack_.empty())
  ------------------
  |  Branch (235:13): [True: 0, False: 1.93k]
  ------------------
  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.93k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  1.93k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  243|  1.93k|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item8is_arrayEv:
   91|  1.93k|        {
   92|  1.93k|            return type_ == jsoncons::bson::container_type::array;
   93|  1.93k|        }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item6offsetEv:
   66|  9.62k|        {
   67|  9.62k|            return offset_;
   68|  9.62k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  505|  3.94k|    {
  506|  3.94k|        static constexpr uint64_t max_value_div_1000 = (std::numeric_limits<uint64_t>::max)() / 1000;
  507|  3.94k|        if (stack_.empty())
  ------------------
  |  Branch (507:13): [True: 0, False: 3.94k]
  ------------------
  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.94k|        switch (tag)
  514|  3.94k|        {
  515|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (515:13): [True: 0, False: 3.94k]
  ------------------
  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.94k]
  ------------------
  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.94k]
  ------------------
  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.94k|            default:
  ------------------
  |  Branch (536:13): [True: 3.94k, False: 0]
  ------------------
  537|  3.94k|            {
  538|  3.94k|                if (val <= static_cast<uint64_t>((std::numeric_limits<int32_t>::max)()))
  ------------------
  |  Branch (538:21): [True: 758, False: 3.19k]
  ------------------
  539|    758|                {
  540|    758|                    before_value(jsoncons::bson::bson_type::int32_type);
  541|    758|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  542|    758|                }
  543|  3.19k|                else if (val <= static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()))
  ------------------
  |  Branch (543:26): [True: 3.11k, False: 80]
  ------------------
  544|  3.11k|                {
  545|  3.11k|                    before_value(jsoncons::bson::bson_type::int64_type);
  546|  3.11k|                    binary::native_to_little(static_cast<uint64_t>(val),std::back_inserter(buffer_));
  547|  3.11k|                }
  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.86k|                break;
  554|  3.94k|            }
  555|  3.94k|        }
  556|  3.86k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  3.86k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  557|  3.94k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12before_valueEh:
  575|  3.45M|    {
  576|  3.45M|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   54|  3.45M|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (54:32): [True: 0, False: 3.45M]
  |  |  ------------------
  |  |   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.45M|        if (stack_.back().is_object())
  ------------------
  |  Branch (577:13): [True: 305k, False: 3.14M]
  ------------------
  578|   305k|        {
  579|   305k|            buffer_[stack_.back().member_offset()] = code;
  580|   305k|        }
  581|  3.14M|        else
  582|  3.14M|        {
  583|  3.14M|            buffer_.push_back(code);
  584|  3.14M|            std::string name = std::to_string(stack_.back().next_index());
  585|  3.14M|            buffer_.insert(buffer_.end(), name.begin(), name.end());
  586|  3.14M|            buffer_.push_back(0x00);
  587|  3.14M|        }
  588|  3.45M|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item9is_objectEv:
   86|  3.45M|        {
   87|  3.45M|            return type_ == jsoncons::bson::container_type::document;
   88|  3.45M|        }
_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.14M|        {
   82|  3.14M|            return index_++;
   83|  3.14M|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  446|  14.9k|    {
  447|  14.9k|        static constexpr int64_t min_value_div_1000 = (std::numeric_limits<int64_t>::min)() / 1000;
  448|  14.9k|        static constexpr int64_t max_value_div_1000 = (std::numeric_limits<int64_t>::max)() / 1000;
  449|  14.9k|        if (stack_.empty())
  ------------------
  |  Branch (449:13): [True: 0, False: 14.9k]
  ------------------
  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|  14.9k|        switch (tag)
  456|  14.9k|        {
  457|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (457:13): [True: 0, False: 14.9k]
  ------------------
  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.30k|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (471:13): [True: 2.30k, False: 12.6k]
  ------------------
  472|  2.30k|                before_value(jsoncons::bson::bson_type::datetime_type);
  473|  2.30k|                binary::native_to_little(val,std::back_inserter(buffer_));
  474|  2.30k|                break;
  475|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (475:13): [True: 0, False: 14.9k]
  ------------------
  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|  12.6k|            default:
  ------------------
  |  Branch (483:13): [True: 12.6k, False: 2.30k]
  ------------------
  484|  12.6k|            {
  485|  12.6k|                if (val >= (std::numeric_limits<int32_t>::lowest)() && val <= (std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (485:21): [True: 12.3k, False: 370]
  |  Branch (485:72): [True: 7.23k, False: 5.07k]
  ------------------
  486|  7.23k|                {
  487|  7.23k|                    before_value(jsoncons::bson::bson_type::int32_type);
  488|  7.23k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  489|  7.23k|                }
  490|  5.44k|                else 
  491|  5.44k|                {
  492|  5.44k|                    before_value(jsoncons::bson::bson_type::int64_type);
  493|  5.44k|                    binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  494|  5.44k|                }
  495|  12.6k|                break;
  496|      0|            }
  497|  14.9k|        }
  498|  14.9k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  14.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  499|  14.9k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  563|    943|    {
  564|    943|        if (stack_.empty())
  ------------------
  |  Branch (564:13): [True: 0, False: 943]
  ------------------
  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|    943|        before_value(jsoncons::bson::bson_type::double_type);
  570|    943|        binary::native_to_little(val,std::back_inserter(buffer_));
  571|    943|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|    943|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  572|    943|    }
_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.4k|    {
  155|  37.4k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  37.4k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 37.4k]
  |  |  ------------------
  ------------------
  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.4k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (160:13): [True: 34.4k, False: 3.05k]
  ------------------
  161|  34.4k|        {
  162|  34.4k|            if (stack_.empty())
  ------------------
  |  Branch (162:17): [True: 0, False: 34.4k]
  ------------------
  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.4k|            before_value(jsoncons::bson::bson_type::document_type);
  168|  34.4k|        }
  169|       |
  170|  37.4k|        stack_.emplace_back(jsoncons::bson::container_type::document, buffer_.size());
  171|  37.4k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  172|       |
  173|  37.4k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  37.4k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  174|  37.4k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_itemC2ENS0_14container_typeEm:
   61|  49.7k|           : type_(type), offset_(offset)
   62|  49.7k|        {
   63|  49.7k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE16visit_end_objectERKNS_11ser_contextERNS3_10error_codeE:
  177|  2.87k|    {
  178|  2.87k|        if (JSONCONS_UNLIKELY(stack_.empty() || !stack_.back().is_object()))
  ------------------
  |  |   79|  5.75k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 2.87k]
  |  |  |  Branch (79:50): [True: 0, False: 2.87k]
  |  |  |  Branch (79:50): [True: 0, False: 2.87k]
  |  |  ------------------
  ------------------
  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|  2.87k|        buffer_.push_back(0x00);
  185|       |
  186|  2.87k|        std::size_t length = buffer_.size() - stack_.back().offset();
  187|  2.87k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  188|       |
  189|  2.87k|        stack_.pop_back();
  190|  2.87k|        if (stack_.empty())
  ------------------
  |  Branch (190:13): [True: 127, False: 2.74k]
  ------------------
  191|    127|        {
  192|    127|            for (auto c : buffer_)
  ------------------
  |  Branch (192:25): [True: 1.99M, False: 127]
  ------------------
  193|  1.99M|            {
  194|  1.99M|                sink_.push_back(c);
  195|  1.99M|            }
  196|    127|        }
  197|  2.87k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  2.87k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  198|  2.87k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  201|  12.2k|    {
  202|  12.2k|        if (JSONCONS_UNLIKELY(stack_.size() >= max_nesting_depth_))
  ------------------
  |  |   79|  12.2k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 0, False: 12.2k]
  |  |  ------------------
  ------------------
  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.2k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (207:13): [True: 12.2k, False: 0]
  ------------------
  208|  12.2k|        {
  209|  12.2k|            if (stack_.empty())
  ------------------
  |  Branch (209:17): [True: 0, False: 12.2k]
  ------------------
  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.2k|            before_value(jsoncons::bson::bson_type::array_type);
  215|  12.2k|        }
  216|  12.2k|        stack_.emplace_back(jsoncons::bson::container_type::array, buffer_.size());
  217|  12.2k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  218|  12.2k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  12.2k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  219|  12.2k|    }
_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: 714k, False: 306k]
  ------------------
  250|   714k|        {
  251|   714k|            buffer_.push_back(c);
  252|   714k|        }
  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.08k|            case semantic_tag::undefined:
  ------------------
  |  Branch (266:13): [True: 1.08k, False: 3.19M]
  ------------------
  267|  1.08k|                before_value(jsoncons::bson::bson_type::undefined_type);
  268|  1.08k|                break;
  269|  3.19M|            default:
  ------------------
  |  Branch (269:13): [True: 3.19M, False: 1.08k]
  ------------------
  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: 342, False: 279]
  ------------------
  285|    342|        {
  286|    342|            buffer_.push_back(0x01);
  287|    342|        }
  288|    279|        else
  289|    279|        {
  290|    279|            buffer_.push_back(0x00);
  291|    279|        }
  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|   171k|    {
  298|   171k|        if (stack_.empty())
  ------------------
  |  Branch (298:13): [True: 0, False: 171k]
  ------------------
  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|   171k|        switch (tag)
  305|   171k|        {
  306|  33.7k|            case semantic_tag::float128:
  ------------------
  |  Branch (306:13): [True: 33.7k, False: 138k]
  ------------------
  307|  33.7k|            {
  308|  33.7k|                before_value(jsoncons::bson::bson_type::decimal128_type);
  309|  33.7k|                decimal128_t dec;
  310|  33.7k|                auto rc = decimal128_from_chars(sv.data(), sv.data()+sv.size(), dec);
  311|  33.7k|                if (rc.ec != std::errc{})
  ------------------
  |  Branch (311:21): [True: 18, False: 33.7k]
  ------------------
  312|     18|                {
  313|     18|                    ec = bson_errc::invalid_decimal128_string;
  314|     18|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|     18|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  315|     18|                }
  316|  33.7k|                binary::native_to_little(dec.low,std::back_inserter(buffer_));
  317|  33.7k|                binary::native_to_little(dec.high,std::back_inserter(buffer_));
  318|  33.7k|                break;
  319|  33.7k|            }
  320|  11.6k|            case semantic_tag::id:
  ------------------
  |  Branch (320:13): [True: 11.6k, False: 160k]
  ------------------
  321|  11.6k|            {
  322|  11.6k|                before_value(jsoncons::bson::bson_type::object_id_type);
  323|  11.6k|                oid_t oid(sv);
  324|  11.6k|                for (auto b : oid)
  ------------------
  |  Branch (324:29): [True: 140k, False: 11.6k]
  ------------------
  325|   140k|                {
  326|   140k|                    buffer_.push_back(b);
  327|   140k|                }
  328|  11.6k|                break;
  329|  33.7k|            }
  330|  5.62k|            case semantic_tag::regex:
  ------------------
  |  Branch (330:13): [True: 5.62k, False: 166k]
  ------------------
  331|  5.62k|            {
  332|  5.62k|                before_value(jsoncons::bson::bson_type::regex_type);
  333|  5.62k|                std::size_t first = sv.find_first_of('/');
  334|  5.62k|                std::size_t last = sv.find_last_of('/');
  335|  5.62k|                if (first == string_view::npos || last == string_view::npos || first == last)
  ------------------
  |  Branch (335:21): [True: 0, False: 5.62k]
  |  Branch (335:51): [True: 0, False: 5.62k]
  |  Branch (335:80): [True: 0, False: 5.62k]
  ------------------
  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|  5.62k|                string_view regex = sv.substr(first+1,last-1);
  341|  5.62k|                for (auto c : regex)
  ------------------
  |  Branch (341:29): [True: 4.72M, False: 5.62k]
  ------------------
  342|  4.72M|                {
  343|  4.72M|                    buffer_.push_back(c);
  344|  4.72M|                }
  345|  5.62k|                buffer_.push_back(0x00);
  346|  5.62k|                string_view options = sv.substr(last+1);
  347|  5.62k|                for (auto c : options)
  ------------------
  |  Branch (347:29): [True: 2.71M, False: 5.62k]
  ------------------
  348|  2.71M|                {
  349|  2.71M|                    buffer_.push_back(c);
  350|  2.71M|                }
  351|  5.62k|                buffer_.push_back(0x00);
  352|  5.62k|                break;
  353|  5.62k|            }
  354|   120k|            default:
  ------------------
  |  Branch (354:13): [True: 120k, False: 51.0k]
  ------------------
  355|   120k|                switch (tag)
  356|   120k|                {
  357|    987|                    case semantic_tag::code:
  ------------------
  |  Branch (357:21): [True: 987, False: 119k]
  ------------------
  358|    987|                        before_value(jsoncons::bson::bson_type::javascript_type);
  359|    987|                        break;
  360|   119k|                    default:
  ------------------
  |  Branch (360:21): [True: 119k, False: 987]
  ------------------
  361|   119k|                        before_value(jsoncons::bson::bson_type::string_type);
  362|   119k|                        break;
  363|   120k|                }
  364|   120k|                std::size_t offset = buffer_.size();
  365|   120k|                buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  366|   120k|                std::size_t string_offset = buffer_.size();
  367|   120k|                auto sink = unicode_traits::validate(sv.data(), sv.size());
  368|   120k|                if (sink.ec != unicode_traits::unicode_errc())
  ------------------
  |  Branch (368:21): [True: 0, False: 120k]
  ------------------
  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|   120k|                for (auto c : sv)
  ------------------
  |  Branch (373:29): [True: 3.71M, False: 120k]
  ------------------
  374|  3.71M|                {
  375|  3.71M|                    buffer_.push_back(c);
  376|  3.71M|                }
  377|   120k|                buffer_.push_back(0x00);
  378|   120k|                std::size_t length = buffer_.size() - string_offset;
  379|   120k|                binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  380|   120k|                break;
  381|   171k|        }
  382|       |
  383|   171k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|   171k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  384|   171k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_byte_stringERKNS_16byte_string_viewEmRKNS_11ser_contextERNS3_10error_codeE:
  418|  17.0k|    {
  419|  17.0k|        if (stack_.empty())
  ------------------
  |  Branch (419:13): [True: 0, False: 17.0k]
  ------------------
  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|  17.0k|        before_value(jsoncons::bson::bson_type::binary_type);
  425|       |
  426|  17.0k|        std::size_t offset = buffer_.size();
  427|  17.0k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  428|  17.0k|        std::size_t string_offset = buffer_.size();
  429|       |
  430|  17.0k|        buffer_.push_back(static_cast<uint8_t>(raw_tag)); // default subtype
  431|       |
  432|  17.0k|        for (auto c : b)
  ------------------
  |  Branch (432:21): [True: 9.88M, False: 17.0k]
  ------------------
  433|  9.88M|        {
  434|  9.88M|            buffer_.push_back(c);
  435|  9.88M|        }
  436|  17.0k|        std::size_t length = buffer_.size() - string_offset - 1;
  437|  17.0k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  438|       |
  439|  17.0k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  321|  17.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  440|  17.0k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEED2Ev:
  126|  3.06k|    {
  127|  3.06k|        sink_.flush();
  128|  3.06k|    }

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

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

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

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

