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

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

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

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

_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEED2Ev:
  188|  2.99k|        {
  189|  2.99k|            if (buffer_)
  ------------------
  |  Branch (189:17): [True: 2.99k, False: 0]
  ------------------
  190|  2.99k|            {
  191|  2.99k|                std::allocator_traits<char_allocator_type>::deallocate(alloc_, buffer_, buffer_size_);
  192|  2.99k|            }
  193|  2.99k|        }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEEC2ERNS1_13basic_istreamIcNS1_11char_traitsIcEEEERKS3_:
  171|  2.99k|            : alloc_(alloc), stream_ptr_(std::addressof(is)), sbuf_(is.rdbuf()),
  172|  2.99k|              buffer_size_(default_max_buffer_size)
  173|  2.99k|        {
  174|  2.99k|            buffer_ = std::allocator_traits<char_allocator_type>::allocate(alloc_, buffer_size_);
  175|  2.99k|            data_ = buffer_;
  176|  2.99k|        }
_ZN8jsoncons18basic_null_istreamIcEC1Ev:
   54|  2.99k|          : std::basic_istream<CharT>(&nb_)
   55|  2.99k|        {
   56|  2.99k|        }
_ZN8jsoncons18basic_null_istreamIcE11null_bufferC2Ev:
   40|  2.99k|            null_buffer() = default;
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE8is_errorEv:
  276|  2.99k|        {
  277|  2.99k|            return stream_ptr_->bad();  
  278|  2.99k|        }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE4readEPhm:
  343|  39.1M|        {
  344|  39.1M|            std::size_t len = 0;
  345|  39.1M|            if (length_ > 0)
  ------------------
  |  Branch (345:17): [True: 39.1M, False: 7.82k]
  ------------------
  346|  39.1M|            {
  347|  39.1M|                len = (std::min)(length_, length);
  348|  39.1M|                std::memcpy(p, data_, len*sizeof(value_type));
  349|  39.1M|                data_ += len;
  350|  39.1M|                length_ -= len;
  351|  39.1M|                position_ += len;
  352|  39.1M|            }
  353|  39.1M|            if (length - len == 0)
  ------------------
  |  Branch (353:17): [True: 39.1M, False: 8.99k]
  ------------------
  354|  39.1M|            {
  355|  39.1M|                return len;
  356|  39.1M|            }
  357|  8.99k|            else if (length - len < buffer_size_)
  ------------------
  |  Branch (357:22): [True: 8.73k, False: 256]
  ------------------
  358|  8.73k|            {
  359|  8.73k|                fill_buffer();
  360|  8.73k|                if (length_ > 0)
  ------------------
  |  Branch (360:21): [True: 6.30k, False: 2.43k]
  ------------------
  361|  6.30k|                {
  362|  6.30k|                    std::size_t len2 = (std::min)(length_, length-len);
  363|  6.30k|                    std::memcpy(p+len, data_, len2*sizeof(value_type));
  364|  6.30k|                    data_ += len2;
  365|  6.30k|                    length_ -= len2;
  366|  6.30k|                    position_ += len2;
  367|  6.30k|                    len += len2;
  368|  6.30k|                }
  369|  8.73k|                return len;
  370|  8.73k|            }
  371|    256|            else
  372|    256|            {
  373|    256|                if (stream_ptr_->eof())
  ------------------
  |  Branch (373:21): [True: 0, False: 256]
  ------------------
  374|      0|                {
  375|      0|                    length_ = 0;
  376|      0|                    return 0;
  377|      0|                }
  378|    256|                JSONCONS_TRY
  ------------------
  |  |   37|    256|    #define JSONCONS_TRY try
  ------------------
  379|    256|                {
  380|    256|                    std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(p+len), length-len);
  381|    256|                    std::size_t len2 = static_cast<std::size_t>(count);
  382|    256|                    if (len2 < length-len)
  ------------------
  |  Branch (382:25): [True: 14, False: 242]
  ------------------
  383|     14|                    {
  384|     14|                        stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  385|     14|                    }
  386|    256|                    len += len2;
  387|    256|                    position_ += len2;
  388|    256|                    return len;
  389|    256|                }
  390|    256|                JSONCONS_CATCH(const std::exception&)     
  391|    256|                {
  392|      0|                    stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  393|      0|                    return 0;
  394|      0|                }
  395|    256|            }
  396|  39.1M|        }
_ZN8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE11fill_bufferEv:
  399|  8.73k|        {
  400|  8.73k|            if (stream_ptr_->eof())
  ------------------
  |  Branch (400:17): [True: 2.41k, False: 6.32k]
  ------------------
  401|  2.41k|            {
  402|  2.41k|                length_ = 0;
  403|  2.41k|                return;
  404|  2.41k|            }
  405|       |
  406|  6.32k|            data_ = buffer_;
  407|  6.32k|            JSONCONS_TRY
  ------------------
  |  |   37|  6.32k|    #define JSONCONS_TRY try
  ------------------
  408|  6.32k|            {
  409|  6.32k|                std::streamsize count = sbuf_->sgetn(reinterpret_cast<char_type*>(buffer_), buffer_size_);
  410|  6.32k|                length_ = static_cast<std::size_t>(count);
  411|       |
  412|  6.32k|                if (length_ < buffer_size_)
  ------------------
  |  Branch (412:21): [True: 2.96k, False: 3.36k]
  ------------------
  413|  2.96k|                {
  414|  2.96k|                    stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::eofbit);
  415|  2.96k|                }
  416|  6.32k|            }
  417|  6.32k|            JSONCONS_CATCH(const std::exception&)     
  418|  6.32k|            {
  419|      0|                stream_ptr_->clear(stream_ptr_->rdstate() | std::ios::badbit | std::ios::eofbit);
  420|      0|                length_ = 0;
  421|      0|            }
  422|  6.32k|        }
_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.90k|        {
  883|  3.90k|            std::size_t unread = length;
  884|       |
  885|  3.90k|            std::size_t n = (std::min)(max_buffer_length, unread);
  886|  6.10k|            while (n > 0 && !source.eof())
  ------------------
  |  Branch (886:20): [True: 2.33k, False: 3.76k]
  |  Branch (886:29): [True: 2.20k, False: 137]
  ------------------
  887|  2.20k|            {
  888|  2.20k|                v.reserve(v.size()+n);
  889|  2.20k|                std::size_t actual = 0;
  890|  10.1M|                while (actual < n)
  ------------------
  |  Branch (890:24): [True: 10.1M, False: 2.11k]
  ------------------
  891|  10.1M|                {
  892|  10.1M|                    typename Source::value_type c{};
  893|  10.1M|                    if (source.read(&c,1) != 1)
  ------------------
  |  Branch (893:25): [True: 91, False: 10.1M]
  ------------------
  894|     91|                    {
  895|     91|                        break;
  896|     91|                    }
  897|  10.1M|                    v.push_back(c);
  898|  10.1M|                    ++actual;
  899|  10.1M|                }
  900|  2.20k|                unread -= actual;
  901|  2.20k|                n = (std::min)(max_buffer_length, unread);
  902|  2.20k|            }
  903|       |
  904|  3.90k|            return length - unread;
  905|  3.90k|        }
_ZNK8jsoncons13stream_sourceIhNSt3__19allocatorIhEEE3eofEv:
  271|  6.17k|        {
  272|  6.17k|            return length_ == 0 && stream_ptr_->eof();
  ------------------
  |  Branch (272:20): [True: 735, False: 5.44k]
  |  Branch (272:36): [True: 319, False: 416]
  ------------------
  273|  6.17k|        }
_ZN8jsoncons13source_readerINS_13stream_sourceIhNSt3__19allocatorIhEEEEE4readINS2_6vectorIhS4_EEEENS2_9enable_ifIXaaaasr3std14is_convertibleIhNT_10value_typeEEE5valuesr10ext_traits11has_reserveISB_EE5valuesr10ext_traits14has_data_exactIPhSB_EE5valueEmE4typeERS5_RSB_m:
  859|  44.0k|        {
  860|  44.0k|            std::size_t unread = length;
  861|       |
  862|  44.0k|            std::size_t n = (std::min)(max_buffer_length, unread);
  863|  47.7k|            while (n > 0 && !source.eof())
  ------------------
  |  Branch (863:20): [True: 3.83k, False: 43.8k]
  |  Branch (863:29): [True: 3.65k, False: 182]
  ------------------
  864|  3.65k|            {
  865|  3.65k|                std::size_t offset = v.size();
  866|  3.65k|                v.resize(v.size()+n);
  867|  3.65k|                std::size_t actual = source.read(v.data()+offset, n);
  868|  3.65k|                unread -= actual;
  869|  3.65k|                n = (std::min)(max_buffer_length, unread);
  870|  3.65k|            }
  871|       |
  872|  44.0k|            return length - unread;
  873|  44.0k|        }

_ZN8jsoncons6binary16native_to_littleIjNSt3__111__wrap_iterIPhEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrS9_6littleEvE4typeET_T0_:
  142|  62.1k|    {
  143|  62.1k|        uint8_t buf[sizeof(T)];
  144|  62.1k|        std::memcpy(buf, &val, sizeof(T));
  145|  62.1k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 248k, False: 62.1k]
  ------------------
  146|   248k|        {
  147|   248k|            *d_first++ = item;
  148|   248k|        }
  149|  62.1k|    }
_ZN8jsoncons6binary16native_to_littleIlNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  33.8k|    {
  143|  33.8k|        uint8_t buf[sizeof(T)];
  144|  33.8k|        std::memcpy(buf, &val, sizeof(T));
  145|  33.8k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 271k, False: 33.8k]
  ------------------
  146|   271k|        {
  147|   271k|            *d_first++ = item;
  148|   271k|        }
  149|  33.8k|    }
_ZN8jsoncons6binary16native_to_littleIjNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|  2.84k|    {
  143|  2.84k|        uint8_t buf[sizeof(T)];
  144|  2.84k|        std::memcpy(buf, &val, sizeof(T));
  145|  2.84k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 11.3k, False: 2.84k]
  ------------------
  146|  11.3k|        {
  147|  11.3k|            *d_first++ = item;
  148|  11.3k|        }
  149|  2.84k|    }
_ZN8jsoncons6binary16native_to_littleImNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|   199k|    {
  143|   199k|        uint8_t buf[sizeof(T)];
  144|   199k|        std::memcpy(buf, &val, sizeof(T));
  145|   199k|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 1.59M, False: 199k]
  ------------------
  146|  1.59M|        {
  147|  1.59M|            *d_first++ = item;
  148|  1.59M|        }
  149|   199k|    }
_ZN8jsoncons6binary16native_to_littleIdNSt3__120back_insert_iteratorINS2_6vectorIhNS2_9allocatorIhEEEEEENS_6detail6endianEEENS2_9enable_ifIXeqsrT1_6nativesrSC_6littleEvE4typeET_T0_:
  142|    932|    {
  143|    932|        uint8_t buf[sizeof(T)];
  144|    932|        std::memcpy(buf, &val, sizeof(T));
  145|    932|        for (auto item : buf)
  ------------------
  |  Branch (145:24): [True: 7.45k, False: 932]
  ------------------
  146|  7.45k|        {
  147|  7.45k|            *d_first++ = item;
  148|  7.45k|        }
  149|    932|    }
_ZN8jsoncons6binary16little_to_nativeIiNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  1.03M|    {
  198|  1.03M|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 1.03M]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  1.03M|        T val;
  203|  1.03M|        std::memcpy(&val,first,sizeof(T));
  204|  1.03M|        return val;
  205|  1.03M|    }
_ZN8jsoncons6binary16little_to_nativeIdNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|    932|    {
  198|    932|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 932]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|    932|        T val;
  203|    932|        std::memcpy(&val,first,sizeof(T));
  204|    932|        return val;
  205|    932|    }
_ZN8jsoncons6binary16little_to_nativeImNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|   202k|    {
  198|   202k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 202k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|   202k|        T val;
  203|   202k|        std::memcpy(&val,first,sizeof(T));
  204|   202k|        return val;
  205|   202k|    }
_ZN8jsoncons6binary16little_to_nativeIlNS_6detail6endianEEENSt3__19enable_ifIXeqsrT0_6nativesrS6_6littleET_E4typeEPKhm:
  197|  33.9k|    {
  198|  33.9k|        if (sizeof(T) > count)
  ------------------
  |  Branch (198:13): [True: 0, False: 33.9k]
  ------------------
  199|      0|        {
  200|      0|            return T{};
  201|      0|        }
  202|  33.9k|        T val;
  203|  33.9k|        std::memcpy(&val,first,sizeof(T));
  204|  33.9k|        return val;
  205|  33.9k|    }

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

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

_ZN8jsoncons10to_integerIicEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  557|  93.0k|{
  558|  93.0k|    n = 0;
  559|       |
  560|  93.0k|    if (length == 0)
  ------------------
  |  Branch (560:9): [True: 238, False: 92.8k]
  ------------------
  561|    238|    {
  562|    238|        return to_number_result<CharT>(s, std::errc::invalid_argument);
  563|    238|    }
  564|       |
  565|  92.8k|    bool is_negative = *s == '-' ? true : false;
  ------------------
  |  Branch (565:24): [True: 82.9k, False: 9.91k]
  ------------------
  566|  92.8k|    if (is_negative)
  ------------------
  |  Branch (566:9): [True: 82.9k, False: 9.91k]
  ------------------
  567|  82.9k|    {
  568|  82.9k|        ++s;
  569|  82.9k|        --length;
  570|  82.9k|    }
  571|       |
  572|  92.8k|    using U = typename ext_traits::make_unsigned<T>::type;
  573|       |
  574|  92.8k|    U u;
  575|  92.8k|    auto ru = to_integer(s, length, u);
  576|  92.8k|    if (ru.ec != std::errc{})
  ------------------
  |  Branch (576:9): [True: 0, False: 92.8k]
  ------------------
  577|      0|    {
  578|      0|        return to_number_result<CharT>(ru.ptr, ru.ec);
  579|      0|    }
  580|  92.8k|    if (is_negative)
  ------------------
  |  Branch (580:9): [True: 82.9k, False: 9.91k]
  ------------------
  581|  82.9k|    {
  582|  82.9k|        if (u > static_cast<U>(-((ext_traits::integer_limits<T>::lowest)()+T(1))) + U(1))
  ------------------
  |  Branch (582:13): [True: 0, False: 82.9k]
  ------------------
  583|      0|        {
  584|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  585|      0|        }
  586|  82.9k|        else
  587|  82.9k|        {
  588|  82.9k|            n = static_cast<T>(U(0) - u);
  589|  82.9k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  590|  82.9k|        }
  591|  82.9k|    }
  592|  9.91k|    else
  593|  9.91k|    {
  594|  9.91k|        if (u > static_cast<U>((ext_traits::integer_limits<T>::max)()))
  ------------------
  |  Branch (594:13): [True: 0, False: 9.91k]
  ------------------
  595|      0|        {
  596|      0|            return to_number_result<CharT>(ru.ptr, std::errc::result_out_of_range);
  597|      0|        }
  598|  9.91k|        else
  599|  9.91k|        {
  600|  9.91k|            n = static_cast<T>(u);
  601|  9.91k|            return to_number_result<CharT>(ru.ptr, std::errc{});
  602|  9.91k|        }
  603|  9.91k|    }
  604|  92.8k|}
_ZN8jsoncons16to_number_resultIcEC2EPKcNSt3__14errcE:
  141|   185k|        : ptr(ptr_), ec(ec_)
  142|   185k|    {
  143|   185k|    }
_ZN8jsoncons10to_integerIjcEENSt3__19enable_ifIXaasr10ext_traits14integer_limitsIT_EE14is_specializedntsr10ext_traits14integer_limitsIS3_EE9is_signedENS_16to_number_resultIT0_EEE4typeEPKS5_mRS3_:
  374|  92.8k|{
  375|  92.8k|    n = 0;
  376|       |
  377|  92.8k|    integer_chars_state state = integer_chars_state::initial;
  378|       |
  379|  92.8k|    const CharT* end = s + length; 
  380|   278k|    while (s < end)
  ------------------
  |  Branch (380:12): [True: 185k, False: 92.8k]
  ------------------
  381|   185k|    {
  382|   185k|        switch(state)
  383|   185k|        {
  384|  92.8k|            case integer_chars_state::initial:
  ------------------
  |  Branch (384:13): [True: 92.8k, False: 92.8k]
  ------------------
  385|  92.8k|            {
  386|  92.8k|                switch(*s)
  387|  92.8k|                {
  388|      0|                    case '0':
  ------------------
  |  Branch (388:21): [True: 0, False: 92.8k]
  ------------------
  389|      0|                        state = integer_chars_state::integer; // Could be binary, octal, hex 
  390|      0|                        ++s;
  391|      0|                        break;
  392|  92.8k|                    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: 557, False: 92.2k]
  |  Branch (392:30): [True: 1.16k, False: 91.6k]
  |  Branch (392:39): [True: 73.2k, False: 19.6k]
  |  Branch (392:48): [True: 5.19k, False: 87.6k]
  |  Branch (392:57): [True: 2.66k, False: 90.1k]
  |  Branch (392:66): [True: 2.76k, False: 90.0k]
  |  Branch (392:75): [True: 6.27k, False: 86.5k]
  |  Branch (392:84): [True: 582, False: 92.2k]
  |  Branch (392:94): [True: 415, False: 92.4k]
  ------------------
  393|  92.8k|                        state = integer_chars_state::decimal;
  394|  92.8k|                        break;
  395|      0|                    default:
  ------------------
  |  Branch (395:21): [True: 0, False: 92.8k]
  ------------------
  396|      0|                        return to_number_result<CharT>(s, std::errc::invalid_argument);
  397|  92.8k|                }
  398|  92.8k|                break;
  399|  92.8k|            }
  400|  92.8k|            case integer_chars_state::integer:
  ------------------
  |  Branch (400:13): [True: 0, False: 185k]
  ------------------
  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: 185k]
  ------------------
  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: 185k]
  ------------------
  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|  92.8k|            case integer_chars_state::decimal:
  ------------------
  |  Branch (482:13): [True: 92.8k, False: 92.8k]
  ------------------
  483|  92.8k|            {
  484|  92.8k|                static constexpr T max_value = (ext_traits::integer_limits<T>::max)();
  485|  92.8k|                static constexpr T max_value_div_10 = max_value / 10;
  486|   443k|                for (; s < end; ++s)
  ------------------
  |  Branch (486:24): [True: 350k, False: 92.8k]
  ------------------
  487|   350k|                {
  488|   350k|                    T x = 0;
  489|   350k|                    switch(*s)
  490|   350k|                    {
  491|   350k|                        case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':case '8': case '9':
  ------------------
  |  Branch (491:25): [True: 54.2k, False: 296k]
  |  Branch (491:34): [True: 23.6k, False: 326k]
  |  Branch (491:43): [True: 54.5k, False: 295k]
  |  Branch (491:52): [True: 94.7k, False: 255k]
  |  Branch (491:61): [True: 8.92k, False: 341k]
  |  Branch (491:70): [True: 9.59k, False: 340k]
  |  Branch (491:79): [True: 8.76k, False: 341k]
  |  Branch (491:88): [True: 64.4k, False: 286k]
  |  Branch (491:97): [True: 26.2k, False: 324k]
  |  Branch (491:107): [True: 5.40k, False: 345k]
  ------------------
  492|   350k|                            x = static_cast<T>(*s) - static_cast<T>('0');
  493|   350k|                            break;
  494|      0|                        default:
  ------------------
  |  Branch (494:25): [True: 0, False: 350k]
  ------------------
  495|      0|                            return to_number_result<CharT>(s, std::errc::invalid_argument);
  496|   350k|                    }
  497|   350k|                    if (n > max_value_div_10)
  ------------------
  |  Branch (497:25): [True: 0, False: 350k]
  ------------------
  498|      0|                    {
  499|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  500|      0|                    }
  501|   350k|                    n = n * 10;
  502|   350k|                    if (n > max_value - x)
  ------------------
  |  Branch (502:25): [True: 0, False: 350k]
  ------------------
  503|      0|                    {
  504|      0|                        return to_number_result<CharT>(s, std::errc::result_out_of_range);
  505|      0|                    }
  506|   350k|                    n += x;
  507|   350k|                }
  508|  92.8k|                break;
  509|  92.8k|            }
  510|  92.8k|            case integer_chars_state::base16:
  ------------------
  |  Branch (510:13): [True: 0, False: 185k]
  ------------------
  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: 185k]
  ------------------
  547|      0|                JSONCONS_UNREACHABLE();
  ------------------
  |  |   79|      0|#define JSONCONS_UNREACHABLE() __builtin_unreachable()
  ------------------
  548|      0|                break;
  549|   185k|        }
  550|   185k|    }
  551|  92.8k|    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: 92.8k]
  ------------------
  552|  92.8k|}

_ZN8jsoncons14unicode_traits8validateIcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_14convert_resultIS4_EEE4typeEPKS4_m:
 1136|   236k|    {
 1137|   236k|        conv_errc  result = conv_errc();
 1138|   236k|        const CharT* last = data + length;
 1139|  7.50M|        while (data != last) 
  ------------------
  |  Branch (1139:16): [True: 7.27M, False: 236k]
  ------------------
 1140|  7.27M|        {
 1141|  7.27M|            std::size_t len = static_cast<std::size_t>(trailing_bytes_for_utf8[static_cast<uint8_t>(*data)]) + 1;
 1142|  7.27M|            if (len > (std::size_t)(last - data))
  ------------------
  |  Branch (1142:17): [True: 13, False: 7.27M]
  ------------------
 1143|     13|            {
 1144|     13|                return convert_result<CharT>{data, conv_errc::source_exhausted};
 1145|     13|            }
 1146|  7.27M|            if ((result=is_legal_utf8(data, len)) != conv_errc())
  ------------------
  |  Branch (1146:17): [True: 99, False: 7.27M]
  ------------------
 1147|     99|            {
 1148|     99|                return convert_result<CharT>{data,result} ;
 1149|     99|            }
 1150|  7.27M|            data += len;
 1151|  7.27M|        }
 1152|   236k|        return convert_result<CharT>{data,result} ;
 1153|   236k|    }
_ZN8jsoncons14unicode_traits13is_legal_utf8IcEENSt3__19enable_ifIXsr10ext_traits8is_char8IT_EE5valueENS0_9conv_errcEE4typeEPKS4_m:
  305|  7.27M|    {
  306|  7.27M|        uint8_t a;
  307|  7.27M|        const CharT* srcptr = first+length;
  308|  7.27M|        switch (length) {
  309|     24|        default:
  ------------------
  |  Branch (309:9): [True: 24, False: 7.27M]
  ------------------
  310|     24|            return conv_errc::over_long_utf8_sequence;
  311|  1.37k|        case 4:
  ------------------
  |  Branch (311:9): [True: 1.37k, False: 7.27M]
  ------------------
  312|  1.37k|            if (((a = (*--srcptr))& 0xC0) != 0x80)
  ------------------
  |  Branch (312:17): [True: 5, False: 1.37k]
  ------------------
  313|      5|                return conv_errc::expected_continuation_byte;
  314|  1.37k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  1.37k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  315|  3.63k|        case 3:
  ------------------
  |  Branch (315:9): [True: 2.26k, False: 7.27M]
  ------------------
  316|  3.63k|            if (((a = (*--srcptr))& 0xC0) != 0x80)
  ------------------
  |  Branch (316:17): [True: 10, False: 3.62k]
  ------------------
  317|     10|                return conv_errc::expected_continuation_byte;
  318|  3.62k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  3.62k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  319|  5.23k|        case 2:
  ------------------
  |  Branch (319:9): [True: 1.60k, False: 7.27M]
  ------------------
  320|  5.23k|            if (((a = (*--srcptr))& 0xC0) != 0x80)
  ------------------
  |  Branch (320:17): [True: 14, False: 5.21k]
  ------------------
  321|     14|                return conv_errc::expected_continuation_byte;
  322|       |
  323|  5.21k|            switch (static_cast<uint8_t>(*first)) 
  324|  5.21k|            {
  325|       |                // no fall-through in this inner switch
  326|  1.92k|                case 0xE0: if (a < 0xA0) return conv_errc::source_illegal; break;
  ------------------
  |  Branch (326:17): [True: 1.92k, False: 3.29k]
  |  Branch (326:32): [True: 7, False: 1.91k]
  ------------------
  327|  1.91k|                case 0xED: if (a > 0x9F) return conv_errc::source_illegal; break;
  ------------------
  |  Branch (327:17): [True: 253, False: 4.96k]
  |  Branch (327:32): [True: 4, False: 249]
  ------------------
  328|    581|                case 0xF0: if (a < 0x90) return conv_errc::source_illegal; break;
  ------------------
  |  Branch (328:17): [True: 581, False: 4.63k]
  |  Branch (328:32): [True: 5, False: 576]
  ------------------
  329|    576|                case 0xF4: if (a > 0x8F) return conv_errc::source_illegal; break;
  ------------------
  |  Branch (329:17): [True: 492, False: 4.72k]
  |  Branch (329:32): [True: 3, False: 489]
  ------------------
  330|  1.96k|                default:   if (a < 0x80) return conv_errc::source_illegal;
  ------------------
  |  Branch (330:17): [True: 1.96k, False: 3.25k]
  |  Branch (330:32): [True: 0, False: 1.96k]
  ------------------
  331|  5.21k|            }
  332|       |
  333|  5.20k|            JSONCONS_FALLTHROUGH;
  ------------------
  |  |  564|  5.20k|#  define JSONCONS_FALLTHROUGH [[fallthrough]]
  ------------------
  334|  7.27M|        case 1:
  ------------------
  |  Branch (334:9): [True: 7.26M, False: 5.27k]
  ------------------
  335|  7.27M|            if (static_cast<uint8_t>(*first) >= 0x80 && static_cast<uint8_t>(*first) < 0xC2)
  ------------------
  |  Branch (335:17): [True: 5.22k, False: 7.26M]
  |  Branch (335:57): [True: 26, False: 5.19k]
  ------------------
  336|     26|                return conv_errc::source_illegal;
  337|  7.27M|            break;
  338|  7.27M|        }
  339|  7.27M|        if (static_cast<uint8_t>(*first) > 0xF4) 
  ------------------
  |  Branch (339:13): [True: 1, False: 7.27M]
  ------------------
  340|      1|            return conv_errc::source_illegal;
  341|       |
  342|  7.27M|        return conv_errc();
  343|  7.27M|    }

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

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

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

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

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

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

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

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

