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

_ZN8jsoncons18basic_json_visitorIcEC2Ev:
  103|  3.00k|        basic_json_visitor() = default;
_ZN8jsoncons19typed_array_visitorD2Ev:
   33|  3.00k|        virtual ~typed_array_visitor() = default;
_ZN8jsoncons18basic_json_visitorIcE12uint64_valueEmNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  414|  2.12k|        {
  415|  2.12k|            visit_uint64(value, tag, context, ec);
  416|  2.12k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  2.12k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  417|  2.12k|        }
_ZN8jsoncons18basic_json_visitorIcE9end_arrayERKNS_11ser_contextERNSt3__110error_codeE:
  351|  1.87k|        {
  352|  1.87k|            visit_end_array(context, ec);
  353|  1.87k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  1.87k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  354|  1.87k|        }
_ZN8jsoncons18basic_json_visitorIcE11int64_valueElNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  423|  32.0k|        {
  424|  32.0k|            visit_int64(value, tag, context, ec);
  425|  32.0k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  32.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  426|  32.0k|        }
_ZN8jsoncons18basic_json_visitorIcE12double_valueEdNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  441|    833|        {
  442|    833|            visit_double(value, tag, context, ec);
  443|    833|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|    833|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  444|    833|        }
_ZN8jsoncons18basic_json_visitorIcE12begin_objectENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  318|  61.4k|        {
  319|  61.4k|            visit_begin_object(tag, context, ec);
  320|  61.4k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  61.4k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  321|  61.4k|        }
_ZN8jsoncons18basic_json_visitorIcE3keyERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEERKNS_11ser_contextERNS2_10error_codeE:
  357|   224k|        {
  358|   224k|            visit_key(name, context, ec);
  359|   224k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|   224k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  360|   224k|        }
_ZN8jsoncons18basic_json_visitorIcE10end_objectERKNS_11ser_contextERNSt3__110error_codeE:
  333|  11.9k|        {
  334|  11.9k|            visit_end_object(context, ec);
  335|  11.9k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  11.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  336|  11.9k|        }
_ZN8jsoncons18basic_json_visitorIcE12string_valueERKNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS2_10error_codeE:
  383|   119k|        {
  384|   119k|            visit_string(value, tag, context, ec);
  385|   119k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|   119k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  386|   119k|        }
_ZN8jsoncons18basic_json_visitorIcE11begin_arrayENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  339|   610k|        {
  340|   610k|            visit_begin_array(tag, context, ec);
  341|   610k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|   610k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  342|   610k|        }
_ZN8jsoncons18basic_json_visitorIcE10null_valueENS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  365|  3.20M|        {
  366|  3.20M|            visit_null(tag, context, ec);
  367|  3.20M|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  3.20M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  368|  3.20M|        }
_ZN8jsoncons18basic_json_visitorIcE10bool_valueEbNS_12semantic_tagERKNS_11ser_contextERNSt3__110error_codeE:
  374|  1.33k|        {
  375|  1.33k|            visit_bool(value, tag, context, ec);
  376|  1.33k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  1.33k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|  1.33k|        }
_ZN8jsoncons18basic_json_visitorIcE17byte_string_valueINSt3__16vectorIhNS3_9allocatorIhEEEEEEbRKT_mRKNS_11ser_contextERNS3_10error_codeENS3_9enable_ifIXsr10ext_traits18is_bytes_view_likeIS8_EE5valueEiE4typeE:
  405|  38.9k|        {
  406|  38.9k|            visit_byte_string(byte_string_view(reinterpret_cast<const uint8_t*>(b.data()),b.size()), ext_tag, context, ec);
  407|  38.9k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  38.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  408|  38.9k|        }
_ZN8jsoncons18basic_json_visitorIcE5flushEv:
  108|      5|        {
  109|      5|            visit_flush();
  110|      5|        }

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

_ZN8jsoncons10bytes_sinkINSt3__16vectorIhNS1_9allocatorIhEEEEvEC2ERS5_:
  315|  3.00k|            : buf_ptr(std::addressof(buf))
  316|  3.00k|        {
  317|  3.00k|        }
_ZN8jsoncons10bytes_sinkINSt3__16vectorIhNS1_9allocatorIhEEEEvE9push_backEh:
  329|  4.44M|        {
  330|  4.44M|            buf_ptr->push_back(static_cast<value_type>(ch));
  331|  4.44M|        }
_ZN8jsoncons10bytes_sinkINSt3__16vectorIhNS1_9allocatorIhEEEEvE5flushEv:
  325|  3.01k|        {
  326|  3.01k|        }

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  188|  3.00k|        {
  189|  3.00k|            if (buffer_)
  ------------------
  |  Branch (189:17): [True: 3.00k, False: 0]
  ------------------
  190|  3.00k|            {
  191|  3.00k|                std::allocator_traits<char_allocator_type>::deallocate(alloc_, buffer_, buffer_size_);
  192|  3.00k|            }
  193|  3.00k|        }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  171|  3.00k|            : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  172|  3.00k|              buffer_size_(default_max_buffer_size)
  173|  3.00k|        {
  174|  3.00k|            buffer_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, buffer_size_);
  175|  3.00k|            data_ = buffer_;
  176|  3.00k|        }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   54|  3.00k|          : std::basic_istream<CharT>(&nb_)
   55|  3.00k|        {
   56|  3.00k|        }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   40|  3.00k|            null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  3.00k|        {
  277|  3.00k|            return stream_ptr_->bad();  
  278|  3.00k|        }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  343|  35.4M|        {
  344|  35.4M|            std::size_t len = 0;
  345|  35.4M|            if (length_ > 0)
  ------------------
  |  Branch (345:17): [True: 35.4M, False: 7.64k]
  ------------------
  346|  35.4M|            {
  347|  35.4M|                len = (std::min)(length_, length);
  348|  35.4M|                std::memcpy(p, data_, len*sizeof(value_type));
  349|  35.4M|                data_ += len;
  350|  35.4M|                length_ -= len;
  351|  35.4M|                position_ += len;
  352|  35.4M|            }
  353|  35.4M|            if (length - len == 0)
  ------------------
  |  Branch (353:17): [True: 35.4M, False: 8.75k]
  ------------------
  354|  35.4M|            {
  355|  35.4M|                return len;
  356|  35.4M|            }
  357|  8.75k|            else if (length - len < buffer_size_)
  ------------------
  |  Branch (357:22): [True: 8.49k, False: 258]
  ------------------
  358|  8.49k|            {
  359|  8.49k|                fill_buffer();
  360|  8.49k|                if (length_ > 0)
  ------------------
  |  Branch (360:21): [True: 6.05k, False: 2.44k]
  ------------------
  361|  6.05k|                {
  362|  6.05k|                    std::size_t len2 = (std::min)(length_, length-len);
  363|  6.05k|                    std::memcpy(p+len, data_, len2*sizeof(value_type));
  364|  6.05k|                    data_ += len2;
  365|  6.05k|                    length_ -= len2;
  366|  6.05k|                    position_ += len2;
  367|  6.05k|                    len += len2;
  368|  6.05k|                }
  369|  8.49k|                return len;
  370|  8.49k|            }
  371|    258|            else
  372|    258|            {
  373|    258|                if (stream_ptr_->eof())
  ------------------
  |  Branch (373:21): [True: 0, False: 258]
  ------------------
  374|      0|                {
  375|      0|                    length_ = 0;
  376|      0|                    return 0;
  377|      0|                }
  378|    258|                JSONCONS_TRY
  ------------------
  |  |   37|    258|    #define JSONCONS_TRY try
  ------------------
  379|    258|                {
  380|    258|                    std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(p+len), length-len);
  381|    258|                    std::size_t len2 = static_cast<std::size_t>(count);
  382|    258|                    if (len2 < length-len)
  ------------------
  |  Branch (382:25): [True: 15, False: 243]
  ------------------
  383|     15|                    {
  384|     15|                        stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  385|     15|                    }
  386|    258|                    len += len2;
  387|    258|                    position_ += len2;
  388|    258|                    return len;
  389|    258|                }
  390|    258|                JSONCONS_CATCH(const std::exception&)     
  391|    258|                {
  392|      0|                    stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  393|      0|                    return 0;
  394|      0|                }
  395|    258|            }
  396|  35.4M|        }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEv:
  399|  8.49k|        {
  400|  8.49k|            if (stream_ptr_->eof())
  ------------------
  |  Branch (400:17): [True: 2.42k, False: 6.07k]
  ------------------
  401|  2.42k|            {
  402|  2.42k|                length_ = 0;
  403|  2.42k|                return;
  404|  2.42k|            }
  405|       |
  406|  6.07k|            data_ = buffer_;
  407|  6.07k|            JSONCONS_TRY
  ------------------
  |  |   37|  6.07k|    #define JSONCONS_TRY try
  ------------------
  408|  6.07k|            {
  409|  6.07k|                std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(buffer_), buffer_size_);
  410|  6.07k|                length_ = static_cast<std::size_t>(count);
  411|       |
  412|  6.07k|                if (length_ < buffer_size_)
  ------------------
  |  Branch (412:21): [True: 2.97k, False: 3.09k]
  ------------------
  413|  2.97k|                {
  414|  2.97k|                    stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  415|  2.97k|                }
  416|  6.07k|            }
  417|  6.07k|            JSONCONS_CATCH(const std::exception&)     
  418|  6.07k|            {
  419|      0|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  420|      0|                length_ = 0;
  421|      0|            }
  422|  6.07k|        }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_12basic_stringIcNS2_11char_traitsIcEENS3_IcEEEEEENS2_9enable_ifIXaaaasr3std14is_convertibleIhNT_10value_typeEEE5valuesr10ext_traits11has_reserveISE_EE5valuentsr10ext_traits14has_data_exactIPhSE_EE5valueEmE4typeERS5_RSE_m:
  882|  3.84k|        {
  883|  3.84k|            std::size_t unread = length;
  884|       |
  885|  3.84k|            std::size_t n = (std::min)(max_buffer_length, unread);
  886|  5.89k|            while (n > 0 && !source.eof())
  ------------------
  |  Branch (886:20): [True: 2.18k, False: 3.71k]
  |  Branch (886:29): [True: 2.05k, False: 132]
  ------------------
  887|  2.05k|            {
  888|  2.05k|                v.reserve(v.size()+n);
  889|  2.05k|                std::size_t actual = 0;
  890|  10.5M|                while (actual < n)
  ------------------
  |  Branch (890:24): [True: 10.4M, False: 1.96k]
  ------------------
  891|  10.4M|                {
  892|  10.4M|                    typename Source::value_type c{};
  893|  10.4M|                    if (source.read(&c,1) != 1)
  ------------------
  |  Branch (893:25): [True: 84, False: 10.4M]
  ------------------
  894|     84|                    {
  895|     84|                        break;
  896|     84|                    }
  897|  10.4M|                    v.push_back(c);
  898|  10.4M|                    ++actual;
  899|  10.4M|                }
  900|  2.05k|                unread -= actual;
  901|  2.05k|                n = (std::min)(max_buffer_length, unread);
  902|  2.05k|            }
  903|       |
  904|  3.84k|            return length - unread;
  905|  3.84k|        }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  5.50k|        {
  272|  5.50k|            return length_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:20): [True: 731, False: 4.77k]
  |  Branch (272:36): [True: 305, False: 426]
  ------------------
  273|  5.50k|        }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaaasr3std14is_convertibleIhNT_10value_typeEEE5valuesr10ext_traits11has_reserveISB_EE5valuesr10ext_traits14has_data_exactIPhSB_EE5valueEmE4typeERS5_RSB_m:
  859|  39.0k|        {
  860|  39.0k|            std::size_t unread = length;
  861|       |
  862|  39.0k|            std::size_t n = (std::min)(max_buffer_length, unread);
  863|  42.2k|            while (n > 0 && !source.eof())
  ------------------
  |  Branch (863:20): [True: 3.31k, False: 38.9k]
  |  Branch (863:29): [True: 3.14k, False: 173]
  ------------------
  864|  3.14k|            {
  865|  3.14k|                std::size_t offset = v.size();
  866|  3.14k|                v.resize(v.size()+n);
  867|  3.14k|                std::size_t actual = source.read(v.data()+offset, n);
  868|  3.14k|                unread -= actual;
  869|  3.14k|                n = (std::min)(max_buffer_length, unread);
  870|  3.14k|            }
  871|       |
  872|  39.0k|            return length - unread;
  873|  39.0k|        }

_ZN8jsoncons6binary16native_to_littleIjNSt3__111__wrap_iterIPhEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrS9_6littleEvE4typeET_T0_:
  142|  55.7k|    {
  143|  55.7k|        uint8_t buf[sizeof(T)];
  144|  55.7k|        std::memcpy(buf, &val, sizeof(T));
  145|  55.7k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 222k, False: 55.7k]
  ------------------
  146|   222k|        {
  147|   222k|            *d_first++ = item;
  148|   222k|        }
  149|  55.7k|    }
_ZN8jsoncons6binary16native_to_littleIlNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  29.8k|    {
  143|  29.8k|        uint8_t buf[sizeof(T)];
  144|  29.8k|        std::memcpy(buf, &val, sizeof(T));
  145|  29.8k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 239k, False: 29.8k]
  ------------------
  146|   239k|        {
  147|   239k|            *d_first++ = item;
  148|   239k|        }
  149|  29.8k|    }
_ZN8jsoncons6binary16native_to_littleIjNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  2.91k|    {
  143|  2.91k|        uint8_t buf[sizeof(T)];
  144|  2.91k|        std::memcpy(buf, &val, sizeof(T));
  145|  2.91k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 11.6k, False: 2.91k]
  ------------------
  146|  11.6k|        {
  147|  11.6k|            *d_first++ = item;
  148|  11.6k|        }
  149|  2.91k|    }
_ZN8jsoncons6binary16native_to_littleImNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|   183k|    {
  143|   183k|        uint8_t buf[sizeof(T)];
  144|   183k|        std::memcpy(buf, &val, sizeof(T));
  145|   183k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 1.46M, False: 183k]
  ------------------
  146|  1.46M|        {
  147|  1.46M|            *d_first++ = item;
  148|  1.46M|        }
  149|   183k|    }
_ZN8jsoncons6binary16native_to_littleIdNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|    833|    {
  143|    833|        uint8_t buf[sizeof(T)];
  144|    833|        std::memcpy(buf, &val, sizeof(T));
  145|    833|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 6.66k, False: 833]
  ------------------
  146|  6.66k|        {
  147|  6.66k|            *d_first++ = item;
  148|  6.66k|        }
  149|    833|    }
_ZN8jsoncons6binary16little_to_nativeIiNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   716k|    {
  198|   716k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 716k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   716k|        T val;
  203|   716k|        std::memcpy(&val,first,sizeof(T));
  204|   716k|        return val;
  205|   716k|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|    833|    {
  198|    833|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 833]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|    833|        T val;
  203|    833|        std::memcpy(&val,first,sizeof(T));
  204|    833|        return val;
  205|    833|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   186k|    {
  198|   186k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 186k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   186k|        T val;
  203|   186k|        std::memcpy(&val,first,sizeof(T));
  204|   186k|        return val;
  205|   186k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  29.9k|    {
  198|  29.9k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 29.9k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  29.9k|        T val;
  203|  29.9k|        std::memcpy(&val,first,sizeof(T));
  204|  29.9k|        return val;
  205|  29.9k|    }

_ZNK8jsoncons16byte_string_view5beginEv:
  409|  38.8k|        {
  410|  38.8k|            return data_;
  411|  38.8k|        }
_ZNK8jsoncons16byte_string_view3endEv:
  413|  38.8k|        {
  414|  38.8k|            return data_ + size_;
  415|  38.8k|        }
_ZN8jsoncons16byte_string_viewC2EPKhm:
  362|  38.9k|            : data_(data), size_(length)
  363|  38.9k|        {
  364|  38.9k|        }

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

_ZN8jsoncons10to_integerIicEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  557|  84.9k|{
  558|  84.9k|    n = 0;
  559|       |
  560|  84.9k|    if (length == 0)
  ------------------
  |  Branch (560:9): [True: 254, False: 84.6k]
  ------------------
  561|    254|    {
  562|    254|        return to_number_result<CharT>(s, std::errc::invalid_argument);
  563|    254|    }
  564|       |
  565|  84.6k|    bool is_negative = *s == '-' ? true : false;
  ------------------
  |  Branch (565:24): [True: 75.0k, False: 9.63k]
  ------------------
  566|  84.6k|    if (is_negative)
  ------------------
  |  Branch (566:9): [True: 75.0k, False: 9.63k]
  ------------------
  567|  75.0k|    {
  568|  75.0k|        ++s;
  569|  75.0k|        --length;
  570|  75.0k|    }
  571|       |
  572|  84.6k|    using U = typename ext_traits::make_unsigned<T>::type;
  573|       |
  574|  84.6k|    U u;
  575|  84.6k|    auto ru = to_integer(s, length, u);
  576|  84.6k|    if (ru.ec != std::errc{})
  ------------------
  |  Branch (576:9): [True: 0, False: 84.6k]
  ------------------
  577|      0|    {
  578|      0|        return to_number_result<CharT>(ru.ptr, ru.ec);
  579|      0|    }
  580|  84.6k|    if (is_negative)
  ------------------
  |  Branch (580:9): [True: 75.0k, False: 9.63k]
  ------------------
  581|  75.0k|    {
  582|  75.0k|        if (u > static_cast<U>(-((ext_traits::integer_limits<T>::lowest)()+T(1))) + U(1))
  ------------------
  |  Branch (582:13): [True: 0, False: 75.0k]
  ------------------
  583|      0|        {
  584|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  585|      0|        }
  586|  75.0k|        else
  587|  75.0k|        {
  588|  75.0k|            n = static_cast<T>(U(0) - u);
  589|  75.0k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  590|  75.0k|        }
  591|  75.0k|    }
  592|  9.63k|    else
  593|  9.63k|    {
  594|  9.63k|        if (u > static_cast<U>((ext_traits::integer_limits<T>::max)()))
  ------------------
  |  Branch (594:13): [True: 0, False: 9.63k]
  ------------------
  595|      0|        {
  596|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  597|      0|        }
  598|  9.63k|        else
  599|  9.63k|        {
  600|  9.63k|            n = static_cast<T>(u);
  601|  9.63k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  602|  9.63k|        }
  603|  9.63k|    }
  604|  84.6k|}
_ZN8jsoncons16to_number_resultIcEC2EPKcNSt3__14errcE:
  141|   169k|        : ptr(ptr_), ec(ec_)
  142|   169k|    {
  143|   169k|    }
_ZN8jsoncons10to_integerIjcEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedntsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  374|  84.6k|{
  375|  84.6k|    n = 0;
  376|       |
  377|  84.6k|    integer_chars_state state = integer_chars_state::initial;
  378|       |
  379|  84.6k|    const CharT* end = s + length; 
  380|   253k|    while (s < end)
  ------------------
  |  Branch (380:12): [True: 169k, False: 84.6k]
  ------------------
  381|   169k|    {
  382|   169k|        switch(state)
  383|   169k|        {
  384|  84.6k|            case integer_chars_state::initial:
  ------------------
  |  Branch (384:13): [True: 84.6k, False: 84.6k]
  ------------------
  385|  84.6k|            {
  386|  84.6k|                switch(*s)
  387|  84.6k|                {
  388|      0|                    case '0':
  ------------------
  |  Branch (388:21): [True: 0, False: 84.6k]
  ------------------
  389|      0|                        state = integer_chars_state::integer; // Could be binary, octal, hex 
  390|      0|                        ++s;
  391|      0|                        break;
  392|  84.6k|                    case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9': // Must be decimal
  ------------------
  |  Branch (392:21): [True: 584, False: 84.0k]
  |  Branch (392:30): [True: 1.19k, False: 83.4k]
  |  Branch (392:39): [True: 66.0k, False: 18.6k]
  |  Branch (392:48): [True: 4.85k, False: 79.8k]
  |  Branch (392:57): [True: 2.48k, False: 82.1k]
  |  Branch (392:66): [True: 2.58k, False: 82.0k]
  |  Branch (392:75): [True: 5.80k, False: 78.8k]
  |  Branch (392:84): [True: 608, False: 84.0k]
  |  Branch (392:94): [True: 507, False: 84.1k]
  ------------------
  393|  84.6k|                        state = integer_chars_state::decimal;
  394|  84.6k|                        break;
  395|      0|                    default:
  ------------------
  |  Branch (395:21): [True: 0, False: 84.6k]
  ------------------
  396|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  397|  84.6k|                }
  398|  84.6k|                break;
  399|  84.6k|            }
  400|  84.6k|            case integer_chars_state::integer:
  ------------------
  |  Branch (400:13): [True: 0, False: 169k]
  ------------------
  401|      0|            {
  402|      0|                switch(*s)
  403|      0|                {
  404|      0|                    case 'b':case 'B':
  ------------------
  |  Branch (404:21): [True: 0, False: 0]
  |  Branch (404:30): [True: 0, False: 0]
  ------------------
  405|      0|                    {
  406|      0|                        state = integer_chars_state::binary;
  407|      0|                        ++s;
  408|      0|                        break;
  409|      0|                    }
  410|      0|                    case 'x':case 'X':
  ------------------
  |  Branch (410:21): [True: 0, False: 0]
  |  Branch (410:30): [True: 0, False: 0]
  ------------------
  411|      0|                    {
  412|      0|                        state = integer_chars_state::base16;
  413|      0|                        ++s;
  414|      0|                        break;
  415|      0|                    }
  416|      0|                    case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (416:21): [True: 0, False: 0]
  |  Branch (416:30): [True: 0, False: 0]
  |  Branch (416:39): [True: 0, False: 0]
  |  Branch (416:48): [True: 0, False: 0]
  |  Branch (416:57): [True: 0, False: 0]
  |  Branch (416:66): [True: 0, False: 0]
  |  Branch (416:75): [True: 0, False: 0]
  |  Branch (416:84): [True: 0, False: 0]
  |  Branch (416:93): [True: 0, False: 0]
  |  Branch (416:103): [True: 0, False: 0]
  ------------------
  417|      0|                    {
  418|      0|                        state = integer_chars_state::octal;
  419|      0|                        break;
  420|      0|                    }
  421|      0|                    default:
  ------------------
  |  Branch (421:21): [True: 0, False: 0]
  ------------------
  422|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  423|      0|                }
  424|      0|                break;
  425|      0|            }
  426|      0|            case integer_chars_state::binary:
  ------------------
  |  Branch (426:13): [True: 0, False: 169k]
  ------------------
  427|      0|            {
  428|      0|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  429|      0|                static constexpr T max_value_div_2 = max_value / 2;
  430|      0|                for (; s < end; ++s)
  ------------------
  |  Branch (430:24): [True: 0, False: 0]
  ------------------
  431|      0|                {
  432|      0|                    T x = 0;
  433|      0|                    switch(*s)
  434|      0|                    {
  435|      0|                        case '0':case '1':
  ------------------
  |  Branch (435:25): [True: 0, False: 0]
  |  Branch (435:34): [True: 0, False: 0]
  ------------------
  436|      0|                            x = static_cast<T>(*s) - static_cast<T>('0');
  437|      0|                            break;
  438|      0|                        default:
  ------------------
  |  Branch (438:25): [True: 0, False: 0]
  ------------------
  439|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  440|      0|                    }
  441|      0|                    if (n > max_value_div_2)
  ------------------
  |  Branch (441:25): [True: 0, False: 0]
  ------------------
  442|      0|                    {
  443|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  444|      0|                    }
  445|      0|                    n = n * 2;
  446|      0|                    if (n > max_value - x)
  ------------------
  |  Branch (446:25): [True: 0, False: 0]
  ------------------
  447|      0|                    {
  448|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  449|      0|                    }
  450|      0|                    n += x;
  451|      0|                }
  452|      0|                break;
  453|      0|            }
  454|      0|            case integer_chars_state::octal:
  ------------------
  |  Branch (454:13): [True: 0, False: 169k]
  ------------------
  455|      0|            {
  456|      0|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  457|      0|                static constexpr T max_value_div_8 = max_value / 8;
  458|      0|                for (; s < end; ++s)
  ------------------
  |  Branch (458:24): [True: 0, False: 0]
  ------------------
  459|      0|                {
  460|      0|                    T x = 0;
  461|      0|                    switch(*s)
  462|      0|                    {
  463|      0|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':
  ------------------
  |  Branch (463:25): [True: 0, False: 0]
  |  Branch (463:34): [True: 0, False: 0]
  |  Branch (463:43): [True: 0, False: 0]
  |  Branch (463:52): [True: 0, False: 0]
  |  Branch (463:61): [True: 0, False: 0]
  |  Branch (463:70): [True: 0, False: 0]
  |  Branch (463:79): [True: 0, False: 0]
  |  Branch (463:88): [True: 0, False: 0]
  ------------------
  464|      0|                            x = static_cast<T>(*s) - static_cast<T>('0');
  465|      0|                            break;
  466|      0|                        default:
  ------------------
  |  Branch (466:25): [True: 0, False: 0]
  ------------------
  467|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  468|      0|                    }
  469|      0|                    if (n > max_value_div_8)
  ------------------
  |  Branch (469:25): [True: 0, False: 0]
  ------------------
  470|      0|                    {
  471|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  472|      0|                    }
  473|      0|                    n = n * 8;
  474|      0|                    if (n > max_value - x)
  ------------------
  |  Branch (474:25): [True: 0, False: 0]
  ------------------
  475|      0|                    {
  476|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  477|      0|                    }
  478|      0|                    n += x;
  479|      0|                }
  480|      0|                break;
  481|      0|            }
  482|  84.6k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (482:13): [True: 84.6k, False: 84.6k]
  ------------------
  483|  84.6k|            {
  484|  84.6k|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  485|  84.6k|                static constexpr T max_value_div_10 = max_value / 10;
  486|   403k|                for (; s < end; ++s)
  ------------------
  |  Branch (486:24): [True: 319k, False: 84.6k]
  ------------------
  487|   319k|                {
  488|   319k|                    T x = 0;
  489|   319k|                    switch(*s)
  490|   319k|                    {
  491|   319k|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (491:25): [True: 49.1k, False: 270k]
  |  Branch (491:34): [True: 21.4k, False: 297k]
  |  Branch (491:43): [True: 49.3k, False: 269k]
  |  Branch (491:52): [True: 85.5k, False: 233k]
  |  Branch (491:61): [True: 9.02k, False: 310k]
  |  Branch (491:70): [True: 8.83k, False: 310k]
  |  Branch (491:79): [True: 8.11k, False: 311k]
  |  Branch (491:88): [True: 58.3k, False: 260k]
  |  Branch (491:97): [True: 23.8k, False: 295k]
  |  Branch (491:107): [True: 5.53k, False: 313k]
  ------------------
  492|   319k|                            x = static_cast<T>(*s) - static_cast<T>('0');
  493|   319k|                            break;
  494|      0|                        default:
  ------------------
  |  Branch (494:25): [True: 0, False: 319k]
  ------------------
  495|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  496|   319k|                    }
  497|   319k|                    if (n > max_value_div_10)
  ------------------
  |  Branch (497:25): [True: 0, False: 319k]
  ------------------
  498|      0|                    {
  499|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  500|      0|                    }
  501|   319k|                    n = n * 10;
  502|   319k|                    if (n > max_value - x)
  ------------------
  |  Branch (502:25): [True: 0, False: 319k]
  ------------------
  503|      0|                    {
  504|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  505|      0|                    }
  506|   319k|                    n += x;
  507|   319k|                }
  508|  84.6k|                break;
  509|  84.6k|            }
  510|  84.6k|            case integer_chars_state::base16:
  ------------------
  |  Branch (510:13): [True: 0, False: 169k]
  ------------------
  511|      0|            {
  512|      0|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  513|      0|                static constexpr T max_value_div_16 = max_value / 16;
  514|      0|                for (; s < end; ++s)
  ------------------
  |  Branch (514:24): [True: 0, False: 0]
  ------------------
  515|      0|                {
  516|      0|                    CharT c = *s;
  517|      0|                    T x = 0;
  518|      0|                    switch (c)
  519|      0|                    {
  520|      0|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (520:25): [True: 0, False: 0]
  |  Branch (520:34): [True: 0, False: 0]
  |  Branch (520:43): [True: 0, False: 0]
  |  Branch (520:52): [True: 0, False: 0]
  |  Branch (520:61): [True: 0, False: 0]
  |  Branch (520:70): [True: 0, False: 0]
  |  Branch (520:79): [True: 0, False: 0]
  |  Branch (520:88): [True: 0, False: 0]
  |  Branch (520:97): [True: 0, False: 0]
  |  Branch (520:107): [True: 0, False: 0]
  ------------------
  521|      0|                            x = static_cast<T>(c - '0');
  522|      0|                            break;
  523|      0|                        case 'a':case 'b':case 'c':case 'd':case 'e':case 'f':
  ------------------
  |  Branch (523:25): [True: 0, False: 0]
  |  Branch (523:34): [True: 0, False: 0]
  |  Branch (523:43): [True: 0, False: 0]
  |  Branch (523:52): [True: 0, False: 0]
  |  Branch (523:61): [True: 0, False: 0]
  |  Branch (523:70): [True: 0, False: 0]
  ------------------
  524|      0|                            x = static_cast<T>(c - ('a' - 10));
  525|      0|                            break;
  526|      0|                        case 'A':case 'B':case 'C':case 'D':case 'E':case 'F':
  ------------------
  |  Branch (526:25): [True: 0, False: 0]
  |  Branch (526:34): [True: 0, False: 0]
  |  Branch (526:43): [True: 0, False: 0]
  |  Branch (526:52): [True: 0, False: 0]
  |  Branch (526:61): [True: 0, False: 0]
  |  Branch (526:70): [True: 0, False: 0]
  ------------------
  527|      0|                            x = static_cast<T>(c - ('A' - 10));
  528|      0|                            break;
  529|      0|                        default:
  ------------------
  |  Branch (529:25): [True: 0, False: 0]
  ------------------
  530|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  531|      0|                    }
  532|      0|                    if (n > max_value_div_16)
  ------------------
  |  Branch (532:25): [True: 0, False: 0]
  ------------------
  533|      0|                    {
  534|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  535|      0|                    }
  536|      0|                    n = n * 16;
  537|      0|                    if (n > max_value - x)
  ------------------
  |  Branch (537:25): [True: 0, False: 0]
  ------------------
  538|      0|                    {
  539|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  540|      0|                    }
  541|       |
  542|      0|                    n += x;
  543|      0|                }
  544|      0|                break;
  545|      0|            }
  546|      0|            default:
  ------------------
  |  Branch (546:13): [True: 0, False: 169k]
  ------------------
  547|      0|                JSONCONS_UNREACHABLE();
  ------------------
  |  |   79|      0|#define JSONCONS_UNREACHABLE() __builtin_unreachable()
  ------------------
  548|      0|                break;
  549|   169k|        }
  550|   169k|    }
  551|  84.6k|    return (state == integer_chars_state::initial) ? to_number_result<CharT>(s, std::errc::invalid_argument) : to_number_result<CharT>(s, std::errc{});
  ------------------
  |  Branch (551:12): [True: 0, False: 84.6k]
  ------------------
  552|  84.6k|}

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14convert_resultIS4_EEE4typeEPKS4_m:
 1134|   230k|    {
 1135|   230k|        conv_errc  result = conv_errc();
 1136|   230k|        const CharT* last = data + length;
 1137|  7.34M|        while (data != last) 
  ------------------
  |  Branch (1137:16): [True: 7.11M, False: 230k]
  ------------------
 1138|  7.11M|        {
 1139|  7.11M|            std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[static_cast<uint8_t>(*data)]) + 1;
 1140|  7.11M|            if (len > (std::size_t)(last - data))
  ------------------
  |  Branch (1140:17): [True: 11, False: 7.11M]
  ------------------
 1141|     11|            {
 1142|     11|                return convert_result<CharT>{data, conv_errc::source_exhausted};
 1143|     11|            }
 1144|  7.11M|            if ((result=is_legal_utf8(data, len)) != conv_errc())
  ------------------
  |  Branch (1144:17): [True: 93, False: 7.11M]
  ------------------
 1145|     93|            {
 1146|     93|                return convert_result<CharT>{data,result} ;
 1147|     93|            }
 1148|  7.11M|            data += len;
 1149|  7.11M|        }
 1150|   230k|        return convert_result<CharT>{data,result} ;
 1151|   230k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8IcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_9conv_errcEE4typeEPKS4_m:
  303|  7.11M|    {
  304|  7.11M|        uint8_t a;
  305|  7.11M|        const CharT* srcptr = first+length;
  306|  7.11M|        switch (length) {
  307|     31|        default:
  ------------------
  |  Branch (307:9): [True: 31, False: 7.11M]
  ------------------
  308|     31|            return conv_errc::over_long_utf8_sequence;
  309|  1.34k|        case 4:
  ------------------
  |  Branch (309:9): [True: 1.34k, False: 7.11M]
  ------------------
  310|  1.34k|            if (((a = (*--srcptr))& 0xC0) != 0x80)
  ------------------
  |  Branch (310:17): [True: 3, False: 1.33k]
  ------------------
  311|      3|                return conv_errc::expected_continuation_byte;
  312|  1.33k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.33k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  313|  3.48k|        case 3:
  ------------------
  |  Branch (313:9): [True: 2.14k, False: 7.11M]
  ------------------
  314|  3.48k|            if (((a = (*--srcptr))& 0xC0) != 0x80)
  ------------------
  |  Branch (314:17): [True: 7, False: 3.48k]
  ------------------
  315|      7|                return conv_errc::expected_continuation_byte;
  316|  3.48k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  3.48k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  317|  4.91k|        case 2:
  ------------------
  |  Branch (317:9): [True: 1.43k, False: 7.11M]
  ------------------
  318|  4.91k|            if (((a = (*--srcptr))& 0xC0) != 0x80)
  ------------------
  |  Branch (318:17): [True: 8, False: 4.90k]
  ------------------
  319|      8|                return conv_errc::expected_continuation_byte;
  320|       |
  321|  4.90k|            switch (static_cast<uint8_t>(*first)) 
  322|  4.90k|            {
  323|       |                // no fall-through in this inner switch
  324|  1.82k|                case 0xE0: if (a < 0xA0) return conv_errc::source_illegal; break;
  ------------------
  |  Branch (324:17): [True: 1.82k, False: 3.08k]
  |  Branch (324:32): [True: 6, False: 1.81k]
  ------------------
  325|  1.81k|                case 0xED: if (a > 0x9F) return conv_errc::source_illegal; break;
  ------------------
  |  Branch (325:17): [True: 243, False: 4.66k]
  |  Branch (325:32): [True: 3, False: 240]
  ------------------
  326|    536|                case 0xF0: if (a < 0x90) return conv_errc::source_illegal; break;
  ------------------
  |  Branch (326:17): [True: 536, False: 4.37k]
  |  Branch (326:32): [True: 6, False: 530]
  ------------------
  327|    530|                case 0xF4: if (a > 0x8F) return conv_errc::source_illegal; break;
  ------------------
  |  Branch (327:17): [True: 496, False: 4.41k]
  |  Branch (327:32): [True: 5, False: 491]
  ------------------
  328|  1.81k|                default:   if (a < 0x80) return conv_errc::source_illegal;
  ------------------
  |  Branch (328:17): [True: 1.81k, False: 3.09k]
  |  Branch (328:32): [True: 0, False: 1.81k]
  ------------------
  329|  4.90k|            }
  330|       |
  331|  4.88k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  4.88k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  332|  7.11M|        case 1:
  ------------------
  |  Branch (332:9): [True: 7.10M, False: 4.95k]
  ------------------
  333|  7.11M|            if (static_cast<uint8_t>(*first) >= 0x80 && static_cast<uint8_t>(*first) < 0xC2)
  ------------------
  |  Branch (333:17): [True: 4.90k, False: 7.10M]
  |  Branch (333:57): [True: 23, False: 4.88k]
  ------------------
  334|     23|                return conv_errc::source_illegal;
  335|  7.11M|            break;
  336|  7.11M|        }
  337|  7.11M|        if (static_cast<uint8_t>(*first) > 0xF4) 
  ------------------
  |  Branch (337:13): [True: 1, False: 7.11M]
  ------------------
  338|      1|            return conv_errc::source_illegal;
  339|       |
  340|  7.11M|        return conv_errc();
  341|  7.11M|    }

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

_ZN8jsoncons4bson3TP1C2Ev:
   78|   183k|        constexpr TP1() : low(0), high(0) {}
_ZN8jsoncons4bson21decimal128_from_charsEPKcS2_RNS0_3TP1E:
  572|  91.8k|    {
  573|  91.8k|        const string_view inf_str = "inf";
  574|  91.8k|        const string_view infinity_str = "infinity";
  575|  91.8k|        const string_view nan_str = "nan";
  576|       |
  577|  91.8k|        ptrdiff_t len = last - first;
  578|       |
  579|  91.8k|        bson_uint128_6464_t significand = {0,0};
  580|       | 
  581|  91.8k|        const char* str_read = first; /* Read pointer for consuming str. */
  582|       | 
  583|       |        /* Parsing state tracking */
  584|  91.8k|        bool is_negative = false;
  585|  91.8k|        bool saw_radix = false;
  586|  91.8k|        bool includes_sign = false; /* True if the input first contains a sign. */
  587|  91.8k|        bool found_nonzero = false;
  588|       | 
  589|  91.8k|        std::size_t significant_digits = 0; /* Total number of significant digits
  590|       |                                        * (no leading or trailing zero) */
  591|  91.8k|        std::size_t ndigits_read = 0;       /* Total number of significand digits read */
  592|  91.8k|        std::size_t ndigits = 0;        /* Total number of digits (no leading zeros) */
  593|  91.8k|        std::size_t radix_position = 0; /* The number of the digits after radix */
  594|  91.8k|        std::size_t first_nonzero = 0;  /* The index of the first non-zero in *str* */
  595|       | 
  596|  91.8k|        uint16_t digits[decimal128_limits::max_digits] = {0};
  597|  91.8k|        uint16_t ndigits_stored = 0;      /* The number of digits in digits */
  598|  91.8k|        uint16_t *digits_insert = digits; /* Insertion pointer for digits */
  599|  91.8k|        std::size_t first_digit = 0;           /* The index of the first non-zero digit */
  600|  91.8k|        std::size_t last_digit = 0;            /* The index of the last digit */
  601|       | 
  602|  91.8k|        int32_t exponent = 0;
  603|  91.8k|        uint64_t significand_high = 0; /* The high 17 digits of the significand */
  604|  91.8k|        uint64_t significand_low = 0;  /* The low 17 digits of the significand */
  605|  91.8k|        uint16_t biased_exponent = 0;  /* The biased exponent */
  606|       | 
  607|  91.8k|        dec.high = 0;
  608|  91.8k|        dec.low = 0;
  609|       | 
  610|  91.8k|        if (*str_read == '+' || *str_read == '-') {
  ------------------
  |  Branch (610:13): [True: 0, False: 91.8k]
  |  Branch (610:33): [True: 10.2k, False: 81.6k]
  ------------------
  611|  10.2k|           is_negative = *(str_read++) == '-';
  612|  10.2k|           includes_sign = true;
  613|  10.2k|        }
  614|       |
  615|       |        /* Check for Infinity or NaN */
  616|  91.8k|        if (!isdigit(*str_read) && *str_read != '.') {
  ------------------
  |  Branch (616:13): [True: 3.80k, False: 88.0k]
  |  Branch (616:36): [True: 3.80k, False: 0]
  ------------------
  617|  3.80k|           if (detail::dec128_istreq (str_read, last, inf_str.data(), inf_str.data()+inf_str.length()) ||
  ------------------
  |  Branch (617:16): [True: 0, False: 3.80k]
  ------------------
  618|  3.80k|               detail::dec128_istreq (str_read, last, infinity_str.data(), infinity_str.data()+infinity_str.length())) 
  ------------------
  |  Branch (618:16): [True: 3.02k, False: 773]
  ------------------
  619|  3.02k|           {
  620|  3.02k|               dec = is_negative ? decimal128_limits::neg_infinity() : decimal128_limits::infinity();
  ------------------
  |  Branch (620:22): [True: 2.81k, False: 214]
  ------------------
  621|  3.02k|              return decimal128_from_chars_result{str_read,std::errc{}};
  622|  3.02k|           } else if (detail::dec128_istreq (str_read, last, nan_str.data(), nan_str.data()+nan_str.length())) {
  ------------------
  |  Branch (622:23): [True: 773, False: 0]
  ------------------
  623|    773|              dec = decimal128_limits::nan();
  624|    773|              return decimal128_from_chars_result{str_read,std::errc{}};
  625|    773|           }
  626|       | 
  627|      0|           dec = decimal128_limits::nan();
  628|      0|           return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  629|  3.80k|        }
  630|       | 
  631|       |        /* Read digits */
  632|  2.86M|        while (((isdigit (*str_read) || *str_read == '.')) &&
  ------------------
  |  Branch (632:18): [True: 2.69M, False: 169k]
  |  Branch (632:41): [True: 80.9k, False: 88.0k]
  ------------------
  633|  2.77M|               (len == -1 || str_read < first + len)) {
  ------------------
  |  Branch (633:17): [True: 0, False: 2.77M]
  |  Branch (633:30): [True: 2.77M, False: 0]
  ------------------
  634|  2.77M|           if (*str_read == '.') {
  ------------------
  |  Branch (634:16): [True: 80.9k, False: 2.69M]
  ------------------
  635|  80.9k|              if (saw_radix) {
  ------------------
  |  Branch (635:19): [True: 0, False: 80.9k]
  ------------------
  636|      0|                 dec = decimal128_limits::nan();
  637|      0|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  638|      0|              }
  639|       | 
  640|  80.9k|              saw_radix = true;
  641|  80.9k|              str_read++;
  642|  80.9k|              continue;
  643|  80.9k|           }
  644|       | 
  645|  2.69M|           if (ndigits_stored < 34) {
  ------------------
  |  Branch (645:16): [True: 2.69M, False: 1.55k]
  ------------------
  646|  2.69M|              if (*str_read != '0' || found_nonzero) {
  ------------------
  |  Branch (646:19): [True: 2.43M, False: 259k]
  |  Branch (646:39): [True: 248k, False: 10.3k]
  ------------------
  647|  2.68M|                 if (!found_nonzero) {
  ------------------
  |  Branch (647:22): [True: 81.4k, False: 2.59M]
  ------------------
  648|  81.4k|                    first_nonzero = ndigits_read;
  649|  81.4k|                 }
  650|       | 
  651|  2.68M|                 found_nonzero = true;
  652|  2.68M|                 *(digits_insert++) = *(str_read) - '0'; /* Only store 34 digits */
  653|  2.68M|                 ndigits_stored++;
  654|  2.68M|              }
  655|  2.69M|           }
  656|       | 
  657|  2.69M|           if (found_nonzero) {
  ------------------
  |  Branch (657:16): [True: 2.68M, False: 10.3k]
  ------------------
  658|  2.68M|              ndigits++;
  659|  2.68M|           }
  660|       | 
  661|  2.69M|           if (saw_radix) {
  ------------------
  |  Branch (661:16): [True: 2.59M, False: 101k]
  ------------------
  662|  2.59M|              radix_position++;
  663|  2.59M|           }
  664|       | 
  665|  2.69M|           ndigits_read++;
  666|  2.69M|           str_read++;
  667|  2.69M|        }
  668|       | 
  669|  88.0k|        if (saw_radix && !ndigits_read) {
  ------------------
  |  Branch (669:13): [True: 80.9k, False: 7.11k]
  |  Branch (669:26): [True: 0, False: 80.9k]
  ------------------
  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|  88.0k|        if (*str_read == 'e' || *str_read == 'E') {
  ------------------
  |  Branch (675:13): [True: 0, False: 88.0k]
  |  Branch (675:33): [True: 84.9k, False: 3.18k]
  ------------------
  676|  84.9k|           ++str_read;
  677|  84.9k|           if (*str_read == '+') {
  ------------------
  |  Branch (677:16): [True: 9.63k, False: 75.2k]
  ------------------
  678|  9.63k|               ++str_read;
  679|  9.63k|           }
  680|  84.9k|           auto result = jsoncons::to_integer(str_read, last - str_read, exponent);
  681|  84.9k|           if (result.ec != std::errc{}) 
  ------------------
  |  Branch (681:16): [True: 254, False: 84.6k]
  ------------------
  682|    254|           {
  683|    254|               dec = decimal128_limits::nan();
  684|    254|               return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  685|    254|           }
  686|  84.6k|           str_read = result.ptr;
  687|  84.6k|        }
  688|       |
  689|  87.8k|        if ((len == -1 || str_read < first + len) && *str_read) {
  ------------------
  |  Branch (689:14): [True: 0, False: 87.8k]
  |  Branch (689:27): [True: 0, False: 87.8k]
  |  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|  87.8k|        first_digit = 0;
  697|       | 
  698|  87.8k|        if (!ndigits_stored) { /* value is zero */
  ------------------
  |  Branch (698:13): [True: 6.62k, False: 81.2k]
  ------------------
  699|  6.62k|           first_digit = 0;
  700|  6.62k|           last_digit = 0;
  701|  6.62k|           digits[0] = 0;
  702|  6.62k|           ndigits = 1;
  703|  6.62k|           ndigits_stored = 1;
  704|  6.62k|           significant_digits = 0;
  705|  81.2k|        } else {
  706|  81.2k|           last_digit = ndigits_stored - 1;
  707|  81.2k|           significant_digits = ndigits;
  708|       |           /* Mark trailing zeros as non-significant */
  709|  95.8k|           while (first[first_nonzero + significant_digits - 1 + includes_sign +
  ------------------
  |  Branch (709:19): [True: 14.6k, False: 81.2k]
  ------------------
  710|  95.8k|                         saw_radix] == '0') {
  711|  14.6k|              significant_digits--;
  712|  14.6k|           }
  713|  81.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|  87.8k|        if (exponent <= static_cast<int32_t>(radix_position) && static_cast<int32_t>(radix_position) - exponent > (1 << 14)) {
  ------------------
  |  Branch (722:13): [True: 78.2k, False: 9.63k]
  |  Branch (722:65): [True: 0, False: 78.2k]
  ------------------
  723|      0|           exponent = decimal128_limits::exponent_min;
  724|  87.8k|        } else {
  725|  87.8k|           exponent -= static_cast<int32_t>(radix_position);
  726|  87.8k|        }
  727|       | 
  728|       |        /* Attempt to normalize the exponent */
  729|  87.8k|        while (exponent > decimal128_limits::exponent_max) {
  ------------------
  |  Branch (729:16): [True: 0, False: 87.8k]
  ------------------
  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|  89.0k|        while (exponent < decimal128_limits::exponent_min || ndigits_stored < ndigits) {
  ------------------
  |  Branch (749:16): [True: 0, False: 89.0k]
  |  Branch (749:62): [True: 1.51k, False: 87.4k]
  ------------------
  750|       |           /* Shift last digit */
  751|  1.51k|           if (last_digit == 0) {
  ------------------
  |  Branch (751:16): [True: 0, False: 1.51k]
  ------------------
  752|       |              /* underflow is not allowed, but zero clamping is */
  753|      0|              if (significant_digits == 0) {
  ------------------
  |  Branch (753:19): [True: 0, False: 0]
  ------------------
  754|      0|                 exponent = decimal128_limits::exponent_min;
  755|      0|                 break;
  756|      0|              }
  757|       | 
  758|      0|              dec = decimal128_limits::nan();
  759|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  760|      0|           }
  761|       | 
  762|  1.51k|           if (ndigits_stored < ndigits) {
  ------------------
  |  Branch (762:16): [True: 1.51k, False: 0]
  ------------------
  763|  1.51k|              if (first[ndigits - 1 + includes_sign + saw_radix] - '0' != 0 &&
  ------------------
  |  Branch (763:19): [True: 351, False: 1.16k]
  ------------------
  764|    351|                  significant_digits != 0) {
  ------------------
  |  Branch (764:19): [True: 351, False: 0]
  ------------------
  765|    351|                 dec = decimal128_limits::nan();
  766|    351|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  767|    351|              }
  768|       | 
  769|  1.16k|              ndigits--; /* adjust to match digits not stored */
  770|  1.16k|           } else {
  771|      0|              if (digits[last_digit] != 0) {
  ------------------
  |  Branch (771:19): [True: 0, False: 0]
  ------------------
  772|       |                 /* Inexact rounding is not allowed. */
  773|      0|                 dec = decimal128_limits::nan();
  774|      0|                 return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  775|      0|              }
  776|       | 
  777|       | 
  778|      0|              last_digit--; /* adjust to round */
  779|      0|           }
  780|       | 
  781|  1.16k|           if (exponent < decimal128_limits::exponent_max) {
  ------------------
  |  Branch (781:16): [True: 1.16k, False: 0]
  ------------------
  782|  1.16k|              exponent++;
  783|  1.16k|           } else {
  784|      0|              dec = decimal128_limits::nan();
  785|      0|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  786|      0|           }
  787|  1.16k|        }
  788|       | 
  789|       |        /* Round */
  790|       |        /* We've normalized the exponent, but might still need to round. */
  791|  87.4k|        if (last_digit - first_digit + 1 < significant_digits) {
  ------------------
  |  Branch (791:13): [True: 208, False: 87.2k]
  ------------------
  792|    208|           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|    208|           round_digit =
  797|    208|              first[first_nonzero + last_digit + includes_sign + saw_radix + 1] -
  798|    208|              '0';
  799|       | 
  800|    208|           if (round_digit != 0) {
  ------------------
  |  Branch (800:16): [True: 208, False: 0]
  ------------------
  801|       |              /* Inexact (non-zero) rounding is not allowed */
  802|    208|              dec = decimal128_limits::nan();
  803|    208|              return decimal128_from_chars_result{str_read,std::errc::invalid_argument};
  804|    208|           }
  805|    208|        }
  806|       | 
  807|       |        /* Encode significand */
  808|  87.2k|        significand_high = 0,   /* The high 17 digits of the significand */
  809|  87.2k|           significand_low = 0; /* The low 17 digits of the significand */
  810|       | 
  811|  87.2k|        if (significant_digits == 0) { /* read a zero */
  ------------------
  |  Branch (811:13): [True: 6.62k, False: 80.6k]
  ------------------
  812|  6.62k|           significand_high = 0;
  813|  6.62k|           significand_low = 0;
  814|  80.6k|        } else if (last_digit - first_digit < 17) {
  ------------------
  |  Branch (814:20): [True: 1.20k, False: 79.4k]
  ------------------
  815|  1.20k|           std::size_t d_idx = first_digit;
  816|  1.20k|           significand_low = digits[d_idx++];
  817|       | 
  818|  6.75k|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (818:19): [True: 5.55k, False: 1.20k]
  ------------------
  819|  5.55k|              significand_low *= 10;
  820|  5.55k|              significand_low += digits[d_idx];
  821|  5.55k|              significand_high = 0;
  822|  5.55k|           }
  823|  79.4k|        } else {
  824|  79.4k|           std::size_t d_idx = first_digit;
  825|  79.4k|           significand_high = digits[d_idx++];
  826|       | 
  827|  1.29M|           for (; d_idx <= last_digit - 17; d_idx++) {
  ------------------
  |  Branch (827:19): [True: 1.21M, False: 79.4k]
  ------------------
  828|  1.21M|              significand_high *= 10;
  829|  1.21M|              significand_high += digits[d_idx];
  830|  1.21M|           }
  831|       | 
  832|  79.4k|           significand_low = digits[d_idx++];
  833|       | 
  834|  1.35M|           for (; d_idx <= last_digit; d_idx++) {
  ------------------
  |  Branch (834:19): [True: 1.27M, False: 79.4k]
  ------------------
  835|  1.27M|              significand_low *= 10;
  836|  1.27M|              significand_low += digits[d_idx];
  837|  1.27M|           }
  838|  79.4k|        }
  839|       | 
  840|  87.2k|        detail::mul_64x64 (significand_high, 100000000000000000ull, &significand);
  841|  87.2k|        significand.low += significand_low;
  842|       | 
  843|  87.2k|        if (significand.low < significand_low) {
  ------------------
  |  Branch (843:13): [True: 11.2k, False: 76.0k]
  ------------------
  844|  11.2k|           significand.high += 1;
  845|  11.2k|        }
  846|       | 
  847|       | 
  848|  87.2k|        biased_exponent = static_cast<uint16_t>(exponent + static_cast<int32_t>(decimal128_limits::exponent_bias));
  849|       | 
  850|       |        /* Encode combination, exponent, and significand. */
  851|  87.2k|        if ((significand.high >> 49) & 1) {
  ------------------
  |  Branch (851:13): [True: 0, False: 87.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|  87.2k|        } else {
  857|  87.2k|           dec.high |= (biased_exponent & 0x3fffull) << 49;
  858|  87.2k|           dec.high |= significand.high & 0x1ffffffffffffull;
  859|  87.2k|        }
  860|       | 
  861|  87.2k|        dec.low = significand.low;
  862|       | 
  863|       |        /* Encode sign */
  864|  87.2k|        if (is_negative) {
  ------------------
  |  Branch (864:13): [True: 7.19k, False: 80.0k]
  ------------------
  865|  7.19k|           dec.high |= 0x8000000000000000ull;
  866|  7.19k|        }
  867|       | 
  868|  87.2k|        return decimal128_from_chars_result{str_read,std::errc{}};
  869|  87.4k|    }
_ZN8jsoncons4bson6detail13dec128_istreqEPKcS3_S3_S3_:
  289|  8.37k|        {
  290|  44.0k|            while (!(a == lasta && b == lastb)) 
  ------------------
  |  Branch (290:22): [True: 3.80k, False: 40.2k]
  |  Branch (290:36): [True: 3.80k, False: 0]
  ------------------
  291|  40.2k|            {
  292|       |               // strings are different lengths
  293|  40.2k|               if (a == lasta || b == lastb) 
  ------------------
  |  Branch (293:20): [True: 0, False: 40.2k]
  |  Branch (293:34): [True: 3.02k, False: 37.1k]
  ------------------
  294|  3.02k|               {
  295|  3.02k|                  return false;
  296|  3.02k|               }
  297|       |         
  298|  37.1k|               if (dec128_tolower (*a) != dec128_tolower (*b)) {
  ------------------
  |  Branch (298:20): [True: 1.54k, False: 35.6k]
  ------------------
  299|  1.54k|                  return false;
  300|  1.54k|               }
  301|       |         
  302|  35.6k|               a++;
  303|  35.6k|               b++;
  304|  35.6k|            }
  305|       |         
  306|  3.80k|            return true;
  307|  8.37k|        }
_ZN8jsoncons4bson6detail14dec128_tolowerEc:
  266|  74.3k|        {
  267|  74.3k|           if (isupper (c)) {
  ------------------
  |  Branch (267:16): [True: 9.15k, False: 65.2k]
  ------------------
  268|  9.15k|              c += 32;
  269|  9.15k|           }
  270|       |
  271|  74.3k|           return c;
  272|  74.3k|        }
_ZN8jsoncons4bson17decimal128_limits12neg_infinityEv:
  124|  2.81k|        static constexpr decimal128_t neg_infinity() {return decimal128_t(0x7800000000000000ull + 0x8000000000000000ull, 0);}
_ZN8jsoncons4bson3TP1C2Emm:
   79|  4.61k|        constexpr TP1(uint64_t hi, uint64_t lo) : low(lo), high(hi) {}
_ZN8jsoncons4bson17decimal128_limits8infinityEv:
  123|    214|        static constexpr decimal128_t infinity() {return decimal128_t(0x7800000000000000ull, 0);}
_ZN8jsoncons4bson17decimal128_limits3nanEv:
  122|  1.58k|        static constexpr decimal128_t nan() {return decimal128_t(0x7c00000000000000ull, 0);}
_ZN8jsoncons4bson6detail9mul_64x64EmmPNS0_19bson_uint128_6464_tE:
  221|  87.2k|        {
  222|  87.2k|            uint64_t left_high, left_low, right_high, right_low, product_high,
  223|  87.2k|               product_mid, product_mid2, product_low;
  224|  87.2k|            bson_uint128_6464_t rt = {0,0};
  225|       | 
  226|  87.2k|            if (!left && !right) {
  ------------------
  |  Branch (226:17): [True: 7.83k, False: 79.4k]
  |  Branch (226:26): [True: 0, False: 7.83k]
  ------------------
  227|      0|               *product = rt;
  228|      0|               return;
  229|      0|            }
  230|       | 
  231|  87.2k|            left_high = left >> 32;
  232|  87.2k|            left_low = (uint32_t) left;
  233|  87.2k|            right_high = right >> 32;
  234|  87.2k|            right_low = (uint32_t) right;
  235|       | 
  236|  87.2k|            product_high = left_high * right_high;
  237|  87.2k|            product_mid = left_high * right_low;
  238|  87.2k|            product_mid2 = left_low * right_high;
  239|  87.2k|            product_low = left_low * right_low;
  240|       | 
  241|  87.2k|            product_high += product_mid >> 32;
  242|  87.2k|            product_mid = (uint32_t) product_mid + product_mid2 + (product_low >> 32);
  243|       | 
  244|  87.2k|            product_high = product_high + (product_mid >> 32);
  245|  87.2k|            product_low = (product_mid << 32) + (uint32_t) product_low;
  246|       | 
  247|  87.2k|            rt.high = product_high;
  248|  87.2k|            rt.low = product_low;
  249|  87.2k|            *product = rt;
  250|  87.2k|        }
_ZN8jsoncons4bson19decimal128_to_charsEPcS1_RKNS0_3TP1E:
  335|  91.9k|    {
  336|  91.9k|        const std::string bson_decimal128_inf = "Infinity";
  337|  91.9k|        const std::string bson_decimal128_nan = "NaN";
  338|       |
  339|  91.9k|        const uint32_t combination_mask = 0x1f;   /* Extract least significant 5 bits */
  340|  91.9k|        const uint32_t exponent_mask = 0x3fff;    /* Extract least significant 14 bits */
  341|  91.9k|        const uint32_t combination_infinity = 30; /* Value of combination field for Inf */
  342|  91.9k|        const uint32_t combination_nan = 31;      /* Value of combination field for NaN */
  343|  91.9k|        const uint32_t exponent_bias = 6176;      /* decimal128 exponent bias */
  344|       |
  345|  91.9k|        char* str_out = first;      /* output pointer in string */
  346|  91.9k|        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|  91.9k|        uint32_t high;                   /* bits 0 - 31 */
  351|  91.9k|        uint32_t midh;                   /* bits 32 - 63 */
  352|  91.9k|        uint32_t midl;                   /* bits 64 - 95 */
  353|  91.9k|        uint32_t low;                    /* bits 96 - 127 */
  354|  91.9k|        uint32_t combination;            /* bits 1 - 5 */
  355|  91.9k|        uint32_t biased_exponent;        /* decoded biased exponent (14 bits) */
  356|  91.9k|        uint32_t significand_digits = 0; /* the number of significand digits */
  357|  91.9k|        uint32_t significand[36] = {0};  /* the base-10 digits in the significand */
  358|  91.9k|        uint32_t *significand_read = significand; /* read pointer into significand */
  359|  91.9k|        int32_t exponent;                         /* unbiased exponent */
  360|  91.9k|        int32_t scientific_exponent; /* the exponent if scientific notation is
  361|       |                                      * used */
  362|  91.9k|        bool is_zero = false;        /* true if the number is zero */
  363|       | 
  364|  91.9k|        uint8_t significand_msb; /* the most signifcant significand bits (50-46) */
  365|  91.9k|        bson_uint128_t
  366|  91.9k|           significand128; /* temporary storage for significand decoding */
  367|       | 
  368|  91.9k|        memset (significand_str, 0, sizeof (significand_str));
  369|       | 
  370|  91.9k|        if ((int64_t) dec.high < 0) { /* negative */
  ------------------
  |  Branch (370:13): [True: 10.9k, False: 81.0k]
  ------------------
  371|  10.9k|           *(str_out++) = '-';
  372|  10.9k|        }
  373|       | 
  374|  91.9k|        low = (uint32_t) dec.low, midl = (uint32_t) (dec.low >> 32),
  375|  91.9k|        midh = (uint32_t) dec.high, high = (uint32_t) (dec.high >> 32);
  376|       | 
  377|       |        /* Decode combination field and exponent */
  378|  91.9k|        combination = (high >> 26) & combination_mask;
  379|       | 
  380|  91.9k|        if (JSONCONS_UNLIKELY ((combination >> 3) == 3)) {
  ------------------
  |  |   78|  91.9k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 10.1k, False: 81.8k]
  |  |  ------------------
  ------------------
  381|       |           /* Check for 'special' values */
  382|  10.1k|           if (combination == combination_infinity) { /* Infinity */
  ------------------
  |  Branch (382:16): [True: 3.02k, False: 7.08k]
  ------------------
  383|  3.02k|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_inf.size())) 
  ------------------
  |  Branch (383:20): [True: 3.02k, False: 0]
  ------------------
  384|  3.02k|               {
  385|  3.02k|                   std::memcpy(str_out, bson_decimal128_inf.data(), bson_decimal128_inf.size());
  386|  3.02k|                   str_out += bson_decimal128_inf.size();
  387|  3.02k|               }
  388|  3.02k|               *str_out = 0;
  389|       |              //strcpy_s (str_out, last-str_out, bson_decimal128_inf.c_str());
  390|  3.02k|              return decimal128_to_chars_result{str_out, std::errc{}};
  391|  7.08k|           } else if (combination == combination_nan) { /* NaN */
  ------------------
  |  Branch (391:23): [True: 773, False: 6.31k]
  ------------------
  392|       |               /* first, not str_out, to erase the sign */
  393|    773|               str_out = first;
  394|    773|               if (last-str_out >= static_cast<ptrdiff_t >(bson_decimal128_nan.size())) 
  ------------------
  |  Branch (394:20): [True: 773, False: 0]
  ------------------
  395|    773|               {
  396|    773|                   std::memcpy(str_out, bson_decimal128_nan.data(), bson_decimal128_nan.size());
  397|    773|                   str_out += bson_decimal128_nan.size();
  398|    773|               }
  399|    773|               *str_out = 0;
  400|       |              //strcpy_s (first, last-first, bson_decimal128_nan.c_str());
  401|       |              /* we don't care about the NaN payload. */
  402|    773|               return decimal128_to_chars_result{str_out, std::errc{}};
  403|  6.31k|           } else {
  404|  6.31k|              biased_exponent = (high >> 15) & exponent_mask;
  405|  6.31k|              significand_msb = 0x8 + ((high >> 14) & 0x1);
  406|  6.31k|           }
  407|  81.8k|        } else {
  408|  81.8k|           significand_msb = (high >> 14) & 0x7;
  409|  81.8k|           biased_exponent = (high >> 17) & exponent_mask;
  410|  81.8k|        }
  411|       | 
  412|  88.1k|        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|  88.1k|        significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  419|  88.1k|        significand128.parts[1] = midh;
  420|  88.1k|        significand128.parts[2] = midl;
  421|  88.1k|        significand128.parts[3] = low;
  422|       | 
  423|  88.1k|        if (significand128.parts[0] == 0 && significand128.parts[1] == 0 &&
  ------------------
  |  Branch (423:13): [True: 4.12k, False: 84.0k]
  |  Branch (423:45): [True: 2.79k, False: 1.33k]
  ------------------
  424|  2.79k|            significand128.parts[2] == 0 && significand128.parts[3] == 0) {
  ------------------
  |  Branch (424:13): [True: 1.33k, False: 1.46k]
  |  Branch (424:45): [True: 318, False: 1.01k]
  ------------------
  425|    318|           is_zero = true;
  426|  87.8k|        } else if (significand128.parts[0] >= (1 << 17)) {
  ------------------
  |  Branch (426:20): [True: 6.31k, False: 81.5k]
  ------------------
  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|  6.31k|           is_zero = true;
  434|  81.5k|        } else {
  435|   407k|           for (int k = 3; k >= 0; k--) {
  ------------------
  |  Branch (435:28): [True: 326k, False: 81.5k]
  ------------------
  436|   326k|              uint32_t least_digits = 0;
  437|   326k|              detail::bson_uint128_divide1B (
  438|   326k|                 significand128, &significand128, &least_digits);
  439|       | 
  440|       |              /* We now have the 9 least significant digits (in base 2). */
  441|       |              /* Convert and output to string. */
  442|   326k|              if (!least_digits) {
  ------------------
  |  Branch (442:19): [True: 5.68k, False: 320k]
  ------------------
  443|  5.68k|                 continue;
  444|  5.68k|              }
  445|       | 
  446|  3.20M|              for (int j = 8; j >= 0; j--) {
  ------------------
  |  Branch (446:31): [True: 2.88M, False: 320k]
  ------------------
  447|  2.88M|                 significand[k * 9 + j] = least_digits % 10;
  448|  2.88M|                 least_digits /= 10;
  449|  2.88M|              }
  450|   320k|           }
  451|  81.5k|        }
  452|       | 
  453|       |        /* Output format options: */
  454|       |        /* Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd */
  455|       |        /* Regular    - ddd.ddd */
  456|       | 
  457|  88.1k|        if (is_zero) {
  ------------------
  |  Branch (457:13): [True: 6.63k, False: 81.5k]
  ------------------
  458|  6.63k|           significand_digits = 1;
  459|  6.63k|           *significand_read = 0;
  460|  81.5k|        } else {
  461|  81.5k|           significand_digits = 36;
  462|   331k|           while (!(*significand_read)) {
  ------------------
  |  Branch (462:19): [True: 250k, False: 81.5k]
  ------------------
  463|   250k|              significand_digits--;
  464|   250k|              significand_read++;
  465|   250k|           }
  466|  81.5k|        }
  467|       | 
  468|  88.1k|        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|  88.1k|        if (scientific_exponent < -6 || exponent > 0) {
  ------------------
  |  Branch (478:13): [True: 75.3k, False: 12.8k]
  |  Branch (478:41): [True: 9.66k, False: 3.18k]
  ------------------
  479|       |           /* Scientific format */
  480|  84.9k|           *(str_out++) = char(*(significand_read++)) + '0';
  481|  84.9k|           significand_digits--;
  482|       | 
  483|  84.9k|           if (significand_digits) {
  ------------------
  |  Branch (483:16): [True: 78.5k, False: 6.45k]
  ------------------
  484|  78.5k|              *(str_out++) = '.';
  485|  78.5k|           }
  486|       | 
  487|  2.61M|           for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (487:36): [True: 2.53M, False: 84.8k]
  |  Branch (487:62): [True: 2.53M, False: 94]
  ------------------
  488|  2.53M|              *(str_out++) = char(*(significand_read++)) + '0';
  489|  2.53M|           }
  490|       |           /* Exponent */
  491|  84.9k|           *(str_out++) = 'E';
  492|       |
  493|  84.9k|           std::string s;
  494|  84.9k|           if (scientific_exponent >= 0) {
  ------------------
  |  Branch (494:16): [True: 9.66k, False: 75.3k]
  ------------------
  495|  9.66k|               s.push_back('+');
  496|  9.66k|           }
  497|  84.9k|           jsoncons::from_integer(scientific_exponent, s);
  498|  84.9k|           if (str_out + s.size() < last) 
  ------------------
  |  Branch (498:16): [True: 84.7k, False: 254]
  ------------------
  499|  84.7k|           {
  500|  84.7k|               std::memcpy(str_out, s.data(), s.size());
  501|  84.7k|           }
  502|    254|           else
  503|    254|           {
  504|    254|               return decimal128_to_chars_result{str_out, std::errc::value_too_large};
  505|    254|           }
  506|  84.7k|           str_out += s.size();
  507|  84.7k|        } else {
  508|       |           /* Regular format with no decimal place */
  509|  3.18k|           if (exponent >= 0) {
  ------------------
  |  Branch (509:16): [True: 664, False: 2.51k]
  ------------------
  510|  5.61k|              for (std::size_t i = 0; i < significand_digits && (str_out - first) < 36; i++) {
  ------------------
  |  Branch (510:39): [True: 4.94k, False: 664]
  |  Branch (510:65): [True: 4.94k, False: 0]
  ------------------
  511|  4.94k|                 *(str_out++) = char(*(significand_read++)) + '0';
  512|  4.94k|              }
  513|  2.51k|           } else {
  514|  2.51k|              int32_t radix_position = significand_digits + exponent;
  515|       | 
  516|  2.51k|              if (radix_position > 0) { /* non-zero digits before radix */
  ------------------
  |  Branch (516:19): [True: 1.36k, False: 1.15k]
  ------------------
  517|  1.36k|                 for (int32_t i = 0;
  518|  12.1k|                      i < radix_position && (str_out < last);
  ------------------
  |  Branch (518:23): [True: 10.8k, False: 1.36k]
  |  Branch (518:45): [True: 10.8k, False: 0]
  ------------------
  519|  10.8k|                      i++) {
  520|  10.8k|                    *(str_out++) = char(*(significand_read++)) + '0';
  521|  10.8k|                 }
  522|  1.36k|              } else { /* leading zero before radix point */
  523|  1.15k|                 *(str_out++) = '0';
  524|  1.15k|              }
  525|       | 
  526|  2.51k|              *(str_out++) = '.';
  527|  5.09k|              while (radix_position++ < 0) { /* add leading zeros after radix */
  ------------------
  |  Branch (527:22): [True: 2.57k, False: 2.51k]
  ------------------
  528|  2.57k|                 *(str_out++) = '0';
  529|  2.57k|              }
  530|       | 
  531|  2.51k|              for (std::size_t i = 0;
  532|  62.5k|                   (i < significand_digits - (std::max) (radix_position - 1, 0)) &&
  ------------------
  |  Branch (532:20): [True: 60.0k, False: 2.51k]
  |  Branch (532:20): [True: 60.0k, False: 2.51k]
  ------------------
  533|  60.0k|                   (str_out < last);
  ------------------
  |  Branch (533:20): [True: 60.0k, False: 0]
  ------------------
  534|  60.0k|                   i++) {
  535|  60.0k|                 *(str_out++) = char(*(significand_read++)) + '0';
  536|  60.0k|              }
  537|  2.51k|           }
  538|  3.18k|        }
  539|  87.9k|        return decimal128_to_chars_result{str_out, std::errc{}};
  540|  88.1k|    }
_ZN8jsoncons4bson6detail21bson_uint128_divide1BENS0_14bson_uint128_tEPS2_Pj:
  178|   326k|        {
  179|   326k|            const uint32_t DIVISOR = 1000 * 1000 * 1000;
  180|   326k|            uint64_t _rem = 0;
  181|   326k|            int i = 0;
  182|       |            
  183|   326k|            if (!value.parts[0] && !value.parts[1] && !value.parts[2] &&
  ------------------
  |  Branch (183:17): [True: 248k, False: 77.7k]
  |  Branch (183:36): [True: 168k, False: 79.5k]
  |  Branch (183:55): [True: 88.0k, False: 80.7k]
  ------------------
  184|  88.0k|                !value.parts[3]) {
  ------------------
  |  Branch (184:17): [True: 5.66k, False: 82.4k]
  ------------------
  185|  5.66k|               *quotient = value;
  186|  5.66k|               *rem = 0;
  187|  5.66k|               return;
  188|  5.66k|            }
  189|       |            
  190|  1.60M|            for (i = 0; i <= 3; i++) {
  ------------------
  |  Branch (190:25): [True: 1.28M, False: 320k]
  ------------------
  191|  1.28M|               _rem <<= 32; /* Adjust remainder to match value of next dividend */
  192|  1.28M|               _rem += value.parts[i]; /* Add the divided to _rem */
  193|  1.28M|               value.parts[i] = (uint32_t) (_rem / DIVISOR);
  194|  1.28M|               _rem %= DIVISOR; /* Store the remainder */
  195|  1.28M|            }
  196|       |            
  197|   320k|            *quotient = value;
  198|   320k|            *rem = (uint32_t) _rem;
  199|   320k|        }

_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKS9_:
  108|  3.00k|       : basic_bson_encoder(std::forward<Sink>(sink),
  109|  3.00k|                            bson_encode_options(),
  110|  3.00k|                            alloc)
  111|  3.00k|    {
  112|  3.00k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEEC2EOS8_RKNS0_19bson_encode_optionsERKS9_:
  117|  3.00k|       : sink_(std::forward<Sink>(sink)),
  118|  3.00k|         max_nesting_depth_(options.max_nesting_depth()),
  119|  3.00k|         alloc_(alloc)
  120|  3.00k|    {
  121|  3.00k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE15visit_end_arrayERKNS_11ser_contextERNS3_10error_codeE:
  218|  1.87k|    {
  219|  1.87k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   45|  1.87k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 0, False: 1.87k]
  |  |  ------------------
  |  |   46|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   47|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  220|  1.87k|        --nesting_depth_;
  221|       |
  222|  1.87k|        buffer_.push_back(0x00);
  223|       |
  224|  1.87k|        std::size_t length = buffer_.size() - stack_.back().offset();
  225|  1.87k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  226|       |
  227|  1.87k|        stack_.pop_back();
  228|  1.87k|        if (stack_.empty())
  ------------------
  |  Branch (228:13): [True: 0, False: 1.87k]
  ------------------
  229|      0|        {
  230|      0|            for (auto c : buffer_)
  ------------------
  |  Branch (230:25): [True: 0, False: 0]
  ------------------
  231|      0|            {
  232|      0|                sink_.push_back(c);
  233|      0|            }
  234|      0|        }
  235|  1.87k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  1.87k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  236|  1.87k|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item6offsetEv:
   66|  27.6k|        {
   67|  27.6k|            return offset_;
   68|  27.6k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_uint64EmNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  498|  2.12k|    {
  499|  2.12k|        static constexpr uint64_t max_value_div_1000 = (std::numeric_limits<uint64_t>::max)() / 1000;
  500|  2.12k|        if (stack_.empty())
  ------------------
  |  Branch (500:13): [True: 0, False: 2.12k]
  ------------------
  501|      0|        {
  502|      0|            ec = bson_errc::expected_bson_document;
  503|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  504|      0|        }
  505|       |
  506|  2.12k|        switch (tag)
  507|  2.12k|        {
  508|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (508:13): [True: 0, False: 2.12k]
  ------------------
  509|      0|                if (val > max_value_div_1000)
  ------------------
  |  Branch (509:21): [True: 0, False: 0]
  ------------------
  510|      0|                {
  511|      0|                    ec = bson_errc::datetime_too_large;
  512|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  513|      0|                }
  514|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  515|      0|                binary::native_to_little(static_cast<int64_t>(val*millis_in_second),std::back_inserter(buffer_));
  516|      0|                break;
  517|      0|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (517:13): [True: 0, False: 2.12k]
  ------------------
  518|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  519|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  520|      0|                break;
  521|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (521:13): [True: 0, False: 2.12k]
  ------------------
  522|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  523|      0|                if (val != 0)
  ------------------
  |  Branch (523:21): [True: 0, False: 0]
  ------------------
  524|      0|                {
  525|      0|                    val /= nanos_in_milli;
  526|      0|                }
  527|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  528|      0|                break;
  529|  2.12k|            default:
  ------------------
  |  Branch (529:13): [True: 2.12k, False: 0]
  ------------------
  530|  2.12k|            {
  531|  2.12k|                if (val <= static_cast<uint64_t>((std::numeric_limits<int32_t>::max)()))
  ------------------
  |  Branch (531:21): [True: 760, False: 1.36k]
  ------------------
  532|    760|                {
  533|    760|                    before_value(jsoncons::bson::bson_type::int32_type);
  534|    760|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  535|    760|                }
  536|  1.36k|                else if (val <= static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()))
  ------------------
  |  Branch (536:26): [True: 980, False: 380]
  ------------------
  537|    980|                {
  538|    980|                    before_value(jsoncons::bson::bson_type::int64_type);
  539|    980|                    binary::native_to_little(static_cast<uint64_t>(val),std::back_inserter(buffer_));
  540|    980|                }
  541|    380|                else
  542|    380|                {
  543|    380|                    ec = bson_errc::number_too_large;
  544|    380|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|    380|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  545|    380|                }
  546|  1.74k|                break;
  547|  2.12k|            }
  548|  2.12k|        }
  549|  1.74k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  1.74k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  550|  2.12k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12before_valueEh:
  568|  3.48M|    {
  569|  3.48M|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   45|  3.48M|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 0, False: 3.48M]
  |  |  ------------------
  |  |   46|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   47|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  570|  3.48M|        if (stack_.back().is_object())
  ------------------
  |  Branch (570:13): [True: 243k, False: 3.24M]
  ------------------
  571|   243k|        {
  572|   243k|            buffer_[stack_.back().member_offset()] = code;
  573|   243k|        }
  574|  3.24M|        else
  575|  3.24M|        {
  576|  3.24M|            buffer_.push_back(code);
  577|  3.24M|            std::string name = std::to_string(stack_.back().next_index());
  578|  3.24M|            buffer_.insert(buffer_.end(), name.begin(), name.end());
  579|  3.24M|            buffer_.push_back(0x00);
  580|  3.24M|        }
  581|  3.48M|    }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item9is_objectEv:
   86|  3.48M|        {
   87|  3.48M|            return type_ == jsoncons::bson::bson_container_type::document;
   88|  3.48M|        }
_ZNK8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEv:
   71|   243k|        {
   72|   243k|            return name_offset_;
   73|   243k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item10next_indexEv:
   81|  3.24M|        {
   82|  3.24M|            return index_++;
   83|  3.24M|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_int64ElNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  439|  32.0k|    {
  440|  32.0k|        static constexpr int64_t min_value_div_1000 = (std::numeric_limits<int64_t>::min)() / 1000;
  441|  32.0k|        static constexpr int64_t max_value_div_1000 = (std::numeric_limits<int64_t>::max)() / 1000;
  442|  32.0k|        if (stack_.empty())
  ------------------
  |  Branch (442:13): [True: 32, False: 32.0k]
  ------------------
  443|     32|        {
  444|     32|            ec = bson_errc::expected_bson_document;
  445|     32|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|     32|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  446|     32|        }
  447|       |
  448|  32.0k|        switch (tag)
  449|  32.0k|        {
  450|      0|            case semantic_tag::epoch_second:
  ------------------
  |  Branch (450:13): [True: 0, False: 32.0k]
  ------------------
  451|      0|                if (val < min_value_div_1000)
  ------------------
  |  Branch (451:21): [True: 0, False: 0]
  ------------------
  452|      0|                {
  453|      0|                    ec = bson_errc::datetime_too_small;
  454|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  455|      0|                }
  456|      0|                if (val > max_value_div_1000)
  ------------------
  |  Branch (456:21): [True: 0, False: 0]
  ------------------
  457|      0|                {
  458|      0|                    ec = bson_errc::datetime_too_large;
  459|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  460|      0|                }
  461|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  462|      0|                binary::native_to_little(val*millis_in_second,std::back_inserter(buffer_));
  463|      0|                break;
  464|  3.64k|            case semantic_tag::epoch_milli:
  ------------------
  |  Branch (464:13): [True: 3.64k, False: 28.4k]
  ------------------
  465|  3.64k|                before_value(jsoncons::bson::bson_type::datetime_type);
  466|  3.64k|                binary::native_to_little(val,std::back_inserter(buffer_));
  467|  3.64k|                break;
  468|      0|            case semantic_tag::epoch_nano:
  ------------------
  |  Branch (468:13): [True: 0, False: 32.0k]
  ------------------
  469|      0|                before_value(jsoncons::bson::bson_type::datetime_type);
  470|      0|                if (val != 0)
  ------------------
  |  Branch (470:21): [True: 0, False: 0]
  ------------------
  471|      0|                {
  472|      0|                    val /= nanos_in_milli;
  473|      0|                }
  474|      0|                binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  475|      0|                break;
  476|  28.4k|            default:
  ------------------
  |  Branch (476:13): [True: 28.4k, False: 3.64k]
  ------------------
  477|  28.4k|            {
  478|  28.4k|                if (val >= (std::numeric_limits<int32_t>::lowest)() && val <= (std::numeric_limits<int32_t>::max)())
  ------------------
  |  Branch (478:21): [True: 27.9k, False: 419]
  |  Branch (478:72): [True: 2.15k, False: 25.8k]
  ------------------
  479|  2.15k|                {
  480|  2.15k|                    before_value(jsoncons::bson::bson_type::int32_type);
  481|  2.15k|                    binary::native_to_little(static_cast<uint32_t>(val),std::back_inserter(buffer_));
  482|  2.15k|                }
  483|  26.2k|                else 
  484|  26.2k|                {
  485|  26.2k|                    before_value(jsoncons::bson::bson_type::int64_type);
  486|  26.2k|                    binary::native_to_little(static_cast<int64_t>(val),std::back_inserter(buffer_));
  487|  26.2k|                }
  488|  28.4k|                break;
  489|      0|            }
  490|  32.0k|        }
  491|  32.0k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  32.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  492|  32.0k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_doubleEdNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  556|    833|    {
  557|    833|        if (stack_.empty())
  ------------------
  |  Branch (557:13): [True: 0, False: 833]
  ------------------
  558|      0|        {
  559|      0|            ec = bson_errc::expected_bson_document;
  560|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  561|      0|        }
  562|    833|        before_value(jsoncons::bson::bson_type::double_type);
  563|    833|        binary::native_to_little(val,std::back_inserter(buffer_));
  564|    833|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|    833|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  565|    833|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE11visit_flushEv:
  148|      5|    {
  149|      5|        sink_.flush();
  150|      5|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE18visit_begin_objectENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  153|  61.4k|    {
  154|  61.4k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|  61.4k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 13.0k, False: 48.3k]
  |  |  ------------------
  ------------------
  155|  13.0k|        {
  156|  13.0k|            ec = bson_errc::max_nesting_depth_exceeded;
  157|  13.0k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  13.0k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  158|  13.0k|        } 
  159|  48.3k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (159:13): [True: 45.3k, False: 3.00k]
  ------------------
  160|  45.3k|        {
  161|  45.3k|            if (stack_.empty())
  ------------------
  |  Branch (161:17): [True: 0, False: 45.3k]
  ------------------
  162|      0|            {
  163|      0|                ec = bson_errc::expected_bson_document;
  164|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  165|      0|            }
  166|  45.3k|            before_value(jsoncons::bson::bson_type::document_type);
  167|  45.3k|        }
  168|       |
  169|  48.3k|        stack_.emplace_back(jsoncons::bson::bson_container_type::document, buffer_.size());
  170|  48.3k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  171|       |
  172|  48.3k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  48.3k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  173|  48.3k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_itemC2ENS0_19bson_container_typeEm:
   61|  92.0k|           : type_(type), offset_(offset)
   62|  92.0k|        {
   63|  92.0k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE16visit_end_objectERKNS_11ser_contextERNS3_10error_codeE:
  176|  11.9k|    {
  177|  11.9k|        JSONCONS_ASSERT(!stack_.empty());
  ------------------
  |  |   45|  11.9k|#define JSONCONS_ASSERT(x) if (!(x)) { \
  |  |  ------------------
  |  |  |  Branch (45:32): [True: 0, False: 11.9k]
  |  |  ------------------
  |  |   46|      0|    JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at  <> :" \
  |  |  ------------------
  |  |  |  |   35|      0|    #define JSONCONS_THROW(exception) throw exception
  |  |  ------------------
  |  |   47|      0|            JSONCONS_STR( 0 ))); }
  ------------------
  178|  11.9k|        --nesting_depth_;
  179|       |
  180|  11.9k|        buffer_.push_back(0x00);
  181|       |
  182|  11.9k|        std::size_t length = buffer_.size() - stack_.back().offset();
  183|  11.9k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+stack_.back().offset());
  184|       |
  185|  11.9k|        stack_.pop_back();
  186|  11.9k|        if (stack_.empty())
  ------------------
  |  Branch (186:13): [True: 161, False: 11.7k]
  ------------------
  187|    161|        {
  188|    161|            for (auto c : buffer_)
  ------------------
  |  Branch (188:25): [True: 4.44M, False: 161]
  ------------------
  189|  4.44M|            {
  190|  4.44M|                sink_.push_back(c);
  191|  4.44M|            }
  192|    161|        }
  193|  11.9k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  11.9k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  194|  11.9k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_begin_arrayENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  197|   610k|    {
  198|   610k|        if (JSONCONS_UNLIKELY(++nesting_depth_ > max_nesting_depth_))
  ------------------
  |  |   78|   610k|#define JSONCONS_UNLIKELY(x) __builtin_expect(!!(x), 0)
  |  |  ------------------
  |  |  |  Branch (78:30): [True: 566k, False: 43.6k]
  |  |  ------------------
  ------------------
  199|   566k|        {
  200|   566k|            ec = bson_errc::max_nesting_depth_exceeded;
  201|   566k|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|   566k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  202|   566k|        } 
  203|  43.6k|        if (buffer_.size() > 0)
  ------------------
  |  Branch (203:13): [True: 43.6k, False: 0]
  ------------------
  204|  43.6k|        {
  205|  43.6k|            if (stack_.empty())
  ------------------
  |  Branch (205:17): [True: 0, False: 43.6k]
  ------------------
  206|      0|            {
  207|      0|                ec = bson_errc::expected_bson_document;
  208|      0|                JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  209|      0|            }
  210|  43.6k|            before_value(jsoncons::bson::bson_type::array_type);
  211|  43.6k|        }
  212|  43.6k|        stack_.emplace_back(jsoncons::bson::bson_container_type::array, buffer_.size());
  213|  43.6k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  214|  43.6k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  43.6k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  215|  43.6k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE9visit_keyERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEERKNS_11ser_contextERNS3_10error_codeE:
  239|   224k|    {
  240|   224k|        stack_.back().member_offset(buffer_.size());
  241|   224k|        buffer_.push_back(0x00); // reserve space for code
  242|   224k|        for (auto c : name)
  ------------------
  |  Branch (242:21): [True: 773k, False: 224k]
  ------------------
  243|   773k|        {
  244|   773k|            buffer_.push_back(c);
  245|   773k|        }
  246|   224k|        buffer_.push_back(0x00);
  247|   224k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|   224k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  248|   224k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10stack_item13member_offsetEm:
   76|   224k|        {
   77|   224k|            name_offset_ = offset;
   78|   224k|        }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_nullENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  251|  3.20M|    {
  252|  3.20M|        if (stack_.empty())
  ------------------
  |  Branch (252:13): [True: 147, False: 3.20M]
  ------------------
  253|    147|        {
  254|    147|            ec = bson_errc::expected_bson_document;
  255|    147|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|    147|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  256|    147|        }
  257|  3.20M|        switch (tag)
  258|  3.20M|        {
  259|    912|            case semantic_tag::undefined:
  ------------------
  |  Branch (259:13): [True: 912, False: 3.20M]
  ------------------
  260|    912|                before_value(jsoncons::bson::bson_type::undefined_type);
  261|    912|                break;
  262|  3.20M|            default:
  ------------------
  |  Branch (262:13): [True: 3.20M, False: 912]
  ------------------
  263|  3.20M|                before_value(jsoncons::bson::bson_type::null_type);
  264|  3.20M|                break;
  265|  3.20M|        }
  266|  3.20M|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  3.20M|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  267|  3.20M|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE10visit_boolEbNS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  270|  1.33k|    {
  271|  1.33k|        if (stack_.empty())
  ------------------
  |  Branch (271:13): [True: 0, False: 1.33k]
  ------------------
  272|      0|        {
  273|      0|            ec = bson_errc::expected_bson_document;
  274|      0|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  275|      0|        }
  276|  1.33k|        before_value(jsoncons::bson::bson_type::bool_type);
  277|  1.33k|        if (val)
  ------------------
  |  Branch (277:13): [True: 709, False: 626]
  ------------------
  278|    709|        {
  279|    709|            buffer_.push_back(0x01);
  280|    709|        }
  281|    626|        else
  282|    626|        {
  283|    626|            buffer_.push_back(0x00);
  284|    626|        }
  285|       |
  286|  1.33k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  1.33k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  287|  1.33k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE12visit_stringERKNS3_17basic_string_viewIcNS3_11char_traitsIcEEEENS_12semantic_tagERKNS_11ser_contextERNS3_10error_codeE:
  290|   119k|    {
  291|   119k|        if (stack_.empty())
  ------------------
  |  Branch (291:13): [True: 83, False: 119k]
  ------------------
  292|     83|        {
  293|     83|            ec = bson_errc::expected_bson_document;
  294|     83|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|     83|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  295|     83|        }
  296|       |
  297|   119k|        switch (tag)
  298|   119k|        {
  299|  91.8k|            case semantic_tag::float128:
  ------------------
  |  Branch (299:13): [True: 91.8k, False: 27.5k]
  ------------------
  300|  91.8k|            {
  301|  91.8k|                before_value(jsoncons::bson::bson_type::decimal128_type);
  302|  91.8k|                decimal128_t dec;
  303|  91.8k|                auto rc = decimal128_from_chars(sv.data(), sv.data()+sv.size(), dec);
  304|  91.8k|                if (rc.ec != std::errc{})
  ------------------
  |  Branch (304:21): [True: 813, False: 91.0k]
  ------------------
  305|    813|                {
  306|    813|                    ec = bson_errc::invalid_decimal128_string;
  307|    813|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|    813|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  308|    813|                }
  309|  91.0k|                binary::native_to_little(dec.low,std::back_inserter(buffer_));
  310|  91.0k|                binary::native_to_little(dec.high,std::back_inserter(buffer_));
  311|  91.0k|                break;
  312|  91.8k|            }
  313|  22.0k|            case semantic_tag::id:
  ------------------
  |  Branch (313:13): [True: 22.0k, False: 97.3k]
  ------------------
  314|  22.0k|            {
  315|  22.0k|                before_value(jsoncons::bson::bson_type::object_id_type);
  316|  22.0k|                oid_t oid(sv);
  317|  22.0k|                for (auto b : oid)
  ------------------
  |  Branch (317:29): [True: 264k, False: 22.0k]
  ------------------
  318|   264k|                {
  319|   264k|                    buffer_.push_back(b);
  320|   264k|                }
  321|  22.0k|                break;
  322|  91.8k|            }
  323|  2.44k|            case semantic_tag::regex:
  ------------------
  |  Branch (323:13): [True: 2.44k, False: 116k]
  ------------------
  324|  2.44k|            {
  325|  2.44k|                before_value(jsoncons::bson::bson_type::regex_type);
  326|  2.44k|                std::size_t first = sv.find_first_of('/');
  327|  2.44k|                std::size_t last = sv.find_last_of('/');
  328|  2.44k|                if (first == string_view::npos || last == string_view::npos || first == last)
  ------------------
  |  Branch (328:21): [True: 0, False: 2.44k]
  |  Branch (328:51): [True: 0, False: 2.44k]
  |  Branch (328:80): [True: 0, False: 2.44k]
  ------------------
  329|      0|                {
  330|      0|                    ec = bson_errc::invalid_regex_string;
  331|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  332|      0|                }
  333|  2.44k|                string_view regex = sv.substr(first+1,last-1);
  334|  2.44k|                for (auto c : regex)
  ------------------
  |  Branch (334:29): [True: 4.40M, False: 2.44k]
  ------------------
  335|  4.40M|                {
  336|  4.40M|                    buffer_.push_back(c);
  337|  4.40M|                }
  338|  2.44k|                buffer_.push_back(0x00);
  339|  2.44k|                string_view options = sv.substr(last+1);
  340|  2.44k|                for (auto c : options)
  ------------------
  |  Branch (340:29): [True: 2.35M, False: 2.44k]
  ------------------
  341|  2.35M|                {
  342|  2.35M|                    buffer_.push_back(c);
  343|  2.35M|                }
  344|  2.44k|                buffer_.push_back(0x00);
  345|  2.44k|                break;
  346|  2.44k|            }
  347|  2.98k|            default:
  ------------------
  |  Branch (347:13): [True: 2.98k, False: 116k]
  ------------------
  348|  2.98k|                switch (tag)
  349|  2.98k|                {
  350|    803|                    case semantic_tag::code:
  ------------------
  |  Branch (350:21): [True: 803, False: 2.17k]
  ------------------
  351|    803|                        before_value(jsoncons::bson::bson_type::javascript_type);
  352|    803|                        break;
  353|  2.17k|                    default:
  ------------------
  |  Branch (353:21): [True: 2.17k, False: 803]
  ------------------
  354|  2.17k|                        before_value(jsoncons::bson::bson_type::string_type);
  355|  2.17k|                        break;
  356|  2.98k|                }
  357|  2.98k|                std::size_t offset = buffer_.size();
  358|  2.98k|                buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  359|  2.98k|                std::size_t string_offset = buffer_.size();
  360|  2.98k|                auto sink = unicode_traits::validate(sv.data(), sv.size());
  361|  2.98k|                if (sink.ec != unicode_traits::conv_errc())
  ------------------
  |  Branch (361:21): [True: 0, False: 2.98k]
  ------------------
  362|      0|                {
  363|      0|                    ec = bson_errc::invalid_utf8_text_string;
  364|      0|                    JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|      0|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  365|      0|                }
  366|  2.98k|                for (auto c : sv)
  ------------------
  |  Branch (366:29): [True: 3.12M, False: 2.98k]
  ------------------
  367|  3.12M|                {
  368|  3.12M|                    buffer_.push_back(c);
  369|  3.12M|                }
  370|  2.98k|                buffer_.push_back(0x00);
  371|  2.98k|                std::size_t length = buffer_.size() - string_offset;
  372|  2.98k|                binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  373|  2.98k|                break;
  374|   119k|        }
  375|       |
  376|   118k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|   118k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  377|   119k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEE17visit_byte_stringERKNS_16byte_string_viewEmRKNS_11ser_contextERNS3_10error_codeE:
  411|  38.9k|    {
  412|  38.9k|        if (stack_.empty())
  ------------------
  |  Branch (412:13): [True: 20, False: 38.8k]
  ------------------
  413|     20|        {
  414|     20|            ec = bson_errc::expected_bson_document;
  415|     20|            JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|     20|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  416|     20|        }
  417|  38.8k|        before_value(jsoncons::bson::bson_type::binary_type);
  418|       |
  419|  38.8k|        std::size_t offset = buffer_.size();
  420|  38.8k|        buffer_.insert(buffer_.end(), sizeof(int32_t), 0);
  421|  38.8k|        std::size_t string_offset = buffer_.size();
  422|       |
  423|  38.8k|        buffer_.push_back(static_cast<uint8_t>(ext_tag)); // default subtype
  424|       |
  425|  38.8k|        for (auto c : b)
  ------------------
  |  Branch (425:21): [True: 5.06M, False: 38.8k]
  ------------------
  426|  5.06M|        {
  427|  5.06M|            buffer_.push_back(c);
  428|  5.06M|        }
  429|  38.8k|        std::size_t length = buffer_.size() - string_offset - 1;
  430|  38.8k|        binary::native_to_little(static_cast<uint32_t>(length), buffer_.begin()+offset);
  431|       |
  432|  38.8k|        JSONCONS_VISITOR_RETURN;
  ------------------
  |  |  272|  38.8k|#define JSONCONS_VISITOR_RETURN return true 
  ------------------
  433|  38.9k|    }
_ZN8jsoncons4bson18basic_bson_encoderINS_10bytes_sinkINSt3__16vectorIhNS3_9allocatorIhEEEEvEENS5_IcEEED2Ev:
  124|  3.00k|    {
  125|  3.00k|        sink_.flush();
  126|  3.00k|    }

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

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

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

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

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

