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

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

_ZNK8jsoncons6nonstd4spanIKhLm18446744073709551615EE4sizeEv:
  159|   609k|    {
  160|   609k|        return size_;
  161|   609k|    }
_ZN8jsoncons6nonstd4spanIKhLm18446744073709551615EEC2Ev:
   99|  13.0k|    {
  100|  13.0k|    }
_ZN8jsoncons6nonstd4spanIKhLm18446744073709551615EEC2EPS2_m:
  102|   190k|        : data_(data), size_(size)
  103|   190k|    {
  104|   190k|    }
_ZNK8jsoncons6nonstd4spanIKhLm18446744073709551615EE4dataEv:
  154|   203k|    {
  155|   203k|        return data_;
  156|   203k|    }

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

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  193|  3.19k|    {
  194|  3.19k|        if (chunk_)
  ------------------
  |  Branch (194:13): [True: 3.19k, False: 0]
  ------------------
  195|  3.19k|        {
  196|  3.19k|            std::allocator_traits<char_allocator_type>::deallocate(alloc_, chunk_, chunk_size_);
  197|  3.19k|        }
  198|  3.19k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  176|  3.19k|        : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  177|  3.19k|          chunk_size_(default_max_chunk_size)
  178|  3.19k|    {
  179|  3.19k|        chunk_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, chunk_size_);
  180|  3.19k|        data_end_ = chunk_;
  181|  3.19k|    }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   57|  3.19k|      : std::basic_istream<CharT>(&nb_)
   58|  3.19k|    {
   59|  3.19k|    }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   43|  3.19k|        null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  3.19k|    {
  277|  3.19k|        return stream_ptr_->bad();  
  278|  3.19k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  377|  28.2M|    {
  378|  28.2M|        std::size_t len = 0;
  379|  28.2M|        if (remaining_ > 0)
  ------------------
  |  Branch (379:13): [True: 28.2M, False: 6.52k]
  ------------------
  380|  28.2M|        {
  381|  28.2M|            len = (std::min)(remaining_, length);
  382|  28.2M|            std::memcpy(p, data_end_, len*sizeof(value_type));
  383|  28.2M|            data_end_ += len;
  384|  28.2M|            remaining_ -= len;
  385|  28.2M|            position_ += len;
  386|  28.2M|        }
  387|  28.2M|        if (length - len == 0)
  ------------------
  |  Branch (387:13): [True: 28.2M, False: 8.61k]
  ------------------
  388|  28.2M|        {
  389|  28.2M|            return len;
  390|  28.2M|        }
  391|  8.61k|        else if (length - len < chunk_size_)
  ------------------
  |  Branch (391:18): [True: 8.61k, False: 0]
  ------------------
  392|  8.61k|        {
  393|  8.61k|            data_end_ = chunk_;
  394|  8.61k|            remaining_ = fill_buffer(chunk_, chunk_size_);
  395|  8.61k|            if (remaining_ > 0)
  ------------------
  |  Branch (395:17): [True: 6.44k, False: 2.16k]
  ------------------
  396|  6.44k|            {
  397|  6.44k|                std::size_t len2 = (std::min)(remaining_, length-len);
  398|  6.44k|                std::memcpy(p+len, data_end_, len2*sizeof(value_type));
  399|  6.44k|                data_end_ += len2;
  400|  6.44k|                remaining_ -= len2;
  401|  6.44k|                position_ += len2;
  402|  6.44k|                len += len2;
  403|  6.44k|            }
  404|  8.61k|            return len;
  405|  8.61k|        }
  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|  28.2M|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEPhm:
  442|  9.65k|    {
  443|  9.65k|        if (stream_ptr_->eof())
  ------------------
  |  Branch (443:13): [True: 2.18k, False: 7.47k]
  ------------------
  444|  2.18k|        {
  445|  2.18k|            return 0;
  446|  2.18k|        }
  447|       |
  448|  7.47k|        JSONCONS_TRY
  ------------------
  |  |   37|  7.47k|    #define JSONCONS_TRY try
  ------------------
  449|  7.47k|        {
  450|  7.47k|            std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(chunk), chunk_size);
  451|  7.47k|            std::size_t length = static_cast<std::size_t>(count);
  452|       |
  453|  7.47k|            if (length < chunk_size)
  ------------------
  |  Branch (453:17): [True: 3.18k, False: 4.28k]
  ------------------
  454|  3.18k|            {
  455|  3.18k|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  456|  3.18k|            }
  457|  7.47k|            return length;
  458|  7.47k|        }
  459|  7.47k|        JSONCONS_CATCH(const std::exception&)     
  460|  7.47k|        {
  461|      0|            stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  462|      0|            return 0;
  463|      0|        }
  464|  7.47k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_12basic_stringIcNS1_11char_traitsIcEENS2_IcEEEEEENS_6nonstd4spanIKhLm18446744073709551615EEEmOT_:
  352|   180k|    {
  353|   180k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   79|   180k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 1.42k, False: 179k]
  |  |  ------------------
  ------------------
  354|  1.42k|        {
  355|  1.42k|            return span<const value_type>{};
  356|  1.42k|        }
  357|   179k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 214, False: 179k]
  |  Branch (357:32): [True: 81, False: 133]
  ------------------
  358|     81|        {
  359|     81|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     81|            data_end_ = chunk_;
  361|     81|        }
  362|   179k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 524, False: 178k]
  ------------------
  363|    524|        {
  364|    524|            buffer.clear();
  365|    524|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    524|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    524|        }
  368|       |
  369|   178k|        const value_type* data = data_end_;
  370|   178k|        data_end_ += length;
  371|   178k|        remaining_ -= length;
  372|   178k|        position_ += length;
  373|   178k|        return span<const value_type>(data, length);
  374|   179k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSG_m:
  749|    524|    {
  750|    524|        std::size_t unread = length;
  751|       |
  752|  1.69k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (752:16): [True: 1.43k, False: 256]
  |  Branch (752:30): [True: 1.16k, False: 268]
  ------------------
  753|  1.16k|        {
  754|  1.16k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (754:17): [True: 477, False: 692]
  |  Branch (754:44): [True: 476, False: 1]
  ------------------
  755|    476|            {
  756|    476|                std::size_t n = source.chunk_size();
  757|    476|                std::size_t offset = buffer.size();
  758|    476|                buffer.resize(offset+n);
  759|    476|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  760|    476|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    476|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 75, False: 401]
  |  |  ------------------
  ------------------
  761|     75|                {
  762|     75|                    buffer.resize(offset+actual);
  763|     75|                }
  764|    476|                unread -= actual;
  765|    476|            }
  766|    693|            else
  767|    693|            {
  768|    693|                std::size_t n = (std::min)(source.chunk_size(), unread);
  769|    693|                std::size_t offset = buffer.size();
  770|    693|                buffer.resize(offset+n);
  771|    693|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  772|    693|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    693|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 114, False: 579]
  |  |  ------------------
  ------------------
  773|    114|                {
  774|    114|                    buffer.resize(offset + actual);
  775|    114|                }
  776|    693|                unread -= actual;
  777|    693|            }
  778|  1.16k|        }
  779|    524|        return length - unread;
  780|    524|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  3.68k|    {
  272|  3.68k|        return remaining_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:16): [True: 1.55k, False: 2.12k]
  |  Branch (272:35): [True: 607, False: 947]
  ------------------
  273|  3.68k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9remainingEv:
  346|  3.07k|    {
  347|  3.07k|        return remaining_;
  348|  3.07k|    }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE10chunk_sizeEv:
  261|  4.02k|    {
  262|  4.02k|        return chunk_size_;
  263|  4.02k|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11read_bufferEPhm:
  435|    930|    {
  436|    930|        auto len = fill_buffer(chunk, chunk_size);
  437|    930|        position_ += len;
  438|    930|        return len;
  439|    930|    }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE9read_spanIRNS1_6vectorIhS3_EEEENS_6nonstd4spanIKhLm18446744073709551615EEEmOT_:
  352|  22.9k|    {
  353|  22.9k|        if (JSONCONS_UNLIKELY(length == 0))
  ------------------
  |  |   79|  22.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 11.5k, False: 11.4k]
  |  |  ------------------
  ------------------
  354|  11.5k|        {
  355|  11.5k|            return span<const value_type>{};
  356|  11.5k|        }
  357|  11.4k|        if (remaining_ == 0 && length <= chunk_size_)
  ------------------
  |  Branch (357:13): [True: 178, False: 11.2k]
  |  Branch (357:32): [True: 34, False: 144]
  ------------------
  358|     34|        {
  359|     34|            remaining_ = fill_buffer(chunk_, chunk_size_);
  360|     34|            data_end_ = chunk_;
  361|     34|        }
  362|  11.4k|        if (length > remaining_)
  ------------------
  |  Branch (362:13): [True: 687, False: 10.7k]
  ------------------
  363|    687|        {
  364|    687|            buffer.clear();
  365|    687|            source_reader<stream_source_type>::read(*this, std::forward<Buffer>(buffer), length);
  366|    687|            return span<const value_type>(reinterpret_cast<const value_type*>(buffer.data()), buffer.size());
  367|    687|        }
  368|       |
  369|  10.7k|        const value_type* data = data_end_;
  370|  10.7k|        data_end_ += length;
  371|  10.7k|        remaining_ -= length;
  372|  10.7k|        position_ += length;
  373|  10.7k|        return span<const value_type>(data, length);
  374|  11.4k|    }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaL_ZNS2_17integral_constantIbLb1EE5valueEEsr10ext_traits7is_byteINT_10value_typeEEE5valueEmE4typeERS5_RSD_m:
  749|    687|    {
  750|    687|        std::size_t unread = length;
  751|       |
  752|  2.59k|        while (unread > 0 && !source.eof())
  ------------------
  |  Branch (752:16): [True: 2.24k, False: 348]
  |  Branch (752:30): [True: 1.90k, False: 339]
  ------------------
  753|  1.90k|        {
  754|  1.90k|            if (source.remaining() == 0 && unread >= source.chunk_size())
  ------------------
  |  Branch (754:17): [True: 470, False: 1.43k]
  |  Branch (754:44): [True: 454, False: 16]
  ------------------
  755|    454|            {
  756|    454|                std::size_t n = source.chunk_size();
  757|    454|                std::size_t offset = buffer.size();
  758|    454|                buffer.resize(offset+n);
  759|    454|                std::size_t actual = source.read_buffer(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  760|    454|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|    454|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 73, False: 381]
  |  |  ------------------
  ------------------
  761|     73|                {
  762|     73|                    buffer.resize(offset+actual);
  763|     73|                }
  764|    454|                unread -= actual;
  765|    454|            }
  766|  1.45k|            else
  767|  1.45k|            {
  768|  1.45k|                std::size_t n = (std::min)(source.chunk_size(), unread);
  769|  1.45k|                std::size_t offset = buffer.size();
  770|  1.45k|                buffer.resize(offset+n);
  771|  1.45k|                std::size_t actual = source.read(reinterpret_cast<value_type*>(&buffer[0]) + offset, n);
  772|  1.45k|                if (JSONCONS_UNLIKELY(actual != n))
  ------------------
  |  |   79|  1.45k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 191, False: 1.26k]
  |  |  ------------------
  ------------------
  773|    191|                {
  774|    191|                    buffer.resize(offset + actual);
  775|    191|                }
  776|  1.45k|                unread -= actual;
  777|  1.45k|            }
  778|  1.90k|        }
  779|    687|        return length - unread;
  780|    687|    }

_ZN8jsoncons6binary16native_to_littleIjNSt3__111__wrap_iterIPhEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrS9_6littleEvE4typeET_T0_:
  142|   209k|    {
  143|   209k|        uint8_t buf[sizeof(T)];
  144|   209k|        std::memcpy(buf, &val, sizeof(T));
  145|   209k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 836k, False: 209k]
  ------------------
  146|   836k|        {
  147|   836k|            *d_first++ = item;
  148|   836k|        }
  149|   209k|    }
_ZN8jsoncons6binary16native_to_littleIlNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  14.0k|    {
  143|  14.0k|        uint8_t buf[sizeof(T)];
  144|  14.0k|        std::memcpy(buf, &val, sizeof(T));
  145|  14.0k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 112k, False: 14.0k]
  ------------------
  146|   112k|        {
  147|   112k|            *d_first++ = item;
  148|   112k|        }
  149|  14.0k|    }
_ZN8jsoncons6binary16native_to_littleIjNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  12.1k|    {
  143|  12.1k|        uint8_t buf[sizeof(T)];
  144|  12.1k|        std::memcpy(buf, &val, sizeof(T));
  145|  12.1k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 48.7k, False: 12.1k]
  ------------------
  146|  48.7k|        {
  147|  48.7k|            *d_first++ = item;
  148|  48.7k|        }
  149|  12.1k|    }
_ZN8jsoncons6binary16native_to_littleImNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  71.6k|    {
  143|  71.6k|        uint8_t buf[sizeof(T)];
  144|  71.6k|        std::memcpy(buf, &val, sizeof(T));
  145|  71.6k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 573k, False: 71.6k]
  ------------------
  146|   573k|        {
  147|   573k|            *d_first++ = item;
  148|   573k|        }
  149|  71.6k|    }
_ZN8jsoncons6binary16native_to_littleIdNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6nonstd6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  1.45k|    {
  143|  1.45k|        uint8_t buf[sizeof(T)];
  144|  1.45k|        std::memcpy(buf, &val, sizeof(T));
  145|  1.45k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 11.6k, False: 1.45k]
  ------------------
  146|  11.6k|        {
  147|  11.6k|            *d_first++ = item;
  148|  11.6k|        }
  149|  1.45k|    }
_ZN8jsoncons6binary16little_to_nativeIiNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   268k|    {
  198|   268k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 268k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   268k|        T val;
  203|   268k|        std::memcpy(&val,first,sizeof(T));
  204|   268k|        return val;
  205|   268k|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  1.45k|    {
  198|  1.45k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 1.45k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  1.45k|        T val;
  203|  1.45k|        std::memcpy(&val,first,sizeof(T));
  204|  1.45k|        return val;
  205|  1.45k|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  72.5k|    {
  198|  72.5k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 72.5k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  72.5k|        T val;
  203|  72.5k|        std::memcpy(&val,first,sizeof(T));
  204|  72.5k|        return val;
  205|  72.5k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6nonstd6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  15.5k|    {
  198|  15.5k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 15.5k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  15.5k|        T val;
  203|  15.5k|        std::memcpy(&val,first,sizeof(T));
  204|  15.5k|        return val;
  205|  15.5k|    }

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

_ZN8jsoncons10ext_traits14integer_limitsIivE6lowestEv:
  106|  20.9k|        {
  107|  20.9k|            return std::numeric_limits<T>::lowest();
  108|  20.9k|        }
_ZN8jsoncons10ext_traits14integer_limitsIivE3maxEv:
   98|  5.29k|        {
   99|  5.29k|            return (std::numeric_limits<T>::max)();
  100|  5.29k|        }

_ZN8jsoncons10to_integerIicEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  580|  26.2k|{
  581|  26.2k|    n = 0;
  582|       |
  583|  26.2k|    if (length == 0)
  ------------------
  |  Branch (583:9): [True: 10, False: 26.2k]
  ------------------
  584|     10|    {
  585|     10|        return to_number_result<CharT>(s, std::errc::invalid_argument);
  586|     10|    }
  587|       |
  588|  26.2k|    bool is_negative = *s == '-' ? true : false;
  ------------------
  |  Branch (588:24): [True: 20.9k, False: 5.29k]
  ------------------
  589|  26.2k|    if (is_negative)
  ------------------
  |  Branch (589:9): [True: 20.9k, False: 5.29k]
  ------------------
  590|  20.9k|    {
  591|  20.9k|        ++s;
  592|  20.9k|        --length;
  593|  20.9k|    }
  594|       |
  595|  26.2k|    using U = typename ext_traits::make_unsigned<T>::type;
  596|       |
  597|  26.2k|    U u;
  598|  26.2k|    auto ru = to_integer(s, length, u);
  599|  26.2k|    if (ru.ec != std::errc{})
  ------------------
  |  Branch (599:9): [True: 0, False: 26.2k]
  ------------------
  600|      0|    {
  601|      0|        return to_number_result<CharT>(ru.ptr, ru.ec);
  602|      0|    }
  603|  26.2k|    if (is_negative)
  ------------------
  |  Branch (603:9): [True: 20.9k, False: 5.29k]
  ------------------
  604|  20.9k|    {
  605|  20.9k|        if (u > static_cast<U>(-((ext_traits::integer_limits<T>::lowest)()+T(1))) + U(1))
  ------------------
  |  Branch (605:13): [True: 0, False: 20.9k]
  ------------------
  606|      0|        {
  607|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  608|      0|        }
  609|  20.9k|        else
  610|  20.9k|        {
  611|  20.9k|            n = static_cast<T>(U(0) - u);
  612|  20.9k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  613|  20.9k|        }
  614|  20.9k|    }
  615|  5.29k|    else
  616|  5.29k|    {
  617|  5.29k|        if (u > static_cast<U>((ext_traits::integer_limits<T>::max)()))
  ------------------
  |  Branch (617:13): [True: 0, False: 5.29k]
  ------------------
  618|      0|        {
  619|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  620|      0|        }
  621|  5.29k|        else
  622|  5.29k|        {
  623|  5.29k|            n = static_cast<T>(u);
  624|  5.29k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  625|  5.29k|        }
  626|  5.29k|    }
  627|  26.2k|}
_ZN8jsoncons16to_number_resultIcEC2EPKcNSt3__14errcE:
  164|  52.4k|        : ptr(ptr_), ec(ec_)
  165|  52.4k|    {
  166|  52.4k|    }
_ZN8jsoncons10to_integerIjcEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedntsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  397|  26.2k|{
  398|  26.2k|    n = 0;
  399|       |
  400|  26.2k|    integer_chars_state state = integer_chars_state::initial;
  401|       |
  402|  26.2k|    const CharT* end = s + length; 
  403|  78.7k|    while (s < end)
  ------------------
  |  Branch (403:12): [True: 52.4k, False: 26.2k]
  ------------------
  404|  52.4k|    {
  405|  52.4k|        switch(state)
  406|  52.4k|        {
  407|  26.2k|            case integer_chars_state::initial:
  ------------------
  |  Branch (407:13): [True: 26.2k, False: 26.2k]
  ------------------
  408|  26.2k|            {
  409|  26.2k|                switch(*s)
  410|  26.2k|                {
  411|      0|                    case '0':
  ------------------
  |  Branch (411:21): [True: 0, False: 26.2k]
  ------------------
  412|      0|                        state = integer_chars_state::integer; // Could be binary, octal, hex 
  413|      0|                        ++s;
  414|      0|                        break;
  415|  26.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: 544, False: 25.6k]
  |  Branch (415:30): [True: 1.02k, False: 25.2k]
  |  Branch (415:39): [True: 13.9k, False: 12.3k]
  |  Branch (415:48): [True: 4.58k, False: 21.6k]
  |  Branch (415:57): [True: 1.45k, False: 24.7k]
  |  Branch (415:66): [True: 3.10k, False: 23.1k]
  |  Branch (415:75): [True: 528, False: 25.7k]
  |  Branch (415:84): [True: 485, False: 25.7k]
  |  Branch (415:94): [True: 593, False: 25.6k]
  ------------------
  416|  26.2k|                        state = integer_chars_state::decimal;
  417|  26.2k|                        break;
  418|      0|                    default:
  ------------------
  |  Branch (418:21): [True: 0, False: 26.2k]
  ------------------
  419|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  420|  26.2k|                }
  421|  26.2k|                break;
  422|  26.2k|            }
  423|  26.2k|            case integer_chars_state::integer:
  ------------------
  |  Branch (423:13): [True: 0, False: 52.4k]
  ------------------
  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: 52.4k]
  ------------------
  450|      0|            {
  451|      0|                static constexpr T max_value = (ext_traits::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: 52.4k]
  ------------------
  478|      0|            {
  479|      0|                static constexpr T max_value = (ext_traits::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|  26.2k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (505:13): [True: 26.2k, False: 26.2k]
  ------------------
  506|  26.2k|            {
  507|  26.2k|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  508|  26.2k|                static constexpr T max_value_div_10 = max_value / 10;
  509|   126k|                for (; s < end; ++s)
  ------------------
  |  Branch (509:24): [True: 100k, False: 26.2k]
  ------------------
  510|   100k|                {
  511|   100k|                    T x = 0;
  512|   100k|                    switch(*s)
  513|   100k|                    {
  514|   100k|                        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.8k, False: 88.4k]
  |  Branch (514:34): [True: 8.27k, False: 92.0k]
  |  Branch (514:43): [True: 12.9k, False: 87.3k]
  |  Branch (514:52): [True: 19.1k, False: 81.1k]
  |  Branch (514:61): [True: 11.8k, False: 88.4k]
  |  Branch (514:70): [True: 4.00k, False: 96.2k]
  |  Branch (514:79): [True: 5.68k, False: 94.5k]
  |  Branch (514:88): [True: 12.9k, False: 87.3k]
  |  Branch (514:97): [True: 8.79k, False: 91.4k]
  |  Branch (514:107): [True: 4.85k, False: 95.4k]
  ------------------
  515|   100k|                            x = static_cast<T>(*s) - static_cast<T>('0');
  516|   100k|                            break;
  517|      0|                        default:
  ------------------
  |  Branch (517:25): [True: 0, False: 100k]
  ------------------
  518|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  519|   100k|                    }
  520|   100k|                    if (n > max_value_div_10)
  ------------------
  |  Branch (520:25): [True: 0, False: 100k]
  ------------------
  521|      0|                    {
  522|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  523|      0|                    }
  524|   100k|                    n = n * 10;
  525|   100k|                    if (n > max_value - x)
  ------------------
  |  Branch (525:25): [True: 0, False: 100k]
  ------------------
  526|      0|                    {
  527|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  528|      0|                    }
  529|   100k|                    n += x;
  530|   100k|                }
  531|  26.2k|                break;
  532|  26.2k|            }
  533|  26.2k|            case integer_chars_state::base16:
  ------------------
  |  Branch (533:13): [True: 0, False: 52.4k]
  ------------------
  534|      0|            {
  535|      0|                static constexpr T max_value = (ext_traits::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: 52.4k]
  ------------------
  570|      0|                JSONCONS_UNREACHABLE();
  ------------------
  |  |   80|      0|#define JSONCONS_UNREACHABLE() __builtin_unreachable()
  ------------------
  571|      0|                break;
  572|  52.4k|        }
  573|  52.4k|    }
  574|  26.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: 26.2k]
  ------------------
  575|  26.2k|}

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

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14unicode_resultIS4_EEE4typeEPKS4_m:
 1147|   676k|    {
 1148|   676k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(data);
 1149|   676k|        const uint8_t* end = it + length;
 1150|       |
 1151|   676k|        unicode_errc  result{};
 1152|  2.55M|        while (it != end) 
  ------------------
  |  Branch (1152:16): [True: 1.88M, False: 676k]
  ------------------
 1153|  1.88M|        {
 1154|  1.88M|            if ((end - it) >= 8)
  ------------------
  |  Branch (1154:17): [True: 1.48M, False: 395k]
  ------------------
 1155|  1.48M|            {
 1156|  10.3M|                JSONCONS_REPEAT8({if (JSONCONS_LIKELY((*it & 0x80) == 0)) ++it; else goto non_ascii;})
  ------------------
  |  |  342|  2.97M|#define JSONCONS_REPEAT8(x)  { x x x x x x x x }
  |  |  ------------------
  |  |  |  Branch (342:32): [True: 1.48M, False: 3.17k]
  |  |  |  Branch (342:34): [True: 1.48M, False: 2.48k]
  |  |  |  Branch (342:36): [True: 1.47M, False: 2.27k]
  |  |  |  Branch (342:38): [True: 1.47M, False: 3.85k]
  |  |  |  Branch (342:40): [True: 1.47M, False: 2.43k]
  |  |  |  Branch (342:42): [True: 1.46M, False: 3.13k]
  |  |  |  Branch (342:44): [True: 1.46M, False: 4.10k]
  |  |  |  Branch (342:46): [True: 1.46M, False: 2.74k]
  |  |  ------------------
  ------------------
 1157|  1.46M|                continue;
 1158|  10.3M|            }
 1159|   419k|    non_ascii:
 1160|   419k|            const std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[*it]) + 1;
 1161|   419k|            if (len > (std::size_t)(end - it))
  ------------------
  |  Branch (1161:17): [True: 37, False: 419k]
  ------------------
 1162|     37|            {
 1163|     37|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it), unicode_errc::source_exhausted};
 1164|     37|            }
 1165|   419k|            if ((result=is_legal_utf8(it, len)) != unicode_errc())
  ------------------
  |  Branch (1165:17): [True: 134, False: 419k]
  ------------------
 1166|    134|            {
 1167|    134|                return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1168|    134|            }
 1169|   419k|            it += len;
 1170|   419k|        }
 1171|   676k|        return unicode_result<CharT>{reinterpret_cast<const CharT*>(it),result} ;
 1172|   676k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8EPKhm:
  305|   419k|    {
  306|   419k|        const uint8_t* it = reinterpret_cast<const uint8_t*>(bytes);
  307|   419k|        const uint8_t* end = it+length;
  308|       |
  309|   419k|        uint8_t byte;
  310|   419k|        switch (length) {
  311|     22|        default:
  ------------------
  |  Branch (311:9): [True: 22, False: 419k]
  ------------------
  312|     22|            return unicode_errc::over_long_utf8_sequence;
  313|  6.07k|        case 4:
  ------------------
  |  Branch (313:9): [True: 6.07k, False: 413k]
  ------------------
  314|  6.07k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 8, False: 6.06k]
  ------------------
  315|      8|                return unicode_errc::bad_continuation_byte;
  316|  6.06k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  576|  6.06k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  17.5k|        case 3:
  ------------------
  |  Branch (317:9): [True: 11.4k, False: 408k]
  ------------------
  318|  17.5k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 16, False: 17.5k]
  ------------------
  319|     16|                return unicode_errc::bad_continuation_byte;
  320|  17.5k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  576|  17.5k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  321|  24.3k|        case 2:
  ------------------
  |  Branch (321:9): [True: 6.84k, False: 412k]
  ------------------
  322|  24.3k|            if (((byte = (*--end))& 0xC0) != 0x80)
  ------------------
  |  Branch (322:17): [True: 21, False: 24.3k]
  ------------------
  323|     21|                return unicode_errc::bad_continuation_byte;
  324|       |
  325|  24.3k|            switch (*it) 
  326|  24.3k|            {
  327|       |                // no fall-through in this inner switch
  328|  10.8k|                case 0xE0: if (byte < 0xA0) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 10.8k, False: 13.5k]
  |  Branch (328:32): [True: 6, False: 10.8k]
  ------------------
  329|  10.8k|                case 0xED: if (byte > 0x9F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 237, False: 24.1k]
  |  Branch (329:32): [True: 4, False: 233]
  ------------------
  330|  2.45k|                case 0xF0: if (byte < 0x90) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (330:17): [True: 2.45k, False: 21.8k]
  |  Branch (330:32): [True: 6, False: 2.45k]
  ------------------
  331|  2.45k|                case 0xF4: if (byte > 0x8F) return unicode_errc::source_illegal; break;
  ------------------
  |  Branch (331:17): [True: 515, False: 23.8k]
  |  Branch (331:32): [True: 2, False: 513]
  ------------------
  332|  10.3k|                default:   if (byte < 0x80) return unicode_errc::source_illegal;
  ------------------
  |  Branch (332:17): [True: 10.3k, False: 14.0k]
  |  Branch (332:32): [True: 0, False: 10.3k]
  ------------------
  333|  24.3k|            }
  334|       |
  335|  24.3k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  576|  24.3k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  336|   419k|        case 1:
  ------------------
  |  Branch (336:9): [True: 395k, False: 24.4k]
  ------------------
  337|   419k|            if (*it >= 0x80 && *it < 0xC2)
  ------------------
  |  Branch (337:17): [True: 24.3k, False: 395k]
  |  Branch (337:32): [True: 47, False: 24.3k]
  ------------------
  338|     47|                return unicode_errc::source_illegal;
  339|   419k|            break;
  340|   419k|        }
  341|   419k|        if (*it > 0xF4) 
  ------------------
  |  Branch (341:13): [True: 2, False: 419k]
  ------------------
  342|      2|            return unicode_errc::source_illegal;
  343|       |
  344|   419k|        return unicode_errc();
  345|   419k|    }

_ZN8jsoncons4bson3TP1C2Ev:
   78|  69.1k|        constexpr TP1() : low(0), high(0) {}
_ZN8jsoncons4bson21decimal128_from_charsEPKcS2_RNS0_3TP1E:
  572|  34.5k|    {
  573|  34.5k|        static const string_view inf_str = "inf";
  574|  34.5k|        static const string_view infinity_str = "infinity";
  575|  34.5k|        static const string_view nan_str = "nan";
  576|       |
  577|  34.5k|        ptrdiff_t len = last - first;
  578|       |
  579|  34.5k|        bson_uint128_6464_t significand = {0,0};
  580|       | 
  581|  34.5k|        const char* str_read = first; /* Read pointer for consuming str. */
  582|       | 
  583|       |        /* Parsing state tracking */
  584|  34.5k|        bool is_negative = false;
  585|  34.5k|        bool saw_radix = false;
  586|  34.5k|        bool includes_sign = false; /* True if the input first contains a sign. */
  587|  34.5k|        bool found_nonzero = false;
  588|       | 
  589|  34.5k|        std::size_t significant_digits = 0; /* Total number of significant digits
  590|       |                                        * (no leading or trailing zero) */
  591|  34.5k|        std::size_t ndigits_read = 0;       /* Total number of significand digits read */
  592|  34.5k|        std::size_t ndigits = 0;        /* Total number of digits (no leading zeros) */
  593|  34.5k|        std::size_t radix_position = 0; /* The number of the digits after radix */
  594|  34.5k|        std::size_t first_nonzero = 0;  /* The index of the first non-zero in *str* */
  595|       | 
  596|  34.5k|        uint16_t digits[decimal128_limits::max_digits] = {0};
  597|  34.5k|        uint16_t ndigits_stored = 0;      /* The number of digits in digits */
  598|  34.5k|        uint16_t *digits_insert = digits; /* Insertion pointer for digits */
  599|  34.5k|        std::size_t first_digit = 0;           /* The index of the first non-zero digit */
  600|  34.5k|        std::size_t last_digit = 0;            /* The index of the last digit */
  601|       | 
  602|  34.5k|        int32_t exponent = 0;
  603|  34.5k|        uint64_t significand_high = 0; /* The high 17 digits of the significand */
  604|  34.5k|        uint64_t significand_low = 0;  /* The low 17 digits of the significand */
  605|  34.5k|        uint16_t biased_exponent = 0;  /* The biased exponent */
  606|       | 
  607|  34.5k|        dec.high = 0;
  608|  34.5k|        dec.low = 0;
  609|       | 
  610|  34.5k|        if (str_read < last && (*str_read == '+' || *str_read == '-')) {
  ------------------
  |  Branch (610:13): [True: 34.5k, False: 0]
  |  Branch (610:33): [True: 0, False: 34.5k]
  |  Branch (610:53): [True: 6.49k, False: 28.0k]
  ------------------
  611|  6.49k|           is_negative = *(str_read++) == '-';
  612|  6.49k|           includes_sign = true;
  613|  6.49k|        }
  614|       |
  615|       |        /* Check for Infinity or NaN */
  616|  34.5k|        if (str_read == last || (!isdigit(*str_read) && *str_read != '.')) {
  ------------------
  |  Branch (616:13): [True: 0, False: 34.5k]
  |  Branch (616:34): [True: 5.28k, False: 29.2k]
  |  Branch (616:57): [True: 5.28k, False: 0]
  ------------------
  617|  5.28k|           if (detail::dec128_istreq (str_read, last, inf_str.data(), inf_str.data()+inf_str.length()) ||
  ------------------
  |  Branch (617:16): [True: 0, False: 5.28k]
  ------------------
  618|  5.28k|               detail::dec128_istreq (str_read, last, infinity_str.data(), infinity_str.data()+infinity_str.length())) 
  ------------------
  |  Branch (618:16): [True: 3.93k, False: 1.35k]
  ------------------
  619|  3.93k|           {
  620|  3.93k|               dec = is_negative ? decimal128_limits::neg_infinity() : decimal128_limits::infinity();
  ------------------
  |  Branch (620:22): [True: 3.31k, False: 618]
  ------------------
  621|  3.93k|              return decimal128_from_chars_result{str_read,std::errc{}};
  622|  3.93k|           } else if (detail::dec128_istreq (str_read, last, nan_str.data(), nan_str.data()+nan_str.length())) {
  ------------------
  |  Branch (622:23): [True: 1.35k, False: 0]
  ------------------
  623|  1.35k|              dec = decimal128_limits::nan();
  624|  1.35k|              return decimal128_from_chars_result{str_read,std::errc{}};
  625|  1.35k|           }
  626|       | 
  627|      0|           dec = decimal128_limits::nan();
  628|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  629|  5.28k|        }
  630|       | 
  631|       |        /* Read digits */
  632|   859k|        while ((len == -1 || str_read < first + len) &&
  ------------------
  |  Branch (632:17): [True: 0, False: 859k]
  |  Branch (632:30): [True: 856k, False: 3.02k]
  ------------------
  633|   856k|               (isdigit (*str_read) || *str_read == '.')) {
  ------------------
  |  Branch (633:17): [True: 804k, False: 51.7k]
  |  Branch (633:40): [True: 25.5k, False: 26.2k]
  ------------------
  634|   830k|           if (*str_read == '.') {
  ------------------
  |  Branch (634:16): [True: 25.5k, False: 804k]
  ------------------
  635|  25.5k|              if (saw_radix) {
  ------------------
  |  Branch (635:19): [True: 0, False: 25.5k]
  ------------------
  636|      0|                 dec = decimal128_limits::nan();
  637|      0|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  638|      0|              }
  639|       | 
  640|  25.5k|              saw_radix = true;
  641|  25.5k|              str_read++;
  642|  25.5k|              continue;
  643|  25.5k|           }
  644|       | 
  645|   804k|           if (ndigits_stored < 34) {
  ------------------
  |  Branch (645:16): [True: 804k, False: 635]
  ------------------
  646|   804k|              if (*str_read != '0' || found_nonzero) {
  ------------------
  |  Branch (646:19): [True: 730k, False: 73.7k]
  |  Branch (646:39): [True: 67.6k, False: 6.03k]
  ------------------
  647|   798k|                 if (!found_nonzero) {
  ------------------
  |  Branch (647:22): [True: 26.2k, False: 771k]
  ------------------
  648|  26.2k|                    first_nonzero = ndigits_read;
  649|  26.2k|                 }
  650|       | 
  651|   798k|                 found_nonzero = true;
  652|   798k|                 *(digits_insert++) = *(str_read) - '0'; /* Only store 34 digits */
  653|   798k|                 ndigits_stored++;
  654|   798k|              }
  655|   804k|           }
  656|       | 
  657|   804k|           if (found_nonzero) {
  ------------------
  |  Branch (657:16): [True: 798k, False: 6.03k]
  ------------------
  658|   798k|              ndigits++;
  659|   798k|           }
  660|       | 
  661|   804k|           if (saw_radix) {
  ------------------
  |  Branch (661:16): [True: 766k, False: 38.6k]
  ------------------
  662|   766k|              radix_position++;
  663|   766k|           }
  664|       | 
  665|   804k|           ndigits_read++;
  666|   804k|           str_read++;
  667|   804k|        }
  668|       | 
  669|  29.2k|        if (saw_radix && !ndigits_read) {
  ------------------
  |  Branch (669:13): [True: 25.5k, False: 3.73k]
  |  Branch (669:26): [True: 0, False: 25.5k]
  ------------------
  670|      0|           dec = decimal128_limits::nan();
  671|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  672|      0|        }
  673|       | 
  674|       |        /* Read exponent if exists */
  675|  29.2k|        if (str_read < last && (*str_read == 'e' || *str_read == 'E')) {
  ------------------
  |  Branch (675:13): [True: 26.2k, False: 3.02k]
  |  Branch (675:33): [True: 0, False: 26.2k]
  |  Branch (675:53): [True: 26.2k, False: 0]
  ------------------
  676|  26.2k|           ++str_read;
  677|  26.2k|           if (str_read < last && *str_read == '+') {
  ------------------
  |  Branch (677:16): [True: 26.2k, False: 10]
  |  Branch (677:35): [True: 5.29k, False: 20.9k]
  ------------------
  678|  5.29k|               ++str_read;
  679|  5.29k|           }
  680|  26.2k|           auto result = jsoncons::to_integer(str_read, last - str_read, exponent);
  681|  26.2k|           if (result.ec != std::errc{}) 
  ------------------
  |  Branch (681:16): [True: 10, False: 26.2k]
  ------------------
  682|     10|           {
  683|     10|               dec = decimal128_limits::nan();
  684|     10|               return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  685|     10|           }
  686|  26.2k|           str_read = result.ptr;
  687|  26.2k|        }
  688|       |
  689|  29.2k|        if ((len == -1 || str_read < first + len) && *str_read) {
  ------------------
  |  Branch (689:14): [True: 0, False: 29.2k]
  |  Branch (689:27): [True: 0, False: 29.2k]
  |  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|  29.2k|        first_digit = 0;
  697|       | 
  698|  29.2k|        if (!ndigits_stored) { /* value is zero */
  ------------------
  |  Branch (698:13): [True: 3.06k, False: 26.2k]
  ------------------
  699|  3.06k|           first_digit = 0;
  700|  3.06k|           last_digit = 0;
  701|  3.06k|           digits[0] = 0;
  702|  3.06k|           ndigits = 1;
  703|  3.06k|           ndigits_stored = 1;
  704|  3.06k|           significant_digits = 0;
  705|  26.2k|        } else {
  706|  26.2k|           last_digit = ndigits_stored - 1;
  707|  26.2k|           significant_digits = ndigits;
  708|       |           /* Mark trailing zeros as non-significant */
  709|  30.2k|           while (first[first_nonzero + significant_digits - 1 + includes_sign +
  ------------------
  |  Branch (709:19): [True: 4.08k, False: 26.2k]
  ------------------
  710|  30.2k|                         saw_radix] == '0') {
  711|  4.08k|              significant_digits--;
  712|  4.08k|           }
  713|  26.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|  29.2k|        if (exponent <= static_cast<int32_t>(radix_position) && static_cast<int32_t>(radix_position) - exponent > (1 << 14)) {
  ------------------
  |  Branch (722:13): [True: 23.9k, False: 5.29k]
  |  Branch (722:65): [True: 0, False: 23.9k]
  ------------------
  723|      0|           exponent = decimal128_limits::exponent_min;
  724|  29.2k|        } else {
  725|  29.2k|           exponent -= static_cast<int32_t>(radix_position);
  726|  29.2k|        }
  727|       | 
  728|       |        /* Attempt to normalize the exponent */
  729|  29.2k|        while (exponent > decimal128_limits::exponent_max) {
  ------------------
  |  Branch (729:16): [True: 0, False: 29.2k]
  ------------------
  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|  29.8k|        while (exponent < decimal128_limits::exponent_min || ndigits_stored < ndigits) {
  ------------------
  |  Branch (749:16): [True: 0, False: 29.8k]
  |  Branch (749:62): [True: 632, False: 29.2k]
  ------------------
  750|       |           /* Shift last digit */
  751|    632|           if (last_digit == 0) {
  ------------------
  |  Branch (751:16): [True: 0, False: 632]
  ------------------
  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|    632|           if (ndigits_stored < ndigits) {
  ------------------
  |  Branch (762:16): [True: 632, False: 0]
  ------------------
  763|    632|              if (first[ndigits - 1 + includes_sign + saw_radix] - '0' != 0 &&
  ------------------
  |  Branch (763:19): [True: 8, False: 624]
  ------------------
  764|      8|                  significant_digits != 0) {
  ------------------
  |  Branch (764:19): [True: 8, False: 0]
  ------------------
  765|      8|                 dec = decimal128_limits::nan();
  766|      8|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  767|      8|              }
  768|       | 
  769|    624|              ndigits--; /* adjust to match digits not stored */
  770|    624|           } 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|    624|           if (exponent < decimal128_limits::exponent_max) {
  ------------------
  |  Branch (781:16): [True: 624, False: 0]
  ------------------
  782|    624|              exponent++;
  783|    624|           } else {
  784|      0|              dec = decimal128_limits::nan();
  785|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  786|      0|           }
  787|    624|        }
  788|       | 
  789|       |        /* Round */
  790|       |        /* We've normalized the exponent, but might still need to round. */
  791|  29.2k|        if (last_digit - first_digit + 1 < significant_digits) {
  ------------------
  |  Branch (791:13): [True: 5, False: 29.2k]
  ------------------
  792|      5|           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|      5|           round_digit =
  797|      5|              first[first_nonzero + last_digit + includes_sign + saw_radix + 1] -
  798|      5|              '0';
  799|       | 
  800|      5|           if (round_digit != 0) {
  ------------------
  |  Branch (800:16): [True: 5, False: 0]
  ------------------
  801|       |              /* Inexact (non-zero) rounding is not allowed */
  802|      5|              dec = decimal128_limits::nan();
  803|      5|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  804|      5|           }
  805|      5|        }
  806|       | 
  807|       |        /* Encode significand */
  808|  29.2k|        significand_high = 0,   /* The high 17 digits of the significand */
  809|  29.2k|           significand_low = 0; /* The low 17 digits of the significand */
  810|       | 
  811|  29.2k|        if (significant_digits == 0) { /* read a zero */
  ------------------
  |  Branch (811:13): [True: 3.06k, False: 26.1k]
  ------------------
  812|  3.06k|           significand_high = 0;
  813|  3.06k|           significand_low = 0;
  814|  26.1k|        } else if (last_digit - first_digit < 17) {
  ------------------
  |  Branch (814:20): [True: 1.27k, False: 24.9k]
  ------------------
  815|  1.27k|           std::size_t d_idx = first_digit;
  816|  1.27k|           significand_low = digits[d_idx++];
  817|       | 
  818|  7.90k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (818:19): [True: 6.63k, False: 1.27k]
  ------------------
  819|  6.63k|              significand_low *= 10;
  820|  6.63k|              significand_low += digits[d_idx];
  821|  6.63k|              significand_high = 0;
  822|  6.63k|           }
  823|  24.9k|        } else {
  824|  24.9k|           std::size_t d_idx = first_digit;
  825|  24.9k|           significand_high = digits[d_idx++];
  826|       | 
  827|   365k|           for (; d_idx <= last_digit - 17; d_idx++) {
  ------------------
  |  Branch (827:19): [True: 340k, False: 24.9k]
  ------------------
  828|   340k|              significand_high *= 10;
  829|   340k|              significand_high += digits[d_idx];
  830|   340k|           }
  831|       | 
  832|  24.9k|           significand_low = digits[d_idx++];
  833|       | 
  834|   423k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (834:19): [True: 398k, False: 24.9k]
  ------------------
  835|   398k|              significand_low *= 10;
  836|   398k|              significand_low += digits[d_idx];
  837|   398k|           }
  838|  24.9k|        }
  839|       | 
  840|  29.2k|        detail::mul_64x64 (significand_high, 100000000000000000ull, &significand);
  841|  29.2k|        significand.low += significand_low;
  842|       | 
  843|  29.2k|        if (significand.low < significand_low) {
  ------------------
  |  Branch (843:13): [True: 4.73k, False: 24.5k]
  ------------------
  844|  4.73k|           significand.high += 1;
  845|  4.73k|        }
  846|       | 
  847|       | 
  848|  29.2k|        biased_exponent = static_cast<uint16_t>(exponent + static_cast<int32_t>(decimal128_limits::exponent_bias));
  849|       | 
  850|       |        /* Encode combination, exponent, and significand. */
  851|  29.2k|        if ((significand.high >> 49) & 1) {
  ------------------
  |  Branch (851:13): [True: 0, False: 29.2k]
  ------------------
  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|  29.2k|        } else {
  857|  29.2k|           dec.high |= (biased_exponent & 0x3fffull) << 49;
  858|  29.2k|           dec.high |= significand.high & 0x1ffffffffffffull;
  859|  29.2k|        }
  860|       | 
  861|  29.2k|        dec.low = significand.low;
  862|       | 
  863|       |        /* Encode sign */
  864|  29.2k|        if (is_negative) {
  ------------------
  |  Branch (864:13): [True: 3.16k, False: 26.0k]
  ------------------
  865|  3.16k|           dec.high |= 0x8000000000000000ull;
  866|  3.16k|        }
  867|       | 
  868|  29.2k|        return decimal128_from_chars_result{str_read,std::errc{}};
  869|  29.2k|    }
_ZN8jsoncons4bson6detail13dec128_istreqEPKcS3_S3_S3_:
  289|  11.9k|        {
  290|  59.2k|            while (!(a == lasta && b == lastb)) 
  ------------------
  |  Branch (290:22): [True: 5.28k, False: 53.9k]
  |  Branch (290:36): [True: 5.28k, False: 0]
  ------------------
  291|  53.9k|            {
  292|       |               // strings are different lengths
  293|  53.9k|               if (a == lasta || b == lastb) 
  ------------------
  |  Branch (293:20): [True: 0, False: 53.9k]
  |  Branch (293:34): [True: 3.93k, False: 50.0k]
  ------------------
  294|  3.93k|               {
  295|  3.93k|                  return false;
  296|  3.93k|               }
  297|       |         
  298|  50.0k|               if (dec128_tolower (*a) != dec128_tolower (*b)) {
  ------------------
  |  Branch (298:20): [True: 2.70k, False: 47.3k]
  ------------------
  299|  2.70k|                  return false;
  300|  2.70k|               }
  301|       |         
  302|  47.3k|               a++;
  303|  47.3k|               b++;
  304|  47.3k|            }
  305|       |         
  306|  5.28k|            return true;
  307|  11.9k|        }
_ZN8jsoncons4bson6detail14dec128_tolowerEc:
  266|   100k|        {
  267|   100k|           if (isupper (c)) {
  ------------------
  |  Branch (267:16): [True: 13.2k, False: 86.8k]
  ------------------
  268|  13.2k|              c += 32;
  269|  13.2k|           }
  270|       |
  271|   100k|           return c;
  272|   100k|        }
_ZN8jsoncons4bson17decimal128_limits12neg_infinityEv:
  124|  3.31k|        static constexpr decimal128_t neg_infinity() {return decimal128_t(0x7800000000000000ull + 0x8000000000000000ull, 0);}
_ZN8jsoncons4bson3TP1C2Emm:
   79|  5.31k|        constexpr TP1(uint64_t hi, uint64_t lo) : low(lo), high(hi) {}
_ZN8jsoncons4bson17decimal128_limits8infinityEv:
  123|    618|        static constexpr decimal128_t infinity() {return decimal128_t(0x7800000000000000ull, 0);}
_ZN8jsoncons4bson17decimal128_limits3nanEv:
  122|  1.37k|        static constexpr decimal128_t nan() {return decimal128_t(0x7c00000000000000ull, 0);}
_ZN8jsoncons4bson6detail9mul_64x64EmmPNS0_19bson_uint128_6464_tE:
  221|  29.2k|        {
  222|  29.2k|            uint64_t left_high, left_low, right_high, right_low, product_high,
  223|  29.2k|               product_mid, product_mid2, product_low;
  224|  29.2k|            bson_uint128_6464_t rt = {0,0};
  225|       | 
  226|  29.2k|            if (!left && !right) {
  ------------------
  |  Branch (226:17): [True: 4.33k, False: 24.9k]
  |  Branch (226:26): [True: 0, False: 4.33k]
  ------------------
  227|      0|               *product = rt;
  228|      0|               return;
  229|      0|            }
  230|       | 
  231|  29.2k|            left_high = left >> 32;
  232|  29.2k|            left_low = (uint32_t) left;
  233|  29.2k|            right_high = right >> 32;
  234|  29.2k|            right_low = (uint32_t) right;
  235|       | 
  236|  29.2k|            product_high = left_high * right_high;
  237|  29.2k|            product_mid = left_high * right_low;
  238|  29.2k|            product_mid2 = left_low * right_high;
  239|  29.2k|            product_low = left_low * right_low;
  240|       | 
  241|  29.2k|            product_high += product_mid >> 32;
  242|  29.2k|            product_mid = (uint32_t) product_mid + product_mid2 + (product_low >> 32);
  243|       | 
  244|  29.2k|            product_high = product_high + (product_mid >> 32);
  245|  29.2k|            product_low = (product_mid << 32) + (uint32_t) product_low;
  246|       | 
  247|  29.2k|            rt.high = product_high;
  248|  29.2k|            rt.low = product_low;
  249|  29.2k|            *product = rt;
  250|  29.2k|        }
_ZN8jsoncons4bson19decimal128_to_charsEPcS1_RKNS0_3TP1E:
  335|  34.5k|    {
  336|  34.5k|        static const std::string bson_decimal128_inf = "Infinity";
  337|  34.5k|        static const std::string bson_decimal128_nan = "NaN";
  338|       |
  339|  34.5k|        static constexpr uint32_t combination_mask = 0x1f;   /* Extract least significant 5 bits */
  340|  34.5k|        static constexpr uint32_t exponent_mask = 0x3fff;    /* Extract least significant 14 bits */
  341|  34.5k|        static constexpr uint32_t combination_infinity = 30; /* Value of combination field for Inf */
  342|  34.5k|        static constexpr uint32_t combination_nan = 31;      /* Value of combination field for NaN */
  343|  34.5k|        static constexpr uint32_t exponent_bias = 6176;      /* decimal128 exponent bias */
  344|       |
  345|  34.5k|        char* str_out = first;      /* output pointer in string */
  346|  34.5k|        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|  34.5k|        uint32_t high;                   /* bits 0 - 31 */
  351|  34.5k|        uint32_t midh;                   /* bits 32 - 63 */
  352|  34.5k|        uint32_t midl;                   /* bits 64 - 95 */
  353|  34.5k|        uint32_t low;                    /* bits 96 - 127 */
  354|  34.5k|        uint32_t combination;            /* bits 1 - 5 */
  355|  34.5k|        uint32_t biased_exponent;        /* decoded biased exponent (14 bits) */
  356|  34.5k|        uint32_t significand_digits = 0; /* the number of significand digits */
  357|  34.5k|        uint32_t significand[36] = {0};  /* the base-10 digits in the significand */
  358|  34.5k|        uint32_t *significand_read = significand; /* read pointer into significand */
  359|  34.5k|        int32_t exponent;                         /* unbiased exponent */
  360|  34.5k|        int32_t scientific_exponent; /* the exponent if scientific notation is
  361|       |                                      * used */
  362|  34.5k|        bool is_zero = false;        /* true if the number is zero */
  363|       | 
  364|  34.5k|        uint8_t significand_msb; /* the most signifcant significand bits (50-46) */
  365|  34.5k|        bson_uint128_t
  366|  34.5k|           significand128; /* temporary storage for significand decoding */
  367|       | 
  368|  34.5k|        memset (significand_str, 0, sizeof (significand_str));
  369|       | 
  370|  34.5k|        if ((int64_t) dec.high < 0) { /* negative */
  ------------------
  |  Branch (370:13): [True: 7.70k, False: 26.8k]
  ------------------
  371|  7.70k|           *(str_out++) = '-';
  372|  7.70k|        }
  373|       | 
  374|  34.5k|        low = (uint32_t) dec.low, midl = (uint32_t) (dec.low >> 32),
  375|  34.5k|        midh = (uint32_t) dec.high, high = (uint32_t) (dec.high >> 32);
  376|       | 
  377|       |        /* Decode combination field and exponent */
  378|  34.5k|        combination = (high >> 26) & combination_mask;
  379|       | 
  380|  34.5k|        if (JSONCONS_UNLIKELY ((combination >> 3) == 3)) {
  ------------------
  |  |   79|  34.5k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (79:30): [True: 8.10k, False: 26.4k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  8.10k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 3.93k, False: 4.17k]
  ------------------
  383|  3.93k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 3.93k, False: 0]
  ------------------
  384|  3.93k|               {
  385|  3.93k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  3.93k|                   str_out += bson_decimal128_inf.size();
  387|  3.93k|               }
  388|  3.93k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  3.93k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  4.17k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 1.35k, False: 2.81k]
  ------------------
  392|       |               /* first, not str_out, to erase the sign */
  393|  1.35k|               str_out = first;
  394|  1.35k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_nan.size())) 
  ------------------
  |  Branch (394:20): [True: 1.35k, False: 0]
  ------------------
  395|  1.35k|               {
  396|  1.35k|                   std::memcpy(str_out, bson_decimal128_nan.data(), bson_decimal128_nan.size());
  397|  1.35k|                   str_out += bson_decimal128_nan.size();
  398|  1.35k|               }
  399|  1.35k|               *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.35k|               return decimal128_to_chars_result{str_out, std::errc{}};
  403|  2.81k|           } else {
  404|  2.81k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  2.81k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  2.81k|           }
  407|  26.4k|        } else {
  408|  26.4k|           significand_msb = (high >> 14) & 0x7;
  409|  26.4k|           biased_exponent = (high >> 17) & exponent_mask;
  410|  26.4k|        }
  411|       | 
  412|  29.2k|        exponent = biased_exponent - exponent_bias;
  413|       |        /* Create string of significand digits */
  414|       | 
  415|       |        /* Convert the 114-bit binary number represented by */
  416|       |        /* (high, midh, midl, low) to at most 34 decimal */
  417|       |        /* digits through modulo and division. */
  418|  29.2k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|  29.2k|        significand128.parts[1] = midh;
  420|  29.2k|        significand128.parts[2] = midl;
  421|  29.2k|        significand128.parts[3] = low;
  422|       | 
  423|  29.2k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 5.30k, False: 23.9k]
  |  Branch (423:45): [True: 3.49k, False: 1.81k]
  ------------------
  424|  3.49k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 1.27k, False: 2.21k]
  |  Branch (424:45): [True: 246, False: 1.03k]
  ------------------
  425|    246|           is_zero = true;
  426|  29.0k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 2.81k, False: 26.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.81k|           is_zero = true;
  434|  26.2k|        } else {
  435|   131k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 104k, False: 26.2k]
  ------------------
  436|   104k|              uint32_t least_digits = 0;
  437|   104k|              detail::bson_uint128_divide1B (
  438|   104k|                 significand128, &significand128, &least_digits);
  439|       | 
  440|       |              /* We now have the 9 least significant digits (in base 2). */
  441|       |              /* Convert and output to string. */
  442|   104k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 6.65k, False: 98.1k]
  ------------------
  443|  6.65k|                 continue;
  444|  6.65k|              }
  445|       | 
  446|   981k|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 883k, False: 98.1k]
  ------------------
  447|   883k|                 significand[k * 9 + j] = least_digits % 10;
  448|   883k|                 least_digits /= 10;
  449|   883k|              }
  450|  98.1k|           }
  451|  26.2k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|  29.2k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 3.06k, False: 26.2k]
  ------------------
  458|  3.06k|           significand_digits = 1;
  459|  3.06k|           *significand_read = 0;
  460|  26.2k|        } else {
  461|  26.2k|           significand_digits = 36;
  462|   171k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 144k, False: 26.2k]
  ------------------
  463|   144k|              significand_digits--;
  464|   144k|              significand_read++;
  465|   144k|           }
  466|  26.2k|        }
  467|       | 
  468|  29.2k|        scientific_exponent = significand_digits - 1 + exponent;
  469|       | 
  470|       |        /* The scientific exponent checks are dictated by the string conversion
  471|       |         * specification and are somewhat arbitrary cutoffs.
  472|       |         *
  473|       |         * We must check exponent > 0, because if this is the case, the number
  474|       |         * has trailing zeros.  However, we *cannot* output these trailing zeros,
  475|       |         * because doing so would change the precision of the value, and would
  476|       |         * change stored data if the string converted number is round tripped.
  477|       |         */
  478|  29.2k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 20.9k, False: 8.32k]
  |  Branch (478:41): [True: 5.29k, False: 3.02k]
  ------------------
  479|       |           /* Scientific format */
  480|  26.2k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|  26.2k|           significand_digits--;
  482|       | 
  483|  26.2k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 24.3k, False: 1.92k]
  ------------------
  484|  24.3k|              *(str_out++) = '.';
  485|  24.3k|           }
  486|       | 
  487|   766k|           for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (487:36): [True: 740k, False: 26.1k]
  |  Branch (487:62): [True: 740k, False: 94]
  ------------------
  488|   740k|              *(str_out++) = char(*(significand_read++)) + '0';
  489|   740k|           }
  490|       |           /* Exponent */
  491|  26.2k|           *(str_out++) = 'E';
  492|       |
  493|  26.2k|           std::string s;
  494|  26.2k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 5.29k, False: 20.9k]
  ------------------
  495|  5.29k|               s.push_back('+');
  496|  5.29k|           }
  497|  26.2k|           jsoncons::append_to_string(scientific_exponent, s);
  498|  26.2k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 26.2k, False: 10]
  ------------------
  499|  26.2k|           {
  500|  26.2k|               std::memcpy(str_out, s.data(), s.size());
  501|  26.2k|           }
  502|     10|           else
  503|     10|           {
  504|     10|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|     10|           }
  506|  26.2k|           str_out += s.size();
  507|  26.2k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  3.02k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 1.81k, False: 1.21k]
  ------------------
  510|  8.55k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 6.73k, False: 1.81k]
  |  Branch (510:65): [True: 6.73k, False: 0]
  ------------------
  511|  6.73k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  6.73k|              }
  513|  1.81k|           } else {
  514|  1.21k|              int32_t radix_position = significand_digits + exponent;
  515|       | 
  516|  1.21k|              if (radix_position > 0) { /* non-zero digits before radix */
  ------------------
  |  Branch (516:19): [True: 347, False: 867]
  ------------------
  517|    347|                 for (int32_t i = 0;
  518|  5.10k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 4.75k, False: 347]
  |  Branch (518:45): [True: 4.75k, False: 0]
  ------------------
  519|  4.75k|                      i++) {
  520|  4.75k|                    *(str_out++) = char(*(significand_read++)) + '0';
  521|  4.75k|                 }
  522|    867|              } else { /* leading zero before radix point */
  523|    867|                 *(str_out++) = '0';
  524|    867|              }
  525|       | 
  526|  1.21k|              *(str_out++) = '.';
  527|  3.31k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 2.10k, False: 1.21k]
  ------------------
  528|  2.10k|                 *(str_out++) = '0';
  529|  2.10k|              }
  530|       | 
  531|  1.21k|              for (std::size_t i = 0;
  532|  25.1k|                   (i < significand_digits - (std::max) (radix_position - 1, 0)) &&
  ------------------
  |  Branch (532:20): [True: 23.9k, False: 1.21k]
  |  Branch (532:20): [True: 23.9k, False: 1.21k]
  ------------------
  533|  23.9k|                   (str_out < last);
  ------------------
  |  Branch (533:20): [True: 23.9k, False: 0]
  ------------------
  534|  23.9k|                   i++) {
  535|  23.9k|                 *(str_out++) = char(*(significand_read++)) + '0';
  536|  23.9k|              }
  537|  1.21k|           }
  538|  3.02k|        }
  539|  29.2k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|  29.2k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|   104k|        {
  179|   104k|            static constexpr uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|   104k|            uint64_t _rem = 0;
  181|   104k|            int i = 0;
  182|       |            
  183|   104k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 83.6k, False: 21.1k]
  |  Branch (183:36): [True: 60.3k, False: 23.3k]
  |  Branch (183:55): [True: 34.5k, False: 25.8k]
  ------------------
  184|  34.5k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 6.62k, False: 27.8k]
  ------------------
  185|  6.62k|               *quotient = value;
  186|  6.62k|               *rem = 0;
  187|  6.62k|               return;
  188|  6.62k|            }
  189|       |            
  190|   491k|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 392k, False: 98.2k]
  ------------------
  191|   392k|               _rem <<= 32; /* Adjust remainder to match value of next dividend */
  192|   392k|               _rem += value.parts[i]; /* Add the divided to _rem */
  193|   392k|               value.parts[i] = (uint32_t) (_rem / DIVISOR);
  194|   392k|               _rem %= DIVISOR; /* Store the remainder */
  195|   392k|            }
  196|       |            
  197|  98.2k|            *quotient = value;
  198|  98.2k|            *rem = (uint32_t) _rem;
  199|  98.2k|        }

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

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

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

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

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

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

