_ZNK5draco28AttributeOctahedronTransform28CopyToAttributeTransformDataEPNS_22AttributeTransformDataE:
   36|    439|    AttributeTransformData* out_data) const {
   37|    439|  out_data->set_transform_type(ATTRIBUTE_OCTAHEDRON_TRANSFORM);
   38|    439|  out_data->AppendParameterValue(quantization_bits_);
   39|    439|}
_ZN5draco28AttributeOctahedronTransform25InverseTransformAttributeERKNS_14PointAttributeEPS1_:
   49|    421|    const PointAttribute& attribute, PointAttribute* target_attribute) {
   50|    421|  if (target_attribute->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (50:7): [True: 0, False: 421]
  ------------------
   51|      0|    return false;
   52|      0|  }
   53|       |
   54|    421|  const int num_points = target_attribute->size();
   55|    421|  const int num_components = target_attribute->num_components();
   56|    421|  if (num_components != 3) {
  ------------------
  |  Branch (56:7): [True: 0, False: 421]
  ------------------
   57|      0|    return false;
   58|      0|  }
   59|    421|  constexpr int kEntrySize = sizeof(float) * 3;
   60|    421|  float att_val[3];
   61|    421|  const int32_t* source_attribute_data = reinterpret_cast<const int32_t*>(
   62|    421|      attribute.GetAddress(AttributeValueIndex(0)));
   63|    421|  uint8_t* target_address =
   64|    421|      target_attribute->GetAddress(AttributeValueIndex(0));
   65|    421|  OctahedronToolBox octahedron_tool_box;
   66|    421|  if (!octahedron_tool_box.SetQuantizationBits(quantization_bits_)) {
  ------------------
  |  Branch (66:7): [True: 287, False: 134]
  ------------------
   67|    287|    return false;
   68|    287|  }
   69|  25.1M|  for (uint32_t i = 0; i < num_points; ++i) {
  ------------------
  |  Branch (69:24): [True: 25.1M, False: 134]
  ------------------
   70|  25.1M|    const int32_t s = *source_attribute_data++;
   71|  25.1M|    const int32_t t = *source_attribute_data++;
   72|  25.1M|    octahedron_tool_box.QuantizedOctahedralCoordsToUnitVector(s, t, att_val);
   73|       |
   74|       |    // Store the decoded floating point values into the attribute buffer.
   75|  25.1M|    std::memcpy(target_address, att_val, kEntrySize);
   76|  25.1M|    target_address += kEntrySize;
   77|  25.1M|  }
   78|    134|  return true;
   79|    421|}
_ZN5draco28AttributeOctahedronTransform16DecodeParametersERKNS_14PointAttributeEPNS_13DecoderBufferE:
   95|    836|    const PointAttribute& attribute, DecoderBuffer* decoder_buffer) {
   96|    836|  uint8_t quantization_bits;
   97|    836|  if (!decoder_buffer->Decode(&quantization_bits)) {
  ------------------
  |  Branch (97:7): [True: 397, False: 439]
  ------------------
   98|    397|    return false;
   99|    397|  }
  100|    439|  quantization_bits_ = quantization_bits;
  101|    439|  return true;
  102|    836|}

_ZN5draco28AttributeOctahedronTransformC2Ev:
   28|  1.34k|  AttributeOctahedronTransform() : quantization_bits_(-1) {}

_ZNK5draco30AttributeQuantizationTransform28CopyToAttributeTransformDataEPNS_22AttributeTransformDataE:
   49|    194|    AttributeTransformData* out_data) const {
   50|    194|  out_data->set_transform_type(ATTRIBUTE_QUANTIZATION_TRANSFORM);
   51|    194|  out_data->AppendParameterValue(quantization_bits_);
   52|  5.56k|  for (int i = 0; i < min_values_.size(); ++i) {
  ------------------
  |  Branch (52:19): [True: 5.37k, False: 194]
  ------------------
   53|  5.37k|    out_data->AppendParameterValue(min_values_[i]);
   54|  5.37k|  }
   55|    194|  out_data->AppendParameterValue(range_);
   56|    194|}
_ZN5draco30AttributeQuantizationTransform25InverseTransformAttributeERKNS_14PointAttributeEPS1_:
   72|     74|    const PointAttribute& attribute, PointAttribute* target_attribute) {
   73|     74|  if (target_attribute->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (73:7): [True: 0, False: 74]
  ------------------
   74|      0|    return false;
   75|      0|  }
   76|       |
   77|       |  // Convert all quantized values back to floats.
   78|     74|  const int32_t max_quantized_value =
   79|     74|      (1u << static_cast<uint32_t>(quantization_bits_)) - 1;
   80|     74|  const int num_components = target_attribute->num_components();
   81|     74|  const int entry_size = sizeof(float) * num_components;
   82|     74|  const std::unique_ptr<float[]> att_val(new float[num_components]);
   83|     74|  int quant_val_id = 0;
   84|     74|  int out_byte_pos = 0;
   85|     74|  Dequantizer dequantizer;
   86|     74|  if (!dequantizer.Init(range_, max_quantized_value)) {
  ------------------
  |  Branch (86:7): [True: 0, False: 74]
  ------------------
   87|      0|    return false;
   88|      0|  }
   89|     74|  const int32_t* const source_attribute_data = reinterpret_cast<const int32_t*>(
   90|     74|      attribute.GetAddress(AttributeValueIndex(0)));
   91|       |
   92|     74|  const int num_values = target_attribute->size();
   93|       |
   94|  38.2M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (94:24): [True: 38.2M, False: 74]
  ------------------
   95|  77.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:21): [True: 39.5M, False: 38.2M]
  ------------------
   96|  39.5M|      float value =
   97|  39.5M|          dequantizer.DequantizeFloat(source_attribute_data[quant_val_id++]);
   98|  39.5M|      value = value + min_values_[c];
   99|  39.5M|      att_val[c] = value;
  100|  39.5M|    }
  101|       |    // Store the floating point value into the attribute buffer.
  102|  38.2M|    target_attribute->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  103|  38.2M|    out_byte_pos += entry_size;
  104|  38.2M|  }
  105|     74|  return true;
  106|     74|}
_ZN5draco30AttributeQuantizationTransform19IsQuantizationValidEi:
  109|    225|    int quantization_bits) {
  110|       |  // Currently we allow only up to 30 bit quantization.
  111|    225|  return quantization_bits >= 1 && quantization_bits <= 30;
  ------------------
  |  Branch (111:10): [True: 209, False: 16]
  |  Branch (111:36): [True: 195, False: 14]
  ------------------
  112|    225|}
_ZN5draco30AttributeQuantizationTransform13SetParametersEiPKfif:
  117|    121|                                                   float range) {
  118|    121|  if (!IsQuantizationValid(quantization_bits)) {
  ------------------
  |  Branch (118:7): [True: 4, False: 117]
  ------------------
  119|      4|    return false;
  120|      4|  }
  121|    117|  quantization_bits_ = quantization_bits;
  122|    117|  min_values_.assign(min_values, min_values + num_components);
  123|    117|  range_ = range;
  124|    117|  return true;
  125|    121|}
_ZN5draco30AttributeQuantizationTransform16DecodeParametersERKNS_14PointAttributeEPNS_13DecoderBufferE:
  202|    170|    const PointAttribute& attribute, DecoderBuffer* decoder_buffer) {
  203|    170|  min_values_.resize(attribute.num_components());
  204|    170|  if (!decoder_buffer->Decode(&min_values_[0],
  ------------------
  |  Branch (204:7): [True: 56, False: 114]
  ------------------
  205|    170|                              sizeof(float) * min_values_.size())) {
  206|     56|    return false;
  207|     56|  }
  208|    114|  if (!decoder_buffer->Decode(&range_)) {
  ------------------
  |  Branch (208:7): [True: 7, False: 107]
  ------------------
  209|      7|    return false;
  210|      7|  }
  211|    107|  uint8_t quantization_bits;
  212|    107|  if (!decoder_buffer->Decode(&quantization_bits)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 104]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|    104|  if (!IsQuantizationValid(quantization_bits)) {
  ------------------
  |  Branch (215:7): [True: 26, False: 78]
  ------------------
  216|     26|    return false;
  217|     26|  }
  218|     78|  quantization_bits_ = quantization_bits;
  219|     78|  return true;
  220|    104|}

_ZN5draco30AttributeQuantizationTransformC2Ev:
   29|    605|  AttributeQuantizationTransform() : quantization_bits_(-1), range_(0.f) {}
_ZNK5draco30AttributeQuantizationTransform17quantization_bitsEv:
   59|     57|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco30AttributeQuantizationTransform5rangeEv:
   62|     57|  float range() const { return range_; }

_ZNK5draco18AttributeTransform19TransferToAttributeEPNS_14PointAttributeE:
   19|    633|bool AttributeTransform::TransferToAttribute(PointAttribute* attribute) const {
   20|    633|  std::unique_ptr<AttributeTransformData> transform_data(
   21|    633|      new AttributeTransformData());
   22|    633|  this->CopyToAttributeTransformData(transform_data.get());
   23|    633|  attribute->SetAttributeTransformData(std::move(transform_data));
   24|    633|  return true;
   25|    633|}

_ZN5draco18AttributeTransformD2Ev:
   29|  2.15k|  virtual ~AttributeTransform() = default;

_ZN5draco22AttributeTransformDataC2Ev:
   32|    633|  AttributeTransformData() : transform_type_(ATTRIBUTE_INVALID_TRANSFORM) {}
_ZN5draco22AttributeTransformData18set_transform_typeENS_22AttributeTransformTypeE:
   37|    633|  void set_transform_type(AttributeTransformType type) {
   38|    633|    transform_type_ = type;
   39|    633|  }
_ZN5draco22AttributeTransformData20AppendParameterValueIiEEvRKT_:
   60|    633|  void AppendParameterValue(const DataTypeT& in_data) {
   61|    633|    SetParameterValue(static_cast<int>(buffer_.data_size()), in_data);
   62|    633|  }
_ZN5draco22AttributeTransformData17SetParameterValueIiEEviRKT_:
   51|    633|  void SetParameterValue(int byte_offset, const DataTypeT& in_data) {
   52|    633|    if (byte_offset + sizeof(DataTypeT) > buffer_.data_size()) {
  ------------------
  |  Branch (52:9): [True: 633, False: 0]
  ------------------
   53|    633|      buffer_.Resize(byte_offset + sizeof(DataTypeT));
   54|    633|    }
   55|    633|    buffer_.Write(byte_offset, &in_data, sizeof(DataTypeT));
   56|    633|  }
_ZN5draco22AttributeTransformData20AppendParameterValueIfEEvRKT_:
   60|  5.56k|  void AppendParameterValue(const DataTypeT& in_data) {
   61|  5.56k|    SetParameterValue(static_cast<int>(buffer_.data_size()), in_data);
   62|  5.56k|  }
_ZN5draco22AttributeTransformData17SetParameterValueIfEEviRKT_:
   51|  5.56k|  void SetParameterValue(int byte_offset, const DataTypeT& in_data) {
   52|  5.56k|    if (byte_offset + sizeof(DataTypeT) > buffer_.data_size()) {
  ------------------
  |  Branch (52:9): [True: 5.56k, False: 0]
  ------------------
   53|  5.56k|      buffer_.Resize(byte_offset + sizeof(DataTypeT));
   54|  5.56k|    }
   55|  5.56k|    buffer_.Write(byte_offset, &in_data, sizeof(DataTypeT));
   56|  5.56k|  }

_ZN5draco17GeometryAttributeC2Ev:
   20|  40.6k|    : buffer_(nullptr),
   21|  40.6k|      num_components_(1),
   22|  40.6k|      data_type_(DT_FLOAT32),
   23|  40.6k|      byte_stride_(0),
   24|  40.6k|      byte_offset_(0),
   25|  40.6k|      attribute_type_(INVALID),
   26|  40.6k|      unique_id_(0) {}
_ZN5draco17GeometryAttribute4InitENS0_4TypeEPNS_10DataBufferEhNS_8DataTypeEbll:
   31|  40.6k|                             int64_t byte_stride, int64_t byte_offset) {
   32|  40.6k|  buffer_ = buffer;
   33|  40.6k|  if (buffer) {
  ------------------
  |  Branch (33:7): [True: 0, False: 40.6k]
  ------------------
   34|      0|    buffer_descriptor_.buffer_id = buffer->buffer_id();
   35|      0|    buffer_descriptor_.buffer_update_count = buffer->update_count();
   36|      0|  }
   37|  40.6k|  num_components_ = num_components;
   38|  40.6k|  data_type_ = data_type;
   39|  40.6k|  normalized_ = normalized;
   40|  40.6k|  byte_stride_ = byte_stride;
   41|  40.6k|  byte_offset_ = byte_offset;
   42|  40.6k|  attribute_type_ = attribute_type;
   43|  40.6k|}
_ZN5draco17GeometryAttribute11ResetBufferEPNS_10DataBufferEll:
  102|  24.6k|                                    int64_t byte_offset) {
  103|  24.6k|  buffer_ = buffer;
  104|  24.6k|  buffer_descriptor_.buffer_id = buffer->buffer_id();
  105|  24.6k|  buffer_descriptor_.buffer_update_count = buffer->update_count();
  106|  24.6k|  byte_stride_ = byte_stride;
  107|  24.6k|  byte_offset_ = byte_offset;
  108|  24.6k|}

_ZNK5draco17GeometryAttribute10GetBytePosENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  118|  16.2M|  inline int64_t GetBytePos(AttributeValueIndex att_index) const {
  119|  16.2M|    return byte_offset_ + byte_stride_ * att_index.value();
  120|  16.2M|  }
_ZNK5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  122|  16.2M|  inline const uint8_t* GetAddress(AttributeValueIndex att_index) const {
  123|  16.2M|    const int64_t byte_pos = GetBytePos(att_index);
  124|  16.2M|    return buffer_->data() + byte_pos;
  125|  16.2M|  }
_ZN5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  126|  12.3k|  inline uint8_t* GetAddress(AttributeValueIndex att_index) {
  127|  12.3k|    const int64_t byte_pos = GetBytePos(att_index);
  128|  12.3k|    return buffer_->data() + byte_pos;
  129|  12.3k|  }
_ZNK5draco17GeometryAttribute14IsAddressValidEPKh:
  130|  48.6M|  inline bool IsAddressValid(const uint8_t* address) const {
  131|  48.6M|    return ((buffer_->data() + buffer_->data_size()) > address);
  132|  48.6M|  }
_ZNK5draco17GeometryAttribute8GetValueENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPv:
  136|    118|  void GetValue(AttributeValueIndex att_index, void* out_data) const {
  137|    118|    const int64_t byte_pos = byte_offset_ + byte_stride_ * att_index.value();
  138|    118|    buffer_->Read(byte_pos, out_data, byte_stride_);
  139|    118|  }
_ZN5draco17GeometryAttribute17SetAttributeValueENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPKv:
  143|   388M|  void SetAttributeValue(AttributeValueIndex entry_index, const void* value) {
  144|   388M|    const int64_t byte_pos = entry_index.value() * byte_stride();
  145|   388M|    buffer_->Write(byte_pos, value, byte_stride());
  146|   388M|  }
_ZNK5draco17GeometryAttribute14attribute_typeEv:
  266|  76.6k|  Type attribute_type() const { return attribute_type_; }
_ZNK5draco17GeometryAttribute9data_typeEv:
  269|  45.4k|  DataType data_type() const { return data_type_; }
_ZNK5draco17GeometryAttribute14num_componentsEv:
  273|   115k|  uint8_t num_components() const { return num_components_; }
_ZNK5draco17GeometryAttribute11byte_strideEv:
  282|   777M|  int64_t byte_stride() const { return byte_stride_; }
_ZNK5draco17GeometryAttribute9unique_idEv:
  287|  9.75k|  uint32_t unique_id() const { return unique_id_; }
_ZN5draco17GeometryAttribute13set_unique_idEj:
  288|   101k|  void set_unique_id(uint32_t id) { unique_id_ = id; }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  16.1M|  bool ConvertValue(AttributeValueIndex att_index, OutT* out_value) const {
  230|  16.1M|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  16.1M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  16.1M|                    OutT* out_val) const {
  180|  16.1M|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 16.1M]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  16.1M|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 16.1M]
  ------------------
  185|      0|        return ConvertTypedValue<int8_t, OutT>(att_id, out_num_components,
  186|      0|                                               out_val);
  187|      0|      case DT_UINT8:
  ------------------
  |  Branch (187:7): [True: 0, False: 16.1M]
  ------------------
  188|      0|        return ConvertTypedValue<uint8_t, OutT>(att_id, out_num_components,
  189|      0|                                                out_val);
  190|      0|      case DT_INT16:
  ------------------
  |  Branch (190:7): [True: 0, False: 16.1M]
  ------------------
  191|      0|        return ConvertTypedValue<int16_t, OutT>(att_id, out_num_components,
  192|      0|                                                out_val);
  193|      0|      case DT_UINT16:
  ------------------
  |  Branch (193:7): [True: 0, False: 16.1M]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  16.1M|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 16.1M, False: 0]
  ------------------
  197|  16.1M|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  16.1M|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 16.1M]
  ------------------
  200|      0|        return ConvertTypedValue<uint32_t, OutT>(att_id, out_num_components,
  201|      0|                                                 out_val);
  202|      0|      case DT_INT64:
  ------------------
  |  Branch (202:7): [True: 0, False: 16.1M]
  ------------------
  203|      0|        return ConvertTypedValue<int64_t, OutT>(att_id, out_num_components,
  204|      0|                                                out_val);
  205|      0|      case DT_UINT64:
  ------------------
  |  Branch (205:7): [True: 0, False: 16.1M]
  ------------------
  206|      0|        return ConvertTypedValue<uint64_t, OutT>(att_id, out_num_components,
  207|      0|                                                 out_val);
  208|      0|      case DT_FLOAT32:
  ------------------
  |  Branch (208:7): [True: 0, False: 16.1M]
  ------------------
  209|      0|        return ConvertTypedValue<float, OutT>(att_id, out_num_components,
  210|      0|                                              out_val);
  211|      0|      case DT_FLOAT64:
  ------------------
  |  Branch (211:7): [True: 0, False: 16.1M]
  ------------------
  212|      0|        return ConvertTypedValue<double, OutT>(att_id, out_num_components,
  213|      0|                                               out_val);
  214|      0|      case DT_BOOL:
  ------------------
  |  Branch (214:7): [True: 0, False: 16.1M]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 16.1M]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  16.1M|    }
  221|  16.1M|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIilEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  16.1M|                         OutT* out_value) const {
  307|  16.1M|    const uint8_t* src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  64.5M|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 48.3M, False: 16.1M]
  ------------------
  311|  48.3M|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 48.3M]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  48.3M|      const T in_value = *reinterpret_cast<const T*>(src_address);
  315|  48.3M|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 48.3M]
  ------------------
  316|  48.3M|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  48.3M|      src_address += sizeof(T);
  320|  48.3M|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  16.1M|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 16.1M]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  16.1M|    return true;
  326|  16.1M|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIilEEbRKT_bPT0_:
  364|  48.3M|                                    OutT* out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  48.3M|#if __cplusplus >= 201703L
  367|  48.3M|    if constexpr (std::is_integral<OutT>::value) {
  368|       |#else
  369|       |    if (std::is_integral<OutT>::value) {
  370|       |#endif
  371|       |      // Make sure the |in_value| fits within the range of values that OutT
  372|       |      // is able to represent. Perform the check only for integral types.
  373|  48.3M|#if __cplusplus >= 201703L
  374|       |      if constexpr (!std::is_same<T, bool>::value &&
  375|  48.3M|                    std::is_integral<T>::value) {
  376|       |#else
  377|       |      if (!std::is_same<T, bool>::value && std::is_integral<T>::value) {
  378|       |#endif
  379|  48.3M|        static constexpr OutT kOutMin =
  380|  48.3M|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (380:13): [True: 0, Folded]
  ------------------
  381|  48.3M|        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (381:13): [True: 0, False: 48.3M]
  |  Branch (381:35): [True: 0, False: 48.3M]
  ------------------
  382|      0|          return false;
  383|      0|        }
  384|  48.3M|      }
  385|       |
  386|       |      // Check conversion of floating point |in_value| to integral value OutT.
  387|  48.3M|#if __cplusplus >= 201703L
  388|       |      if constexpr (std::is_floating_point<T>::value) {
  389|       |#else
  390|       |      if (std::is_floating_point<T>::value) {
  391|       |#endif
  392|       |        // Make sure the floating point |in_value| is not NaN and not Inf as
  393|       |        // integral type OutT is unable to represent these values.
  394|       |        if (sizeof(in_value) > sizeof(double)) {
  395|       |          if (std::isnan(static_cast<long double>(in_value)) ||
  396|       |              std::isinf(static_cast<long double>(in_value))) {
  397|       |            return false;
  398|       |          }
  399|       |        } else if (sizeof(in_value) > sizeof(float)) {
  400|       |          if (std::isnan(static_cast<double>(in_value)) ||
  401|       |              std::isinf(static_cast<double>(in_value))) {
  402|       |            return false;
  403|       |          }
  404|       |        } else {
  405|       |          if (std::isnan(static_cast<float>(in_value)) ||
  406|       |              std::isinf(static_cast<float>(in_value))) {
  407|       |            return false;
  408|       |          }
  409|       |        }
  410|       |
  411|       |        // Make sure the floating point |in_value| fits within the range of
  412|       |        // values that integral type OutT is able to represent.
  413|       |        if (in_value < std::numeric_limits<OutT>::min() ||
  414|       |            in_value >= std::numeric_limits<OutT>::max()) {
  415|       |          return false;
  416|       |        }
  417|       |      }
  418|  48.3M|    }
  419|       |
  420|  48.3M|    if (!normalized) {
  ------------------
  |  Branch (420:9): [True: 48.3M, False: 0]
  ------------------
  421|  48.3M|      *out_value = static_cast<OutT>(in_value);
  422|  48.3M|    } else {
  423|      0|#if __cplusplus >= 201703L
  424|       |      if constexpr (std::is_integral<T>::value &&
  425|       |                    std::is_floating_point<OutT>::value) {
  426|       |#else
  427|       |      if (std::is_integral<T>::value && std::is_floating_point<OutT>::value) {
  428|       |#endif
  429|       |        // When converting integer to floating point, normalize the value if
  430|       |        // necessary.
  431|       |        *out_value = static_cast<OutT>(in_value);
  432|       |        *out_value /= static_cast<OutT>(std::numeric_limits<T>::max());
  433|       |#if __cplusplus >= 201703L
  434|       |      } else if constexpr (std::is_floating_point<T>::value &&
  435|       |                           std::is_integral<OutT>::value) {
  436|       |#else
  437|       |      } else if (std::is_floating_point<T>::value &&
  438|       |                 std::is_integral<OutT>::value) {
  439|       |#endif
  440|       |        // Converting from floating point to a normalized integer.
  441|       |        if (in_value > 1 || in_value < 0) {
  442|       |          // Normalized float values need to be between 0 and 1.
  443|       |          return false;
  444|       |        }
  445|       |        // TODO(ostava): Consider allowing float to normalized integer
  446|       |        // conversion for 64-bit integer types. Currently it doesn't work
  447|       |        // because we don't have a floating point type that could store all 64
  448|       |        // bit integers.
  449|       |        if (sizeof(OutT) > 4) {
  450|       |          return false;
  451|       |        }
  452|       |        // Expand the float to the range of the output integer and round it to
  453|       |        // the nearest representable value. Use doubles for the math to ensure
  454|       |        // the integer values are represented properly during the conversion
  455|       |        // process.
  456|       |        *out_value = static_cast<OutT>(std::floor(
  457|       |            in_value * static_cast<double>(std::numeric_limits<OutT>::max()) +
  458|       |            0.5));
  459|      0|      } else {
  460|      0|        *out_value = static_cast<OutT>(in_value);
  461|      0|      }
  462|      0|    }
  463|       |
  464|       |    // TODO(ostava): Add handling of normalized attributes when converting
  465|       |    // between different integer representations. If the attribute is
  466|       |    // normalized, integer values should be converted as if they represent 0-1
  467|       |    // range. E.g. when we convert uint16 to uint8, the range <0, 2^16 - 1>
  468|       |    // should be converted to range <0, 2^8 - 1>.
  469|  48.3M|    return true;
  470|  48.3M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  93.3k|  bool ConvertValue(AttributeValueIndex att_index, OutT* out_value) const {
  230|  93.3k|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  93.3k|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  93.3k|                    OutT* out_val) const {
  180|  93.3k|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 93.3k]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  93.3k|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 93.3k]
  ------------------
  185|      0|        return ConvertTypedValue<int8_t, OutT>(att_id, out_num_components,
  186|      0|                                               out_val);
  187|      0|      case DT_UINT8:
  ------------------
  |  Branch (187:7): [True: 0, False: 93.3k]
  ------------------
  188|      0|        return ConvertTypedValue<uint8_t, OutT>(att_id, out_num_components,
  189|      0|                                                out_val);
  190|      0|      case DT_INT16:
  ------------------
  |  Branch (190:7): [True: 0, False: 93.3k]
  ------------------
  191|      0|        return ConvertTypedValue<int16_t, OutT>(att_id, out_num_components,
  192|      0|                                                out_val);
  193|      0|      case DT_UINT16:
  ------------------
  |  Branch (193:7): [True: 0, False: 93.3k]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  93.3k|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 93.3k, False: 0]
  ------------------
  197|  93.3k|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  93.3k|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 93.3k]
  ------------------
  200|      0|        return ConvertTypedValue<uint32_t, OutT>(att_id, out_num_components,
  201|      0|                                                 out_val);
  202|      0|      case DT_INT64:
  ------------------
  |  Branch (202:7): [True: 0, False: 93.3k]
  ------------------
  203|      0|        return ConvertTypedValue<int64_t, OutT>(att_id, out_num_components,
  204|      0|                                                out_val);
  205|      0|      case DT_UINT64:
  ------------------
  |  Branch (205:7): [True: 0, False: 93.3k]
  ------------------
  206|      0|        return ConvertTypedValue<uint64_t, OutT>(att_id, out_num_components,
  207|      0|                                                 out_val);
  208|      0|      case DT_FLOAT32:
  ------------------
  |  Branch (208:7): [True: 0, False: 93.3k]
  ------------------
  209|      0|        return ConvertTypedValue<float, OutT>(att_id, out_num_components,
  210|      0|                                              out_val);
  211|      0|      case DT_FLOAT64:
  ------------------
  |  Branch (211:7): [True: 0, False: 93.3k]
  ------------------
  212|      0|        return ConvertTypedValue<double, OutT>(att_id, out_num_components,
  213|      0|                                               out_val);
  214|      0|      case DT_BOOL:
  ------------------
  |  Branch (214:7): [True: 0, False: 93.3k]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 93.3k]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  93.3k|    }
  221|  93.3k|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIifEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  93.3k|                         OutT* out_value) const {
  307|  93.3k|    const uint8_t* src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|   373k|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 279k, False: 93.3k]
  ------------------
  311|   279k|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 279k]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|   279k|      const T in_value = *reinterpret_cast<const T*>(src_address);
  315|   279k|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 279k]
  ------------------
  316|   279k|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|   279k|      src_address += sizeof(T);
  320|   279k|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  93.3k|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 93.3k]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  93.3k|    return true;
  326|  93.3k|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIifEEbRKT_bPT0_:
  364|   279k|                                    OutT* out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|   279k|#if __cplusplus >= 201703L
  367|       |    if constexpr (std::is_integral<OutT>::value) {
  368|       |#else
  369|       |    if (std::is_integral<OutT>::value) {
  370|       |#endif
  371|       |      // Make sure the |in_value| fits within the range of values that OutT
  372|       |      // is able to represent. Perform the check only for integral types.
  373|       |#if __cplusplus >= 201703L
  374|       |      if constexpr (!std::is_same<T, bool>::value &&
  375|       |                    std::is_integral<T>::value) {
  376|       |#else
  377|       |      if (!std::is_same<T, bool>::value && std::is_integral<T>::value) {
  378|       |#endif
  379|       |        static constexpr OutT kOutMin =
  380|       |            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  381|       |        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  382|       |          return false;
  383|       |        }
  384|       |      }
  385|       |
  386|       |      // Check conversion of floating point |in_value| to integral value OutT.
  387|       |#if __cplusplus >= 201703L
  388|       |      if constexpr (std::is_floating_point<T>::value) {
  389|       |#else
  390|       |      if (std::is_floating_point<T>::value) {
  391|       |#endif
  392|       |        // Make sure the floating point |in_value| is not NaN and not Inf as
  393|       |        // integral type OutT is unable to represent these values.
  394|       |        if (sizeof(in_value) > sizeof(double)) {
  395|       |          if (std::isnan(static_cast<long double>(in_value)) ||
  396|       |              std::isinf(static_cast<long double>(in_value))) {
  397|       |            return false;
  398|       |          }
  399|       |        } else if (sizeof(in_value) > sizeof(float)) {
  400|       |          if (std::isnan(static_cast<double>(in_value)) ||
  401|       |              std::isinf(static_cast<double>(in_value))) {
  402|       |            return false;
  403|       |          }
  404|       |        } else {
  405|       |          if (std::isnan(static_cast<float>(in_value)) ||
  406|       |              std::isinf(static_cast<float>(in_value))) {
  407|       |            return false;
  408|       |          }
  409|       |        }
  410|       |
  411|       |        // Make sure the floating point |in_value| fits within the range of
  412|       |        // values that integral type OutT is able to represent.
  413|       |        if (in_value < std::numeric_limits<OutT>::min() ||
  414|       |            in_value >= std::numeric_limits<OutT>::max()) {
  415|       |          return false;
  416|       |        }
  417|       |      }
  418|       |    }
  419|       |
  420|   279k|    if (!normalized) {
  ------------------
  |  Branch (420:9): [True: 279k, False: 0]
  ------------------
  421|   279k|      *out_value = static_cast<OutT>(in_value);
  422|   279k|    } else {
  423|      0|#if __cplusplus >= 201703L
  424|       |      if constexpr (std::is_integral<T>::value &&
  425|      0|                    std::is_floating_point<OutT>::value) {
  426|       |#else
  427|       |      if (std::is_integral<T>::value && std::is_floating_point<OutT>::value) {
  428|       |#endif
  429|       |        // When converting integer to floating point, normalize the value if
  430|       |        // necessary.
  431|      0|        *out_value = static_cast<OutT>(in_value);
  432|      0|        *out_value /= static_cast<OutT>(std::numeric_limits<T>::max());
  433|      0|#if __cplusplus >= 201703L
  434|       |      } else if constexpr (std::is_floating_point<T>::value &&
  435|       |                           std::is_integral<OutT>::value) {
  436|       |#else
  437|       |      } else if (std::is_floating_point<T>::value &&
  438|       |                 std::is_integral<OutT>::value) {
  439|       |#endif
  440|       |        // Converting from floating point to a normalized integer.
  441|       |        if (in_value > 1 || in_value < 0) {
  442|       |          // Normalized float values need to be between 0 and 1.
  443|       |          return false;
  444|       |        }
  445|       |        // TODO(ostava): Consider allowing float to normalized integer
  446|       |        // conversion for 64-bit integer types. Currently it doesn't work
  447|       |        // because we don't have a floating point type that could store all 64
  448|       |        // bit integers.
  449|       |        if (sizeof(OutT) > 4) {
  450|       |          return false;
  451|       |        }
  452|       |        // Expand the float to the range of the output integer and round it to
  453|       |        // the nearest representable value. Use doubles for the math to ensure
  454|       |        // the integer values are represented properly during the conversion
  455|       |        // process.
  456|       |        *out_value = static_cast<OutT>(std::floor(
  457|       |            in_value * static_cast<double>(std::numeric_limits<OutT>::max()) +
  458|       |            0.5));
  459|       |      } else {
  460|       |        *out_value = static_cast<OutT>(in_value);
  461|       |      }
  462|      0|    }
  463|       |
  464|       |    // TODO(ostava): Add handling of normalized attributes when converting
  465|       |    // between different integer representations. If the attribute is
  466|       |    // normalized, integer values should be converted as if they represent 0-1
  467|       |    // range. E.g. when we convert uint16 to uint8, the range <0, 2^16 - 1>
  468|       |    // should be converted to range <0, 2^8 - 1>.
  469|   279k|    return true;
  470|   279k|  }

_ZN5draco14PointAttributeC2ERKNS_17GeometryAttributeE:
   32|  40.6k|    : GeometryAttribute(att),
   33|  40.6k|      num_unique_entries_(0),
   34|  40.6k|      identity_mapping_(false) {}
_ZN5draco14PointAttribute5ResetEm:
   67|  24.6k|bool PointAttribute::Reset(size_t num_attribute_values) {
   68|  24.6k|  if (attribute_buffer_ == nullptr) {
  ------------------
  |  Branch (68:7): [True: 24.6k, False: 0]
  ------------------
   69|  24.6k|    attribute_buffer_ = std::unique_ptr<DataBuffer>(new DataBuffer());
   70|  24.6k|  }
   71|  24.6k|  const int64_t entry_size = DataTypeLength(data_type()) * num_components();
   72|  24.6k|  if (!attribute_buffer_->Update(nullptr, num_attribute_values * entry_size)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 24.6k]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|       |  // Assign the new buffer to the parent attribute.
   76|  24.6k|  ResetBuffer(attribute_buffer_.get(), entry_size, 0);
   77|  24.6k|  num_unique_entries_ = static_cast<uint32_t>(num_attribute_values);
   78|  24.6k|  return true;
   79|  24.6k|}

_ZNK5draco14PointAttribute4sizeEv:
   55|   388M|  size_t size() const { return num_unique_entries_; }
_ZNK5draco14PointAttribute12mapped_indexENS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   56|   429M|  AttributeValueIndex mapped_index(PointIndex point_index) const {
   57|   429M|    if (identity_mapping_) {
  ------------------
  |  Branch (57:9): [True: 388M, False: 40.8M]
  ------------------
   58|   388M|      return AttributeValueIndex(point_index.value());
   59|   388M|    }
   60|  40.8M|    return indices_map_[point_index];
   61|   429M|  }
_ZNK5draco14PointAttribute6bufferEv:
   62|   922M|  DataBuffer* buffer() const { return attribute_buffer_.get(); }
_ZNK5draco14PointAttribute19is_mapping_identityEv:
   63|  24.6M|  bool is_mapping_identity() const { return identity_mapping_; }
_ZNK5draco14PointAttribute16indices_map_sizeEv:
   64|  24.6M|  size_t indices_map_size() const {
   65|  24.6M|    if (is_mapping_identity()) {
  ------------------
  |  Branch (65:9): [True: 0, False: 24.6M]
  ------------------
   66|      0|      return 0;
   67|      0|    }
   68|  24.6M|    return indices_map_.size();
   69|  24.6M|  }
_ZN5draco14PointAttribute18SetIdentityMappingEv:
   88|  15.3k|  void SetIdentityMapping() {
   89|  15.3k|    identity_mapping_ = true;
   90|  15.3k|    indices_map_.clear();
   91|  15.3k|  }
_ZN5draco14PointAttribute18SetExplicitMappingEm:
   94|  17.9k|  void SetExplicitMapping(size_t num_points) {
   95|  17.9k|    identity_mapping_ = false;
   96|  17.9k|    indices_map_.resize(num_points, kInvalidAttributeValueIndex);
   97|  17.9k|  }
_ZN5draco14PointAttribute16SetPointMapEntryENS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEE:
  101|  69.4M|                        AttributeValueIndex entry_index) {
  102|  69.4M|    DRACO_DCHECK(!identity_mapping_);
  103|  69.4M|    indices_map_[point_index] = entry_index;
  104|  69.4M|  }
_ZN5draco14PointAttribute25SetAttributeTransformDataENSt3__110unique_ptrINS_22AttributeTransformDataENS1_14default_deleteIS3_EEEE:
  129|    633|      std::unique_ptr<AttributeTransformData> transform_data) {
  130|    633|    attribute_transform_data_ = std::move(transform_data);
  131|    633|  }

_ZN5draco17AttributesDecoderC2Ev:
   22|  43.6k|    : point_cloud_decoder_(nullptr), point_cloud_(nullptr) {}
_ZN5draco17AttributesDecoder4InitEPNS_17PointCloudDecoderEPNS_10PointCloudE:
   24|  43.5k|bool AttributesDecoder::Init(PointCloudDecoder* decoder, PointCloud* pc) {
   25|  43.5k|  point_cloud_decoder_ = decoder;
   26|  43.5k|  point_cloud_ = pc;
   27|  43.5k|  return true;
   28|  43.5k|}
_ZN5draco17AttributesDecoder27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   30|  12.6k|bool AttributesDecoder::DecodeAttributesDecoderData(DecoderBuffer* in_buffer) {
   31|       |  // Decode and create attributes.
   32|  12.6k|  uint32_t num_attributes;
   33|  12.6k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   34|  12.6k|  if (point_cloud_decoder_->bitstream_version() <
  ------------------
  |  Branch (34:7): [True: 79, False: 12.6k]
  ------------------
   35|  12.6k|      DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  12.6k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
   36|     79|    if (!in_buffer->Decode(&num_attributes)) {
  ------------------
  |  Branch (36:9): [True: 12, False: 67]
  ------------------
   37|     12|      return false;
   38|     12|    }
   39|     79|  } else
   40|  12.6k|#endif
   41|  12.6k|  {
   42|  12.6k|    if (!DecodeVarint(&num_attributes, in_buffer)) {
  ------------------
  |  Branch (42:9): [True: 78, False: 12.5k]
  ------------------
   43|     78|      return false;
   44|     78|    }
   45|  12.6k|  }
   46|       |
   47|       |  // Check that decoded number of attributes is valid.
   48|  12.6k|  if (num_attributes == 0) {
  ------------------
  |  Branch (48:7): [True: 17, False: 12.5k]
  ------------------
   49|     17|    return false;
   50|     17|  }
   51|  12.5k|  if (num_attributes > 5 * in_buffer->remaining_size()) {
  ------------------
  |  Branch (51:7): [True: 123, False: 12.4k]
  ------------------
   52|       |    // The decoded number of attributes is unreasonably high, because at least
   53|       |    // five bytes of attribute descriptor data per attribute are expected.
   54|    123|    return false;
   55|    123|  }
   56|       |
   57|       |  // Decode attribute descriptor data.
   58|  12.4k|  point_attribute_ids_.resize(num_attributes);
   59|  12.4k|  PointCloud* pc = point_cloud_;
   60|  42.9k|  for (uint32_t i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:24): [True: 30.6k, False: 12.3k]
  ------------------
   61|       |    // Decode attribute descriptor data.
   62|  30.6k|    uint8_t att_type, data_type, num_components, normalized;
   63|  30.6k|    if (!in_buffer->Decode(&att_type)) {
  ------------------
  |  Branch (63:9): [True: 23, False: 30.5k]
  ------------------
   64|     23|      return false;
   65|     23|    }
   66|  30.5k|    if (!in_buffer->Decode(&data_type)) {
  ------------------
  |  Branch (66:9): [True: 28, False: 30.5k]
  ------------------
   67|     28|      return false;
   68|     28|    }
   69|  30.5k|    if (!in_buffer->Decode(&num_components)) {
  ------------------
  |  Branch (69:9): [True: 13, False: 30.5k]
  ------------------
   70|     13|      return false;
   71|     13|    }
   72|  30.5k|    if (!in_buffer->Decode(&normalized)) {
  ------------------
  |  Branch (72:9): [True: 15, False: 30.5k]
  ------------------
   73|     15|      return false;
   74|     15|    }
   75|  30.5k|    if (att_type >= GeometryAttribute::NAMED_ATTRIBUTES_COUNT) {
  ------------------
  |  Branch (75:9): [True: 27, False: 30.5k]
  ------------------
   76|     27|      return false;
   77|     27|    }
   78|  30.5k|    if (data_type == DT_INVALID || data_type >= DT_TYPES_COUNT) {
  ------------------
  |  Branch (78:9): [True: 5, False: 30.5k]
  |  Branch (78:36): [True: 17, False: 30.4k]
  ------------------
   79|     22|      return false;
   80|     22|    }
   81|       |
   82|       |    // Check decoded attribute descriptor data.
   83|  30.4k|    if (num_components == 0) {
  ------------------
  |  Branch (83:9): [True: 3, False: 30.4k]
  ------------------
   84|      3|      return false;
   85|      3|    }
   86|       |
   87|       |    // Add the attribute to the point cloud.
   88|  30.4k|    const DataType draco_dt = static_cast<DataType>(data_type);
   89|  30.4k|    GeometryAttribute ga;
   90|  30.4k|    ga.Init(static_cast<GeometryAttribute::Type>(att_type), nullptr,
   91|  30.4k|            num_components, draco_dt, normalized > 0,
   92|  30.4k|            DataTypeLength(draco_dt) * num_components, 0);
   93|  30.4k|    uint32_t unique_id;
   94|  30.4k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   95|  30.4k|    if (point_cloud_decoder_->bitstream_version() <
  ------------------
  |  Branch (95:9): [True: 24, False: 30.4k]
  ------------------
   96|  30.4k|        DRACO_BITSTREAM_VERSION(1, 3)) {
  ------------------
  |  |  115|  30.4k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
   97|     24|      uint16_t custom_id;
   98|     24|      if (!in_buffer->Decode(&custom_id)) {
  ------------------
  |  Branch (98:11): [True: 1, False: 23]
  ------------------
   99|      1|        return false;
  100|      1|      }
  101|       |      // TODO(draco-eng): Add "custom_id" to attribute metadata.
  102|     23|      unique_id = static_cast<uint32_t>(custom_id);
  103|     23|      ga.set_unique_id(unique_id);
  104|     23|    } else
  105|  30.4k|#endif
  106|  30.4k|    {
  107|  30.4k|      if (!DecodeVarint(&unique_id, in_buffer)) {
  ------------------
  |  Branch (107:11): [True: 25, False: 30.4k]
  ------------------
  108|     25|        return false;
  109|     25|      }
  110|  30.4k|      ga.set_unique_id(unique_id);
  111|  30.4k|    }
  112|  30.4k|    const int att_id = pc->AddAttribute(
  113|  30.4k|        std::unique_ptr<PointAttribute>(new PointAttribute(ga)));
  114|  30.4k|    pc->attribute(att_id)->set_unique_id(unique_id);
  115|  30.4k|    point_attribute_ids_[i] = att_id;
  116|       |
  117|       |    // Update the inverse map.
  118|  30.4k|    if (att_id >=
  ------------------
  |  Branch (118:9): [True: 30.4k, False: 0]
  ------------------
  119|  30.4k|        static_cast<int32_t>(point_attribute_to_local_id_map_.size())) {
  120|  30.4k|      point_attribute_to_local_id_map_.resize(att_id + 1, -1);
  121|  30.4k|    }
  122|  30.4k|    point_attribute_to_local_id_map_[att_id] = i;
  123|  30.4k|  }
  124|  12.3k|  return true;
  125|  12.4k|}

_ZNK5draco17AttributesDecoder14GetAttributeIdEi:
   44|  76.8k|  int32_t GetAttributeId(int i) const override {
   45|  76.8k|    return point_attribute_ids_[i];
   46|  76.8k|  }
_ZNK5draco17AttributesDecoder16GetNumAttributesEv:
   47|  56.8k|  int32_t GetNumAttributes() const override {
   48|  56.8k|    return static_cast<int32_t>(point_attribute_ids_.size());
   49|  56.8k|  }
_ZNK5draco17AttributesDecoder10GetDecoderEv:
   50|  44.0k|  PointCloudDecoder* GetDecoder() const override {
   51|  44.0k|    return point_cloud_decoder_;
   52|  44.0k|  }
_ZN5draco17AttributesDecoder16DecodeAttributesEPNS_13DecoderBufferE:
   55|  8.31k|  bool DecodeAttributes(DecoderBuffer* in_buffer) override {
   56|  8.31k|    if (!DecodePortableAttributes(in_buffer)) {
  ------------------
  |  Branch (56:9): [True: 4.08k, False: 4.23k]
  ------------------
   57|  4.08k|      return false;
   58|  4.08k|    }
   59|  4.23k|    if (!DecodeDataNeededByPortableTransforms(in_buffer)) {
  ------------------
  |  Branch (59:9): [True: 1.92k, False: 2.30k]
  ------------------
   60|  1.92k|      return false;
   61|  1.92k|    }
   62|  2.30k|    if (!TransformAttributesToOriginalFormat()) {
  ------------------
  |  Branch (62:9): [True: 603, False: 1.70k]
  ------------------
   63|    603|      return false;
   64|    603|    }
   65|  1.70k|    return true;
   66|  2.30k|  }
_ZNK5draco17AttributesDecoder27GetLocalIdForPointAttributeEi:
   69|  2.55k|  int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const {
   70|  2.55k|    const int id_map_size =
   71|  2.55k|        static_cast<int>(point_attribute_to_local_id_map_.size());
   72|  2.55k|    if (point_attribute_id >= id_map_size) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.55k]
  ------------------
   73|      0|      return -1;
   74|      0|    }
   75|  2.55k|    return point_attribute_to_local_id_map_[point_attribute_id];
   76|  2.55k|  }
_ZN5draco17AttributesDecoderD2Ev:
   35|  43.6k|  virtual ~AttributesDecoder() = default;

_ZN5draco26AttributesDecoderInterfaceD2Ev:
   34|  43.6k|  virtual ~AttributesDecoderInterface() = default;
_ZN5draco26AttributesDecoderInterfaceC2Ev:
   33|  43.6k|  AttributesDecoderInterface() = default;

_ZN5draco23KdTreeAttributesDecoderC2Ev:
  132|  13.7k|KdTreeAttributesDecoder::KdTreeAttributesDecoder() = default;
_ZN5draco23KdTreeAttributesDecoder24DecodePortableAttributesEPNS_13DecoderBufferE:
  135|  2.72k|    DecoderBuffer* in_buffer) {
  136|  2.72k|  if (in_buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 3)) {
  ------------------
  |  |  115|  2.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (136:7): [True: 1.37k, False: 1.35k]
  ------------------
  137|       |    // Old bitstream does everything in the
  138|       |    // DecodeDataNeededByPortableTransforms() method.
  139|  1.37k|    return true;
  140|  1.37k|  }
  141|  1.35k|  uint8_t compression_level = 0;
  142|  1.35k|  if (!in_buffer->Decode(&compression_level)) {
  ------------------
  |  Branch (142:7): [True: 5, False: 1.35k]
  ------------------
  143|      5|    return false;
  144|      5|  }
  145|  1.35k|  const int32_t num_points = GetDecoder()->point_cloud()->num_points();
  146|       |
  147|       |  // Decode data using the kd tree decoding into integer (portable) attributes.
  148|       |  // We first need to go over all attributes and create a new portable storage
  149|       |  // for those attributes that need it (floating point attributes that have to
  150|       |  // be dequantized after decoding).
  151|       |
  152|  1.35k|  const int num_attributes = GetNumAttributes();
  153|  1.35k|  uint32_t total_dimensionality = 0;  // position is a required dimension
  154|  1.35k|  std::vector<AttributeTuple> atts(num_attributes);
  155|       |
  156|  3.58k|  for (int i = 0; i < GetNumAttributes(); ++i) {
  ------------------
  |  Branch (156:19): [True: 2.23k, False: 1.34k]
  ------------------
  157|  2.23k|    const int att_id = GetAttributeId(i);
  158|  2.23k|    PointAttribute* const att = GetDecoder()->point_cloud()->attribute(att_id);
  159|       |    // All attributes have the same number of values and identity mapping
  160|       |    // between PointIndex and AttributeValueIndex.
  161|  2.23k|    att->Reset(num_points);
  162|  2.23k|    att->SetIdentityMapping();
  163|       |
  164|  2.23k|    PointAttribute* target_att = nullptr;
  165|  2.23k|    if (att->data_type() == DT_UINT32 || att->data_type() == DT_UINT16 ||
  ------------------
  |  Branch (165:9): [True: 63, False: 2.17k]
  |  Branch (165:42): [True: 234, False: 1.93k]
  ------------------
  166|  1.93k|        att->data_type() == DT_UINT8) {
  ------------------
  |  Branch (166:9): [True: 407, False: 1.53k]
  ------------------
  167|       |      // We can decode to these attributes directly.
  168|    704|      target_att = att;
  169|  1.53k|    } else if (att->data_type() == DT_INT32 || att->data_type() == DT_INT16 ||
  ------------------
  |  Branch (169:16): [True: 244, False: 1.28k]
  |  Branch (169:48): [True: 191, False: 1.09k]
  ------------------
  170|  1.14k|               att->data_type() == DT_INT8) {
  ------------------
  |  Branch (170:16): [True: 705, False: 392]
  ------------------
  171|       |      // Prepare storage for data that is used to convert unsigned values back
  172|       |      // to the signed ones.
  173|  53.6k|      for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (173:23): [True: 52.4k, False: 1.14k]
  ------------------
  174|  52.4k|        min_signed_values_.push_back(0);
  175|  52.4k|      }
  176|  1.14k|      target_att = att;
  177|  1.14k|    } else if (att->data_type() == DT_FLOAT32) {
  ------------------
  |  Branch (177:16): [True: 389, False: 3]
  ------------------
  178|       |      // Create a portable attribute that will hold the decoded data. We will
  179|       |      // dequantize the decoded data to the final attribute later on.
  180|    389|      const int num_components = att->num_components();
  181|    389|      GeometryAttribute va;
  182|    389|      va.Init(att->attribute_type(), nullptr, num_components, DT_UINT32, false,
  183|    389|              num_components * DataTypeLength(DT_UINT32), 0);
  184|    389|      std::unique_ptr<PointAttribute> port_att(new PointAttribute(va));
  185|    389|      port_att->SetIdentityMapping();
  186|    389|      port_att->Reset(num_points);
  187|    389|      quantized_portable_attributes_.push_back(std::move(port_att));
  188|    389|      target_att = quantized_portable_attributes_.back().get();
  189|    389|    } else {
  190|       |      // Unsupported type.
  191|      3|      return false;
  192|      3|    }
  193|       |    // Add attribute to the output iterator used by the core algorithm.
  194|  2.23k|    const DataType data_type = target_att->data_type();
  195|  2.23k|    const uint32_t data_size = (std::max)(0, DataTypeLength(data_type));
  196|  2.23k|    const uint32_t num_components = target_att->num_components();
  197|  2.23k|    atts[i] = std::make_tuple(target_att, total_dimensionality, data_type,
  198|  2.23k|                              data_size, num_components);
  199|  2.23k|    total_dimensionality += num_components;
  200|  2.23k|  }
  201|  1.34k|  typedef PointAttributeVectorOutputIterator<uint32_t> OutIt;
  202|  1.34k|  OutIt out_it(atts);
  203|       |
  204|  1.34k|  switch (compression_level) {
  205|    202|    case 0: {
  ------------------
  |  Branch (205:5): [True: 202, False: 1.14k]
  ------------------
  206|    202|      if (!DecodePoints<0, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (206:11): [True: 122, False: 80]
  ------------------
  207|    202|                                  &out_it)) {
  208|    122|        return false;
  209|    122|      }
  210|     80|      break;
  211|    202|    }
  212|    113|    case 1: {
  ------------------
  |  Branch (212:5): [True: 113, False: 1.23k]
  ------------------
  213|    113|      if (!DecodePoints<1, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (213:11): [True: 75, False: 38]
  ------------------
  214|    113|                                  &out_it)) {
  215|     75|        return false;
  216|     75|      }
  217|     38|      break;
  218|    113|    }
  219|    173|    case 2: {
  ------------------
  |  Branch (219:5): [True: 173, False: 1.17k]
  ------------------
  220|    173|      if (!DecodePoints<2, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (220:11): [True: 152, False: 21]
  ------------------
  221|    173|                                  &out_it)) {
  222|    152|        return false;
  223|    152|      }
  224|     21|      break;
  225|    173|    }
  226|    164|    case 3: {
  ------------------
  |  Branch (226:5): [True: 164, False: 1.18k]
  ------------------
  227|    164|      if (!DecodePoints<3, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (227:11): [True: 155, False: 9]
  ------------------
  228|    164|                                  &out_it)) {
  229|    155|        return false;
  230|    155|      }
  231|      9|      break;
  232|    164|    }
  233|    195|    case 4: {
  ------------------
  |  Branch (233:5): [True: 195, False: 1.15k]
  ------------------
  234|    195|      if (!DecodePoints<4, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (234:11): [True: 184, False: 11]
  ------------------
  235|    195|                                  &out_it)) {
  236|    184|        return false;
  237|    184|      }
  238|     11|      break;
  239|    195|    }
  240|    254|    case 5: {
  ------------------
  |  Branch (240:5): [True: 254, False: 1.09k]
  ------------------
  241|    254|      if (!DecodePoints<5, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (241:11): [True: 240, False: 14]
  ------------------
  242|    254|                                  &out_it)) {
  243|    240|        return false;
  244|    240|      }
  245|     14|      break;
  246|    254|    }
  247|    229|    case 6: {
  ------------------
  |  Branch (247:5): [True: 229, False: 1.11k]
  ------------------
  248|    229|      if (!DecodePoints<6, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (248:11): [True: 206, False: 23]
  ------------------
  249|    229|                                  &out_it)) {
  250|    206|        return false;
  251|    206|      }
  252|     23|      break;
  253|    229|    }
  254|     23|    default:
  ------------------
  |  Branch (254:5): [True: 18, False: 1.33k]
  ------------------
  255|     18|      return false;
  256|  1.34k|  }
  257|    196|  return true;
  258|  1.34k|}
_ZN5draco23KdTreeAttributesDecoder36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
  274|  1.56k|    DecoderBuffer* in_buffer) {
  275|  1.56k|  if (in_buffer->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 3)) {
  ------------------
  |  |  115|  1.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (275:7): [True: 196, False: 1.37k]
  ------------------
  276|       |    // Decode quantization data for each attribute that need it.
  277|       |    // TODO(ostava): This should be moved to AttributeQuantizationTransform.
  278|    196|    std::vector<float> min_value;
  279|    556|    for (int i = 0; i < GetNumAttributes(); ++i) {
  ------------------
  |  Branch (279:21): [True: 404, False: 152]
  ------------------
  280|    404|      const int att_id = GetAttributeId(i);
  281|    404|      const PointAttribute* const att =
  282|    404|          GetDecoder()->point_cloud()->attribute(att_id);
  283|    404|      if (att->data_type() == DT_FLOAT32) {
  ------------------
  |  Branch (283:11): [True: 161, False: 243]
  ------------------
  284|    161|        const int num_components = att->num_components();
  285|    161|        min_value.resize(num_components);
  286|    161|        if (!in_buffer->Decode(&min_value[0], sizeof(float) * num_components)) {
  ------------------
  |  Branch (286:13): [True: 26, False: 135]
  ------------------
  287|     26|          return false;
  288|     26|        }
  289|    135|        float max_value_dif;
  290|    135|        if (!in_buffer->Decode(&max_value_dif)) {
  ------------------
  |  Branch (290:13): [True: 4, False: 131]
  ------------------
  291|      4|          return false;
  292|      4|        }
  293|    131|        uint8_t quantization_bits;
  294|    131|        if (!in_buffer->Decode(&quantization_bits) || quantization_bits > 31) {
  ------------------
  |  Branch (294:13): [True: 1, False: 130]
  |  Branch (294:55): [True: 9, False: 121]
  ------------------
  295|     10|          return false;
  296|     10|        }
  297|    121|        AttributeQuantizationTransform transform;
  298|    121|        if (!transform.SetParameters(quantization_bits, min_value.data(),
  ------------------
  |  Branch (298:13): [True: 4, False: 117]
  ------------------
  299|    121|                                     num_components, max_value_dif)) {
  300|      4|          return false;
  301|      4|        }
  302|    117|        const int num_transforms =
  303|    117|            static_cast<int>(attribute_quantization_transforms_.size());
  304|    117|        if (!transform.TransferToAttribute(
  ------------------
  |  Branch (304:13): [True: 0, False: 117]
  ------------------
  305|    117|                quantized_portable_attributes_[num_transforms].get())) {
  306|      0|          return false;
  307|      0|        }
  308|    117|        attribute_quantization_transforms_.push_back(transform);
  309|    117|      }
  310|    404|    }
  311|       |
  312|       |    // Decode transform data for signed integer attributes.
  313|  3.19k|    for (int i = 0; i < min_signed_values_.size(); ++i) {
  ------------------
  |  Branch (313:21): [True: 3.09k, False: 102]
  ------------------
  314|  3.09k|      int32_t val;
  315|  3.09k|      if (!DecodeVarint(&val, in_buffer)) {
  ------------------
  |  Branch (315:11): [True: 50, False: 3.04k]
  ------------------
  316|     50|        return false;
  317|     50|      }
  318|  3.04k|      min_signed_values_[i] = val;
  319|  3.04k|    }
  320|    102|    return true;
  321|    152|  }
  322|  1.37k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  323|       |  // Handle old bitstream
  324|       |  // Figure out the total dimensionality of the point cloud
  325|  1.37k|  const uint32_t attribute_count = GetNumAttributes();
  326|  1.37k|  uint32_t total_dimensionality = 0;  // position is a required dimension
  327|  1.37k|  std::vector<AttributeTuple> atts(attribute_count);
  328|  1.37k|  for (auto attribute_index = 0;
  329|  3.25k|       static_cast<uint32_t>(attribute_index) < attribute_count;
  ------------------
  |  Branch (329:8): [True: 1.88k, False: 1.37k]
  ------------------
  330|  1.88k|       attribute_index += 1)  // increment the dimensionality as needed...
  331|  1.88k|  {
  332|  1.88k|    const int att_id = GetAttributeId(attribute_index);
  333|  1.88k|    PointAttribute* const att = GetDecoder()->point_cloud()->attribute(att_id);
  334|  1.88k|    const DataType data_type = att->data_type();
  335|  1.88k|    const uint32_t data_size = (std::max)(0, DataTypeLength(data_type));
  336|  1.88k|    const uint32_t num_components = att->num_components();
  337|  1.88k|    if (data_size > 4) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.88k]
  ------------------
  338|      1|      return false;
  339|      1|    }
  340|       |
  341|  1.88k|    atts[attribute_index] = std::make_tuple(
  342|  1.88k|        att, total_dimensionality, data_type, data_size, num_components);
  343|       |    // everything is treated as 32bit in the encoder.
  344|  1.88k|    total_dimensionality += num_components;
  345|  1.88k|  }
  346|       |
  347|  1.37k|  const int att_id = GetAttributeId(0);
  348|  1.37k|  PointAttribute* const att = GetDecoder()->point_cloud()->attribute(att_id);
  349|  1.37k|  att->SetIdentityMapping();
  350|       |  // Decode method
  351|  1.37k|  uint8_t method;
  352|  1.37k|  if (!in_buffer->Decode(&method)) {
  ------------------
  |  Branch (352:7): [True: 6, False: 1.36k]
  ------------------
  353|      6|    return false;
  354|      6|  }
  355|  1.36k|  if (method == KdTreeAttributesEncodingMethod::kKdTreeQuantizationEncoding) {
  ------------------
  |  Branch (355:7): [True: 990, False: 374]
  ------------------
  356|       |    // This method only supports one attribute with exactly three components.
  357|    990|    if (atts.size() != 1 || std::get<4>(atts[0]) != 3) {
  ------------------
  |  Branch (357:9): [True: 3, False: 987]
  |  Branch (357:29): [True: 3, False: 984]
  ------------------
  358|      6|      return false;
  359|      6|    }
  360|    984|    uint8_t compression_level = 0;
  361|    984|    if (!in_buffer->Decode(&compression_level)) {
  ------------------
  |  Branch (361:9): [True: 1, False: 983]
  ------------------
  362|      1|      return false;
  363|      1|    }
  364|    983|    uint32_t num_points = 0;
  365|    983|    if (!in_buffer->Decode(&num_points)) {
  ------------------
  |  Branch (365:9): [True: 2, False: 981]
  ------------------
  366|      2|      return false;
  367|      2|    }
  368|    981|    att->Reset(num_points);
  369|    981|    FloatPointsTreeDecoder decoder;
  370|    981|    decoder.set_num_points_from_header(num_points);
  371|    981|    PointAttributeVectorOutputIterator<float> out_it(atts);
  372|    981|    if (!decoder.DecodePointCloud(in_buffer, out_it)) {
  ------------------
  |  Branch (372:9): [True: 970, False: 11]
  ------------------
  373|    970|      return false;
  374|    970|    }
  375|    981|  } else if (method == KdTreeAttributesEncodingMethod::kKdTreeIntegerEncoding) {
  ------------------
  |  Branch (375:14): [True: 362, False: 12]
  ------------------
  376|    362|    uint8_t compression_level = 0;
  377|    362|    if (!in_buffer->Decode(&compression_level)) {
  ------------------
  |  Branch (377:9): [True: 2, False: 360]
  ------------------
  378|      2|      return false;
  379|      2|    }
  380|    360|    if (6 < compression_level) {
  ------------------
  |  Branch (380:9): [True: 3, False: 357]
  ------------------
  381|      3|      DRACO_LOGE(
  ------------------
  |  |   31|      3|#define DRACO_LOGE printf
  ------------------
  382|      3|          "KdTreeAttributesDecoder: compression level %i not supported.\n",
  383|      3|          compression_level);
  384|      3|      return false;
  385|      3|    }
  386|       |
  387|    357|    uint32_t num_points;
  388|    357|    if (!in_buffer->Decode(&num_points)) {
  ------------------
  |  Branch (388:9): [True: 9, False: 348]
  ------------------
  389|      9|      return false;
  390|      9|    }
  391|       |
  392|    348|    for (auto attribute_index = 0;
  393|    869|         static_cast<uint32_t>(attribute_index) < attribute_count;
  ------------------
  |  Branch (393:10): [True: 521, False: 348]
  ------------------
  394|    521|         attribute_index += 1) {
  395|    521|      const int att_id = GetAttributeId(attribute_index);
  396|    521|      PointAttribute* const attr =
  397|    521|          GetDecoder()->point_cloud()->attribute(att_id);
  398|    521|      attr->Reset(num_points);
  399|    521|      attr->SetIdentityMapping();
  400|    521|    }
  401|       |
  402|    348|    using OutIt = PointAttributeVectorOutputIterator<uint32_t>;
  403|    348|    OutIt out_it(atts);
  404|       |
  405|    348|    switch (compression_level) {
  406|    142|      case 0: {
  ------------------
  |  Branch (406:7): [True: 142, False: 206]
  ------------------
  407|    142|        if (!DecodePoints<0, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (407:13): [True: 135, False: 7]
  ------------------
  408|    142|                                    &out_it)) {
  409|    135|          return false;
  410|    135|        }
  411|      7|        break;
  412|    142|      }
  413|    151|      case 1: {
  ------------------
  |  Branch (413:7): [True: 151, False: 197]
  ------------------
  414|    151|        if (!DecodePoints<1, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (414:13): [True: 147, False: 4]
  ------------------
  415|    151|                                    &out_it)) {
  416|    147|          return false;
  417|    147|        }
  418|      4|        break;
  419|    151|      }
  420|     30|      case 2: {
  ------------------
  |  Branch (420:7): [True: 30, False: 318]
  ------------------
  421|     30|        if (!DecodePoints<2, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (421:13): [True: 29, False: 1]
  ------------------
  422|     30|                                    &out_it)) {
  423|     29|          return false;
  424|     29|        }
  425|      1|        break;
  426|     30|      }
  427|      9|      case 3: {
  ------------------
  |  Branch (427:7): [True: 9, False: 339]
  ------------------
  428|      9|        if (!DecodePoints<3, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (428:13): [True: 8, False: 1]
  ------------------
  429|      9|                                    &out_it)) {
  430|      8|          return false;
  431|      8|        }
  432|      1|        break;
  433|      9|      }
  434|      7|      case 4: {
  ------------------
  |  Branch (434:7): [True: 7, False: 341]
  ------------------
  435|      7|        if (!DecodePoints<4, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (435:13): [True: 6, False: 1]
  ------------------
  436|      7|                                    &out_it)) {
  437|      6|          return false;
  438|      6|        }
  439|      1|        break;
  440|      7|      }
  441|      4|      case 5: {
  ------------------
  |  Branch (441:7): [True: 4, False: 344]
  ------------------
  442|      4|        if (!DecodePoints<5, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (442:13): [True: 3, False: 1]
  ------------------
  443|      4|                                    &out_it)) {
  444|      3|          return false;
  445|      3|        }
  446|      1|        break;
  447|      4|      }
  448|      5|      case 6: {
  ------------------
  |  Branch (448:7): [True: 5, False: 343]
  ------------------
  449|      5|        if (!DecodePoints<6, OutIt>(total_dimensionality, num_points, in_buffer,
  ------------------
  |  Branch (449:13): [True: 3, False: 2]
  ------------------
  450|      5|                                    &out_it)) {
  451|      3|          return false;
  452|      3|        }
  453|      2|        break;
  454|      5|      }
  455|      2|      default:
  ------------------
  |  Branch (455:7): [True: 0, False: 348]
  ------------------
  456|      0|        return false;
  457|    348|    }
  458|    348|  } else {
  459|       |    // Invalid method.
  460|     12|    return false;
  461|     12|  }
  462|     28|  return true;
  463|       |#else
  464|       |  return false;
  465|       |#endif
  466|  1.36k|}
_ZN5draco23KdTreeAttributesDecoder35TransformAttributesToOriginalFormatEv:
  494|    130|bool KdTreeAttributesDecoder::TransformAttributesToOriginalFormat() {
  495|    130|  if (quantized_portable_attributes_.empty() && min_signed_values_.empty()) {
  ------------------
  |  Branch (495:7): [True: 110, False: 20]
  |  Branch (495:49): [True: 49, False: 61]
  ------------------
  496|     49|    return true;
  497|     49|  }
  498|     81|  int num_processed_quantized_attributes = 0;
  499|     81|  int num_processed_signed_components = 0;
  500|       |  // Dequantize attributes that needed it.
  501|    285|  for (int i = 0; i < GetNumAttributes(); ++i) {
  ------------------
  |  Branch (501:19): [True: 204, False: 81]
  ------------------
  502|    204|    const int att_id = GetAttributeId(i);
  503|    204|    PointAttribute* const att = GetDecoder()->point_cloud()->attribute(att_id);
  504|    204|    if (att->data_type() == DT_INT32 || att->data_type() == DT_INT16 ||
  ------------------
  |  Branch (504:9): [True: 27, False: 177]
  |  Branch (504:41): [True: 36, False: 141]
  ------------------
  505|    141|        att->data_type() == DT_INT8) {
  ------------------
  |  Branch (505:9): [True: 38, False: 103]
  ------------------
  506|    101|      std::vector<uint32_t> unsigned_val(att->num_components());
  507|    101|      std::vector<int32_t> signed_val(att->num_components());
  508|       |      // Values are stored as unsigned in the attribute, make them signed again.
  509|    101|      if (att->data_type() == DT_INT32) {
  ------------------
  |  Branch (509:11): [True: 27, False: 74]
  ------------------
  510|     27|        if (!TransformAttributeBackToSignedType<int32_t>(
  ------------------
  |  Branch (510:13): [True: 0, False: 27]
  ------------------
  511|     27|                att, num_processed_signed_components)) {
  512|      0|          return false;
  513|      0|        }
  514|     74|      } else if (att->data_type() == DT_INT16) {
  ------------------
  |  Branch (514:18): [True: 36, False: 38]
  ------------------
  515|     36|        if (!TransformAttributeBackToSignedType<int16_t>(
  ------------------
  |  Branch (515:13): [True: 0, False: 36]
  ------------------
  516|     36|                att, num_processed_signed_components)) {
  517|      0|          return false;
  518|      0|        }
  519|     38|      } else if (att->data_type() == DT_INT8) {
  ------------------
  |  Branch (519:18): [True: 38, False: 0]
  ------------------
  520|     38|        if (!TransformAttributeBackToSignedType<int8_t>(
  ------------------
  |  Branch (520:13): [True: 0, False: 38]
  ------------------
  521|     38|                att, num_processed_signed_components)) {
  522|      0|          return false;
  523|      0|        }
  524|     38|      }
  525|    101|      num_processed_signed_components += att->num_components();
  526|    103|    } else if (att->data_type() == DT_FLOAT32) {
  ------------------
  |  Branch (526:16): [True: 57, False: 46]
  ------------------
  527|       |      // TODO(ostava): This code should be probably moved out to attribute
  528|       |      // transform and shared with the SequentialQuantizationAttributeDecoder.
  529|       |
  530|     57|      const PointAttribute* const src_att =
  531|     57|          quantized_portable_attributes_[num_processed_quantized_attributes]
  532|     57|              .get();
  533|       |
  534|     57|      const AttributeQuantizationTransform& transform =
  535|     57|          attribute_quantization_transforms_
  536|     57|              [num_processed_quantized_attributes];
  537|       |
  538|     57|      num_processed_quantized_attributes++;
  539|       |
  540|     57|      if (GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (540:11): [True: 0, False: 57]
  ------------------
  541|     57|              att->attribute_type(), "skip_attribute_transform", false)) {
  542|       |        // Attribute transform should not be performed. In this case, we replace
  543|       |        // the output geometry attribute with the portable attribute.
  544|       |        // TODO(ostava): We can potentially avoid this copy by introducing a new
  545|       |        // mechanism that would allow to use the final attributes as portable
  546|       |        // attributes for predictors that may need them.
  547|      0|        att->CopyFrom(*src_att);
  548|      0|        continue;
  549|      0|      }
  550|       |
  551|       |      // Convert all quantized values back to floats.
  552|     57|      const int32_t max_quantized_value =
  553|     57|          (1u << static_cast<uint32_t>(transform.quantization_bits())) - 1;
  554|     57|      const int num_components = att->num_components();
  555|     57|      const int entry_size = sizeof(float) * num_components;
  556|     57|      const std::unique_ptr<float[]> att_val(new float[num_components]);
  557|     57|      int quant_val_id = 0;
  558|     57|      int out_byte_pos = 0;
  559|     57|      Dequantizer dequantizer;
  560|     57|      if (!dequantizer.Init(transform.range(), max_quantized_value)) {
  ------------------
  |  Branch (560:11): [True: 0, False: 57]
  ------------------
  561|      0|        return false;
  562|      0|      }
  563|     57|      const uint32_t* const portable_attribute_data =
  564|     57|          reinterpret_cast<const uint32_t*>(
  565|     57|              src_att->GetAddress(AttributeValueIndex(0)));
  566|     57|      for (uint32_t i = 0; i < src_att->size(); ++i) {
  ------------------
  |  Branch (566:28): [True: 0, False: 57]
  ------------------
  567|      0|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (567:25): [True: 0, False: 0]
  ------------------
  568|      0|          float value = dequantizer.DequantizeFloat(
  569|      0|              portable_attribute_data[quant_val_id++]);
  570|      0|          value = value + transform.min_value(c);
  571|      0|          att_val[c] = value;
  572|      0|        }
  573|       |        // Store the floating point value into the attribute buffer.
  574|      0|        att->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  575|      0|        out_byte_pos += entry_size;
  576|      0|      }
  577|     57|    }
  578|    204|  }
  579|     81|  return true;
  580|     81|}
_ZN5draco34PointAttributeVectorOutputIteratorIjEC2ERKNSt3__16vectorINS2_5tupleIJPNS_14PointAttributeEjNS_8DataTypeEjjEEENS2_9allocatorIS8_EEEE:
   48|  1.69k|      : attributes_(atts), point_id_(0) {
   49|  1.69k|    DRACO_DCHECK_GE(atts.size(), 1);
   50|  1.69k|    uint32_t required_decode_bytes = 0;
   51|  4.44k|    for (auto index = 0; index < attributes_.size(); index++) {
  ------------------
  |  Branch (51:26): [True: 2.75k, False: 1.69k]
  ------------------
   52|  2.75k|      const AttributeTuple& att = attributes_[index];
   53|  2.75k|      required_decode_bytes = (std::max)(required_decode_bytes,
   54|  2.75k|                                         std::get<3>(att) * std::get<4>(att));
   55|  2.75k|    }
   56|  1.69k|    memory_.resize(required_decode_bytes);
   57|  1.69k|    data_ = memory_.data();
   58|  1.69k|  }
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi0ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    344|                                           OutIteratorT* out_iterator) {
  265|    344|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    344|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 223, False: 121]
  ------------------
  267|    257|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 34, False: 87]
  ------------------
  268|    257|    return false;
  269|    257|  }
  270|     87|  return true;
  271|    344|}
_ZN5draco34PointAttributeVectorOutputIteratorIjEdeEv:
   73|   341M|  Self& operator*() { return *this; }
_ZN5draco34PointAttributeVectorOutputIteratorIjEaSERKNSt3__16vectorIjNS2_9allocatorIjEEEE:
   91|   341M|  const Self& operator=(const std::vector<CoeffT>& val) {
   92|   729M|    for (auto index = 0; index < attributes_.size(); index++) {
  ------------------
  |  Branch (92:26): [True: 388M, False: 341M]
  ------------------
   93|   388M|      AttributeTuple& att = attributes_[index];
   94|   388M|      PointAttribute* attribute = std::get<0>(att);
   95|   388M|      const AttributeValueIndex avi = attribute->mapped_index(point_id_);
   96|   388M|      if (avi >= static_cast<uint32_t>(attribute->size())) {
  ------------------
  |  Branch (96:11): [True: 0, False: 388M]
  ------------------
   97|      0|        return *this;
   98|      0|      }
   99|   388M|      const uint32_t& offset = std::get<1>(att);
  100|   388M|      const uint32_t& data_size = std::get<3>(att);
  101|   388M|      const uint32_t& num_components = std::get<4>(att);
  102|   388M|      const uint32_t* data_source = val.data() + offset;
  103|   388M|      if (data_size < 4) {  // handle uint16_t, uint8_t
  ------------------
  |  Branch (103:11): [True: 251M, False: 136M]
  ------------------
  104|       |        // selectively copy data bytes
  105|   251M|        uint8_t* data_counter = data_;
  106|   775M|        for (uint32_t index = 0; index < num_components;
  ------------------
  |  Branch (106:34): [True: 523M, False: 251M]
  ------------------
  107|   523M|             index += 1, data_counter += data_size) {
  108|   523M|          std::memcpy(data_counter, data_source + index, data_size);
  109|   523M|        }
  110|       |        // redirect to copied data
  111|   251M|        data_source = reinterpret_cast<uint32_t*>(data_);
  112|   251M|      }
  113|   388M|      attribute->SetAttributeValue(avi, data_source);
  114|   388M|    }
  115|   341M|    return *this;
  116|   341M|  }
_ZN5draco34PointAttributeVectorOutputIteratorIjEppEv:
   60|   341M|  const Self& operator++() {
   61|   341M|    ++point_id_;
   62|   341M|    return *this;
   63|   341M|  }
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi1ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    264|                                           OutIteratorT* out_iterator) {
  265|    264|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    264|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 194, False: 70]
  ------------------
  267|    222|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 28, False: 42]
  ------------------
  268|    222|    return false;
  269|    222|  }
  270|     42|  return true;
  271|    264|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi2ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    203|                                           OutIteratorT* out_iterator) {
  265|    203|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    203|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 172, False: 31]
  ------------------
  267|    181|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 9, False: 22]
  ------------------
  268|    181|    return false;
  269|    181|  }
  270|     22|  return true;
  271|    203|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi3ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    173|                                           OutIteratorT* out_iterator) {
  265|    173|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    173|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 157, False: 16]
  ------------------
  267|    163|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 6, False: 10]
  ------------------
  268|    163|    return false;
  269|    163|  }
  270|     10|  return true;
  271|    173|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi4ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    202|                                           OutIteratorT* out_iterator) {
  265|    202|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    202|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 170, False: 32]
  ------------------
  267|    190|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 20, False: 12]
  ------------------
  268|    190|    return false;
  269|    190|  }
  270|     12|  return true;
  271|    202|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi5ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    258|                                           OutIteratorT* out_iterator) {
  265|    258|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    258|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 195, False: 63]
  ------------------
  267|    243|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 48, False: 15]
  ------------------
  268|    243|    return false;
  269|    243|  }
  270|     15|  return true;
  271|    258|}
_ZN5draco23KdTreeAttributesDecoder12DecodePointsILi6ENS_34PointAttributeVectorOutputIteratorIjEEEEbijPNS_13DecoderBufferEPT0_:
  264|    234|                                           OutIteratorT* out_iterator) {
  265|    234|  DynamicIntegerPointsKdTreeDecoder<level_t> decoder(total_dimensionality);
  266|    234|  if (!decoder.DecodePoints(in_buffer, *out_iterator, num_expected_points) ||
  ------------------
  |  Branch (266:7): [True: 189, False: 45]
  ------------------
  267|    209|      decoder.num_decoded_points() != num_expected_points) {
  ------------------
  |  Branch (267:7): [True: 20, False: 25]
  ------------------
  268|    209|    return false;
  269|    209|  }
  270|     25|  return true;
  271|    234|}
_ZN5draco34PointAttributeVectorOutputIteratorIfEC2ERKNSt3__16vectorINS2_5tupleIJPNS_14PointAttributeEjNS_8DataTypeEjjEEENS2_9allocatorIS8_EEEE:
   48|    981|      : attributes_(atts), point_id_(0) {
   49|    981|    DRACO_DCHECK_GE(atts.size(), 1);
   50|    981|    uint32_t required_decode_bytes = 0;
   51|  1.96k|    for (auto index = 0; index < attributes_.size(); index++) {
  ------------------
  |  Branch (51:26): [True: 981, False: 981]
  ------------------
   52|    981|      const AttributeTuple& att = attributes_[index];
   53|    981|      required_decode_bytes = (std::max)(required_decode_bytes,
   54|    981|                                         std::get<3>(att) * std::get<4>(att));
   55|    981|    }
   56|    981|    memory_.resize(required_decode_bytes);
   57|    981|    data_ = memory_.data();
   58|    981|  }
_ZN5draco34PointAttributeVectorOutputIteratorIfEdeEv:
   73|     59|  Self& operator*() { return *this; }
_ZN5draco34PointAttributeVectorOutputIteratorIfEaSERKNS_7VectorDIfLi3EEE:
   77|     59|  const Self& operator=(const VectorD<CoeffT, 3>& val) {
   78|     59|    DRACO_DCHECK_EQ(attributes_.size(), 1);  // Expect only ONE attribute.
   79|     59|    AttributeTuple& att = attributes_[0];
   80|     59|    PointAttribute* attribute = std::get<0>(att);
   81|     59|    const AttributeValueIndex avi = attribute->mapped_index(point_id_);
   82|     59|    if (avi >= static_cast<uint32_t>(attribute->size())) {
  ------------------
  |  Branch (82:9): [True: 55, False: 4]
  ------------------
   83|     55|      return *this;
   84|     55|    }
   85|      4|    const uint32_t& offset = std::get<1>(att);
   86|      4|    DRACO_DCHECK_EQ(offset, 0);  // expected to be zero
   87|      4|    attribute->SetAttributeValue(avi, &val[0] + offset);
   88|      4|    return *this;
   89|     59|  }
_ZN5draco34PointAttributeVectorOutputIteratorIfEppEv:
   60|     59|  const Self& operator++() {
   61|     59|    ++point_id_;
   62|     59|    return *this;
   63|     59|  }
_ZN5draco23KdTreeAttributesDecoder34TransformAttributeBackToSignedTypeIiEEbPNS_14PointAttributeEi:
  470|     27|    PointAttribute* att, int num_processed_signed_components) {
  471|     27|  typedef typename std::make_unsigned<SignedDataTypeT>::type UnsignedType;
  472|     27|  std::vector<UnsignedType> unsigned_val(att->num_components());
  473|     27|  std::vector<SignedDataTypeT> signed_val(att->num_components());
  474|       |
  475|     61|  for (AttributeValueIndex avi(0); avi < static_cast<uint32_t>(att->size());
  ------------------
  |  Branch (475:36): [True: 34, False: 27]
  ------------------
  476|     34|       ++avi) {
  477|     34|    att->GetValue(avi, &unsigned_val[0]);
  478|  5.50k|    for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (478:21): [True: 5.47k, False: 34]
  ------------------
  479|       |      // Up-cast |unsigned_val| to int32_t to ensure we don't overflow it for
  480|       |      // smaller data types. But first check that the up-casting does not cause
  481|       |      // signed integer overflow.
  482|  5.47k|      if (unsigned_val[c] > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (482:11): [True: 0, False: 5.47k]
  ------------------
  483|      0|        return false;
  484|      0|      }
  485|  5.47k|      signed_val[c] = static_cast<SignedDataTypeT>(
  486|  5.47k|          static_cast<int32_t>(unsigned_val[c]) +
  487|  5.47k|          min_signed_values_[num_processed_signed_components + c]);
  488|  5.47k|    }
  489|     34|    att->SetAttributeValue(avi, &signed_val[0]);
  490|     34|  }
  491|     27|  return true;
  492|     27|}
_ZN5draco23KdTreeAttributesDecoder34TransformAttributeBackToSignedTypeIsEEbPNS_14PointAttributeEi:
  470|     36|    PointAttribute* att, int num_processed_signed_components) {
  471|     36|  typedef typename std::make_unsigned<SignedDataTypeT>::type UnsignedType;
  472|     36|  std::vector<UnsignedType> unsigned_val(att->num_components());
  473|     36|  std::vector<SignedDataTypeT> signed_val(att->num_components());
  474|       |
  475|     36|  for (AttributeValueIndex avi(0); avi < static_cast<uint32_t>(att->size());
  ------------------
  |  Branch (475:36): [True: 0, False: 36]
  ------------------
  476|     36|       ++avi) {
  477|      0|    att->GetValue(avi, &unsigned_val[0]);
  478|      0|    for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (478:21): [True: 0, False: 0]
  ------------------
  479|       |      // Up-cast |unsigned_val| to int32_t to ensure we don't overflow it for
  480|       |      // smaller data types. But first check that the up-casting does not cause
  481|       |      // signed integer overflow.
  482|      0|      if (unsigned_val[c] > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (482:11): [True: 0, False: 0]
  ------------------
  483|      0|        return false;
  484|      0|      }
  485|      0|      signed_val[c] = static_cast<SignedDataTypeT>(
  486|      0|          static_cast<int32_t>(unsigned_val[c]) +
  487|      0|          min_signed_values_[num_processed_signed_components + c]);
  488|      0|    }
  489|      0|    att->SetAttributeValue(avi, &signed_val[0]);
  490|      0|  }
  491|     36|  return true;
  492|     36|}
_ZN5draco23KdTreeAttributesDecoder34TransformAttributeBackToSignedTypeIaEEbPNS_14PointAttributeEi:
  470|     38|    PointAttribute* att, int num_processed_signed_components) {
  471|     38|  typedef typename std::make_unsigned<SignedDataTypeT>::type UnsignedType;
  472|     38|  std::vector<UnsignedType> unsigned_val(att->num_components());
  473|     38|  std::vector<SignedDataTypeT> signed_val(att->num_components());
  474|       |
  475|    122|  for (AttributeValueIndex avi(0); avi < static_cast<uint32_t>(att->size());
  ------------------
  |  Branch (475:36): [True: 84, False: 38]
  ------------------
  476|     84|       ++avi) {
  477|     84|    att->GetValue(avi, &unsigned_val[0]);
  478|    546|    for (int c = 0; c < att->num_components(); ++c) {
  ------------------
  |  Branch (478:21): [True: 462, False: 84]
  ------------------
  479|       |      // Up-cast |unsigned_val| to int32_t to ensure we don't overflow it for
  480|       |      // smaller data types. But first check that the up-casting does not cause
  481|       |      // signed integer overflow.
  482|    462|      if (unsigned_val[c] > std::numeric_limits<int32_t>::max()) {
  ------------------
  |  Branch (482:11): [True: 0, False: 462]
  ------------------
  483|      0|        return false;
  484|      0|      }
  485|    462|      signed_val[c] = static_cast<SignedDataTypeT>(
  486|    462|          static_cast<int32_t>(unsigned_val[c]) +
  487|    462|          min_signed_values_[num_processed_signed_components + c]);
  488|    462|    }
  489|     84|    att->SetAttributeValue(avi, &signed_val[0]);
  490|     84|  }
  491|     38|  return true;
  492|     38|}

_ZN5draco15LinearSequencerC2Ei:
   26|  25.0k|  explicit LinearSequencer(int32_t num_points) : num_points_(num_points) {}
_ZN5draco15LinearSequencer34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   28|  1.09k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   29|  1.09k|    attribute->SetIdentityMapping();
   30|  1.09k|    return true;
   31|  1.09k|  }
_ZN5draco15LinearSequencer24GenerateSequenceInternalEv:
   34|    914|  bool GenerateSequenceInternal() override {
   35|    914|    if (num_points_ < 0) {
  ------------------
  |  Branch (35:9): [True: 4, False: 910]
  ------------------
   36|      4|      return false;
   37|      4|    }
   38|    910|    out_point_ids()->resize(num_points_);
   39|  2.79G|    for (int i = 0; i < num_points_; ++i) {
  ------------------
  |  Branch (39:21): [True: 2.79G, False: 910]
  ------------------
   40|  2.79G|      out_point_ids()->at(i) = PointIndex(i);
   41|  2.79G|    }
   42|    910|    return true;
   43|    914|  }

_ZN5draco32MeshAttributeIndicesEncodingDataC2Ev:
   28|  62.0k|  MeshAttributeIndicesEncodingData() : num_values(0) {}
_ZN5draco32MeshAttributeIndicesEncodingData4InitEi:
   30|  15.0k|  void Init(int num_vertices) {
   31|  15.0k|    vertex_to_encoded_attribute_value_index_map.resize(num_vertices);
   32|       |
   33|       |    // We expect to store one value for each vertex.
   34|  15.0k|    encoded_attribute_value_index_to_corner_map.reserve(num_vertices);
   35|  15.0k|  }

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.94k|      : quantization_bits_(-1),
   54|  2.94k|        max_quantized_value_(-1),
   55|  2.94k|        max_value_(-1),
   56|  2.94k|        dequantization_scale_(1.f),
   57|  2.94k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.68k|  bool SetQuantizationBits(int32_t q) {
   60|  2.68k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 843, False: 1.84k]
  |  Branch (60:18): [True: 144, False: 1.69k]
  ------------------
   61|    987|      return false;
   62|    987|    }
   63|  1.69k|    quantization_bits_ = q;
   64|  1.69k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.69k|    max_value_ = max_quantized_value_ - 1;
   66|  1.69k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.69k|    center_value_ = max_value_ / 2;
   68|  1.69k|    return true;
   69|  2.68k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.68M|                                           int32_t* out_t) const {
   77|  2.68M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.03k, False: 2.68M]
  |  Branch (77:20): [True: 0, False: 3.03k]
  |  Branch (77:32): [True: 3.03k, False: 2.68M]
  |  Branch (77:42): [True: 0, False: 3.03k]
  ------------------
   78|  2.68M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 2.25M, False: 429k]
  |  Branch (78:29): [True: 8.54k, False: 2.24M]
  ------------------
   79|  8.54k|      s = max_value_;
   80|  8.54k|      t = max_value_;
   81|  2.67M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.03k, False: 2.67M]
  |  Branch (81:26): [True: 1.04k, False: 1.99k]
  ------------------
   82|  1.04k|      t = center_value_ - (t - center_value_);
   83|  2.67M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 2.24M, False: 428k]
  |  Branch (83:35): [True: 7.96k, False: 2.23M]
  ------------------
   84|  7.96k|      t = center_value_ + (center_value_ - t);
   85|  2.66M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 2.24M, False: 426k]
  |  Branch (85:35): [True: 495, False: 2.24M]
  ------------------
   86|    495|      s = center_value_ + (center_value_ - s);
   87|  2.66M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.38k, False: 2.66M]
  |  Branch (87:26): [True: 2.14k, False: 2.23k]
  ------------------
   88|  2.14k|      s = center_value_ - (s - center_value_);
   89|  2.14k|    }
   90|       |
   91|  2.68M|    *out_s = s;
   92|  2.68M|    *out_t = t;
   93|  2.68M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.68M|                                                       int32_t* out_t) const {
  100|  2.68M|    DRACO_DCHECK_EQ(
  101|  2.68M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.68M|        center_value_);
  103|  2.68M|    int32_t s, t;
  104|  2.68M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.34M, False: 1.33M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.34M|      s = (int_vec[1] + center_value_);
  107|  1.34M|      t = (int_vec[2] + center_value_);
  108|  1.34M|    } else {
  109|       |      // Left hemisphere.
  110|  1.33M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 42.0k, False: 1.29M]
  ------------------
  111|  42.0k|        s = std::abs(int_vec[2]);
  112|  1.29M|      } else {
  113|  1.29M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.29M|      }
  115|  1.33M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 45.4k, False: 1.29M]
  ------------------
  116|  45.4k|        t = std::abs(int_vec[1]);
  117|  1.29M|      } else {
  118|  1.29M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.29M|      }
  120|  1.33M|    }
  121|  2.68M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.68M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  25.1M|                                                    float* out_vector) const {
  199|  25.1M|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  25.1M|                                 in_t * dequantization_scale_ - 1.f,
  201|  25.1M|                                 out_vector);
  202|  25.1M|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  90.2M|  inline bool IsInDiamond(const int32_t& s, const int32_t& t) const {
  206|       |    // Expect center already at origin.
  207|  90.2M|    DRACO_DCHECK_LE(s, center_value_);
  208|  90.2M|    DRACO_DCHECK_LE(t, center_value_);
  209|  90.2M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  90.2M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  90.2M|    const uint32_t st =
  212|  90.2M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  90.2M|    return st <= center_value_;
  214|  90.2M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|   123M|  void InvertDiamond(int32_t* s, int32_t* t) const {
  217|       |    // Expect center already at origin.
  218|   123M|    DRACO_DCHECK_LE(*s, center_value_);
  219|   123M|    DRACO_DCHECK_LE(*t, center_value_);
  220|   123M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|   123M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|   123M|    int32_t sign_s = 0;
  223|   123M|    int32_t sign_t = 0;
  224|   123M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 104M, False: 18.7M]
  |  Branch (224:20): [True: 101M, False: 2.72M]
  ------------------
  225|   101M|      sign_s = 1;
  226|   101M|      sign_t = 1;
  227|   101M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 20.0M, False: 1.47M]
  |  Branch (227:27): [True: 10.9M, False: 9.05M]
  ------------------
  228|  10.9M|      sign_s = -1;
  229|  10.9M|      sign_t = -1;
  230|  10.9M|    } else {
  231|  10.5M|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 1.47M, False: 9.05M]
  ------------------
  232|  10.5M|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 9.05M, False: 1.47M]
  ------------------
  233|  10.5M|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|   123M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|   123M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|   123M|    uint32_t us = *s;
  241|   123M|    uint32_t ut = *t;
  242|   123M|    us = us + us - corner_point_s;
  243|   123M|    ut = ut + ut - corner_point_t;
  244|   123M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 112M, False: 10.5M]
  ------------------
  245|   112M|      uint32_t temp = us;
  246|   112M|      us = -ut;
  247|   112M|      ut = -temp;
  248|   112M|    } else {
  249|  10.5M|      std::swap(us, ut);
  250|  10.5M|    }
  251|   123M|    us = us + corner_point_s;
  252|   123M|    ut = ut + corner_point_t;
  253|       |
  254|   123M|    *s = us;
  255|   123M|    *t = ut;
  256|   123M|    *s /= 2;
  257|   123M|    *t /= 2;
  258|   123M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|   180M|  int32_t ModMax(int32_t x) const {
  273|   180M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 4.11k, False: 180M]
  ------------------
  274|  4.11k|      return x - this->max_quantized_value();
  275|  4.11k|    }
  276|   180M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 9.71k, False: 180M]
  ------------------
  277|  9.71k|      return x + this->max_quantized_value();
  278|  9.71k|    }
  279|   180M|    return x;
  280|   180M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.67k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  13.8k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|   541M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  25.1M|                                           float* out_vector) const {
  299|       |    // Background about the encoding:
  300|       |    //   A normal is encoded in a normalized space <s, t> depicted below. The
  301|       |    //   encoding correponds to an octahedron that is unwrapped to a 2D plane.
  302|       |    //   During encoding, a normal is projected to the surface of the octahedron
  303|       |    //   and the projection is then unwrapped to the 2D plane. Decoding is the
  304|       |    //   reverse of this process.
  305|       |    //   All points in the central diamond are located on triangles on the
  306|       |    //   right "hemisphere" of the octahedron while all points outside of the
  307|       |    //   diamond are on the left hemisphere (basically, they would have to be
  308|       |    //   wrapped along the diagonal edges to form the octahedron). The central
  309|       |    //   point corresponds to the right most vertex of the octahedron and all
  310|       |    //   corners of the plane correspond to the left most vertex of the
  311|       |    //   octahedron.
  312|       |    //
  313|       |    // t
  314|       |    // ^ *-----*-----*
  315|       |    // | |    /|\    |
  316|       |    //   |   / | \   |
  317|       |    //   |  /  |  \  |
  318|       |    //   | /   |   \ |
  319|       |    //   *-----*---- *
  320|       |    //   | \   |   / |
  321|       |    //   |  \  |  /  |
  322|       |    //   |   \ | /   |
  323|       |    //   |    \|/    |
  324|       |    //   *-----*-----*  --> s
  325|       |
  326|       |    // Note that the input |in_s_scaled| and |in_t_scaled| are already scaled to
  327|       |    // <-1, 1> range. This way, the central point is at coordinate (0, 0).
  328|  25.1M|    float y = in_s_scaled;
  329|  25.1M|    float z = in_t_scaled;
  330|       |
  331|       |    // Remaining coordinate can be computed by projecting the (y, z) values onto
  332|       |    // the surface of the octahedron.
  333|  25.1M|    const float x = 1.f - std::abs(y) - std::abs(z);
  334|       |
  335|       |    // |x| is essentially a signed distance from the diagonal edges of the
  336|       |    // diamond shown on the figure above. It is positive for all points in the
  337|       |    // diamond (right hemisphere) and negative for all points outside the
  338|       |    // diamond (left hemisphere). For all points on the left hemisphere we need
  339|       |    // to update their (y, z) coordinates to account for the wrapping along
  340|       |    // the edges of the diamond.
  341|  25.1M|    float x_offset = -x;
  342|  25.1M|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 710k, False: 24.4M]
  ------------------
  343|       |
  344|       |    // This will do nothing for the points on the right hemisphere but it will
  345|       |    // mirror the (y, z) location along the nearest diagonal edge of the
  346|       |    // diamond.
  347|  25.1M|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 5.26M, False: 19.9M]
  ------------------
  348|  25.1M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 4.90M, False: 20.2M]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  25.1M|    const float norm_squared = x * x + y * y + z * z;
  352|  25.1M|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 25.1M]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  25.1M|    } else {
  357|  25.1M|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  25.1M|      out_vector[0] = x * d;
  359|  25.1M|      out_vector[1] = y * d;
  360|  25.1M|      out_vector[2] = z * d;
  361|  25.1M|    }
  362|  25.1M|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.68M|  void CanonicalizeIntegerVector(T* vec) const {
  174|  2.68M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.68M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.68M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.68M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.68M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.68M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 2.45M, False: 230k]
  ------------------
  181|  2.45M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  2.45M|    } else {
  183|   230k|      vec[0] =
  184|   230k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   230k|          abs_sum;
  186|   230k|      vec[1] =
  187|   230k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   230k|          abs_sum;
  189|   230k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 124k, False: 106k]
  ------------------
  190|   124k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   124k|      } else {
  192|   106k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   106k|      }
  194|   230k|    }
  195|  2.68M|  }

_ZN5draco15PointsSequencerC2Ev:
   29|  29.9k|  PointsSequencer() : out_point_ids_(nullptr) {}
_ZN5draco15PointsSequencer16GenerateSequenceEPNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   33|  5.59k|  bool GenerateSequence(std::vector<PointIndex>* out_point_ids) {
   34|  5.59k|    out_point_ids_ = out_point_ids;
   35|  5.59k|    return GenerateSequenceInternal();
   36|  5.59k|  }
_ZN5draco15PointsSequencer10AddPointIdENS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   39|  11.4M|  void AddPointId(PointIndex point_id) { out_point_ids_->push_back(point_id); }
_ZNK5draco15PointsSequencer13out_point_idsEv:
   55|  2.79G|  std::vector<PointIndex>* out_point_ids() const { return out_point_ids_; }
_ZN5draco15PointsSequencerD2Ev:
   30|  29.9k|  virtual ~PointsSequencer() = default;

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    479|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    479|            attribute, transform, mesh_data),
   52|    479|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    457|                                                                buffer) {
  197|    457|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    457|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    457|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 2, False: 455]
  ------------------
  199|       |    // Decode prediction mode.
  200|      2|    uint8_t mode;
  201|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 0, False: 2]
  ------------------
  202|      0|      return false;
  203|      0|    }
  204|       |
  205|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 1, False: 1]
  ------------------
  206|       |      // Unsupported mode.
  207|      1|      return false;
  208|      1|    }
  209|      2|  }
  210|    456|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  2.07k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 1.70k, False: 365]
  ------------------
  214|  1.70k|    uint32_t num_flags;
  215|  1.70k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 18, False: 1.69k]
  ------------------
  216|     18|      return false;
  217|     18|    }
  218|  1.69k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 47, False: 1.64k]
  ------------------
  219|     47|      return false;
  220|     47|    }
  221|  1.64k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 656, False: 988]
  ------------------
  222|    656|      is_crease_edge_[i].resize(num_flags);
  223|    656|      RAnsBitDecoder decoder;
  224|    656|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 26, False: 630]
  ------------------
  225|     26|        return false;
  226|     26|      }
  227|  1.04M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.04M, False: 630]
  ------------------
  228|  1.04M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.04M|      }
  230|    630|      decoder.EndDecoding();
  231|    630|    }
  232|  1.64k|  }
  233|    365|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    365|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    456|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    336|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    336|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    336|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.68k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.34k, False: 336]
  ------------------
   93|  1.34k|    pred_vals[i].resize(num_components, 0);
   94|  1.34k|  }
   95|    336|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    336|                                         out_data);
   97|       |
   98|    336|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    336|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    336|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    336|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    336|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    336|  const int corner_map_size =
  109|    336|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    336|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 336]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   300k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 300k, False: 207]
  ------------------
  114|   300k|    const CornerIndex start_corner_id =
  115|   300k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   300k|    CornerIndex corner_id(start_corner_id);
  118|   300k|    int num_parallelograms = 0;
  119|   300k|    bool first_pass = true;
  120|   728k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 457k, False: 270k]
  ------------------
  121|   457k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 62.0k, False: 395k]
  ------------------
  122|   457k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   457k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|  62.0k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|  62.0k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 640, False: 61.3k]
  ------------------
  130|    640|          break;
  131|    640|        }
  132|  62.0k|      }
  133|       |
  134|       |      // Proceed to the next corner attached to the vertex. First swing left
  135|       |      // and if we reach a boundary, swing right from the start corner.
  136|   457k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 449k, False: 7.64k]
  ------------------
  137|   449k|        corner_id = table->SwingLeft(corner_id);
  138|   449k|      } else {
  139|  7.64k|        corner_id = table->SwingRight(corner_id);
  140|  7.64k|      }
  141|   457k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 28.7k, False: 428k]
  ------------------
  142|  28.7k|        break;
  143|  28.7k|      }
  144|   428k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 273k, False: 154k]
  |  Branch (144:47): [True: 270k, False: 3.17k]
  ------------------
  145|   270k|        first_pass = false;
  146|   270k|        corner_id = table->SwingRight(start_corner_id);
  147|   270k|      }
  148|   428k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   300k|    int num_used_parallelograms = 0;
  153|   300k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 33.9k, False: 266k]
  ------------------
  154|  1.87M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 1.84M, False: 33.9k]
  ------------------
  155|  1.84M|        multi_pred_vals[i] = 0;
  156|  1.84M|      }
  157|       |      // Check which parallelograms are actually used.
  158|  95.7k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 61.9k, False: 33.7k]
  ------------------
  159|  61.9k|        const int context = num_parallelograms - 1;
  160|  61.9k|        const int pos = is_crease_edge_pos[context]++;
  161|  61.9k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 129, False: 61.8k]
  ------------------
  162|    129|          return false;
  163|    129|        }
  164|  61.8k|        const bool is_crease = is_crease_edge_[context][pos];
  165|  61.8k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 10.1k, False: 51.6k]
  ------------------
  166|  10.1k|          ++num_used_parallelograms;
  167|   703k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 693k, False: 10.1k]
  ------------------
  168|   693k|            multi_pred_vals[j] =
  169|   693k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|   693k|          }
  171|  10.1k|        }
  172|  61.8k|      }
  173|  33.9k|    }
  174|   299k|    const int dst_offset = p * num_components;
  175|   299k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 295k, False: 4.59k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|   295k|      const int src_offset = (p - 1) * num_components;
  179|   295k|      this->transform().ComputeOriginalValue(
  180|   295k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|   295k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|   321k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 317k, False: 4.59k]
  ------------------
  184|   317k|        multi_pred_vals[c] /= num_used_parallelograms;
  185|   317k|      }
  186|  4.59k|      this->transform().ComputeOriginalValue(
  187|  4.59k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  4.59k|    }
  189|   299k|  }
  190|    207|  return true;
  191|    336|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    653|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    653|            attribute, transform, mesh_data),
   52|    653|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  196|    634|                                                                buffer) {
  197|    634|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  198|    634|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    634|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (198:7): [True: 3, False: 631]
  ------------------
  199|       |    // Decode prediction mode.
  200|      3|    uint8_t mode;
  201|      3|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (201:9): [True: 0, False: 3]
  ------------------
  202|      0|      return false;
  203|      0|    }
  204|       |
  205|      3|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (205:9): [True: 2, False: 1]
  ------------------
  206|       |      // Unsupported mode.
  207|      2|      return false;
  208|      2|    }
  209|      3|  }
  210|    632|#endif
  211|       |
  212|       |  // Encode selected edges using separate rans bit coder for each context.
  213|  2.74k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (213:19): [True: 2.28k, False: 467]
  ------------------
  214|  2.28k|    uint32_t num_flags;
  215|  2.28k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (215:9): [True: 20, False: 2.26k]
  ------------------
  216|     20|      return false;
  217|     20|    }
  218|  2.26k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (218:9): [True: 100, False: 2.16k]
  ------------------
  219|    100|      return false;
  220|    100|    }
  221|  2.16k|    if (num_flags > 0) {
  ------------------
  |  Branch (221:9): [True: 956, False: 1.20k]
  ------------------
  222|    956|      is_crease_edge_[i].resize(num_flags);
  223|    956|      RAnsBitDecoder decoder;
  224|    956|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (224:11): [True: 45, False: 911]
  ------------------
  225|     45|        return false;
  226|     45|      }
  227|  1.04M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (227:28): [True: 1.04M, False: 911]
  ------------------
  228|  1.04M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  229|  1.04M|      }
  230|    911|      decoder.EndDecoding();
  231|    911|    }
  232|  2.16k|  }
  233|    467|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  234|    467|                                     MeshDataT>::DecodePredictionData(buffer);
  235|    632|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    424|                          const PointIndex* /* entry_to_point_id_map */) {
   87|    424|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    424|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  2.12k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.69k, False: 424]
  ------------------
   93|  1.69k|    pred_vals[i].resize(num_components, 0);
   94|  1.69k|  }
   95|    424|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    424|                                         out_data);
   97|       |
   98|    424|  const CornerTable* const table = this->mesh_data().corner_table();
   99|    424|  const std::vector<int32_t>* const vertex_to_data_map =
  100|    424|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    424|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    424|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    424|  const int corner_map_size =
  109|    424|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    424|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (110:7): [True: 0, False: 424]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|   154k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (113:19): [True: 154k, False: 197]
  ------------------
  114|   154k|    const CornerIndex start_corner_id =
  115|   154k|        this->mesh_data().data_to_corner_map()->at(p);
  116|       |
  117|   154k|    CornerIndex corner_id(start_corner_id);
  118|   154k|    int num_parallelograms = 0;
  119|   154k|    bool first_pass = true;
  120|   900k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (120:12): [True: 892k, False: 8.64k]
  ------------------
  121|   892k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (121:11): [True: 293k, False: 598k]
  ------------------
  122|   892k|              p, corner_id, table, *vertex_to_data_map, out_data,
  123|   892k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  124|       |        // Parallelogram prediction applied and stored in
  125|       |        // |pred_vals[num_parallelograms]|
  126|   293k|        ++num_parallelograms;
  127|       |        // Stop processing when we reach the maximum number of allowed
  128|       |        // parallelograms.
  129|   293k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (129:13): [True: 459, False: 292k]
  ------------------
  130|    459|          break;
  131|    459|        }
  132|   293k|      }
  133|       |
  134|       |      // Proceed to the next corner attached to the vertex. First swing left
  135|       |      // and if we reach a boundary, swing right from the start corner.
  136|   891k|      if (first_pass) {
  ------------------
  |  Branch (136:11): [True: 884k, False: 7.24k]
  ------------------
  137|   884k|        corner_id = table->SwingLeft(corner_id);
  138|   884k|      } else {
  139|  7.24k|        corner_id = table->SwingRight(corner_id);
  140|  7.24k|      }
  141|   891k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (141:11): [True: 145k, False: 746k]
  ------------------
  142|   145k|        break;
  143|   145k|      }
  144|   746k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (144:11): [True: 12.3k, False: 734k]
  |  Branch (144:47): [True: 8.66k, False: 3.68k]
  ------------------
  145|  8.66k|        first_pass = false;
  146|  8.66k|        corner_id = table->SwingRight(start_corner_id);
  147|  8.66k|      }
  148|   746k|    }
  149|       |
  150|       |    // Check which of the available parallelograms are actually used and compute
  151|       |    // the final predicted value.
  152|   154k|    int num_used_parallelograms = 0;
  153|   154k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (153:9): [True: 150k, False: 4.22k]
  ------------------
  154|  21.5M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (154:23): [True: 21.4M, False: 150k]
  ------------------
  155|  21.4M|        multi_pred_vals[i] = 0;
  156|  21.4M|      }
  157|       |      // Check which parallelograms are actually used.
  158|   442k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (158:23): [True: 292k, False: 149k]
  ------------------
  159|   292k|        const int context = num_parallelograms - 1;
  160|   292k|        const int pos = is_crease_edge_pos[context]++;
  161|   292k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (161:13): [True: 227, False: 292k]
  ------------------
  162|    227|          return false;
  163|    227|        }
  164|   292k|        const bool is_crease = is_crease_edge_[context][pos];
  165|   292k|        if (!is_crease) {
  ------------------
  |  Branch (165:13): [True: 11.3k, False: 281k]
  ------------------
  166|  11.3k|          ++num_used_parallelograms;
  167|  1.46M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (167:27): [True: 1.45M, False: 11.3k]
  ------------------
  168|  1.45M|            multi_pred_vals[j] =
  169|  1.45M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  170|  1.45M|          }
  171|  11.3k|        }
  172|   292k|      }
  173|   150k|    }
  174|   154k|    const int dst_offset = p * num_components;
  175|   154k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (175:9): [True: 146k, False: 8.01k]
  ------------------
  176|       |      // No parallelogram was valid.
  177|       |      // We use the last decoded point as a reference.
  178|   146k|      const int src_offset = (p - 1) * num_components;
  179|   146k|      this->transform().ComputeOriginalValue(
  180|   146k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  181|   146k|    } else {
  182|       |      // Compute the correction from the predicted value.
  183|  1.09M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (183:23): [True: 1.08M, False: 8.01k]
  ------------------
  184|  1.08M|        multi_pred_vals[c] /= num_used_parallelograms;
  185|  1.08M|      }
  186|  8.01k|      this->transform().ComputeOriginalValue(
  187|  8.01k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  188|  8.01k|    }
  189|   154k|  }
  190|    197|  return true;
  191|    424|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.91k|           const std::vector<int32_t>* vertex_to_data_map) {
   38|  2.91k|    mesh_ = mesh;
   39|  2.91k|    corner_table_ = table;
   40|  2.91k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.91k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.91k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  15.7M|  const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  10.8M|  const std::vector<int32_t>* vertex_to_data_map() const {
   47|  10.8M|    return vertex_to_data_map_;
   48|  10.8M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  7.25M|  const std::vector<CornerIndex>* data_to_corner_map() const {
   50|  7.25M|    return data_to_corner_map_;
   51|  7.25M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  3.33k|           const std::vector<int32_t>* vertex_to_data_map) {
   38|  3.33k|    mesh_ = mesh;
   39|  3.33k|    corner_table_ = table;
   40|  3.33k|    data_to_corner_map_ = data_to_corner_map;
   41|  3.33k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  3.33k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  9.62M|  const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  8.41M|  const std::vector<int32_t>* vertex_to_data_map() const {
   47|  8.41M|    return vertex_to_data_map_;
   48|  8.41M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.20M|  const std::vector<CornerIndex>* data_to_corner_map() const {
   50|  2.20M|    return data_to_corner_map_;
   51|  2.20M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  2.91k|      : mesh_(nullptr),
   31|  2.91k|        corner_table_(nullptr),
   32|  2.91k|        vertex_to_data_map_(nullptr),
   33|  2.91k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  3.33k|      : mesh_(nullptr),
   31|  3.33k|        corner_table_(nullptr),
   32|  3.33k|        vertex_to_data_map_(nullptr),
   33|  3.33k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   765k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   222k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   368k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   188k|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.54k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.54k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  11.4M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.99k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.99k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  2.63M|  const MeshData& mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    171|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    171|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    161|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    161|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    172|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    172|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    172|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    172|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    341|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    171|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    171|    DRACO_DCHECK_EQ(i, 0);
   70|    171|    (void)i;
   71|    171|    return GeometryAttribute::POSITION;
   72|    171|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    171|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    171|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 171]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    171|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 170]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    170|    predictor_.SetPositionAttribute(*att);
   82|    170|    return true;
   83|    171|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    170|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    170|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 12, False: 158]
  ------------------
  148|     12|    return false;
  149|     12|  }
  150|       |
  151|    158|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    158|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    158|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 24, False: 134]
  ------------------
  153|     24|    uint8_t prediction_mode;
  154|     24|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 24]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     24|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 22]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     22|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 22]
  ------------------
  163|     22|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     22|  }
  167|    156|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    156|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 11, False: 145]
  ------------------
  171|     11|    return false;
  172|     11|  }
  173|       |
  174|    145|  return true;
  175|    156|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    145|                                      const PointIndex* entry_to_point_id_map) {
  103|    145|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    145|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    145|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    145|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    145|  const int corner_map_size =
  111|    145|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    145|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 145]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    145|  VectorD<int32_t, 3> pred_normal_3d;
  117|    145|  int32_t pred_normal_oct[2];
  118|       |
  119|   765k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 765k, False: 145]
  ------------------
  120|   765k|    const CornerIndex corner_id =
  121|   765k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   765k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   765k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   765k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   765k|                    octahedron_tool_box_.center_value());
  128|   765k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 686k, False: 79.1k]
  ------------------
  129|   686k|      pred_normal_3d = -pred_normal_3d;
  130|   686k|    }
  131|   765k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   765k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   765k|    const int data_offset = data_id * 2;
  135|   765k|    this->transform().ComputeOriginalValue(
  136|   765k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   765k|  }
  138|    145|  flip_normal_bit_decoder_.EndDecoding();
  139|    145|  return true;
  140|    145|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    145|  void SetQuantizationBits(int q) {
   85|    145|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    145|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    319|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    161|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    161|    DRACO_DCHECK_EQ(i, 0);
   70|    161|    (void)i;
   71|    161|    return GeometryAttribute::POSITION;
   72|    161|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    160|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    160|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 160]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    160|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 158]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    158|    predictor_.SetPositionAttribute(*att);
   82|    158|    return true;
   83|    160|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    158|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    158|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 7, False: 151]
  ------------------
  148|      7|    return false;
  149|      7|  }
  150|       |
  151|    151|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    151|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    151|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 28, False: 123]
  ------------------
  153|     28|    uint8_t prediction_mode;
  154|     28|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 28]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     28|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 27]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     27|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 27]
  ------------------
  163|     27|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     27|  }
  167|    150|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    150|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 1, False: 149]
  ------------------
  171|      1|    return false;
  172|      1|  }
  173|       |
  174|    149|  return true;
  175|    150|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    149|                                      const PointIndex* entry_to_point_id_map) {
  103|    149|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    149|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    149|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    149|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    149|  const int corner_map_size =
  111|    149|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    149|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 149]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    149|  VectorD<int32_t, 3> pred_normal_3d;
  117|    149|  int32_t pred_normal_oct[2];
  118|       |
  119|   222k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 222k, False: 149]
  ------------------
  120|   222k|    const CornerIndex corner_id =
  121|   222k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   222k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   222k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   222k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   222k|                    octahedron_tool_box_.center_value());
  128|   222k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 180k, False: 42.0k]
  ------------------
  129|   180k|      pred_normal_3d = -pred_normal_3d;
  130|   180k|    }
  131|   222k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   222k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   222k|    const int data_offset = data_id * 2;
  135|   222k|    this->transform().ComputeOriginalValue(
  136|   222k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   222k|  }
  138|    149|  flip_normal_bit_decoder_.EndDecoding();
  139|    149|  return true;
  140|    149|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    149|  void SetQuantizationBits(int q) {
   85|    149|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    149|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    342|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    172|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    172|    DRACO_DCHECK_EQ(i, 0);
   70|    172|    (void)i;
   71|    172|    return GeometryAttribute::POSITION;
   72|    172|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    171|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    171|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 171]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    171|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 170]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    170|    predictor_.SetPositionAttribute(*att);
   82|    170|    return true;
   83|    171|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    170|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    170|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 6, False: 164]
  ------------------
  148|      6|    return false;
  149|      6|  }
  150|       |
  151|    164|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    164|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    164|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 26, False: 138]
  ------------------
  153|     26|    uint8_t prediction_mode;
  154|     26|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 25]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|     25|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 23]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     23|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 23]
  ------------------
  163|     23|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     23|  }
  167|    161|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    161|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 2, False: 159]
  ------------------
  171|      2|    return false;
  172|      2|  }
  173|       |
  174|    159|  return true;
  175|    161|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    159|                                      const PointIndex* entry_to_point_id_map) {
  103|    159|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    159|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    159|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    159|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    159|  const int corner_map_size =
  111|    159|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    159|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 159]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    159|  VectorD<int32_t, 3> pred_normal_3d;
  117|    159|  int32_t pred_normal_oct[2];
  118|       |
  119|   368k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 367k, False: 159]
  ------------------
  120|   367k|    const CornerIndex corner_id =
  121|   367k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   367k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   367k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   367k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   367k|                    octahedron_tool_box_.center_value());
  128|   367k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 286k, False: 81.0k]
  ------------------
  129|   286k|      pred_normal_3d = -pred_normal_3d;
  130|   286k|    }
  131|   367k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   367k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   367k|    const int data_offset = data_id * 2;
  135|   367k|    this->transform().ComputeOriginalValue(
  136|   367k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   367k|  }
  138|    159|  flip_normal_bit_decoder_.EndDecoding();
  139|    159|  return true;
  140|    159|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    159|  void SetQuantizationBits(int q) {
   85|    159|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    159|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    342|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    172|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    172|    DRACO_DCHECK_EQ(i, 0);
   70|    172|    (void)i;
   71|    172|    return GeometryAttribute::POSITION;
   72|    172|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    171|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    171|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 171]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    171|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 170]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    170|    predictor_.SetPositionAttribute(*att);
   82|    170|    return true;
   83|    171|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    169|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    169|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 8, False: 161]
  ------------------
  148|      8|    return false;
  149|      8|  }
  150|       |
  151|    161|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    161|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    161|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 41, False: 120]
  ------------------
  153|     41|    uint8_t prediction_mode;
  154|     41|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 41]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     41|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 2, False: 39]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      2|      return false;
  160|      2|    }
  161|       |
  162|     39|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 39]
  ------------------
  163|     39|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     39|  }
  167|    159|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    159|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 3, False: 156]
  ------------------
  171|      3|    return false;
  172|      3|  }
  173|       |
  174|    156|  return true;
  175|    159|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    156|                                      const PointIndex* entry_to_point_id_map) {
  103|    156|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    156|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    156|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    156|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    156|  const int corner_map_size =
  111|    156|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    156|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 156]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    156|  VectorD<int32_t, 3> pred_normal_3d;
  117|    156|  int32_t pred_normal_oct[2];
  118|       |
  119|   188k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 188k, False: 156]
  ------------------
  120|   188k|    const CornerIndex corner_id =
  121|   188k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   188k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   188k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   188k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   188k|                    octahedron_tool_box_.center_value());
  128|   188k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 166k, False: 21.3k]
  ------------------
  129|   166k|      pred_normal_3d = -pred_normal_3d;
  130|   166k|    }
  131|   188k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   188k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   188k|    const int data_offset = data_id * 2;
  135|   188k|    this->transform().ComputeOriginalValue(
  136|   188k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   188k|  }
  138|    156|  flip_normal_bit_decoder_.EndDecoding();
  139|    156|  return true;
  140|    156|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    156|  void SetQuantizationBits(int q) {
   85|    156|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    156|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    233|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    233|            attribute, transform, mesh_data),
   37|    233|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    461|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    233|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    233|    DRACO_DCHECK_EQ(i, 0);
   70|    233|    (void)i;
   71|    233|    return GeometryAttribute::POSITION;
   72|    233|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    232|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    232|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 232]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    232|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 4, False: 228]
  ------------------
   79|      4|      return false;  // Currently works only for 3 component positions.
   80|      4|    }
   81|    228|    predictor_.SetPositionAttribute(*att);
   82|    228|    return true;
   83|    232|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    226|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    226|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 20, False: 206]
  ------------------
  148|     20|    return false;
  149|     20|  }
  150|       |
  151|    206|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    206|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    206|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 64, False: 142]
  ------------------
  153|     64|    uint8_t prediction_mode;
  154|     64|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 0, False: 64]
  ------------------
  155|      0|      return false;
  156|      0|    }
  157|     64|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 1, False: 63]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      1|      return false;
  160|      1|    }
  161|       |
  162|     63|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 63]
  ------------------
  163|     63|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     63|  }
  167|    205|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    205|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 13, False: 192]
  ------------------
  171|     13|    return false;
  172|     13|  }
  173|       |
  174|    192|  return true;
  175|    205|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    192|                                      const PointIndex* entry_to_point_id_map) {
  103|    192|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    192|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    192|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    192|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    192|  const int corner_map_size =
  111|    192|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    192|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 192]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    192|  VectorD<int32_t, 3> pred_normal_3d;
  117|    192|  int32_t pred_normal_oct[2];
  118|       |
  119|   938k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 938k, False: 192]
  ------------------
  120|   938k|    const CornerIndex corner_id =
  121|   938k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   938k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   938k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   938k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   938k|                    octahedron_tool_box_.center_value());
  128|   938k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 878k, False: 60.2k]
  ------------------
  129|   878k|      pred_normal_3d = -pred_normal_3d;
  130|   878k|    }
  131|   938k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   938k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   938k|    const int data_offset = data_id * 2;
  135|   938k|    this->transform().ComputeOriginalValue(
  136|   938k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   938k|  }
  138|    192|  flip_normal_bit_decoder_.EndDecoding();
  139|    192|  return true;
  140|    192|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    192|  void SetQuantizationBits(int q) {
   85|    192|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    192|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    536|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    536|            attribute, transform, mesh_data),
   37|    536|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|  1.06k|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    536|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    536|    DRACO_DCHECK_EQ(i, 0);
   70|    536|    (void)i;
   71|    536|    return GeometryAttribute::POSITION;
   72|    536|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    534|  bool SetParentAttribute(const PointAttribute* att) override {
   75|    534|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 534]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    534|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 533]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    533|    predictor_.SetPositionAttribute(*att);
   82|    533|    return true;
   83|    534|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  145|    531|                                                                buffer) {
  146|       |  // Get data needed for transform
  147|    531|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (147:7): [True: 21, False: 510]
  ------------------
  148|     21|    return false;
  149|     21|  }
  150|       |
  151|    510|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  152|    510|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    510|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (152:7): [True: 101, False: 409]
  ------------------
  153|    101|    uint8_t prediction_mode;
  154|    101|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (154:9): [True: 1, False: 100]
  ------------------
  155|      1|      return false;
  156|      1|    }
  157|    100|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (157:9): [True: 3, False: 97]
  ------------------
  158|       |      // Invalid prediction mode.
  159|      3|      return false;
  160|      3|    }
  161|       |
  162|     97|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (162:9): [True: 0, False: 97]
  ------------------
  163|     97|            NormalPredictionMode(prediction_mode))) {
  164|      0|      return false;
  165|      0|    }
  166|     97|  }
  167|    506|#endif
  168|       |
  169|       |  // Init normal flips.
  170|    506|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (170:7): [True: 32, False: 474]
  ------------------
  171|     32|    return false;
  172|     32|  }
  173|       |
  174|    474|  return true;
  175|    506|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    474|                                      const PointIndex* entry_to_point_id_map) {
  103|    474|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    474|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    474|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    474|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    474|  const int corner_map_size =
  111|    474|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|    474|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (112:7): [True: 0, False: 474]
  ------------------
  113|      0|    return false;
  114|      0|  }
  115|       |
  116|    474|  VectorD<int32_t, 3> pred_normal_3d;
  117|    474|  int32_t pred_normal_oct[2];
  118|       |
  119|   203k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (119:25): [True: 202k, False: 474]
  ------------------
  120|   202k|    const CornerIndex corner_id =
  121|   202k|        this->mesh_data().data_to_corner_map()->at(data_id);
  122|   202k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  123|       |
  124|       |    // Compute predicted octahedral coordinates.
  125|   202k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  126|   202k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  127|   202k|                    octahedron_tool_box_.center_value());
  128|   202k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (128:9): [True: 133k, False: 69.8k]
  ------------------
  129|   133k|      pred_normal_3d = -pred_normal_3d;
  130|   133k|    }
  131|   202k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  132|   202k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  133|       |
  134|   202k|    const int data_offset = data_id * 2;
  135|   202k|    this->transform().ComputeOriginalValue(
  136|   202k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  137|   202k|  }
  138|    474|  flip_normal_bit_decoder_.EndDecoding();
  139|    474|  return true;
  140|    474|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    474|  void SetQuantizationBits(int q) {
   85|    474|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    474|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    171|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    171|            attribute, transform, mesh_data),
   37|    171|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    161|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    161|            attribute, transform, mesh_data),
   37|    161|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    172|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    172|            attribute, transform, mesh_data),
   37|    172|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    172|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    172|            attribute, transform, mesh_data),
   37|    172|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    193|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    193|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 21, False: 172]
  ------------------
  105|     21|      this->normal_prediction_mode_ = mode;
  106|     21|      return true;
  107|    172|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 172, False: 0]
  ------------------
  108|    172|      this->normal_prediction_mode_ = mode;
  109|    172|      return true;
  110|    172|    }
  111|      0|    return false;
  112|    193|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   765k|                             DataTypeT* prediction) override {
   42|   765k|    DRACO_DCHECK(this->IsInitialized());
   43|   765k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   765k|    const CornerTable* const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   765k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   765k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   765k|    VectorD<int64_t, 3> normal;
   53|   765k|    CornerIndex c_next, c_prev;
   54|  1.84M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.08M, False: 765k]
  ------------------
   55|       |      // Getting corners.
   56|  1.08M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 84, False: 1.08M]
  ------------------
   57|     84|        c_next = corner_table->Next(corner_id);
   58|     84|        c_prev = corner_table->Previous(corner_id);
   59|  1.08M|      } else {
   60|  1.08M|        c_next = corner_table->Next(cit.Corner());
   61|  1.08M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.08M|      }
   63|  1.08M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.08M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.08M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.08M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.08M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.08M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.08M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.08M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.08M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.08M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.08M|      cit.Next();
   81|  1.08M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   765k|    constexpr int64_t upper_bound = 1 << 29;
   85|   765k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 62, False: 765k]
  ------------------
   86|     62|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     62|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 20, False: 42]
  ------------------
   88|     20|        const int64_t quotient = abs_sum / upper_bound;
   89|     20|        normal = normal / quotient;
   90|     20|      }
   91|   765k|    } else {
   92|   765k|      const int64_t abs_sum = normal.AbsSum();
   93|   765k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.70k, False: 763k]
  ------------------
   94|  1.70k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.70k|        normal = normal / quotient;
   96|  1.70k|      }
   97|   765k|    }
   98|   765k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   765k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   765k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   765k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   765k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    188|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    188|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 26, False: 162]
  ------------------
  105|     26|      this->normal_prediction_mode_ = mode;
  106|     26|      return true;
  107|    162|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 162, False: 0]
  ------------------
  108|    162|      this->normal_prediction_mode_ = mode;
  109|    162|      return true;
  110|    162|    }
  111|      0|    return false;
  112|    188|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   222k|                             DataTypeT* prediction) override {
   42|   222k|    DRACO_DCHECK(this->IsInitialized());
   43|   222k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   222k|    const CornerTable* const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   222k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   222k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   222k|    VectorD<int64_t, 3> normal;
   53|   222k|    CornerIndex c_next, c_prev;
   54|  1.54M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.32M, False: 222k]
  ------------------
   55|       |      // Getting corners.
   56|  1.32M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 156, False: 1.32M]
  ------------------
   57|    156|        c_next = corner_table->Next(corner_id);
   58|    156|        c_prev = corner_table->Previous(corner_id);
   59|  1.32M|      } else {
   60|  1.32M|        c_next = corner_table->Next(cit.Corner());
   61|  1.32M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.32M|      }
   63|  1.32M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.32M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.32M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.32M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.32M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.32M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.32M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.32M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.32M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.32M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.32M|      cit.Next();
   81|  1.32M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   222k|    constexpr int64_t upper_bound = 1 << 29;
   85|   222k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 104, False: 222k]
  ------------------
   86|    104|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    104|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 26, False: 78]
  ------------------
   88|     26|        const int64_t quotient = abs_sum / upper_bound;
   89|     26|        normal = normal / quotient;
   90|     26|      }
   91|   222k|    } else {
   92|   222k|      const int64_t abs_sum = normal.AbsSum();
   93|   222k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 109k, False: 112k]
  ------------------
   94|   109k|        const int64_t quotient = abs_sum / upper_bound;
   95|   109k|        normal = normal / quotient;
   96|   109k|      }
   97|   222k|    }
   98|   222k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   222k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   222k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   222k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   222k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    195|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    195|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 22, False: 173]
  ------------------
  105|     22|      this->normal_prediction_mode_ = mode;
  106|     22|      return true;
  107|    173|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 173, False: 0]
  ------------------
  108|    173|      this->normal_prediction_mode_ = mode;
  109|    173|      return true;
  110|    173|    }
  111|      0|    return false;
  112|    195|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   367k|                             DataTypeT* prediction) override {
   42|   367k|    DRACO_DCHECK(this->IsInitialized());
   43|   367k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   367k|    const CornerTable* const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   367k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   367k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   367k|    VectorD<int64_t, 3> normal;
   53|   367k|    CornerIndex c_next, c_prev;
   54|   958k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 590k, False: 367k]
  ------------------
   55|       |      // Getting corners.
   56|   590k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 126, False: 590k]
  ------------------
   57|    126|        c_next = corner_table->Next(corner_id);
   58|    126|        c_prev = corner_table->Previous(corner_id);
   59|   590k|      } else {
   60|   590k|        c_next = corner_table->Next(cit.Corner());
   61|   590k|        c_prev = corner_table->Previous(cit.Corner());
   62|   590k|      }
   63|   590k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   590k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   590k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   590k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   590k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   590k|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|   590k|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|   590k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   590k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   590k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   590k|      cit.Next();
   81|   590k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   367k|    constexpr int64_t upper_bound = 1 << 29;
   85|   367k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 84, False: 367k]
  ------------------
   86|     84|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     84|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 21, False: 63]
  ------------------
   88|     21|        const int64_t quotient = abs_sum / upper_bound;
   89|     21|        normal = normal / quotient;
   90|     21|      }
   91|   367k|    } else {
   92|   367k|      const int64_t abs_sum = normal.AbsSum();
   93|   367k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.81k, False: 366k]
  ------------------
   94|  1.81k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.81k|        normal = normal / quotient;
   96|  1.81k|      }
   97|   367k|    }
   98|   367k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   367k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   367k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   367k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   367k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    211|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    211|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 37, False: 174]
  ------------------
  105|     37|      this->normal_prediction_mode_ = mode;
  106|     37|      return true;
  107|    174|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 174, False: 0]
  ------------------
  108|    174|      this->normal_prediction_mode_ = mode;
  109|    174|      return true;
  110|    174|    }
  111|      0|    return false;
  112|    211|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   188k|                             DataTypeT* prediction) override {
   42|   188k|    DRACO_DCHECK(this->IsInitialized());
   43|   188k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   188k|    const CornerTable* const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   188k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   188k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   188k|    VectorD<int64_t, 3> normal;
   53|   188k|    CornerIndex c_next, c_prev;
   54|  1.30M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.12M, False: 188k]
  ------------------
   55|       |      // Getting corners.
   56|  1.12M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 216, False: 1.11M]
  ------------------
   57|    216|        c_next = corner_table->Next(corner_id);
   58|    216|        c_prev = corner_table->Previous(corner_id);
   59|  1.11M|      } else {
   60|  1.11M|        c_next = corner_table->Next(cit.Corner());
   61|  1.11M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.11M|      }
   63|  1.12M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.12M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.12M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.12M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.12M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.12M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.12M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.12M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.12M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.12M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.12M|      cit.Next();
   81|  1.12M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   188k|    constexpr int64_t upper_bound = 1 << 29;
   85|   188k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 144, False: 188k]
  ------------------
   86|    144|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    144|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 48, False: 96]
  ------------------
   88|     48|        const int64_t quotient = abs_sum / upper_bound;
   89|     48|        normal = normal / quotient;
   90|     48|      }
   91|   188k|    } else {
   92|   188k|      const int64_t abs_sum = normal.AbsSum();
   93|   188k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 85.4k, False: 102k]
  ------------------
   94|  85.4k|        const int64_t quotient = abs_sum / upper_bound;
   95|  85.4k|        normal = normal / quotient;
   96|  85.4k|      }
   97|   188k|    }
   98|   188k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   188k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   188k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   188k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   188k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    233|      : Base(md) {
   35|    233|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    233|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    296|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    296|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 60, False: 236]
  ------------------
  105|     60|      this->normal_prediction_mode_ = mode;
  106|     60|      return true;
  107|    236|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 236, False: 0]
  ------------------
  108|    236|      this->normal_prediction_mode_ = mode;
  109|    236|      return true;
  110|    236|    }
  111|      0|    return false;
  112|    296|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   938k|                             DataTypeT* prediction) override {
   42|   938k|    DRACO_DCHECK(this->IsInitialized());
   43|   938k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   938k|    const CornerTable* const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   938k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   938k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   938k|    VectorD<int64_t, 3> normal;
   53|   938k|    CornerIndex c_next, c_prev;
   54|  2.30M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.36M, False: 938k]
  ------------------
   55|       |      // Getting corners.
   56|  1.36M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 462k, False: 899k]
  ------------------
   57|   462k|        c_next = corner_table->Next(corner_id);
   58|   462k|        c_prev = corner_table->Previous(corner_id);
   59|   899k|      } else {
   60|   899k|        c_next = corner_table->Next(cit.Corner());
   61|   899k|        c_prev = corner_table->Previous(cit.Corner());
   62|   899k|      }
   63|  1.36M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.36M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.36M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.36M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.36M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.36M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.36M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.36M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.36M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.36M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.36M|      cit.Next();
   81|  1.36M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   938k|    constexpr int64_t upper_bound = 1 << 29;
   85|   938k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 77.9k, False: 860k]
  ------------------
   86|  77.9k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  77.9k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 147, False: 77.8k]
  ------------------
   88|    147|        const int64_t quotient = abs_sum / upper_bound;
   89|    147|        normal = normal / quotient;
   90|    147|      }
   91|   860k|    } else {
   92|   860k|      const int64_t abs_sum = normal.AbsSum();
   93|   860k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.04k, False: 859k]
  ------------------
   94|  1.04k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.04k|        normal = normal / quotient;
   96|  1.04k|      }
   97|   860k|    }
   98|   938k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   938k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   938k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   938k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   938k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    536|      : Base(md) {
   35|    536|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    536|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    633|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    633|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 94, False: 539]
  ------------------
  105|     94|      this->normal_prediction_mode_ = mode;
  106|     94|      return true;
  107|    539|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 539, False: 0]
  ------------------
  108|    539|      this->normal_prediction_mode_ = mode;
  109|    539|      return true;
  110|    539|    }
  111|      0|    return false;
  112|    633|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   202k|                             DataTypeT* prediction) override {
   42|   202k|    DRACO_DCHECK(this->IsInitialized());
   43|   202k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   202k|    const CornerTable* const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   202k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   202k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   202k|    VectorD<int64_t, 3> normal;
   53|   202k|    CornerIndex c_next, c_prev;
   54|  1.36M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.16M, False: 202k]
  ------------------
   55|       |      // Getting corners.
   56|  1.16M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 407k, False: 752k]
  ------------------
   57|   407k|        c_next = corner_table->Next(corner_id);
   58|   407k|        c_prev = corner_table->Previous(corner_id);
   59|   752k|      } else {
   60|   752k|        c_next = corner_table->Next(cit.Corner());
   61|   752k|        c_prev = corner_table->Previous(cit.Corner());
   62|   752k|      }
   63|  1.16M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.16M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.16M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.16M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.16M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.16M|      auto normal_data = reinterpret_cast<uint64_t*>(normal.data());
   75|  1.16M|      auto cross_data = reinterpret_cast<const uint64_t*>(cross.data());
   76|  1.16M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.16M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.16M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.16M|      cit.Next();
   81|  1.16M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   202k|    constexpr int64_t upper_bound = 1 << 29;
   85|   202k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 69.0k, False: 133k]
  ------------------
   86|  69.0k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  69.0k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 340, False: 68.7k]
  ------------------
   88|    340|        const int64_t quotient = abs_sum / upper_bound;
   89|    340|        normal = normal / quotient;
   90|    340|      }
   91|   133k|    } else {
   92|   133k|      const int64_t abs_sum = normal.AbsSum();
   93|   133k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 12.5k, False: 121k]
  ------------------
   94|  12.5k|        const int64_t quotient = abs_sum / upper_bound;
   95|  12.5k|        normal = normal / quotient;
   96|  12.5k|      }
   97|   133k|    }
   98|   202k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   202k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   202k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   202k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   202k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    171|      : Base(md) {
   35|    171|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    171|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    161|      : Base(md) {
   35|    161|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    161|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    172|      : Base(md) {
   35|    172|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    172|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    172|      : Base(md) {
   35|    172|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    172|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.93M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.93M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.93M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.93M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.93M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.93M|    return GetPositionForDataId(data_id);
   77|  2.93M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.93M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.93M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.93M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.93M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.93M|    VectorD<int64_t, 3> pos;
   68|  2.93M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.93M|    return pos;
   70|  2.93M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    170|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    170|    pos_attribute_ = &position_attribute;
   43|    170|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    145|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    145|    entry_to_point_id_map_ = map;
   46|    145|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.87M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.87M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.87M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.87M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.87M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.87M|    return GetPositionForDataId(data_id);
   77|  2.87M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.87M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.87M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.87M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.87M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.87M|    VectorD<int64_t, 3> pos;
   68|  2.87M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.87M|    return pos;
   70|  2.87M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    158|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    158|    pos_attribute_ = &position_attribute;
   43|    158|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    149|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    149|    entry_to_point_id_map_ = map;
   46|    149|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.54M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.54M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.54M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.54M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.54M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.54M|    return GetPositionForDataId(data_id);
   77|  1.54M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.54M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.54M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.54M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.54M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.54M|    VectorD<int64_t, 3> pos;
   68|  1.54M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.54M|    return pos;
   70|  1.54M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    170|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    170|    pos_attribute_ = &position_attribute;
   43|    170|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    159|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    159|    entry_to_point_id_map_ = map;
   46|    159|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.42M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.42M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.42M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.42M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.42M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.42M|    return GetPositionForDataId(data_id);
   77|  2.42M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.42M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.42M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.42M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.42M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.42M|    VectorD<int64_t, 3> pos;
   68|  2.42M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.42M|    return pos;
   70|  2.42M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    170|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    170|    pos_attribute_ = &position_attribute;
   43|    170|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    156|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    156|    entry_to_point_id_map_ = map;
   46|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    233|      : pos_attribute_(nullptr),
   36|    233|        entry_to_point_id_map_(nullptr),
   37|    233|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    233|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.66M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.66M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.66M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.66M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.66M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.66M|    return GetPositionForDataId(data_id);
   77|  3.66M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.66M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.66M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.66M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.66M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.66M|    VectorD<int64_t, 3> pos;
   68|  3.66M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.66M|    return pos;
   70|  3.66M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    228|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    228|    pos_attribute_ = &position_attribute;
   43|    228|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    192|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    192|    entry_to_point_id_map_ = map;
   46|    192|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    536|      : pos_attribute_(nullptr),
   36|    536|        entry_to_point_id_map_(nullptr),
   37|    536|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    536|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.52M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.52M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.52M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.52M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.52M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.52M|    return GetPositionForDataId(data_id);
   77|  2.52M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.52M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.52M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.52M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.52M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.52M|    VectorD<int64_t, 3> pos;
   68|  2.52M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.52M|    return pos;
   70|  2.52M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    533|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    533|    pos_attribute_ = &position_attribute;
   43|    533|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    474|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    474|    entry_to_point_id_map_ = map;
   46|    474|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    171|      : pos_attribute_(nullptr),
   36|    171|        entry_to_point_id_map_(nullptr),
   37|    171|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    171|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    161|      : pos_attribute_(nullptr),
   36|    161|        entry_to_point_id_map_(nullptr),
   37|    161|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    161|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    172|      : pos_attribute_(nullptr),
   36|    172|        entry_to_point_id_map_(nullptr),
   37|    172|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    172|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    172|      : pos_attribute_(nullptr),
   36|    172|        entry_to_point_id_map_(nullptr),
   37|    172|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    172|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    465|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    465|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    447|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    447|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    447|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    447|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    447|      new DataTypeT[num_components]());
   70|       |
   71|    447|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    447|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    447|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    447|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    447|  const int corner_map_size =
   78|    447|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    447|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 447]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|  1.21M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 1.21M, False: 447]
  ------------------
   83|  1.21M|    const CornerIndex start_corner_id =
   84|  1.21M|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|  1.21M|    CornerIndex corner_id(start_corner_id);
   87|  1.21M|    int num_parallelograms = 0;
   88|  55.9M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 54.7M, False: 1.21M]
  ------------------
   89|  54.7M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  54.7M|    }
   91|  2.89M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 1.67M, False: 1.21M]
  ------------------
   92|  1.67M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 185k, False: 1.48M]
  ------------------
   93|  1.67M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  1.67M|              num_components, parallelogram_pred_vals.get())) {
   95|  8.49M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 8.30M, False: 185k]
  ------------------
   96|  8.30M|          pred_vals[c] =
   97|  8.30M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  8.30M|        }
   99|   185k|        ++num_parallelograms;
  100|   185k|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  1.67M|      corner_id = table->SwingRight(corner_id);
  104|  1.67M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 90.1k, False: 1.58M]
  ------------------
  105|  90.1k|        corner_id = kInvalidCornerIndex;
  106|  90.1k|      }
  107|  1.67M|    }
  108|       |
  109|  1.21M|    const int dst_offset = p * num_components;
  110|  1.21M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 1.11M, False: 97.2k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  1.11M|      const int src_offset = (p - 1) * num_components;
  114|  1.11M|      this->transform().ComputeOriginalValue(
  115|  1.11M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|  1.11M|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  4.43M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 4.33M, False: 97.2k]
  ------------------
  119|  4.33M|        pred_vals[c] /= num_parallelograms;
  120|  4.33M|      }
  121|  97.2k|      this->transform().ComputeOriginalValue(
  122|  97.2k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|  97.2k|    }
  124|  1.21M|  }
  125|    447|  return true;
  126|    447|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    593|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    593|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    567|                          const PointIndex* /* entry_to_point_id_map */) {
   64|    567|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    567|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    567|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    567|      new DataTypeT[num_components]());
   70|       |
   71|    567|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    567|  const CornerTable* const table = this->mesh_data().corner_table();
   74|    567|  const std::vector<int32_t>* const vertex_to_data_map =
   75|    567|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    567|  const int corner_map_size =
   78|    567|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|    567|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (79:7): [True: 0, False: 567]
  ------------------
   80|      0|    return false;
   81|      0|  }
   82|   830k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (82:19): [True: 830k, False: 567]
  ------------------
   83|   830k|    const CornerIndex start_corner_id =
   84|   830k|        this->mesh_data().data_to_corner_map()->at(p);
   85|       |
   86|   830k|    CornerIndex corner_id(start_corner_id);
   87|   830k|    int num_parallelograms = 0;
   88|  22.6M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (88:21): [True: 21.7M, False: 830k]
  ------------------
   89|  21.7M|      pred_vals[i] = static_cast<DataTypeT>(0);
   90|  21.7M|    }
   91|  5.74M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (91:12): [True: 4.91M, False: 830k]
  ------------------
   92|  4.91M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (92:11): [True: 1.61M, False: 3.29M]
  ------------------
   93|  4.91M|              p, corner_id, table, *vertex_to_data_map, out_data,
   94|  4.91M|              num_components, parallelogram_pred_vals.get())) {
   95|  44.1M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (95:25): [True: 42.5M, False: 1.61M]
  ------------------
   96|  42.5M|          pred_vals[c] =
   97|  42.5M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   98|  42.5M|        }
   99|  1.61M|        ++num_parallelograms;
  100|  1.61M|      }
  101|       |
  102|       |      // Proceed to the next corner attached to the vertex.
  103|  4.91M|      corner_id = table->SwingRight(corner_id);
  104|  4.91M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (104:11): [True: 814k, False: 4.09M]
  ------------------
  105|   814k|        corner_id = kInvalidCornerIndex;
  106|   814k|      }
  107|  4.91M|    }
  108|       |
  109|   830k|    const int dst_offset = p * num_components;
  110|   830k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (110:9): [True: 2.55k, False: 827k]
  ------------------
  111|       |      // No parallelogram was valid.
  112|       |      // We use the last decoded point as a reference.
  113|  2.55k|      const int src_offset = (p - 1) * num_components;
  114|  2.55k|      this->transform().ComputeOriginalValue(
  115|  2.55k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  116|   827k|    } else {
  117|       |      // Compute the correction from the predicted value.
  118|  22.5M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (118:23): [True: 21.7M, False: 827k]
  ------------------
  119|  21.7M|        pred_vals[c] /= num_parallelograms;
  120|  21.7M|      }
  121|   827k|      this->transform().ComputeOriginalValue(
  122|   827k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  123|   827k|    }
  124|   830k|  }
  125|    567|  return true;
  126|    567|}

_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    766|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    766|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    743|                          const PointIndex* /* entry_to_point_id_map */) {
   61|    743|  this->transform().Init(num_components);
   62|       |
   63|    743|  const CornerTable* const table = this->mesh_data().corner_table();
   64|    743|  const std::vector<int32_t>* const vertex_to_data_map =
   65|    743|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    743|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    743|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    743|  const int corner_map_size =
   74|    743|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|    743|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (75:7): [True: 0, False: 743]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|  2.29M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (78:19): [True: 2.29M, False: 743]
  ------------------
   79|  2.29M|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   80|  2.29M|    const int dst_offset = p * num_components;
   81|  2.29M|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (81:9): [True: 2.12M, False: 167k]
  ------------------
   82|  2.29M|                                        *vertex_to_data_map, out_data,
   83|  2.29M|                                        num_components, pred_vals.get())) {
   84|       |      // Parallelogram could not be computed, Possible because some of the
   85|       |      // vertices are not valid (not encoded yet).
   86|       |      // We use the last encoded point as a reference (delta coding).
   87|  2.12M|      const int src_offset = (p - 1) * num_components;
   88|  2.12M|      this->transform().ComputeOriginalValue(
   89|  2.12M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   90|  2.12M|    } else {
   91|       |      // Apply the parallelogram prediction.
   92|   167k|      this->transform().ComputeOriginalValue(
   93|   167k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   94|   167k|    }
   95|  2.29M|  }
   96|    743|  return true;
   97|    743|}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    699|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    699|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    652|                          const PointIndex* /* entry_to_point_id_map */) {
   61|    652|  this->transform().Init(num_components);
   62|       |
   63|    652|  const CornerTable* const table = this->mesh_data().corner_table();
   64|    652|  const std::vector<int32_t>* const vertex_to_data_map =
   65|    652|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    652|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    652|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    652|  const int corner_map_size =
   74|    652|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|    652|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (75:7): [True: 0, False: 652]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|   310k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (78:19): [True: 309k, False: 652]
  ------------------
   79|   309k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   80|   309k|    const int dst_offset = p * num_components;
   81|   309k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (81:9): [True: 3.27k, False: 306k]
  ------------------
   82|   309k|                                        *vertex_to_data_map, out_data,
   83|   309k|                                        num_components, pred_vals.get())) {
   84|       |      // Parallelogram could not be computed, Possible because some of the
   85|       |      // vertices are not valid (not encoded yet).
   86|       |      // We use the last encoded point as a reference (delta coding).
   87|  3.27k|      const int src_offset = (p - 1) * num_components;
   88|  3.27k|      this->transform().ComputeOriginalValue(
   89|  3.27k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   90|   306k|    } else {
   91|       |      // Apply the parallelogram prediction.
   92|   306k|      this->transform().ComputeOriginalValue(
   93|   306k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   94|   306k|    }
   95|   309k|  }
   96|    652|  return true;
   97|    652|}

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  4.42M|    int num_components, DataTypeT* out_prediction) {
   49|  4.42M|  const CornerIndex oci = table->Opposite(ci);
   50|  4.42M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 3.52M, False: 908k]
  ------------------
   51|  3.52M|    return false;
   52|  3.52M|  }
   53|   908k|  int vert_opp, vert_next, vert_prev;
   54|   908k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   908k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   908k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 532k, False: 375k]
  |  Branch (56:35): [True: 429k, False: 103k]
  ------------------
   57|   429k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 414k, False: 14.4k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   414k|    const int v_opp_off = vert_opp * num_components;
   60|   414k|    const int v_next_off = vert_next * num_components;
   61|   414k|    const int v_prev_off = vert_prev * num_components;
   62|  19.0M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 18.5M, False: 414k]
  ------------------
   63|  18.5M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  18.5M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  18.5M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  18.5M|      const int64_t result =
   67|  18.5M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  18.5M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  18.5M|    }
   71|   414k|    return true;
   72|   414k|  }
   73|   493k|  return false;  // Not all data is available for prediction
   74|   908k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   908k|    int* next_entry, int* prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|   908k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   908k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   908k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   908k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  6.11M|    int num_components, DataTypeT* out_prediction) {
   49|  6.11M|  const CornerIndex oci = table->Opposite(ci);
   50|  6.11M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 23.8k, False: 6.08M]
  ------------------
   51|  23.8k|    return false;
   52|  23.8k|  }
   53|  6.08M|  int vert_opp, vert_next, vert_prev;
   54|  6.08M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  6.08M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  6.08M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 3.18M, False: 2.90M]
  |  Branch (56:35): [True: 2.45M, False: 734k]
  ------------------
   57|  2.45M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.21M, False: 240k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.21M|    const int v_opp_off = vert_opp * num_components;
   60|  2.21M|    const int v_next_off = vert_next * num_components;
   61|  2.21M|    const int v_prev_off = vert_prev * num_components;
   62|   100M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 98.0M, False: 2.21M]
  ------------------
   63|  98.0M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  98.0M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  98.0M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  98.0M|      const int64_t result =
   67|  98.0M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  98.0M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  98.0M|    }
   71|  2.21M|    return true;
   72|  2.21M|  }
   73|  3.87M|  return false;  // Not all data is available for prediction
   74|  6.08M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  6.08M|    int* next_entry, int* prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  6.08M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  6.08M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  6.08M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  6.08M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    212|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    212|            attribute, transform, mesh_data),
   46|    212|        pos_attribute_(nullptr),
   47|    212|        entry_to_point_id_map_(nullptr),
   48|    212|        num_components_(0),
   49|    212|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    422|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|    212|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    212|    DRACO_DCHECK_EQ(i, 0);
   75|    212|    (void)i;
   76|    212|    return GeometryAttribute::POSITION;
   77|    212|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    211|  bool SetParentAttribute(const PointAttribute* att) override {
   80|    211|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 211]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    211|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 211]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    211|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 1, False: 210]
  ------------------
   87|      1|      return false;  // Currently works only for 3 component positions.
   88|      1|    }
   89|    210|    pos_attribute_ = att;
   90|    210|    return true;
   91|    211|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  156|    205|    DecodePredictionData(DecoderBuffer* buffer) {
  157|       |  // Decode the delta coded orientations.
  158|    205|  uint32_t num_orientations = 0;
  159|    205|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    205|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (159:7): [True: 12, False: 193]
  ------------------
  160|     12|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (160:9): [True: 1, False: 11]
  ------------------
  161|      1|      return false;
  162|      1|    }
  163|    193|  } else {
  164|    193|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (164:9): [True: 1, False: 192]
  ------------------
  165|      1|      return false;
  166|      1|    }
  167|    193|  }
  168|    203|  if (num_orientations == 0) {
  ------------------
  |  Branch (168:7): [True: 7, False: 196]
  ------------------
  169|      7|    return false;
  170|      7|  }
  171|    196|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (171:7): [True: 14, False: 182]
  ------------------
  172|       |    // We can't have more orientations than the maximum number of decoded
  173|       |    // values.
  174|     14|    return false;
  175|     14|  }
  176|    182|  orientations_.resize(num_orientations);
  177|    182|  bool last_orientation = true;
  178|    182|  RAnsBitDecoder decoder;
  179|    182|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (179:7): [True: 2, False: 180]
  ------------------
  180|      2|    return false;
  181|      2|  }
  182|  91.2k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (182:24): [True: 91.1k, False: 180]
  ------------------
  183|  91.1k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (183:9): [True: 12.8k, False: 78.2k]
  ------------------
  184|  12.8k|      last_orientation = !last_orientation;
  185|  12.8k|    }
  186|  91.1k|    orientations_[i] = last_orientation;
  187|  91.1k|  }
  188|    180|  decoder.EndDecoding();
  189|    180|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  190|    180|                                     MeshDataT>::DecodePredictionData(buffer);
  191|    182|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|    127|                          const PointIndex* entry_to_point_id_map) {
  126|    127|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 5, False: 122]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      5|    return false;
  129|      5|  }
  130|    122|  num_components_ = num_components;
  131|    122|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|    122|  predicted_value_ =
  133|    122|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|    122|  this->transform().Init(num_components);
  135|       |
  136|    122|  const int corner_map_size =
  137|    122|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|    122|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (138:7): [True: 0, False: 122]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|   891k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (141:19): [True: 891k, False: 87]
  ------------------
  142|   891k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  143|   891k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (143:9): [True: 35, False: 891k]
  ------------------
  144|     35|      return false;
  145|     35|    }
  146|       |
  147|   891k|    const int dst_offset = p * num_components;
  148|   891k|    this->transform().ComputeOriginalValue(
  149|   891k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  150|   891k|  }
  151|     87|  return true;
  152|    122|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  196|   891k|                          int data_id) {
  197|       |  // Compute the predicted UV coordinate from the positions on all corners
  198|       |  // of the processed triangle. For the best prediction, the UV coordinates
  199|       |  // on the next/previous corners need to be already encoded/decoded.
  200|   891k|  const CornerIndex next_corner_id =
  201|   891k|      this->mesh_data().corner_table()->Next(corner_id);
  202|   891k|  const CornerIndex prev_corner_id =
  203|   891k|      this->mesh_data().corner_table()->Previous(corner_id);
  204|       |  // Get the encoded data ids from the next and previous corners.
  205|       |  // The data id is the encoding order of the UV coordinates.
  206|   891k|  int next_data_id, prev_data_id;
  207|       |
  208|   891k|  int next_vert_id, prev_vert_id;
  209|   891k|  next_vert_id =
  210|   891k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  211|   891k|  prev_vert_id =
  212|   891k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  213|       |
  214|   891k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  215|   891k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  216|       |
  217|   891k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (217:7): [True: 603k, False: 288k]
  |  Branch (217:33): [True: 314k, False: 288k]
  ------------------
  218|       |    // Both other corners have available UV coordinates for prediction.
  219|   314k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  220|   314k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  221|   314k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (221:9): [True: 290k, False: 24.1k]
  ------------------
  222|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  223|       |      // Technically floats > INT_MAX are undefined, but compilers will
  224|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  225|   581k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (225:24): [True: 581k, False: 290k]
  ------------------
  226|   581k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (226:13): [True: 0, False: 581k]
  |  Branch (226:36): [True: 82, False: 580k]
  ------------------
  227|   580k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (227:13): [True: 0, False: 580k]
  ------------------
  228|     82|          predicted_value_[i] = INT_MIN;
  229|   580k|        } else {
  230|   580k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  231|   580k|        }
  232|   581k|      }
  233|   290k|      return true;
  234|   290k|    }
  235|       |
  236|       |    // Get positions at all corners.
  237|  24.1k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  238|  24.1k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  239|  24.1k|    const Vector3f prev_pos = GetPositionForEntryId(prev_data_id);
  240|       |    // Use the positions of the above triangle to predict the texture coordinate
  241|       |    // on the tip corner C.
  242|       |    // Convert the triangle into a new coordinate system defined by orthogonal
  243|       |    // bases vectors S, T, where S is vector prev_pos - next_pos and T is an
  244|       |    // perpendicular vector to S in the same plane as vector the
  245|       |    // tip_pos - next_pos.
  246|       |    // The transformed triangle in the new coordinate system is then going to
  247|       |    // be represented as:
  248|       |    //
  249|       |    //        1 ^
  250|       |    //          |
  251|       |    //          |
  252|       |    //          |   C
  253|       |    //          |  /  \
  254|       |    //          | /      \
  255|       |    //          |/          \
  256|       |    //          N--------------P
  257|       |    //          0              1
  258|       |    //
  259|       |    // Where next_pos point (N) is at position (0, 0), prev_pos point (P) is
  260|       |    // at (1, 0). Our goal is to compute the position of the tip_pos point (C)
  261|       |    // in this new coordinate space (s, t).
  262|       |    //
  263|  24.1k|    const Vector3f pn = prev_pos - next_pos;
  264|  24.1k|    const Vector3f cn = tip_pos - next_pos;
  265|  24.1k|    const float pn_norm2_squared = pn.SquaredNorm();
  266|       |    // Coordinate s of the tip corner C is simply the dot product of the
  267|       |    // normalized vectors |pn| and |cn| (normalized by the length of |pn|).
  268|       |    // Since both of these vectors are normalized, we don't need to perform the
  269|       |    // normalization explicitly and instead we can just use the squared norm
  270|       |    // of |pn| as a denominator of the resulting dot product of non normalized
  271|       |    // vectors.
  272|  24.1k|    float s, t;
  273|       |    // |pn_norm2_squared| can be exactly 0 when the next_pos and prev_pos are
  274|       |    // the same positions (e.g. because they were quantized to the same
  275|       |    // location).
  276|  24.1k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  48.3k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (276:9): [True: 0, False: 24.1k]
  |  Branch (276:53): [True: 359, False: 23.8k]
  ------------------
  277|    359|      s = pn.Dot(cn) / pn_norm2_squared;
  278|       |      // To get the coordinate t, we can use formula:
  279|       |      //      t = |C-N - (P-N) * s| / |P-N|
  280|       |      // Do not use std::sqrt to avoid changes in the bitstream.
  281|    359|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  282|  23.8k|    } else {
  283|  23.8k|      s = 0;
  284|  23.8k|      t = 0;
  285|  23.8k|    }
  286|       |
  287|       |    // Now we need to transform the point (s, t) to the texture coordinate space
  288|       |    // UV. We know the UV coordinates on points N and P (N_UV and P_UV). Lets
  289|       |    // denote P_UV - N_UV = PN_UV. PN_UV is then 2 dimensional vector that can
  290|       |    // be used to define transformation from the normalized coordinate system
  291|       |    // to the texture coordinate system using a 3x3 affine matrix M:
  292|       |    //
  293|       |    //  M = | PN_UV[0]  -PN_UV[1]  N_UV[0] |
  294|       |    //      | PN_UV[1]   PN_UV[0]  N_UV[1] |
  295|       |    //      | 0          0         1       |
  296|       |    //
  297|       |    // The predicted point C_UV in the texture space is then equal to
  298|       |    // C_UV = M * (s, t, 1). Because the triangle in UV space may be flipped
  299|       |    // around the PN_UV axis, we also need to consider point C_UV' = M * (s, -t)
  300|       |    // as the prediction.
  301|  24.1k|    const Vector2f pn_uv = p_uv - n_uv;
  302|  24.1k|    const float pnus = pn_uv[0] * s + n_uv[0];
  303|  24.1k|    const float pnut = pn_uv[0] * t;
  304|  24.1k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  305|  24.1k|    const float pnvt = pn_uv[1] * t;
  306|  24.1k|    Vector2f predicted_uv;
  307|  24.1k|    if (orientations_.empty()) {
  ------------------
  |  Branch (307:9): [True: 35, False: 24.1k]
  ------------------
  308|     35|      return false;
  309|     35|    }
  310|       |
  311|       |    // When decoding the data, we already know which orientation to use.
  312|  24.1k|    const bool orientation = orientations_.back();
  313|  24.1k|    orientations_.pop_back();
  314|  24.1k|    if (orientation) {
  ------------------
  |  Branch (314:9): [True: 8.44k, False: 15.7k]
  ------------------
  315|  8.44k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  316|  15.7k|    } else {
  317|  15.7k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  318|  15.7k|    }
  319|  24.1k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (319:9): [True: 24.1k, Folded]
  ------------------
  320|       |      // Round the predicted value for integer types.
  321|       |      // Technically floats > INT_MAX are undefined, but compilers will
  322|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  323|  24.1k|      const double u = floor(predicted_uv[0] + 0.5);
  324|  24.1k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (324:11): [True: 0, False: 24.1k]
  |  Branch (324:28): [True: 81, False: 24.0k]
  |  Branch (324:43): [True: 32, False: 24.0k]
  ------------------
  325|    113|        predicted_value_[0] = INT_MIN;
  326|  24.0k|      } else {
  327|  24.0k|        predicted_value_[0] = static_cast<int>(u);
  328|  24.0k|      }
  329|  24.1k|      const double v = floor(predicted_uv[1] + 0.5);
  330|  24.1k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (330:11): [True: 0, False: 24.1k]
  |  Branch (330:28): [True: 66, False: 24.0k]
  |  Branch (330:43): [True: 37, False: 24.0k]
  ------------------
  331|    103|        predicted_value_[1] = INT_MIN;
  332|  24.0k|      } else {
  333|  24.0k|        predicted_value_[1] = static_cast<int>(v);
  334|  24.0k|      }
  335|  24.1k|    } else {
  336|      0|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  337|      0|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  338|      0|    }
  339|       |
  340|  24.1k|    return true;
  341|  24.1k|  }
  342|       |  // Else we don't have available textures on both corners. For such case we
  343|       |  // can't use positions for predicting the uv value and we resort to delta
  344|       |  // coding.
  345|   576k|  int data_offset = 0;
  346|   576k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (346:7): [True: 288k, False: 288k]
  ------------------
  347|       |    // Use the value on the previous corner as the prediction.
  348|   288k|    data_offset = prev_data_id * num_components_;
  349|   288k|  }
  350|   576k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (350:7): [True: 12, False: 576k]
  ------------------
  351|       |    // Use the value on the next corner as the prediction.
  352|     12|    data_offset = next_data_id * num_components_;
  353|   576k|  } else {
  354|       |    // None of the other corners have a valid value. Use the last encoded value
  355|       |    // as the prediction if possible.
  356|   576k|    if (data_id > 0) {
  ------------------
  |  Branch (356:9): [True: 576k, False: 122]
  ------------------
  357|   576k|      data_offset = (data_id - 1) * num_components_;
  358|   576k|    } else {
  359|       |      // We are encoding the first value. Predict 0.
  360|    366|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (360:23): [True: 244, False: 122]
  ------------------
  361|    244|        predicted_value_[i] = 0;
  362|    244|      }
  363|    122|      return true;
  364|    122|    }
  365|   576k|  }
  366|  1.73M|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (366:19): [True: 1.15M, False: 576k]
  ------------------
  367|  1.15M|    predicted_value_[i] = data[data_offset + i];
  368|  1.15M|  }
  369|   576k|  return true;
  370|   576k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   629k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT* data) const {
  103|   629k|    const int data_offset = entry_id * num_components_;
  104|   629k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   629k|                    static_cast<float>(data[data_offset + 1]));
  106|   629k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  72.5k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  72.5k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  72.5k|    Vector3f pos;
   97|  72.5k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  72.5k|                                 &pos[0]);
   99|  72.5k|    return pos;
  100|  72.5k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    223|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    223|            attribute, transform, mesh_data),
   46|    223|        pos_attribute_(nullptr),
   47|    223|        entry_to_point_id_map_(nullptr),
   48|    223|        num_components_(0),
   49|    223|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    442|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|    223|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    223|    DRACO_DCHECK_EQ(i, 0);
   75|    223|    (void)i;
   76|    223|    return GeometryAttribute::POSITION;
   77|    223|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    221|  bool SetParentAttribute(const PointAttribute* att) override {
   80|    221|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 221]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    221|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 221]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    221|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 2, False: 219]
  ------------------
   87|      2|      return false;  // Currently works only for 3 component positions.
   88|      2|    }
   89|    219|    pos_attribute_ = att;
   90|    219|    return true;
   91|    221|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  156|    215|    DecodePredictionData(DecoderBuffer* buffer) {
  157|       |  // Decode the delta coded orientations.
  158|    215|  uint32_t num_orientations = 0;
  159|    215|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    215|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (159:7): [True: 2, False: 213]
  ------------------
  160|      2|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (160:9): [True: 1, False: 1]
  ------------------
  161|      1|      return false;
  162|      1|    }
  163|    213|  } else {
  164|    213|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (164:9): [True: 1, False: 212]
  ------------------
  165|      1|      return false;
  166|      1|    }
  167|    213|  }
  168|    213|  if (num_orientations == 0) {
  ------------------
  |  Branch (168:7): [True: 3, False: 210]
  ------------------
  169|      3|    return false;
  170|      3|  }
  171|    210|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (171:7): [True: 41, False: 169]
  ------------------
  172|       |    // We can't have more orientations than the maximum number of decoded
  173|       |    // values.
  174|     41|    return false;
  175|     41|  }
  176|    169|  orientations_.resize(num_orientations);
  177|    169|  bool last_orientation = true;
  178|    169|  RAnsBitDecoder decoder;
  179|    169|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (179:7): [True: 3, False: 166]
  ------------------
  180|      3|    return false;
  181|      3|  }
  182|  67.8k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (182:24): [True: 67.6k, False: 166]
  ------------------
  183|  67.6k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (183:9): [True: 28.5k, False: 39.1k]
  ------------------
  184|  28.5k|      last_orientation = !last_orientation;
  185|  28.5k|    }
  186|  67.6k|    orientations_[i] = last_orientation;
  187|  67.6k|  }
  188|    166|  decoder.EndDecoding();
  189|    166|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  190|    166|                                     MeshDataT>::DecodePredictionData(buffer);
  191|    169|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|    134|                          const PointIndex* entry_to_point_id_map) {
  126|    134|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 12, False: 122]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|     12|    return false;
  129|     12|  }
  130|    122|  num_components_ = num_components;
  131|    122|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|    122|  predicted_value_ =
  133|    122|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|    122|  this->transform().Init(num_components);
  135|       |
  136|    122|  const int corner_map_size =
  137|    122|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|    122|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (138:7): [True: 0, False: 122]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|   138k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (141:19): [True: 138k, False: 88]
  ------------------
  142|   138k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  143|   138k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (143:9): [True: 34, False: 138k]
  ------------------
  144|     34|      return false;
  145|     34|    }
  146|       |
  147|   138k|    const int dst_offset = p * num_components;
  148|   138k|    this->transform().ComputeOriginalValue(
  149|   138k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  150|   138k|  }
  151|     88|  return true;
  152|    122|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  196|   138k|                          int data_id) {
  197|       |  // Compute the predicted UV coordinate from the positions on all corners
  198|       |  // of the processed triangle. For the best prediction, the UV coordinates
  199|       |  // on the next/previous corners need to be already encoded/decoded.
  200|   138k|  const CornerIndex next_corner_id =
  201|   138k|      this->mesh_data().corner_table()->Next(corner_id);
  202|   138k|  const CornerIndex prev_corner_id =
  203|   138k|      this->mesh_data().corner_table()->Previous(corner_id);
  204|       |  // Get the encoded data ids from the next and previous corners.
  205|       |  // The data id is the encoding order of the UV coordinates.
  206|   138k|  int next_data_id, prev_data_id;
  207|       |
  208|   138k|  int next_vert_id, prev_vert_id;
  209|   138k|  next_vert_id =
  210|   138k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  211|   138k|  prev_vert_id =
  212|   138k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  213|       |
  214|   138k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  215|   138k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  216|       |
  217|   138k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (217:7): [True: 138k, False: 364]
  |  Branch (217:33): [True: 138k, False: 348]
  ------------------
  218|       |    // Both other corners have available UV coordinates for prediction.
  219|   138k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  220|   138k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  221|   138k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (221:9): [True: 131k, False: 6.91k]
  ------------------
  222|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  223|       |      // Technically floats > INT_MAX are undefined, but compilers will
  224|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  225|   262k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (225:24): [True: 262k, False: 131k]
  ------------------
  226|   262k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (226:13): [True: 0, False: 262k]
  |  Branch (226:36): [True: 219, False: 262k]
  ------------------
  227|   262k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (227:13): [True: 0, False: 262k]
  ------------------
  228|    219|          predicted_value_[i] = INT_MIN;
  229|   262k|        } else {
  230|   262k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  231|   262k|        }
  232|   262k|      }
  233|   131k|      return true;
  234|   131k|    }
  235|       |
  236|       |    // Get positions at all corners.
  237|  6.91k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  238|  6.91k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  239|  6.91k|    const Vector3f prev_pos = GetPositionForEntryId(prev_data_id);
  240|       |    // Use the positions of the above triangle to predict the texture coordinate
  241|       |    // on the tip corner C.
  242|       |    // Convert the triangle into a new coordinate system defined by orthogonal
  243|       |    // bases vectors S, T, where S is vector prev_pos - next_pos and T is an
  244|       |    // perpendicular vector to S in the same plane as vector the
  245|       |    // tip_pos - next_pos.
  246|       |    // The transformed triangle in the new coordinate system is then going to
  247|       |    // be represented as:
  248|       |    //
  249|       |    //        1 ^
  250|       |    //          |
  251|       |    //          |
  252|       |    //          |   C
  253|       |    //          |  /  \
  254|       |    //          | /      \
  255|       |    //          |/          \
  256|       |    //          N--------------P
  257|       |    //          0              1
  258|       |    //
  259|       |    // Where next_pos point (N) is at position (0, 0), prev_pos point (P) is
  260|       |    // at (1, 0). Our goal is to compute the position of the tip_pos point (C)
  261|       |    // in this new coordinate space (s, t).
  262|       |    //
  263|  6.91k|    const Vector3f pn = prev_pos - next_pos;
  264|  6.91k|    const Vector3f cn = tip_pos - next_pos;
  265|  6.91k|    const float pn_norm2_squared = pn.SquaredNorm();
  266|       |    // Coordinate s of the tip corner C is simply the dot product of the
  267|       |    // normalized vectors |pn| and |cn| (normalized by the length of |pn|).
  268|       |    // Since both of these vectors are normalized, we don't need to perform the
  269|       |    // normalization explicitly and instead we can just use the squared norm
  270|       |    // of |pn| as a denominator of the resulting dot product of non normalized
  271|       |    // vectors.
  272|  6.91k|    float s, t;
  273|       |    // |pn_norm2_squared| can be exactly 0 when the next_pos and prev_pos are
  274|       |    // the same positions (e.g. because they were quantized to the same
  275|       |    // location).
  276|  6.91k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  13.8k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (276:9): [True: 0, False: 6.91k]
  |  Branch (276:53): [True: 355, False: 6.55k]
  ------------------
  277|    355|      s = pn.Dot(cn) / pn_norm2_squared;
  278|       |      // To get the coordinate t, we can use formula:
  279|       |      //      t = |C-N - (P-N) * s| / |P-N|
  280|       |      // Do not use std::sqrt to avoid changes in the bitstream.
  281|    355|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  282|  6.55k|    } else {
  283|  6.55k|      s = 0;
  284|  6.55k|      t = 0;
  285|  6.55k|    }
  286|       |
  287|       |    // Now we need to transform the point (s, t) to the texture coordinate space
  288|       |    // UV. We know the UV coordinates on points N and P (N_UV and P_UV). Lets
  289|       |    // denote P_UV - N_UV = PN_UV. PN_UV is then 2 dimensional vector that can
  290|       |    // be used to define transformation from the normalized coordinate system
  291|       |    // to the texture coordinate system using a 3x3 affine matrix M:
  292|       |    //
  293|       |    //  M = | PN_UV[0]  -PN_UV[1]  N_UV[0] |
  294|       |    //      | PN_UV[1]   PN_UV[0]  N_UV[1] |
  295|       |    //      | 0          0         1       |
  296|       |    //
  297|       |    // The predicted point C_UV in the texture space is then equal to
  298|       |    // C_UV = M * (s, t, 1). Because the triangle in UV space may be flipped
  299|       |    // around the PN_UV axis, we also need to consider point C_UV' = M * (s, -t)
  300|       |    // as the prediction.
  301|  6.91k|    const Vector2f pn_uv = p_uv - n_uv;
  302|  6.91k|    const float pnus = pn_uv[0] * s + n_uv[0];
  303|  6.91k|    const float pnut = pn_uv[0] * t;
  304|  6.91k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  305|  6.91k|    const float pnvt = pn_uv[1] * t;
  306|  6.91k|    Vector2f predicted_uv;
  307|  6.91k|    if (orientations_.empty()) {
  ------------------
  |  Branch (307:9): [True: 34, False: 6.87k]
  ------------------
  308|     34|      return false;
  309|     34|    }
  310|       |
  311|       |    // When decoding the data, we already know which orientation to use.
  312|  6.87k|    const bool orientation = orientations_.back();
  313|  6.87k|    orientations_.pop_back();
  314|  6.87k|    if (orientation) {
  ------------------
  |  Branch (314:9): [True: 3.71k, False: 3.16k]
  ------------------
  315|  3.71k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  316|  3.71k|    } else {
  317|  3.16k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  318|  3.16k|    }
  319|  6.87k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (319:9): [True: 6.87k, Folded]
  ------------------
  320|       |      // Round the predicted value for integer types.
  321|       |      // Technically floats > INT_MAX are undefined, but compilers will
  322|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  323|  6.87k|      const double u = floor(predicted_uv[0] + 0.5);
  324|  6.87k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (324:11): [True: 0, False: 6.87k]
  |  Branch (324:28): [True: 156, False: 6.72k]
  |  Branch (324:43): [True: 45, False: 6.67k]
  ------------------
  325|    201|        predicted_value_[0] = INT_MIN;
  326|  6.67k|      } else {
  327|  6.67k|        predicted_value_[0] = static_cast<int>(u);
  328|  6.67k|      }
  329|  6.87k|      const double v = floor(predicted_uv[1] + 0.5);
  330|  6.87k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (330:11): [True: 0, False: 6.87k]
  |  Branch (330:28): [True: 138, False: 6.74k]
  |  Branch (330:43): [True: 22, False: 6.71k]
  ------------------
  331|    160|        predicted_value_[1] = INT_MIN;
  332|  6.71k|      } else {
  333|  6.71k|        predicted_value_[1] = static_cast<int>(v);
  334|  6.71k|      }
  335|  6.87k|    } else {
  336|      0|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  337|      0|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  338|      0|    }
  339|       |
  340|  6.87k|    return true;
  341|  6.91k|  }
  342|       |  // Else we don't have available textures on both corners. For such case we
  343|       |  // can't use positions for predicting the uv value and we resort to delta
  344|       |  // coding.
  345|    712|  int data_offset = 0;
  346|    712|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (346:7): [True: 348, False: 364]
  ------------------
  347|       |    // Use the value on the previous corner as the prediction.
  348|    348|    data_offset = prev_data_id * num_components_;
  349|    348|  }
  350|    712|  if (next_data_id < data_id) {
  ------------------
  |  Branch (350:7): [True: 25, False: 687]
  ------------------
  351|       |    // Use the value on the next corner as the prediction.
  352|     25|    data_offset = next_data_id * num_components_;
  353|    687|  } else {
  354|       |    // None of the other corners have a valid value. Use the last encoded value
  355|       |    // as the prediction if possible.
  356|    687|    if (data_id > 0) {
  ------------------
  |  Branch (356:9): [True: 565, False: 122]
  ------------------
  357|    565|      data_offset = (data_id - 1) * num_components_;
  358|    565|    } else {
  359|       |      // We are encoding the first value. Predict 0.
  360|    366|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (360:23): [True: 244, False: 122]
  ------------------
  361|    244|        predicted_value_[i] = 0;
  362|    244|      }
  363|    122|      return true;
  364|    122|    }
  365|    687|  }
  366|  1.77k|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (366:19): [True: 1.18k, False: 590]
  ------------------
  367|  1.18k|    predicted_value_[i] = data[data_offset + i];
  368|  1.18k|  }
  369|    590|  return true;
  370|    712|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   276k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT* data) const {
  103|   276k|    const int data_offset = entry_id * num_components_;
  104|   276k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   276k|                    static_cast<float>(data[data_offset + 1]));
  106|   276k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  20.7k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  20.7k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  20.7k|    Vector3f pos;
   97|  20.7k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  20.7k|                                 &pos[0]);
   99|  20.7k|    return pos;
  100|  20.7k|  }

_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    394|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    394|            attribute, transform, mesh_data),
   40|    394|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   62|    785|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   64|    394|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    394|    DRACO_DCHECK_EQ(i, 0);
   66|    394|    (void)i;
   67|    394|    return GeometryAttribute::POSITION;
   68|    394|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    392|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    392|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 392]
  |  Branch (71:17): [True: 0, False: 392]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    392|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 1, False: 391]
  ------------------
   75|      1|      return false;  // Currently works only for 3 component positions.
   76|      1|    }
   77|    391|    predictor_.SetPositionAttribute(*att);
   78|    391|    return true;
   79|    392|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    390|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    390|  int32_t num_orientations = 0;
  131|    390|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 2, False: 388]
  |  Branch (131:45): [True: 11, False: 377]
  ------------------
  132|     13|    return false;
  133|     13|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    377|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    377|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 377, False: 0]
  |  Branch (137:37): [True: 22, False: 355]
  ------------------
  138|     22|    return false;
  139|     22|  }
  140|       |
  141|    355|  predictor_.ResizeOrientations(num_orientations);
  142|    355|  bool last_orientation = true;
  143|    355|  RAnsBitDecoder decoder;
  144|    355|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 3, False: 352]
  ------------------
  145|      3|    return false;
  146|      3|  }
  147|  9.49k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 9.14k, False: 352]
  ------------------
  148|  9.14k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 2.56k, False: 6.58k]
  ------------------
  149|  2.56k|      last_orientation = !last_orientation;
  150|  2.56k|    }
  151|  9.14k|    predictor_.set_orientation(i, last_orientation);
  152|  9.14k|  }
  153|    352|  decoder.EndDecoding();
  154|    352|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    352|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    355|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    390|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    390|    max_num_predicted_values_ = num;
   83|    390|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    310|                                      const PointIndex* entry_to_point_id_map) {
   98|    310|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 9, False: 301]
  ------------------
   99|    310|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|      9|    return false;
  101|      9|  }
  102|    301|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    301|  this->transform().Init(num_components);
  104|       |
  105|    301|  const int corner_map_size =
  106|    301|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    301|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 301]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|   482k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 482k, False: 112]
  ------------------
  111|   482k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|   482k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 189, False: 482k]
  ------------------
  113|   482k|                                                          p)) {
  114|    189|      return false;
  115|    189|    }
  116|       |
  117|   482k|    const int dst_offset = p * num_components;
  118|   482k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|   482k|                                           in_corr + dst_offset,
  120|   482k|                                           out_data + dst_offset);
  121|   482k|  }
  122|    112|  return true;
  123|    301|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   38|    289|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   39|    289|            attribute, transform, mesh_data),
   40|    289|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   62|    575|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   64|    289|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   65|    289|    DRACO_DCHECK_EQ(i, 0);
   66|    289|    (void)i;
   67|    289|    return GeometryAttribute::POSITION;
   68|    289|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   70|    287|  bool SetParentAttribute(const PointAttribute* att) override {
   71|    287|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (71:9): [True: 0, False: 287]
  |  Branch (71:17): [True: 0, False: 287]
  ------------------
   72|      0|      return false;  // Invalid attribute type.
   73|      0|    }
   74|    287|    if (att->num_components() != 3) {
  ------------------
  |  Branch (74:9): [True: 1, False: 286]
  ------------------
   75|      1|      return false;  // Currently works only for 3 component positions.
   76|      1|    }
   77|    286|    predictor_.SetPositionAttribute(*att);
   78|    286|    return true;
   79|    287|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  128|    284|                                                                buffer) {
  129|       |  // Decode the delta coded orientations.
  130|    284|  int32_t num_orientations = 0;
  131|    284|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (131:7): [True: 1, False: 283]
  |  Branch (131:45): [True: 24, False: 259]
  ------------------
  132|     25|    return false;
  133|     25|  }
  134|       |
  135|       |  // Check that the decoded number of orientations is not unreasonably high.
  136|    259|  const int32_t max_num_orientations = max_num_predicted_values_;
  137|    259|  if (max_num_orientations != -1 && num_orientations > max_num_orientations) {
  ------------------
  |  Branch (137:7): [True: 259, False: 0]
  |  Branch (137:37): [True: 27, False: 232]
  ------------------
  138|     27|    return false;
  139|     27|  }
  140|       |
  141|    232|  predictor_.ResizeOrientations(num_orientations);
  142|    232|  bool last_orientation = true;
  143|    232|  RAnsBitDecoder decoder;
  144|    232|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (144:7): [True: 3, False: 229]
  ------------------
  145|      3|    return false;
  146|      3|  }
  147|   105k|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (147:19): [True: 105k, False: 229]
  ------------------
  148|   105k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (148:9): [True: 84.8k, False: 20.5k]
  ------------------
  149|  84.8k|      last_orientation = !last_orientation;
  150|  84.8k|    }
  151|   105k|    predictor_.set_orientation(i, last_orientation);
  152|   105k|  }
  153|    229|  decoder.EndDecoding();
  154|    229|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  155|    229|                                     MeshDataT>::DecodePredictionData(buffer);
  156|    232|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE24SetMaxNumPredictedValuesEi:
   81|    284|  virtual void SetMaxNumPredictedValues(int32_t num) {
   82|    284|    max_num_predicted_values_ = num;
   83|    284|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   97|    211|                                      const PointIndex* entry_to_point_id_map) {
   98|    211|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (98:7): [True: 10, False: 201]
  ------------------
   99|    211|                            DataTypeT, MeshDataT>::kNumComponents) {
  100|     10|    return false;
  101|     10|  }
  102|    201|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  103|    201|  this->transform().Init(num_components);
  104|       |
  105|    201|  const int corner_map_size =
  106|    201|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  107|    201|  if (corner_map_size * num_components > size) {
  ------------------
  |  Branch (107:7): [True: 0, False: 201]
  ------------------
  108|      0|    return false;
  109|      0|  }
  110|   154k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 154k, False: 82]
  ------------------
  111|   154k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  112|   154k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (112:9): [True: 119, False: 154k]
  ------------------
  113|   154k|                                                          p)) {
  114|    119|      return false;
  115|    119|    }
  116|       |
  117|   154k|    const int dst_offset = p * num_components;
  118|   154k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  119|   154k|                                           in_corr + dst_offset,
  120|   154k|                                           out_data + dst_offset);
  121|   154k|  }
  122|     82|  return true;
  123|    201|}

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    394|      : pos_attribute_(nullptr),
   39|    394|        entry_to_point_id_map_(nullptr),
   40|    394|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    391|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    391|    pos_attribute_ = &position_attribute;
   43|    391|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    355|  void ResizeOrientations(int num_orientations) {
   74|    355|    orientations_.resize(num_orientations);
   75|    355|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  9.14k|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    301|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    301|    entry_to_point_id_map_ = map;
   46|    301|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   482k|                                                 int data_id) {
   94|       |  // Compute the predicted UV coordinate from the positions on all corners
   95|       |  // of the processed triangle. For the best prediction, the UV coordinates
   96|       |  // on the next/previous corners need to be already encoded/decoded.
   97|   482k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   482k|  const CornerIndex prev_corner_id =
   99|   482k|      mesh_data_.corner_table()->Previous(corner_id);
  100|       |  // Get the encoded data ids from the next and previous corners.
  101|       |  // The data id is the encoding order of the UV coordinates.
  102|   482k|  int next_data_id, prev_data_id;
  103|       |
  104|   482k|  int next_vert_id, prev_vert_id;
  105|   482k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   482k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   482k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   482k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   482k|  typedef VectorD<int64_t, 2> Vec2;
  112|   482k|  typedef VectorD<int64_t, 3> Vec3;
  113|   482k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   482k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 328k, False: 153k]
  |  Branch (115:33): [True: 174k, False: 153k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   174k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   174k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   174k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 157k, False: 17.7k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   157k|      predicted_value_[0] = p_uv[0];
  122|   157k|      predicted_value_[1] = p_uv[1];
  123|   157k|      return true;
  124|   157k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  17.7k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  17.7k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  17.7k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  17.7k|    const Vec3 pn = prev_pos - next_pos;
  146|  17.7k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  17.7k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.50k, False: 16.2k]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|  1.50k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.50k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.50k|      const Vec2 pn_uv = p_uv - n_uv;
  156|       |      // Because we perform all computations with integers, we don't explicitly
  157|       |      // compute the normalized factor |s|, but rather we perform all operations
  158|       |      // over UV vectors in a non-normalized coordinate system scaled with a
  159|       |      // scaling factor |pn_norm2_squared|:
  160|       |      //
  161|       |      //      x_uv = X_UV * PN.Norm2Squared()
  162|       |      //
  163|  1.50k|      const int64_t n_uv_absmax_element =
  164|  1.50k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.50k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 74, False: 1.42k]
  ------------------
  166|  1.50k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     74|        return false;
  169|     74|      }
  170|  1.42k|      const int64_t pn_uv_absmax_element =
  171|  1.42k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.42k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 44, False: 1.38k]
  ------------------
  173|  1.42k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     44|        return false;
  176|     44|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.
  178|  1.38k|      const Vec2 x_uv = Vec2(Vec2u(n_uv) * pn_norm2_squared +
  179|  1.38k|                             Vec2u(pn_uv) * static_cast<uint64_t>(cn_dot_pn));
  180|  1.38k|      const int64_t pn_absmax_element =
  181|  1.38k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  182|  1.38k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (182:11): [True: 17, False: 1.36k]
  ------------------
  183|  1.38k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  184|       |        // Return false if squared length calculation would overflow.
  185|     17|        return false;
  186|     17|      }
  187|       |
  188|       |      // Compute squared length of vector CX in position coordinate system:
  189|  1.36k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  190|  1.36k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  191|       |
  192|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  193|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  194|       |      //
  195|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  196|       |      //
  197|       |      // To preserve precision, we perform all operations in scaled space as
  198|       |      // explained above, so we want the final vector to be:
  199|       |      //
  200|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  201|       |      //
  202|       |      // We can then rewrite the formula as:
  203|       |      //
  204|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  205|       |      //
  206|  1.36k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  207|       |      // Compute CX.Norm2() * PN.Norm2()
  208|  1.36k|      const uint64_t norm_squared =
  209|  1.36k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  210|       |      // Final cx_uv in the scaled coordinate space.
  211|  1.36k|      cx_uv = cx_uv * norm_squared;
  212|       |
  213|       |      // Predicted uv coordinate is then computed by either adding or
  214|       |      // subtracting CX_UV to/from X_UV.
  215|  1.36k|      Vec2 predicted_uv;
  216|  1.36k|      if (is_encoder_t) {
  ------------------
  |  Branch (216:11): [Folded, False: 1.36k]
  ------------------
  217|       |        // When encoding, compute both possible vectors and determine which one
  218|       |        // results in a better prediction.
  219|       |        // Both vectors need to be transformed back from the scaled space to
  220|       |        // the real UV coordinate space.
  221|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  222|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  223|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  224|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (224:13): [True: 0, False: 0]
  ------------------
  225|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  226|      0|          predicted_uv = predicted_uv_0;
  227|      0|          orientations_.push_back(true);
  228|      0|        } else {
  229|      0|          predicted_uv = predicted_uv_1;
  230|      0|          orientations_.push_back(false);
  231|      0|        }
  232|  1.36k|      } else {
  233|       |        // When decoding the data, we already know which orientation to use.
  234|  1.36k|        if (orientations_.empty()) {
  ------------------
  |  Branch (234:13): [True: 54, False: 1.31k]
  ------------------
  235|     54|          return false;
  236|     54|        }
  237|  1.31k|        const bool orientation = orientations_.back();
  238|  1.31k|        orientations_.pop_back();
  239|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  240|       |        // Note that the result will be the same (for non-overflowing values).
  241|  1.31k|        if (orientation) {
  ------------------
  |  Branch (241:13): [True: 820, False: 491]
  ------------------
  242|    820|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  243|    820|        } else {
  244|    491|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  245|    491|        }
  246|  1.31k|      }
  247|  1.31k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  248|  1.31k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  249|  1.31k|      return true;
  250|  1.36k|    }
  251|  17.7k|  }
  252|       |  // Else we don't have available textures on both corners or the position data
  253|       |  // is invalid. For such cases we can't use positions for predicting the uv
  254|       |  // value and we resort to delta coding.
  255|   323k|  int data_offset = 0;
  256|   323k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (256:7): [True: 169k, False: 153k]
  ------------------
  257|       |    // Use the value on the previous corner as the prediction.
  258|   169k|    data_offset = prev_data_id * kNumComponents;
  259|   169k|  }
  260|   323k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (260:7): [True: 16.2k, False: 307k]
  ------------------
  261|       |    // Use the value on the next corner as the prediction.
  262|  16.2k|    data_offset = next_data_id * kNumComponents;
  263|   307k|  } else {
  264|       |    // None of the other corners have a valid value. Use the last encoded value
  265|       |    // as the prediction if possible.
  266|   307k|    if (data_id > 0) {
  ------------------
  |  Branch (266:9): [True: 307k, False: 301]
  ------------------
  267|   307k|      data_offset = (data_id - 1) * kNumComponents;
  268|   307k|    } else {
  269|       |      // We are encoding the first value. Predict 0.
  270|    903|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (270:23): [True: 602, False: 301]
  ------------------
  271|    602|        predicted_value_[i] = 0;
  272|    602|      }
  273|    301|      return true;
  274|    301|    }
  275|   307k|  }
  276|   970k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:19): [True: 646k, False: 323k]
  ------------------
  277|   646k|    predicted_value_[i] = data[data_offset + i];
  278|   646k|  }
  279|   323k|  return true;
  280|   323k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   349k|                                            const DataTypeT* data) const {
   59|   349k|    const int data_offset = entry_id * kNumComponents;
   60|   349k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   349k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  53.2k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  53.2k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  53.2k|    VectorD<int64_t, 3> pos;
   52|  53.2k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  53.2k|                                 &pos[0]);
   54|  53.2k|    return pos;
   55|  53.2k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   482k|  const DataTypeT* predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    289|      : pos_attribute_(nullptr),
   39|    289|        entry_to_point_id_map_(nullptr),
   40|    289|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    286|  void SetPositionAttribute(const PointAttribute& position_attribute) {
   42|    286|    pos_attribute_ = &position_attribute;
   43|    286|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    232|  void ResizeOrientations(int num_orientations) {
   74|    232|    orientations_.resize(num_orientations);
   75|    232|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|   105k|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    201|  void SetEntryToPointIdMap(const PointIndex* map) {
   45|    201|    entry_to_point_id_map_ = map;
   46|    201|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   154k|                                                 int data_id) {
   94|       |  // Compute the predicted UV coordinate from the positions on all corners
   95|       |  // of the processed triangle. For the best prediction, the UV coordinates
   96|       |  // on the next/previous corners need to be already encoded/decoded.
   97|   154k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   154k|  const CornerIndex prev_corner_id =
   99|   154k|      mesh_data_.corner_table()->Previous(corner_id);
  100|       |  // Get the encoded data ids from the next and previous corners.
  101|       |  // The data id is the encoding order of the UV coordinates.
  102|   154k|  int next_data_id, prev_data_id;
  103|       |
  104|   154k|  int next_vert_id, prev_vert_id;
  105|   154k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   154k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   154k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   154k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   154k|  typedef VectorD<int64_t, 2> Vec2;
  112|   154k|  typedef VectorD<int64_t, 3> Vec3;
  113|   154k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   154k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 154k, False: 235]
  |  Branch (115:33): [True: 153k, False: 232]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   153k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   153k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   153k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 118k, False: 35.0k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   118k|      predicted_value_[0] = p_uv[0];
  122|   118k|      predicted_value_[1] = p_uv[1];
  123|   118k|      return true;
  124|   118k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  35.0k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  35.0k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  35.0k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  35.0k|    const Vec3 pn = prev_pos - next_pos;
  146|  35.0k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  35.0k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.64k, False: 33.3k]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|  1.64k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.64k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.64k|      const Vec2 pn_uv = p_uv - n_uv;
  156|       |      // Because we perform all computations with integers, we don't explicitly
  157|       |      // compute the normalized factor |s|, but rather we perform all operations
  158|       |      // over UV vectors in a non-normalized coordinate system scaled with a
  159|       |      // scaling factor |pn_norm2_squared|:
  160|       |      //
  161|       |      //      x_uv = X_UV * PN.Norm2Squared()
  162|       |      //
  163|  1.64k|      const int64_t n_uv_absmax_element =
  164|  1.64k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.64k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 34, False: 1.61k]
  ------------------
  166|  1.64k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     34|        return false;
  169|     34|      }
  170|  1.61k|      const int64_t pn_uv_absmax_element =
  171|  1.61k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.61k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 25, False: 1.58k]
  ------------------
  173|  1.61k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     25|        return false;
  176|     25|      }
  177|       |      // Keep the scaled prediction arithmetic in the unsigned domain.
  178|  1.58k|      const Vec2 x_uv = Vec2(Vec2u(n_uv) * pn_norm2_squared +
  179|  1.58k|                             Vec2u(pn_uv) * static_cast<uint64_t>(cn_dot_pn));
  180|  1.58k|      const int64_t pn_absmax_element =
  181|  1.58k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  182|  1.58k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (182:11): [True: 12, False: 1.57k]
  ------------------
  183|  1.58k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  184|       |        // Return false if squared length calculation would overflow.
  185|     12|        return false;
  186|     12|      }
  187|       |
  188|       |      // Compute squared length of vector CX in position coordinate system:
  189|  1.57k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  190|  1.57k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  191|       |
  192|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  193|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  194|       |      //
  195|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  196|       |      //
  197|       |      // To preserve precision, we perform all operations in scaled space as
  198|       |      // explained above, so we want the final vector to be:
  199|       |      //
  200|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  201|       |      //
  202|       |      // We can then rewrite the formula as:
  203|       |      //
  204|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  205|       |      //
  206|  1.57k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  207|       |      // Compute CX.Norm2() * PN.Norm2()
  208|  1.57k|      const uint64_t norm_squared =
  209|  1.57k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  210|       |      // Final cx_uv in the scaled coordinate space.
  211|  1.57k|      cx_uv = cx_uv * norm_squared;
  212|       |
  213|       |      // Predicted uv coordinate is then computed by either adding or
  214|       |      // subtracting CX_UV to/from X_UV.
  215|  1.57k|      Vec2 predicted_uv;
  216|  1.57k|      if (is_encoder_t) {
  ------------------
  |  Branch (216:11): [Folded, False: 1.57k]
  ------------------
  217|       |        // When encoding, compute both possible vectors and determine which one
  218|       |        // results in a better prediction.
  219|       |        // Both vectors need to be transformed back from the scaled space to
  220|       |        // the real UV coordinate space.
  221|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  222|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  223|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  224|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (224:13): [True: 0, False: 0]
  ------------------
  225|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  226|      0|          predicted_uv = predicted_uv_0;
  227|      0|          orientations_.push_back(true);
  228|      0|        } else {
  229|      0|          predicted_uv = predicted_uv_1;
  230|      0|          orientations_.push_back(false);
  231|      0|        }
  232|  1.57k|      } else {
  233|       |        // When decoding the data, we already know which orientation to use.
  234|  1.57k|        if (orientations_.empty()) {
  ------------------
  |  Branch (234:13): [True: 48, False: 1.52k]
  ------------------
  235|     48|          return false;
  236|     48|        }
  237|  1.52k|        const bool orientation = orientations_.back();
  238|  1.52k|        orientations_.pop_back();
  239|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  240|       |        // Note that the result will be the same (for non-overflowing values).
  241|  1.52k|        if (orientation) {
  ------------------
  |  Branch (241:13): [True: 962, False: 566]
  ------------------
  242|    962|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  243|    962|        } else {
  244|    566|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  245|    566|        }
  246|  1.52k|      }
  247|  1.52k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  248|  1.52k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  249|  1.52k|      return true;
  250|  1.57k|    }
  251|  35.0k|  }
  252|       |  // Else we don't have available textures on both corners or the position data
  253|       |  // is invalid. For such cases we can't use positions for predicting the uv
  254|       |  // value and we resort to delta coding.
  255|  33.8k|  int data_offset = 0;
  256|  33.8k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (256:7): [True: 33.5k, False: 235]
  ------------------
  257|       |    // Use the value on the previous corner as the prediction.
  258|  33.5k|    data_offset = prev_data_id * kNumComponents;
  259|  33.5k|  }
  260|  33.8k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (260:7): [True: 33.3k, False: 462]
  ------------------
  261|       |    // Use the value on the next corner as the prediction.
  262|  33.3k|    data_offset = next_data_id * kNumComponents;
  263|  33.3k|  } else {
  264|       |    // None of the other corners have a valid value. Use the last encoded value
  265|       |    // as the prediction if possible.
  266|    462|    if (data_id > 0) {
  ------------------
  |  Branch (266:9): [True: 261, False: 201]
  ------------------
  267|    261|      data_offset = (data_id - 1) * kNumComponents;
  268|    261|    } else {
  269|       |      // We are encoding the first value. Predict 0.
  270|    603|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (270:23): [True: 402, False: 201]
  ------------------
  271|    402|        predicted_value_[i] = 0;
  272|    402|      }
  273|    201|      return true;
  274|    201|    }
  275|    462|  }
  276|   100k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (276:19): [True: 67.2k, False: 33.6k]
  ------------------
  277|  67.2k|    predicted_value_[i] = data[data_offset + i];
  278|  67.2k|  }
  279|  33.6k|  return true;
  280|  33.8k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   307k|                                            const DataTypeT* data) const {
   59|   307k|    const int data_offset = entry_id * kNumComponents;
   60|   307k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   307k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|   105k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|   105k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|   105k|    VectorD<int64_t, 3> pos;
   52|   105k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|   105k|                                 &pos[0]);
   54|   105k|    return pos;
   55|   105k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   154k|  const DataTypeT* predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    145|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    460|  bool AreCorrectionsPositive() override {
   71|    460|    return transform_.AreCorrectionsPositive();
   72|    460|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    132|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|    132|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 23, False: 109]
  ------------------
   50|     23|      return false;
   51|     23|    }
   52|    109|    return true;
   53|    132|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  70.6M|  inline Transform& transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    261|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    584|  bool AreCorrectionsPositive() override {
   71|    584|    return transform_.AreCorrectionsPositive();
   72|    584|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    245|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|    245|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 35, False: 210]
  ------------------
   50|     35|      return false;
   51|     35|    }
   52|    210|    return true;
   53|    245|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  19.5M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  5.94k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  4.05k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  5.73k|  bool AreCorrectionsPositive() override {
   71|  5.73k|    return transform_.AreCorrectionsPositive();
   72|  5.73k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  4.54k|  bool DecodePredictionData(DecoderBuffer* buffer) override {
   49|  4.54k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 286, False: 4.26k]
  ------------------
   50|    286|      return false;
   51|    286|    }
   52|  4.26k|    return true;
   53|  4.54k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|   169M|  inline Transform& transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    477|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    605|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    477|                                 const PointCloudDecoder* decoder) {
  188|    477|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    477|      method, att_id, decoder, TransformT());
  190|    477|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    477|                                 const TransformT& transform) {
  156|    477|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 477]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    477|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    477|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 396, False: 81]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|    396|    const MeshDecoder* const mesh_decoder =
  167|    396|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    396|    auto ret = CreateMeshPredictionScheme<
  170|    396|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    396|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    396|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    396|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 332, False: 64]
  ------------------
  174|    332|      return ret;
  175|    332|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    396|  }
  178|       |  // Create delta decoder.
  179|    145|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    145|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    477|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    179|      uint16_t bitstream_version) {
  143|    179|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    179|        method, attribute, transform, mesh_data, bitstream_version);
  145|    179|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    179|        uint16_t bitstream_version) {
  127|    179|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 171, False: 8]
  ------------------
  128|    171|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    171|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    171|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    171|                                                  mesh_data));
  132|    171|      }
  133|      8|      return nullptr;
  134|    179|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    166|      uint16_t bitstream_version) {
  143|    166|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    166|        method, attribute, transform, mesh_data, bitstream_version);
  145|    166|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    166|        uint16_t bitstream_version) {
  127|    166|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 161, False: 5]
  ------------------
  128|    161|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    161|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    161|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    161|                                                  mesh_data));
  132|    161|      }
  133|      5|      return nullptr;
  134|    166|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    605|                                 const PointCloudDecoder* decoder) {
  188|    605|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    605|      method, att_id, decoder, TransformT());
  190|    605|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    605|                                 const TransformT& transform) {
  156|    605|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 605]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    605|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|    605|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 599, False: 6]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|    599|    const MeshDecoder* const mesh_decoder =
  167|    599|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|    599|    auto ret = CreateMeshPredictionScheme<
  170|    599|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    599|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    599|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    599|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 344, False: 255]
  ------------------
  174|    344|      return ret;
  175|    344|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    599|  }
  178|       |  // Create delta decoder.
  179|    261|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    261|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    605|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    182|      uint16_t bitstream_version) {
  143|    182|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    182|        method, attribute, transform, mesh_data, bitstream_version);
  145|    182|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    182|        uint16_t bitstream_version) {
  111|    182|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 172, False: 10]
  ------------------
  112|    172|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    172|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    172|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    172|                                                  mesh_data));
  116|    172|      }
  117|     10|      return nullptr;
  118|    182|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    177|      uint16_t bitstream_version) {
  143|    177|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    177|        method, attribute, transform, mesh_data, bitstream_version);
  145|    177|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    177|        uint16_t bitstream_version) {
  111|    177|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 172, False: 5]
  ------------------
  112|    172|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    172|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    172|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    172|                                                  mesh_data));
  116|    172|      }
  117|      5|      return nullptr;
  118|    177|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  5.94k|                                 const PointCloudDecoder* decoder) {
  188|  5.94k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  5.94k|      method, att_id, decoder, TransformT());
  190|  5.94k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  5.94k|                                 const TransformT& transform) {
  156|  5.94k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 5.94k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  5.94k|  const PointAttribute* const att = decoder->point_cloud()->attribute(att_id);
  160|  5.94k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 5.90k, False: 39]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  5.90k|    const MeshDecoder* const mesh_decoder =
  167|  5.90k|        static_cast<const MeshDecoder*>(decoder);
  168|       |
  169|  5.90k|    auto ret = CreateMeshPredictionScheme<
  170|  5.90k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  5.90k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  5.90k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  5.90k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 5.54k, False: 365]
  ------------------
  174|  5.54k|      return ret;
  175|  5.54k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  5.90k|  }
  178|       |  // Create delta decoder.
  179|    404|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    404|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  5.94k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.54k|      uint16_t bitstream_version) {
  143|  2.54k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.54k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.54k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.54k|        uint16_t bitstream_version) {
   53|  2.54k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 766, False: 1.78k]
  ------------------
   54|    766|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    766|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    766|                                                         MeshDataT>(
   57|    766|                attribute, transform, mesh_data));
   58|    766|      }
   59|  1.78k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.78k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 465, False: 1.31k]
  ------------------
   61|    465|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    465|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    465|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    465|                                                  mesh_data));
   65|    465|      }
   66|  1.31k|#endif
   67|  1.31k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 479, False: 839]
  ------------------
   68|    479|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    479|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    479|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    479|                                                  mesh_data));
   72|    479|      }
   73|    839|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    839|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 212, False: 627]
  ------------------
   75|    212|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    212|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    212|                                                     MeshDataT>(
   78|    212|                attribute, transform, mesh_data, bitstream_version));
   79|    212|      }
   80|    627|#endif
   81|    627|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 394, False: 233]
  ------------------
   82|    394|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    394|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    394|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    394|                                                  mesh_data));
   86|    394|      }
   87|    233|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    233|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 233, False: 0]
  ------------------
   89|    233|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    233|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    233|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    233|                                                  mesh_data));
   93|    233|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.54k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.99k|      uint16_t bitstream_version) {
  143|  2.99k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.99k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.99k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.99k|        uint16_t bitstream_version) {
   53|  2.99k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 699, False: 2.29k]
  ------------------
   54|    699|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    699|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    699|                                                         MeshDataT>(
   57|    699|                attribute, transform, mesh_data));
   58|    699|      }
   59|  2.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.29k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 593, False: 1.70k]
  ------------------
   61|    593|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    593|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    593|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    593|                                                  mesh_data));
   65|    593|      }
   66|  1.70k|#endif
   67|  1.70k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 653, False: 1.04k]
  ------------------
   68|    653|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    653|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    653|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    653|                                                  mesh_data));
   72|    653|      }
   73|  1.04k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|  1.04k|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 223, False: 825]
  ------------------
   75|    223|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    223|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    223|                                                     MeshDataT>(
   78|    223|                attribute, transform, mesh_data, bitstream_version));
   79|    223|      }
   80|    825|#endif
   81|    825|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 289, False: 536]
  ------------------
   82|    289|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    289|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    289|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    289|                                                  mesh_data));
   86|    289|      }
   87|    536|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    536|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 536, False: 0]
  ------------------
   89|    536|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    536|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    536|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    536|                                                  mesh_data));
   93|    536|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.99k|    }

_ZN5draco32PredictionSchemeDecoderInterface24SetMaxNumPredictedValuesEi:
   38|  6.10k|  virtual void SetMaxNumPredictedValues(int32_t num) {};

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    109|    const PointIndex*) {
   50|    109|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    109|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    109|  this->transform().ComputeOriginalValue(zero_vals.get(), in_corr, out_data);
   54|       |
   55|       |  // Decode data from the front using D(i) = D(i) + D(i - 1).
   56|  69.7M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 69.7M, False: 109]
  ------------------
   57|  69.7M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  69.7M|                                           in_corr + i, out_data + i);
   59|  69.7M|  }
   60|    109|  return true;
   61|    109|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    210|    const PointIndex*) {
   50|    210|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    210|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    210|  this->transform().ComputeOriginalValue(zero_vals.get(), in_corr, out_data);
   54|       |
   55|       |  // Decode data from the front using D(i) = D(i) + D(i - 1).
   56|  18.9M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 18.9M, False: 210]
  ------------------
   57|  18.9M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  18.9M|                                           in_corr + i, out_data + i);
   59|  18.9M|  }
   60|    210|  return true;
   61|    210|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    404|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    311|    const PointIndex*) {
   50|    311|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    311|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    311|  this->transform().ComputeOriginalValue(zero_vals.get(), in_corr, out_data);
   54|       |
   55|       |  // Decode data from the front using D(i) = D(i) + D(i - 1).
   56|   161M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 161M, False: 311]
  ------------------
   57|   161M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   161M|                                           in_corr + i, out_data + i);
   59|   161M|  }
   60|    311|  return true;
   61|    311|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    145|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    261|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    396|    uint16_t bitstream_version) {
   38|    396|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    396|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 396, False: 0]
  ------------------
   40|    396|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 6, False: 390]
  ------------------
   41|    390|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 4, False: 386]
  ------------------
   42|    386|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 4, False: 382]
  ------------------
   43|    382|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 381]
  ------------------
   44|    381|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 332, False: 49]
  ------------------
   45|    351|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 4, False: 45]
  ------------------
   46|    351|    const CornerTable* const ct = source->GetCornerTable();
   47|    351|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    351|        source->GetAttributeEncodingData(att_id);
   49|    351|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 6, False: 345]
  |  Branch (49:26): [True: 0, False: 345]
  ------------------
   50|       |      // No connectivity data found.
   51|      6|      return nullptr;
   52|      6|    }
   53|       |    // Connectivity data exists.
   54|    345|    const MeshAttributeCornerTable* const att_ct =
   55|    345|        source->GetAttributeCornerTable(att_id);
   56|    345|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 179, False: 166]
  ------------------
   57|    179|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    179|      MeshData md;
   59|    179|      md.Set(source->mesh(), att_ct,
   60|    179|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    179|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    179|      MeshPredictionSchemeFactoryT factory;
   63|    179|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    179|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 171, False: 8]
  ------------------
   65|    171|        return ret;
   66|    171|      }
   67|    179|    } else {
   68|    166|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    166|      MeshData md;
   70|    166|      md.Set(source->mesh(), ct,
   71|    166|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    166|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    166|      MeshPredictionSchemeFactoryT factory;
   74|    166|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    166|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 161, False: 5]
  ------------------
   76|    161|        return ret;
   77|    161|      }
   78|    166|    }
   79|    345|  }
   80|     58|  return nullptr;
   81|    396|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    599|    uint16_t bitstream_version) {
   38|    599|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|    599|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 599, False: 0]
  ------------------
   40|    599|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 103, False: 496]
  ------------------
   41|    496|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 36, False: 460]
  ------------------
   42|    460|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1, False: 459]
  ------------------
   43|    459|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 3, False: 456]
  ------------------
   44|    456|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 344, False: 112]
  ------------------
   45|    490|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 3, False: 109]
  ------------------
   46|    490|    const CornerTable* const ct = source->GetCornerTable();
   47|    490|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|    490|        source->GetAttributeEncodingData(att_id);
   49|    490|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 131, False: 359]
  |  Branch (49:26): [True: 0, False: 359]
  ------------------
   50|       |      // No connectivity data found.
   51|    131|      return nullptr;
   52|    131|    }
   53|       |    // Connectivity data exists.
   54|    359|    const MeshAttributeCornerTable* const att_ct =
   55|    359|        source->GetAttributeCornerTable(att_id);
   56|    359|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 182, False: 177]
  ------------------
   57|    182|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    182|      MeshData md;
   59|    182|      md.Set(source->mesh(), att_ct,
   60|    182|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    182|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    182|      MeshPredictionSchemeFactoryT factory;
   63|    182|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    182|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 172, False: 10]
  ------------------
   65|    172|        return ret;
   66|    172|      }
   67|    182|    } else {
   68|    177|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    177|      MeshData md;
   70|    177|      md.Set(source->mesh(), ct,
   71|    177|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    177|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    177|      MeshPredictionSchemeFactoryT factory;
   74|    177|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    177|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 172, False: 5]
  ------------------
   76|    172|        return ret;
   77|    172|      }
   78|    177|    }
   79|    359|  }
   80|    124|  return nullptr;
   81|    599|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  5.90k|    uint16_t bitstream_version) {
   38|  5.90k|  const PointAttribute* const att = source->point_cloud()->attribute(att_id);
   39|  5.90k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 5.90k, False: 0]
  ------------------
   40|  5.90k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.49k, False: 4.41k]
  ------------------
   41|  4.41k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1.08k, False: 3.32k]
  ------------------
   42|  3.32k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1.22k, False: 2.10k]
  ------------------
   43|  2.10k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 705, False: 1.39k]
  ------------------
   44|  1.39k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 771, False: 624]
  ------------------
   45|  5.74k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 459, False: 165]
  ------------------
   46|  5.74k|    const CornerTable* const ct = source->GetCornerTable();
   47|  5.74k|    const MeshAttributeIndicesEncodingData* const encoding_data =
   48|  5.74k|        source->GetAttributeEncodingData(att_id);
   49|  5.74k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 200, False: 5.54k]
  |  Branch (49:26): [True: 0, False: 5.54k]
  ------------------
   50|       |      // No connectivity data found.
   51|    200|      return nullptr;
   52|    200|    }
   53|       |    // Connectivity data exists.
   54|  5.54k|    const MeshAttributeCornerTable* const att_ct =
   55|  5.54k|        source->GetAttributeCornerTable(att_id);
   56|  5.54k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 2.54k, False: 2.99k]
  ------------------
   57|  2.54k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  2.54k|      MeshData md;
   59|  2.54k|      md.Set(source->mesh(), att_ct,
   60|  2.54k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  2.54k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  2.54k|      MeshPredictionSchemeFactoryT factory;
   63|  2.54k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  2.54k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 2.54k, False: 0]
  ------------------
   65|  2.54k|        return ret;
   66|  2.54k|      }
   67|  2.99k|    } else {
   68|  2.99k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.99k|      MeshData md;
   70|  2.99k|      md.Set(source->mesh(), ct,
   71|  2.99k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.99k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.99k|      MeshPredictionSchemeFactoryT factory;
   74|  2.99k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.99k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.99k, False: 0]
  ------------------
   76|  2.99k|        return ret;
   77|  2.99k|      }
   78|  2.99k|    }
   79|  5.54k|  }
   80|    165|  return nullptr;
   81|  5.90k|}

_ZN5draco25PredictionSchemeInterfaceD2Ev:
   29|  7.02k|  virtual ~PredictionSchemeInterface() = default;

_ZN5draco62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiE19DecodeTransformDataEPNS_13DecoderBufferE:
   46|    584|  bool DecodeTransformData(DecoderBuffer* buffer) {
   47|    584|    DataTypeT max_quantized_value, center_value;
   48|    584|    if (!buffer->Decode(&max_quantized_value)) {
  ------------------
  |  Branch (48:9): [True: 9, False: 575]
  ------------------
   49|      9|      return false;
   50|      9|    }
   51|    575|    if (!buffer->Decode(&center_value)) {
  ------------------
  |  Branch (51:9): [True: 6, False: 569]
  ------------------
   52|      6|      return false;
   53|      6|    }
   54|    569|    (void)center_value;
   55|    569|    if (!this->set_max_quantized_value(max_quantized_value)) {
  ------------------
  |  Branch (55:9): [True: 34, False: 535]
  ------------------
   56|     34|      return false;
   57|     34|    }
   58|       |    // Account for reading wrong values, e.g., due to fuzzing.
   59|    535|    if (this->quantization_bits() < 2) {
  ------------------
  |  Branch (59:9): [True: 0, False: 535]
  ------------------
   60|      0|      return false;
   61|      0|    }
   62|    535|    if (this->quantization_bits() > 30) {
  ------------------
  |  Branch (62:9): [True: 0, False: 535]
  ------------------
   63|      0|      return false;
   64|      0|    }
   65|    535|    return true;
   66|    535|  }
_ZNK5draco62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiE20ComputeOriginalValueEPKiS3_Pi:
   70|  19.5M|                                   DataType* out_orig_vals) const {
   71|  19.5M|    DRACO_DCHECK_LE(pred_vals[0], 2 * this->center_value());
   72|  19.5M|    DRACO_DCHECK_LE(pred_vals[1], 2 * this->center_value());
   73|  19.5M|    DRACO_DCHECK_LE(corr_vals[0], 2 * this->center_value());
   74|  19.5M|    DRACO_DCHECK_LE(corr_vals[1], 2 * this->center_value());
   75|       |
   76|  19.5M|    DRACO_DCHECK_LE(0, pred_vals[0]);
   77|  19.5M|    DRACO_DCHECK_LE(0, pred_vals[1]);
   78|  19.5M|    DRACO_DCHECK_LE(0, corr_vals[0]);
   79|  19.5M|    DRACO_DCHECK_LE(0, corr_vals[1]);
   80|       |
   81|  19.5M|    const Point2 pred = Point2(pred_vals[0], pred_vals[1]);
   82|  19.5M|    const Point2 corr = Point2(corr_vals[0], corr_vals[1]);
   83|  19.5M|    const Point2 orig = ComputeOriginalValue(pred, corr);
   84|       |
   85|  19.5M|    out_orig_vals[0] = orig[0];
   86|  19.5M|    out_orig_vals[1] = orig[1];
   87|  19.5M|  }
_ZNK5draco62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiE20ComputeOriginalValueENS_7VectorDIiLi2EEES3_:
   90|  19.5M|  Point2 ComputeOriginalValue(Point2 pred, Point2 corr) const {
   91|  19.5M|    const Point2 t(this->center_value(), this->center_value());
   92|  19.5M|    pred = pred - t;
   93|  19.5M|    const bool pred_is_in_diamond = this->IsInDiamond(pred[0], pred[1]);
   94|  19.5M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (94:9): [True: 12.6M, False: 6.94M]
  ------------------
   95|  12.6M|      this->InvertDiamond(&pred[0], &pred[1]);
   96|  12.6M|    }
   97|  19.5M|    const bool pred_is_in_bottom_left = this->IsInBottomLeft(pred);
   98|  19.5M|    const int32_t rotation_count = this->GetRotationCount(pred);
   99|  19.5M|    if (!pred_is_in_bottom_left) {
  ------------------
  |  Branch (99:9): [True: 11.8M, False: 7.68M]
  ------------------
  100|  11.8M|      pred = this->RotatePoint(pred, rotation_count);
  101|  11.8M|    }
  102|  19.5M|    Point2 orig(this->ModMax(AddAsUnsigned(pred[0], corr[0])),
  103|  19.5M|                this->ModMax(AddAsUnsigned(pred[1], corr[1])));
  104|  19.5M|    if (!pred_is_in_bottom_left) {
  ------------------
  |  Branch (104:9): [True: 11.8M, False: 7.68M]
  ------------------
  105|  11.8M|      const int32_t reverse_rotation_count = (4 - rotation_count) % 4;
  106|  11.8M|      orig = this->RotatePoint(orig, reverse_rotation_count);
  107|  11.8M|    }
  108|  19.5M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (108:9): [True: 12.6M, False: 6.94M]
  ------------------
  109|  12.6M|      this->InvertDiamond(&orig[0], &orig[1]);
  110|  12.6M|    }
  111|  19.5M|    orig = orig + t;
  112|  19.5M|    return orig;
  113|  19.5M|  }
_ZN5draco62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiE4InitEi:
   44|    210|  void Init(int num_components) {}
_ZN5draco62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEC2Ev:
   41|    605|  PredictionSchemeNormalOctahedronCanonicalizedDecodingTransform() {}

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  19.5M|  bool IsInBottomLeft(const Point2& p) const {
   93|  19.5M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 11.2M, False: 8.29M]
  |  Branch (93:22): [True: 5.17M, False: 6.08M]
  ------------------
   94|  5.17M|      return true;
   95|  5.17M|    }
   96|  14.3M|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 3.23M, False: 11.1M]
  |  Branch (96:25): [True: 2.50M, False: 726k]
  ------------------
   97|  19.5M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  19.5M|  int32_t GetRotationCount(Point2 pred) const {
   51|  19.5M|    const DataType sign_x = pred[0];
   52|  19.5M|    const DataType sign_y = pred[1];
   53|       |
   54|  19.5M|    int32_t rotation_count = 0;
   55|  19.5M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 11.2M, False: 8.29M]
  ------------------
   56|  11.2M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 5.17M, False: 6.08M]
  ------------------
   57|  5.17M|        rotation_count = 0;
   58|  6.08M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 4.66M, False: 1.41M]
  ------------------
   59|  4.66M|        rotation_count = 3;
   60|  4.66M|      } else {
   61|  1.41M|        rotation_count = 1;
   62|  1.41M|      }
   63|  11.2M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 5.05M, False: 3.23M]
  ------------------
   64|  5.05M|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 4.32M, False: 734k]
  ------------------
   65|  4.32M|        rotation_count = 2;
   66|  4.32M|      } else {
   67|   734k|        rotation_count = 1;
   68|   734k|      }
   69|  5.05M|    } else {
   70|  3.23M|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 2.50M, False: 726k]
  ------------------
   71|  2.50M|        rotation_count = 0;
   72|  2.50M|      } else {
   73|   726k|        rotation_count = 3;
   74|   726k|      }
   75|  3.23M|    }
   76|  19.5M|    return rotation_count;
   77|  19.5M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  23.7M|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  23.7M|    switch (rotation_count) {
   81|  7.54M|      case 1:
  ------------------
  |  Branch (81:7): [True: 7.54M, False: 16.1M]
  ------------------
   82|  7.54M|        return Point2(p[1], -p[0]);
   83|  8.65M|      case 2:
  ------------------
  |  Branch (83:7): [True: 8.65M, False: 15.0M]
  ------------------
   84|  8.65M|        return Point2(-p[0], -p[1]);
   85|  7.54M|      case 3:
  ------------------
  |  Branch (85:7): [True: 7.54M, False: 16.1M]
  ------------------
   86|  7.54M|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 23.7M]
  ------------------
   88|      0|        return p;
   89|  23.7M|    }
   90|  23.7M|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    605|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE19DecodeTransformDataEPNS_13DecoderBufferE:
   45|    460|  bool DecodeTransformData(DecoderBuffer* buffer) {
   46|    460|    DataTypeT max_quantized_value, center_value;
   47|    460|    if (!buffer->Decode(&max_quantized_value)) {
  ------------------
  |  Branch (47:9): [True: 10, False: 450]
  ------------------
   48|     10|      return false;
   49|     10|    }
   50|    450|    if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    450|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (50:9): [True: 70, False: 380]
  ------------------
   51|     70|      if (!buffer->Decode(&center_value)) {
  ------------------
  |  Branch (51:11): [True: 3, False: 67]
  ------------------
   52|      3|        return false;
   53|      3|      }
   54|     70|    }
   55|    447|    (void)center_value;
   56|    447|    return this->set_max_quantized_value(max_quantized_value);
   57|    450|  }
_ZNK5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE20ComputeOriginalValueEPKiS3_Pi:
   61|  70.6M|                                   DataType* out_orig_vals) const {
   62|  70.6M|    DRACO_DCHECK_LE(pred_vals[0], 2 * this->center_value());
   63|  70.6M|    DRACO_DCHECK_LE(pred_vals[1], 2 * this->center_value());
   64|  70.6M|    DRACO_DCHECK_LE(corr_vals[0], 2 * this->center_value());
   65|  70.6M|    DRACO_DCHECK_LE(corr_vals[1], 2 * this->center_value());
   66|       |
   67|  70.6M|    DRACO_DCHECK_LE(0, pred_vals[0]);
   68|  70.6M|    DRACO_DCHECK_LE(0, pred_vals[1]);
   69|  70.6M|    DRACO_DCHECK_LE(0, corr_vals[0]);
   70|  70.6M|    DRACO_DCHECK_LE(0, corr_vals[1]);
   71|       |
   72|  70.6M|    const Point2 pred = Point2(pred_vals[0], pred_vals[1]);
   73|  70.6M|    const Point2 corr = Point2(corr_vals[0], corr_vals[1]);
   74|  70.6M|    const Point2 orig = ComputeOriginalValue(pred, corr);
   75|       |
   76|  70.6M|    out_orig_vals[0] = orig[0];
   77|  70.6M|    out_orig_vals[1] = orig[1];
   78|  70.6M|  }
_ZNK5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE20ComputeOriginalValueENS_7VectorDIiLi2EEERKS3_:
   81|  70.6M|  Point2 ComputeOriginalValue(Point2 pred, const Point2& corr) const {
   82|  70.6M|    const Point2 t(this->center_value(), this->center_value());
   83|  70.6M|    typedef typename std::make_unsigned<DataTypeT>::type UnsignedDataTypeT;
   84|  70.6M|    typedef VectorD<UnsignedDataTypeT, 2> Point2u;
   85|       |
   86|       |    // Perform the addition in unsigned type to avoid signed integer overflow.
   87|       |    // Note that the result will be the same (for non-overflowing values).
   88|  70.6M|    pred = Point2(Point2u(pred) - Point2u(t));
   89|       |
   90|  70.6M|    const bool pred_is_in_diamond = this->IsInDiamond(pred[0], pred[1]);
   91|  70.6M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (91:9): [True: 48.9M, False: 21.7M]
  ------------------
   92|  48.9M|      this->InvertDiamond(&pred[0], &pred[1]);
   93|  48.9M|    }
   94|       |
   95|       |    // Perform the addition in unsigned type to avoid signed integer overflow.
   96|       |    // Note that the result will be the same (for non-overflowing values).
   97|  70.6M|    Point2 orig(Point2u(pred) + Point2u(corr));
   98|       |
   99|  70.6M|    orig[0] = this->ModMax(orig[0]);
  100|  70.6M|    orig[1] = this->ModMax(orig[1]);
  101|  70.6M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (101:9): [True: 48.9M, False: 21.7M]
  ------------------
  102|  48.9M|      this->InvertDiamond(&orig[0], &orig[1]);
  103|  48.9M|    }
  104|       |
  105|       |    // Perform the addition in unsigned type to avoid signed integer overflow.
  106|       |    // Note that the result will be the same (for non-overflowing values).
  107|  70.6M|    orig = Point2(Point2u(orig) + Point2u(t));
  108|  70.6M|    return orig;
  109|  70.6M|  }
_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE4InitEi:
   44|    109|  void Init(int num_components) {}
_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiEC2Ev:
   41|    477|  PredictionSchemeNormalOctahedronDecodingTransform() {}

_ZNK5draco45PredictionSchemeNormalOctahedronTransformBaseIiE22AreCorrectionsPositiveEv:
   49|  1.04k|  bool AreCorrectionsPositive() const { return true; }
_ZN5draco45PredictionSchemeNormalOctahedronTransformBaseIiE23set_max_quantized_valueEi:
   62|  1.01k|  inline bool set_max_quantized_value(DataTypeT max_quantized_value) {
   63|  1.01k|    if (max_quantized_value % 2 == 0) {
  ------------------
  |  Branch (63:9): [True: 29, False: 987]
  ------------------
   64|     29|      return false;
   65|     29|    }
   66|    987|    int q = MostSignificantBit(max_quantized_value) + 1;
   67|    987|    return octahedron_tool_box_.SetQuantizationBits(q);
   68|  1.01k|  }
_ZNK5draco45PredictionSchemeNormalOctahedronTransformBaseIiE17quantization_bitsEv:
   57|  1.67k|  inline int32_t quantization_bits() const {
   58|  1.67k|    return octahedron_tool_box_.quantization_bits();
   59|  1.67k|  }
_ZNK5draco45PredictionSchemeNormalOctahedronTransformBaseIiE12center_valueEv:
   54|   180M|  inline DataTypeT center_value() const {
   55|   180M|    return octahedron_tool_box_.center_value();
   56|   180M|  }
_ZNK5draco45PredictionSchemeNormalOctahedronTransformBaseIiE11IsInDiamondEii:
   70|  90.2M|  bool IsInDiamond(DataTypeT s, DataTypeT t) const {
   71|  90.2M|    return octahedron_tool_box_.IsInDiamond(s, t);
   72|  90.2M|  }
_ZNK5draco45PredictionSchemeNormalOctahedronTransformBaseIiE13InvertDiamondEPiS2_:
   73|   123M|  void InvertDiamond(DataTypeT* s, DataTypeT* t) const {
   74|   123M|    return octahedron_tool_box_.InvertDiamond(s, t);
   75|   123M|  }
_ZNK5draco45PredictionSchemeNormalOctahedronTransformBaseIiE6ModMaxEi:
   77|   180M|  int32_t ModMax(int32_t x) const { return octahedron_tool_box_.ModMax(x); }
_ZN5draco45PredictionSchemeNormalOctahedronTransformBaseIiEC2Ev:
   37|  1.08k|  PredictionSchemeNormalOctahedronTransformBase() {}

_ZN5draco37PredictionSchemeWrapDecodingTransformIiiE19DecodeTransformDataEPNS_13DecoderBufferE:
   65|  5.30k|  bool DecodeTransformData(DecoderBuffer* buffer) {
   66|  5.30k|    DataTypeT min_value, max_value;
   67|  5.30k|    if (!buffer->Decode(&min_value)) {
  ------------------
  |  Branch (67:9): [True: 60, False: 5.24k]
  ------------------
   68|     60|      return false;
   69|     60|    }
   70|  5.24k|    if (!buffer->Decode(&max_value)) {
  ------------------
  |  Branch (70:9): [True: 57, False: 5.18k]
  ------------------
   71|     57|      return false;
   72|     57|    }
   73|  5.18k|    if (min_value > max_value) {
  ------------------
  |  Branch (73:9): [True: 191, False: 4.99k]
  ------------------
   74|    191|      return false;
   75|    191|    }
   76|  4.99k|    this->set_min_value(min_value);
   77|  4.99k|    this->set_max_value(max_value);
   78|  4.99k|    if (!this->InitCorrectionBounds()) {
  ------------------
  |  Branch (78:9): [True: 19, False: 4.97k]
  ------------------
   79|     19|      return false;
   80|     19|    }
   81|  4.97k|    return true;
   82|  4.99k|  }
_ZNK5draco37PredictionSchemeWrapDecodingTransformIiiE20ComputeOriginalValueEPKiS3_Pi:
   38|   169M|                                   DataTypeT* out_original_vals) const {
   39|       |    // For now we assume both |DataTypeT| and |CorrTypeT| are equal.
   40|   169M|    static_assert(std::is_same<DataTypeT, CorrTypeT>::value,
   41|   169M|                  "Predictions and corrections must have the same type.");
   42|       |
   43|       |    // The only valid implementation right now is for int32_t.
   44|   169M|    static_assert(std::is_same<DataTypeT, int32_t>::value,
   45|   169M|                  "Only int32_t is supported for predicted values.");
   46|       |
   47|   169M|    predicted_vals = this->ClampPredictedValue(predicted_vals);
   48|       |
   49|       |    // The sum is computed in int64_t, where it is exact. The encoder keeps each
   50|       |    // correction within half of the span, so the sum lies at most one span
   51|       |    // outside [min, max] and a single wrap gives the original value. Malformed
   52|       |    // corrections cannot overflow int64_t either.
   53|   904M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (53:21): [True: 734M, False: 169M]
  ------------------
   54|   734M|      int64_t value = static_cast<int64_t>(predicted_vals[i]) +
   55|   734M|                      static_cast<int64_t>(corr_vals[i]);
   56|   734M|      if (value > this->max_value()) {
  ------------------
  |  Branch (56:11): [True: 175k, False: 734M]
  ------------------
   57|   175k|        value -= this->max_dif();
   58|   734M|      } else if (value < this->min_value()) {
  ------------------
  |  Branch (58:18): [True: 56.7M, False: 677M]
  ------------------
   59|  56.7M|        value += this->max_dif();
   60|  56.7M|      }
   61|   734M|      out_original_vals[i] = static_cast<DataTypeT>(value);
   62|   734M|    }
   63|   169M|  }
_ZN5draco37PredictionSchemeWrapDecodingTransformIiiEC2Ev:
   32|  5.94k|  PredictionSchemeWrapDecodingTransform() {}

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  5.73k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  4.99k|  inline void set_min_value(const DataTypeT& v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  4.99k|  inline void set_max_value(const DataTypeT& v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  4.99k|  bool InitCorrectionBounds() {
   84|  4.99k|    const int64_t dif =
   85|  4.99k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  4.99k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 4.99k]
  |  Branch (86:20): [True: 19, False: 4.97k]
  ------------------
   87|     19|      return false;
   88|     19|    }
   89|  4.97k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  4.97k|    max_correction_ = max_dif_ / 2;
   91|  4.97k|    min_correction_ = -max_correction_;
   92|  4.97k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 2.19k, False: 2.78k]
  ------------------
   93|  2.19k|      max_correction_ -= 1;
   94|  2.19k|    }
   95|  4.97k|    return true;
   96|  4.99k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  4.22k|  void Init(int num_components) {
   56|  4.22k|    num_components_ = num_components;
   57|  4.22k|    clamped_value_.resize(num_components);
   58|  4.22k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|   169M|      const DataTypeT* predicted_val) const {
   64|   904M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 734M, False: 169M]
  ------------------
   65|   734M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 386k, False: 734M]
  ------------------
   66|   386k|        clamped_value_[i] = max_value_;
   67|   734M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 3.78M, False: 730M]
  ------------------
   68|  3.78M|        clamped_value_[i] = min_value_;
   69|   730M|      } else {
   70|   730M|        clamped_value_[i] = predicted_val[i];
   71|   730M|      }
   72|   734M|    }
   73|   169M|    return clamped_value_.data();
   74|   169M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|  1.80G|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   734M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|  56.9M|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   734M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    666|  int quantization_bits() const {
   78|    666|    DRACO_DCHECK(false);
   79|    666|    return -1;
   80|    666|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  5.94k|      : num_components_(0),
   45|  5.94k|        min_value_(0),
   46|  5.94k|        max_value_(0),
   47|  5.94k|        max_dif_(0),
   48|  5.94k|        max_correction_(0),
   49|  5.94k|        min_correction_(0) {}

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  15.5k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  15.5k|                                      int attribute_id) {
   24|  15.5k|  decoder_ = decoder;
   25|  15.5k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  15.5k|  attribute_id_ = attribute_id;
   27|  15.5k|  return true;
   28|  15.5k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  10.8k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   39|  10.8k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 10.8k]
  ------------------
   40|  10.8k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 10.8k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  10.8k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 2.92k, False: 7.88k]
  ------------------
   44|  2.92k|    return false;
   45|  2.92k|  }
   46|  7.88k|  return true;
   47|  10.8k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  3.07k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  3.07k|  return true;
   53|  3.07k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    153|    const std::vector<PointIndex>& point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    153|  return true;
   59|    153|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  7.15k|const PointAttribute* SequentialAttributeDecoder::GetPortableAttribute() {
   62|       |  // If needed, copy point to attribute value index mapping from the final
   63|       |  // attribute to the portable attribute.
   64|  7.15k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 5.97k, False: 1.18k]
  |  Branch (64:45): [True: 5.86k, False: 111]
  ------------------
   65|  5.86k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 4.61k, False: 1.25k]
  ------------------
   66|  4.61k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  4.61k|    for (PointIndex i(0);
   68|  24.6M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 24.6M, False: 4.61k]
  ------------------
   69|  24.6M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  24.6M|    }
   71|  4.61k|  }
   72|  7.15k|  return portable_attribute_.get();
   73|  7.15k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  7.02k|    PredictionSchemeInterface* ps) {
   77|  9.56k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 2.56k, False: 7.00k]
  ------------------
   78|  2.56k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  2.56k|        ps->GetParentAttributeType(i));
   80|  2.56k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 9, False: 2.55k]
  ------------------
   81|      9|      return false;  // Requested attribute does not exist.
   82|      9|    }
   83|  2.55k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  2.55k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.55k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 2.55k]
  ------------------
   85|      0|      if (!ps->SetParentAttribute(decoder_->point_cloud()->attribute(att_id))) {
  ------------------
  |  Branch (85:11): [True: 0, False: 0]
  ------------------
   86|      0|        return false;
   87|      0|      }
   88|      0|    } else
   89|  2.55k|#endif
   90|  2.55k|    {
   91|  2.55k|      const PointAttribute* const pa = decoder_->GetPortableAttribute(att_id);
   92|  2.55k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 4, False: 2.55k]
  |  Branch (92:28): [True: 15, False: 2.53k]
  ------------------
   93|     19|        return false;
   94|     19|      }
   95|  2.55k|    }
   96|  2.55k|  }
   97|  7.00k|  return true;
   98|  7.02k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    415|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
  102|    415|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    415|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    415|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    415|  uint8_t* const value_data = value_data_ptr.get();
  106|    415|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  4.69k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 4.47k, False: 219]
  ------------------
  109|  4.47k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 196, False: 4.28k]
  ------------------
  110|    196|      return false;
  111|    196|    }
  112|  4.28k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  4.28k|    out_byte_pos += entry_size;
  114|  4.28k|  }
  115|    219|  return true;
  116|    415|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  8.61k|  const PointAttribute* attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   884M|  PointAttribute* attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  7.02k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  31.0k|  PointCloudDecoder* decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  9.75k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  9.75k|    portable_attribute_ = std::move(att);
   71|  9.75k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  33.2k|  PointAttribute* portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  15.5k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  29.9k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  6.43k|    DecoderBuffer* buffer) {
   30|  6.43k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 302, False: 6.13k]
  ------------------
   31|    302|    return false;
   32|    302|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  6.13k|  const int32_t num_attributes = GetNumAttributes();
   35|  6.13k|  sequential_decoders_.resize(num_attributes);
   36|  21.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 15.5k, False: 6.09k]
  ------------------
   37|  15.5k|    uint8_t decoder_type;
   38|  15.5k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 14, False: 15.5k]
  ------------------
   39|     14|      return false;
   40|     14|    }
   41|       |    // Create the decoder from the id.
   42|  15.5k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  15.5k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 8, False: 15.5k]
  ------------------
   44|      8|      return false;
   45|      8|    }
   46|  15.5k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 11, False: 15.5k]
  ------------------
   47|     11|      return false;
   48|     11|    }
   49|  15.5k|  }
   50|  6.09k|  return true;
   51|  6.13k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  5.59k|    DecoderBuffer* buffer) {
   55|  5.59k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 5.59k]
  |  Branch (55:22): [True: 4, False: 5.58k]
  ------------------
   56|      4|    return false;
   57|      4|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  5.58k|  const int32_t num_attributes = GetNumAttributes();
   60|  20.0k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 14.4k, False: 5.58k]
  ------------------
   61|  14.4k|    PointAttribute* const pa =
   62|  14.4k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  14.4k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 1, False: 14.4k]
  ------------------
   64|      1|      return false;
   65|      1|    }
   66|  14.4k|  }
   67|  5.58k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  5.58k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  5.58k|    DecoderBuffer* in_buffer) {
   72|  5.58k|  const int32_t num_attributes = GetNumAttributes();
   73|  13.4k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 10.8k, False: 2.66k]
  ------------------
   74|  10.8k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.92k, False: 7.88k]
  ------------------
   75|  10.8k|                                                          in_buffer)) {
   76|  2.92k|      return false;
   77|  2.92k|    }
   78|  10.8k|  }
   79|  2.66k|  return true;
   80|  5.58k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.66k|    DecodeDataNeededByPortableTransforms(DecoderBuffer* in_buffer) {
   84|  2.66k|  const int32_t num_attributes = GetNumAttributes();
   85|  6.25k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 4.08k, False: 2.17k]
  ------------------
   86|  4.08k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 487, False: 3.59k]
  ------------------
   87|  4.08k|            point_ids_, in_buffer)) {
   88|    487|      return false;
   89|    487|    }
   90|  4.08k|  }
   91|  2.17k|  return true;
   92|  2.66k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  2.17k|    TransformAttributesToOriginalFormat() {
   96|  2.17k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.67k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.10k, False: 1.57k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  3.10k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 3.10k, False: 0]
  ------------------
  100|  3.10k|      const PointAttribute* const attribute =
  101|  3.10k|          sequential_decoders_[i]->attribute();
  102|  3.10k|      const PointAttribute* const portable_attribute =
  103|  3.10k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  3.10k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 2.95k, False: 153]
  |  Branch (104:11): [True: 0, False: 3.10k]
  ------------------
  105|  2.95k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 0, False: 2.95k]
  ------------------
  106|  2.95k|              attribute->attribute_type(), "skip_attribute_transform", false)) {
  107|       |        // Attribute transform should not be performed. In this case, we replace
  108|       |        // the output geometry attribute with the portable attribute.
  109|       |        // TODO(ostava): We can potentially avoid this copy by introducing a new
  110|       |        // mechanism that would allow to use the final attributes as portable
  111|       |        // attributes for predictors that may need them.
  112|      0|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|      0|        continue;
  114|      0|      }
  115|  3.10k|    }
  116|  3.10k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 603, False: 2.50k]
  ------------------
  117|  3.10k|            point_ids_)) {
  118|    603|      return false;
  119|    603|    }
  120|  3.10k|  }
  121|  1.57k|  return true;
  122|  2.17k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  15.5k|    uint8_t decoder_type) {
  127|  15.5k|  switch (decoder_type) {
  128|    959|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 959, False: 14.5k]
  ------------------
  129|    959|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|    959|          new SequentialAttributeDecoder());
  131|  12.7k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 12.7k, False: 2.79k]
  ------------------
  132|  12.7k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  12.7k|          new SequentialIntegerAttributeDecoder());
  134|    484|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 484, False: 15.0k]
  ------------------
  135|    484|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    484|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.34k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.34k, False: 14.1k]
  ------------------
  139|  1.34k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.34k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      8|    default:
  ------------------
  |  Branch (142:5): [True: 8, False: 15.5k]
  ------------------
  143|      8|      break;
  144|  15.5k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      8|  return nullptr;
  147|  15.5k|}

_ZN5draco37SequentialAttributeDecodersController20GetPortableAttributeEi:
   38|  2.55k|      int32_t point_attribute_id) override {
   39|  2.55k|    const int32_t loc_id = GetLocalIdForPointAttribute(point_attribute_id);
   40|  2.55k|    if (loc_id < 0) {
  ------------------
  |  Branch (40:9): [True: 0, False: 2.55k]
  ------------------
   41|      0|      return nullptr;
   42|      0|    }
   43|  2.55k|    return sequential_decoders_[loc_id]->GetPortableAttribute();
   44|  2.55k|  }

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  14.5k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() =
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   27|  14.5k|                                             int attribute_id) {
   28|  14.5k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (28:7): [True: 0, False: 14.5k]
  ------------------
   29|      0|    return false;
   30|      0|  }
   31|  14.5k|  return true;
   32|  14.5k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   35|  2.95k|    const std::vector<PointIndex>& point_ids) {
   36|  2.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   37|  2.95k|  if (decoder() &&
  ------------------
  |  Branch (37:7): [True: 2.95k, False: 0]
  ------------------
   38|  2.95k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (38:7): [True: 1, False: 2.94k]
  ------------------
   39|      1|    return true;  // Don't revert the transform here for older files.
   40|      1|  }
   41|  2.94k|#endif
   42|  2.94k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   43|  2.95k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   46|  10.3k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   47|       |  // Decode prediction scheme.
   48|  10.3k|  int8_t prediction_scheme_method;
   49|  10.3k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (49:7): [True: 194, False: 10.1k]
  ------------------
   50|    194|    return false;
   51|    194|  }
   52|       |  // Check that decoded prediction scheme method type is valid.
   53|  10.1k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (53:7): [True: 80, False: 10.1k]
  ------------------
   54|  10.1k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (54:7): [True: 161, False: 9.95k]
  ------------------
   55|    241|    return false;
   56|    241|  }
   57|  9.95k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (57:7): [True: 9.82k, False: 132]
  ------------------
   58|  9.82k|    int8_t prediction_transform_type;
   59|  9.82k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (59:9): [True: 75, False: 9.74k]
  ------------------
   60|     75|      return false;
   61|     75|    }
   62|       |    // Check that decoded prediction scheme transform type is valid.
   63|  9.74k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (63:9): [True: 22, False: 9.72k]
  ------------------
   64|  9.72k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (64:9): [True: 73, False: 9.65k]
  ------------------
   65|     95|      return false;
   66|     95|    }
   67|  9.65k|    prediction_scheme_ = CreateIntPredictionScheme(
   68|  9.65k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   69|  9.65k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   70|  9.65k|  }
   71|       |
   72|  9.78k|  if (prediction_scheme_) {
  ------------------
  |  Branch (72:7): [True: 7.02k, False: 2.75k]
  ------------------
   73|  7.02k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (73:9): [True: 28, False: 7.00k]
  ------------------
   74|     28|      return false;
   75|     28|    }
   76|  7.02k|  }
   77|       |
   78|  9.75k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (78:7): [True: 2.09k, False: 7.66k]
  ------------------
   79|  2.09k|    return false;
   80|  2.09k|  }
   81|       |
   82|  7.66k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   83|  7.66k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   84|  7.66k|  if (decoder() &&
  ------------------
  |  Branch (84:7): [True: 7.66k, False: 0]
  ------------------
   85|  7.66k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  7.66k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (85:7): [True: 2, False: 7.66k]
  ------------------
   86|       |    // For older files, revert the transform right after we decode the data.
   87|      2|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (87:9): [True: 1, False: 1]
  ------------------
   88|      1|      return false;
   89|      1|    }
   90|      2|  }
   91|  7.66k|#endif
   92|  7.66k|  return true;
   93|  7.66k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   98|  8.50k|    PredictionSchemeTransformType transform_type) {
   99|  8.50k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (99:7): [True: 2.56k, False: 5.94k]
  ------------------
  100|  2.56k|    return nullptr;  // For now we support only wrap transform.
  101|  2.56k|  }
  102|  5.94k|  return CreatePredictionSchemeForDecoder<
  103|  5.94k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  104|  5.94k|      method, attribute_id(), decoder());
  105|  8.50k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  108|  9.75k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
  109|  9.75k|  const int num_components = GetNumValueComponents();
  110|  9.75k|  if (num_components <= 0) {
  ------------------
  |  Branch (110:7): [True: 0, False: 9.75k]
  ------------------
  111|      0|    return false;
  112|      0|  }
  113|  9.75k|  const size_t num_entries = point_ids.size();
  114|  9.75k|  const size_t num_values = num_entries * num_components;
  115|  9.75k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  116|  9.75k|  int32_t* const portable_attribute_data = GetPortableAttributeData();
  117|  9.75k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (117:7): [True: 9, False: 9.74k]
  ------------------
  118|      9|    return false;
  119|      9|  }
  120|  9.74k|  uint8_t compressed;
  121|  9.74k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (121:7): [True: 36, False: 9.71k]
  ------------------
  122|     36|    return false;
  123|     36|  }
  124|  9.71k|  if (compressed > 0) {
  ------------------
  |  Branch (124:7): [True: 729, False: 8.98k]
  ------------------
  125|       |    // Decode compressed values.
  126|    729|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (126:9): [True: 272, False: 457]
  ------------------
  127|    729|                       in_buffer,
  128|    729|                       reinterpret_cast<uint32_t*>(portable_attribute_data))) {
  129|    272|      return false;
  130|    272|    }
  131|  8.98k|  } else {
  132|       |    // Decode the integer data directly.
  133|       |    // Get the number of bytes for a given entry.
  134|  8.98k|    uint8_t num_bytes;
  135|  8.98k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (135:9): [True: 12, False: 8.97k]
  ------------------
  136|     12|      return false;
  137|     12|    }
  138|  8.97k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (138:9): [True: 390, False: 8.58k]
  ------------------
  139|    390|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (139:11): [True: 0, False: 390]
  ------------------
  140|    390|          sizeof(int32_t) * num_values) {
  141|      0|        return false;
  142|      0|      }
  143|    390|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (143:11): [True: 5, False: 385]
  ------------------
  144|    390|                             sizeof(int32_t) * num_values)) {
  145|      5|        return false;
  146|      5|      }
  147|  8.58k|    } else {
  148|  8.58k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (148:11): [True: 31, False: 8.54k]
  ------------------
  149|  8.58k|          num_bytes * num_values) {
  150|     31|        return false;
  151|     31|      }
  152|  8.54k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (152:11): [True: 38, False: 8.51k]
  ------------------
  153|  8.54k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  154|     38|        return false;
  155|     38|      }
  156|  3.34G|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (156:26): [True: 3.34G, False: 8.51k]
  ------------------
  157|  3.34G|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (157:13): [True: 0, False: 3.34G]
  ------------------
  158|      0|          return false;
  159|      0|        }
  160|  3.34G|      }
  161|  8.51k|    }
  162|  8.97k|  }
  163|       |
  164|  9.35k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (164:7): [True: 9.35k, False: 0]
  |  Branch (164:26): [True: 2.57k, False: 6.77k]
  ------------------
  165|  8.30k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (165:26): [True: 5.73k, False: 1.04k]
  ------------------
  166|       |    // Convert the values back to the original signed format.
  167|  8.30k|    ConvertSymbolsToSignedInts(
  168|  8.30k|        reinterpret_cast<const uint32_t*>(portable_attribute_data),
  169|  8.30k|        static_cast<int>(num_values), portable_attribute_data);
  170|  8.30k|  }
  171|       |
  172|       |  // If the data was encoded with a prediction scheme, we must revert it.
  173|  9.35k|  if (prediction_scheme_) {
  ------------------
  |  Branch (173:7): [True: 6.77k, False: 2.57k]
  ------------------
  174|  6.77k|    prediction_scheme_->SetMaxNumPredictedValues(num_values);
  175|  6.77k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (175:9): [True: 919, False: 5.85k]
  ------------------
  176|    919|      return false;
  177|    919|    }
  178|       |
  179|  5.85k|    if (num_values > 0) {
  ------------------
  |  Branch (179:9): [True: 5.85k, False: 0]
  ------------------
  180|  5.85k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (180:11): [True: 769, False: 5.08k]
  ------------------
  181|  5.85k|              portable_attribute_data, portable_attribute_data,
  182|  5.85k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  183|    769|        return false;
  184|    769|      }
  185|  5.85k|    }
  186|  5.85k|  }
  187|  7.66k|  return true;
  188|  9.35k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  190|  2.45k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  191|  2.45k|  switch (attribute()->data_type()) {
  192|    299|    case DT_UINT8:
  ------------------
  |  Branch (192:5): [True: 299, False: 2.15k]
  ------------------
  193|    299|      StoreTypedValues<uint8_t>(num_values);
  194|    299|      break;
  195|    785|    case DT_INT8:
  ------------------
  |  Branch (195:5): [True: 785, False: 1.67k]
  ------------------
  196|    785|      StoreTypedValues<int8_t>(num_values);
  197|    785|      break;
  198|    204|    case DT_UINT16:
  ------------------
  |  Branch (198:5): [True: 204, False: 2.25k]
  ------------------
  199|    204|      StoreTypedValues<uint16_t>(num_values);
  200|    204|      break;
  201|    424|    case DT_INT16:
  ------------------
  |  Branch (201:5): [True: 424, False: 2.03k]
  ------------------
  202|    424|      StoreTypedValues<int16_t>(num_values);
  203|    424|      break;
  204|    324|    case DT_UINT32:
  ------------------
  |  Branch (204:5): [True: 324, False: 2.13k]
  ------------------
  205|    324|      StoreTypedValues<uint32_t>(num_values);
  206|    324|      break;
  207|    103|    case DT_INT32:
  ------------------
  |  Branch (207:5): [True: 103, False: 2.35k]
  ------------------
  208|    103|      StoreTypedValues<int32_t>(num_values);
  209|    103|      break;
  210|    317|    default:
  ------------------
  |  Branch (210:5): [True: 317, False: 2.13k]
  ------------------
  211|    317|      return false;
  212|  2.45k|  }
  213|  2.13k|  return true;
  214|  2.45k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  238|  9.75k|    int num_entries, int num_components) {
  239|  9.75k|  GeometryAttribute ga;
  240|  9.75k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  241|  9.75k|          false, num_components * DataTypeLength(DT_INT32), 0);
  242|  9.75k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  243|  9.75k|  port_att->SetIdentityMapping();
  244|  9.75k|  port_att->Reset(num_entries);
  245|  9.75k|  port_att->set_unique_id(attribute()->unique_id());
  246|  9.75k|  SetPortableAttribute(std::move(port_att));
  247|  9.75k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  217|    299|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    299|  const int num_components = attribute()->num_components();
  219|    299|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    299|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    299|      new AttributeTypeT[num_components]);
  222|    299|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    299|  int val_id = 0;
  224|    299|  int out_byte_pos = 0;
  225|   250M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 250M, False: 299]
  ------------------
  226|   955M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 705M, False: 250M]
  ------------------
  227|   705M|      const AttributeTypeT value =
  228|   705M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   705M|      att_val[c] = value;
  230|   705M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   250M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   250M|    out_byte_pos += entry_size;
  234|   250M|  }
  235|    299|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  217|    785|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    785|  const int num_components = attribute()->num_components();
  219|    785|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    785|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    785|      new AttributeTypeT[num_components]);
  222|    785|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    785|  int val_id = 0;
  224|    785|  int out_byte_pos = 0;
  225|   215M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 215M, False: 785]
  ------------------
  226|   626M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 411M, False: 215M]
  ------------------
  227|   411M|      const AttributeTypeT value =
  228|   411M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   411M|      att_val[c] = value;
  230|   411M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   215M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   215M|    out_byte_pos += entry_size;
  234|   215M|  }
  235|    785|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  217|    204|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    204|  const int num_components = attribute()->num_components();
  219|    204|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    204|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    204|      new AttributeTypeT[num_components]);
  222|    204|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    204|  int val_id = 0;
  224|    204|  int out_byte_pos = 0;
  225|   208M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 208M, False: 204]
  ------------------
  226|   857M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 648M, False: 208M]
  ------------------
  227|   648M|      const AttributeTypeT value =
  228|   648M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   648M|      att_val[c] = value;
  230|   648M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   208M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   208M|    out_byte_pos += entry_size;
  234|   208M|  }
  235|    204|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  217|    424|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    424|  const int num_components = attribute()->num_components();
  219|    424|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    424|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    424|      new AttributeTypeT[num_components]);
  222|    424|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    424|  int val_id = 0;
  224|    424|  int out_byte_pos = 0;
  225|  3.75M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 3.75M, False: 424]
  ------------------
  226|   282M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 278M, False: 3.75M]
  ------------------
  227|   278M|      const AttributeTypeT value =
  228|   278M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   278M|      att_val[c] = value;
  230|   278M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  3.75M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  3.75M|    out_byte_pos += entry_size;
  234|  3.75M|  }
  235|    424|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  217|    324|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    324|  const int num_components = attribute()->num_components();
  219|    324|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    324|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    324|      new AttributeTypeT[num_components]);
  222|    324|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    324|  int val_id = 0;
  224|    324|  int out_byte_pos = 0;
  225|  99.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 99.7M, False: 324]
  ------------------
  226|   267M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 167M, False: 99.7M]
  ------------------
  227|   167M|      const AttributeTypeT value =
  228|   167M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   167M|      att_val[c] = value;
  230|   167M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|  99.7M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|  99.7M|    out_byte_pos += entry_size;
  234|  99.7M|  }
  235|    324|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  217|    103|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  218|    103|  const int num_components = attribute()->num_components();
  219|    103|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  220|    103|  const std::unique_ptr<AttributeTypeT[]> att_val(
  221|    103|      new AttributeTypeT[num_components]);
  222|    103|  const int32_t* const portable_attribute_data = GetPortableAttributeData();
  223|    103|  int val_id = 0;
  224|    103|  int out_byte_pos = 0;
  225|   106M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (225:24): [True: 106M, False: 103]
  ------------------
  226|   824M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (226:21): [True: 717M, False: 106M]
  ------------------
  227|   717M|      const AttributeTypeT value =
  228|   717M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  229|   717M|      att_val[c] = value;
  230|   717M|    }
  231|       |    // Store the integer value into the attribute buffer.
  232|   106M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  233|   106M|    out_byte_pos += entry_size;
  234|   106M|  }
  235|    103|}

_ZNK5draco33SequentialIntegerAttributeDecoder21GetNumValueComponentsEv:
   47|  8.61k|  virtual int32_t GetNumValueComponents() const {
   48|  8.61k|    return attribute()->num_components();
   49|  8.61k|  }
_ZN5draco33SequentialIntegerAttributeDecoder24GetPortableAttributeDataEv:
   57|  11.8k|  int32_t* GetPortableAttributeData() {
   58|  11.8k|    if (portable_attribute()->size() == 0) {
  ------------------
  |  Branch (58:9): [True: 9, False: 11.8k]
  ------------------
   59|      9|      return nullptr;
   60|      9|    }
   61|  11.8k|    return reinterpret_cast<int32_t*>(
   62|  11.8k|        portable_attribute()->GetAddress(AttributeValueIndex(0)));
   63|  11.8k|  }

_ZN5draco32SequentialNormalAttributeDecoderC2Ev:
   21|  1.34k|SequentialNormalAttributeDecoder::SequentialNormalAttributeDecoder() = default;
_ZN5draco32SequentialNormalAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   24|  1.34k|                                            int attribute_id) {
   25|  1.34k|  if (!SequentialIntegerAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (25:7): [True: 0, False: 1.34k]
  ------------------
   26|      0|    return false;
   27|      0|  }
   28|       |  // Currently, this encoder works only for 3-component normal vectors.
   29|  1.34k|  if (attribute()->num_components() != 3) {
  ------------------
  |  Branch (29:7): [True: 2, False: 1.34k]
  ------------------
   30|      2|    return false;
   31|      2|  }
   32|       |  // Also the data type must be DT_FLOAT32.
   33|  1.34k|  if (attribute()->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (33:7): [True: 2, False: 1.34k]
  ------------------
   34|      2|    return false;
   35|      2|  }
   36|  1.34k|  return true;
   37|  1.34k|}
_ZN5draco32SequentialNormalAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   40|  1.14k|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   41|  1.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   42|  1.14k|  if (decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (42:7): [True: 0, False: 1.14k]
  ------------------
   43|       |    // Note: in older bitstreams, we do not have a PortableAttribute() decoded
   44|       |    // at this stage so we cannot pass it down to the DecodeParameters() call.
   45|       |    // It still works fine for octahedral transform because it does not need to
   46|       |    // use any data from the attribute.
   47|      0|    if (!octahedral_transform_.DecodeParameters(*attribute(), in_buffer)) {
  ------------------
  |  Branch (47:9): [True: 0, False: 0]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|      0|  }
   51|  1.14k|#endif
   52|  1.14k|  return SequentialIntegerAttributeDecoder::DecodeIntegerValues(point_ids,
   53|  1.14k|                                                                in_buffer);
   54|  1.14k|}
_ZN5draco32SequentialNormalAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   57|    836|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   58|    836|  if (decoder()->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    836|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (58:7): [True: 836, False: 0]
  ------------------
   59|       |    // For newer file version, decode attribute transform data here.
   60|    836|    if (!octahedral_transform_.DecodeParameters(*GetPortableAttribute(),
  ------------------
  |  Branch (60:9): [True: 397, False: 439]
  ------------------
   61|    836|                                                in_buffer)) {
   62|    397|      return false;
   63|    397|    }
   64|    836|  }
   65|       |
   66|       |  // Store the decoded transform data in portable attribute.
   67|    439|  return octahedral_transform_.TransferToAttribute(portable_attribute());
   68|    836|}
_ZN5draco32SequentialNormalAttributeDecoder11StoreValuesEj:
   70|    421|bool SequentialNormalAttributeDecoder::StoreValues(uint32_t num_points) {
   71|       |  // Convert all quantized values back to floats.
   72|    421|  return octahedral_transform_.InverseTransformAttribute(
   73|    421|      *GetPortableAttribute(), attribute());
   74|    421|}

_ZNK5draco32SequentialNormalAttributeDecoder21GetNumValueComponentsEv:
   35|  1.14k|  int32_t GetNumValueComponents() const override {
   36|  1.14k|    return 2;  // We quantize everything into two components.
   37|  1.14k|  }
_ZN5draco32SequentialNormalAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   51|  1.14k|      PredictionSchemeTransformType transform_type) override {
   52|  1.14k|    switch (transform_type) {
   53|      0|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   54|    477|      case PREDICTION_TRANSFORM_NORMAL_OCTAHEDRON: {
  ------------------
  |  Branch (54:7): [True: 477, False: 671]
  ------------------
   55|    477|        typedef PredictionSchemeNormalOctahedronDecodingTransform<int32_t>
   56|    477|            Transform;
   57|       |        // At this point the decoder has not read the quantization bits,
   58|       |        // which is why we must construct the transform by default.
   59|       |        // See Transform.DecodeTransformData for more details.
   60|    477|        return CreatePredictionSchemeForDecoder<int32_t, Transform>(
   61|    477|            method, attribute_id(), decoder());
   62|      0|      }
   63|      0|#endif
   64|    605|      case PREDICTION_TRANSFORM_NORMAL_OCTAHEDRON_CANONICALIZED: {
  ------------------
  |  Branch (64:7): [True: 605, False: 543]
  ------------------
   65|    605|        typedef PredictionSchemeNormalOctahedronCanonicalizedDecodingTransform<
   66|    605|            int32_t>
   67|    605|            Transform;
   68|       |        // At this point the decoder has not read the quantization bits,
   69|       |        // which is why we must construct the transform by default.
   70|       |        // See Transform.DecodeTransformData for more details.
   71|    605|        return CreatePredictionSchemeForDecoder<int32_t, Transform>(
   72|    605|            method, attribute_id(), decoder());
   73|      0|      }
   74|     66|      default:
  ------------------
  |  Branch (74:7): [True: 66, False: 1.08k]
  ------------------
   75|     66|        return nullptr;  // Currently, we support only octahedron transform and
   76|       |                         // octahedron transform canonicalized.
   77|  1.14k|    }
   78|  1.14k|  }

_ZN5draco38SequentialQuantizationAttributeDecoderC2Ev:
   22|    484|    SequentialQuantizationAttributeDecoder() = default;
_ZN5draco38SequentialQuantizationAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   25|    484|                                                  int attribute_id) {
   26|    484|  if (!SequentialIntegerAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (26:7): [True: 0, False: 484]
  ------------------
   27|      0|    return false;
   28|      0|  }
   29|    484|  const PointAttribute* const attribute =
   30|    484|      decoder->point_cloud()->attribute(attribute_id);
   31|       |  // Currently we can quantize only floating point arguments.
   32|    484|  if (attribute->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (32:7): [True: 7, False: 477]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|    477|  return true;
   36|    484|}
_ZN5draco38SequentialQuantizationAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   39|    446|    const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   40|    446|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   41|    446|  if (decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0) &&
  ------------------
  |  |  115|    892|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (41:7): [True: 3, False: 443]
  ------------------
   42|      3|      !DecodeQuantizedDataInfo()) {
  ------------------
  |  Branch (42:7): [True: 2, False: 1]
  ------------------
   43|      2|    return false;
   44|      2|  }
   45|    444|#endif
   46|    444|  return SequentialIntegerAttributeDecoder::DecodeIntegerValues(point_ids,
   47|    444|                                                                in_buffer);
   48|    446|}
_ZN5draco38SequentialQuantizationAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   52|    167|        const std::vector<PointIndex>& point_ids, DecoderBuffer* in_buffer) {
   53|    167|  if (decoder()->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    167|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (53:7): [True: 167, False: 0]
  ------------------
   54|       |    // Decode quantization data here only for files with bitstream version 2.0+
   55|    167|    if (!DecodeQuantizedDataInfo()) {
  ------------------
  |  Branch (55:9): [True: 90, False: 77]
  ------------------
   56|     90|      return false;
   57|     90|    }
   58|    167|  }
   59|       |
   60|       |  // Store the decoded transform data in portable attribute;
   61|     77|  return quantization_transform_.TransferToAttribute(portable_attribute());
   62|    167|}
_ZN5draco38SequentialQuantizationAttributeDecoder11StoreValuesEj:
   64|     74|bool SequentialQuantizationAttributeDecoder::StoreValues(uint32_t num_points) {
   65|     74|  return DequantizeValues(num_points);
   66|     74|}
_ZN5draco38SequentialQuantizationAttributeDecoder23DecodeQuantizedDataInfoEv:
   68|    170|bool SequentialQuantizationAttributeDecoder::DecodeQuantizedDataInfo() {
   69|       |  // Get attribute used as source for decoding.
   70|    170|  auto att = GetPortableAttribute();
   71|    170|  if (att == nullptr) {
  ------------------
  |  Branch (71:7): [True: 3, False: 167]
  ------------------
   72|       |    // This should happen only in the backward compatibility mode. It will still
   73|       |    // work fine for this case because the only thing the quantization transform
   74|       |    // cares about is the number of components that is the same for both source
   75|       |    // and target attributes.
   76|      3|    att = attribute();
   77|      3|  }
   78|    170|  return quantization_transform_.DecodeParameters(*att, decoder()->buffer());
   79|    170|}
_ZN5draco38SequentialQuantizationAttributeDecoder16DequantizeValuesEj:
   82|     74|    uint32_t num_values) {
   83|       |  // Convert all quantized values back to floats.
   84|     74|  return quantization_transform_.InverseTransformAttribute(
   85|     74|      *GetPortableAttribute(), attribute());
   86|     74|}

_ZN5draco16DirectBitDecoderC2Ev:
   19|  8.39k|DirectBitDecoder::DirectBitDecoder() : pos_(bits_.end()), num_used_bits_(0) {}
_ZN5draco16DirectBitDecoderD2Ev:
   21|  8.39k|DirectBitDecoder::~DirectBitDecoder() { Clear(); }
_ZN5draco16DirectBitDecoder13StartDecodingEPNS_13DecoderBufferE:
   23|  3.67k|bool DirectBitDecoder::StartDecoding(DecoderBuffer* source_buffer) {
   24|  3.67k|  Clear();
   25|  3.67k|  uint32_t size_in_bytes;
   26|  3.67k|  if (!source_buffer->Decode(&size_in_bytes)) {
  ------------------
  |  Branch (26:7): [True: 44, False: 3.63k]
  ------------------
   27|     44|    return false;
   28|     44|  }
   29|       |
   30|       |  // Check that size_in_bytes is > 0 and a multiple of 4 as the encoder always
   31|       |  // encodes 32 bit elements.
   32|  3.63k|  if (size_in_bytes == 0 || size_in_bytes & 0x3) {
  ------------------
  |  Branch (32:7): [True: 15, False: 3.62k]
  |  Branch (32:29): [True: 98, False: 3.52k]
  ------------------
   33|    113|    return false;
   34|    113|  }
   35|  3.52k|  if (size_in_bytes > source_buffer->remaining_size()) {
  ------------------
  |  Branch (35:7): [True: 102, False: 3.42k]
  ------------------
   36|    102|    return false;
   37|    102|  }
   38|  3.42k|  const uint32_t num_32bit_elements = size_in_bytes / 4;
   39|  3.42k|  bits_.resize(num_32bit_elements);
   40|  3.42k|  if (!source_buffer->Decode(bits_.data(), size_in_bytes)) {
  ------------------
  |  Branch (40:7): [True: 0, False: 3.42k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  3.42k|  pos_ = bits_.begin();
   44|  3.42k|  num_used_bits_ = 0;
   45|  3.42k|  return true;
   46|  3.42k|}
_ZN5draco16DirectBitDecoder5ClearEv:
   48|  12.0k|void DirectBitDecoder::Clear() {
   49|  12.0k|  bits_.clear();
   50|  12.0k|  num_used_bits_ = 0;
   51|  12.0k|  pos_ = bits_.end();
   52|  12.0k|}

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  8.48M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t* value) {
   51|  8.48M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  8.48M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  8.48M|    const int remaining = 32 - num_used_bits_;
   54|  8.48M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 8.05M, False: 425k]
  ------------------
   55|  8.05M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 7.52M, False: 535k]
  ------------------
   56|  7.52M|        return false;
   57|  7.52M|      }
   58|   535k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   535k|      num_used_bits_ += nbits;
   60|   535k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 17.6k, False: 517k]
  ------------------
   61|  17.6k|        ++pos_;
   62|  17.6k|        num_used_bits_ = 0;
   63|  17.6k|      }
   64|   535k|    } else {
   65|   425k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 413k, False: 12.1k]
  ------------------
   66|   413k|        return false;
   67|   413k|      }
   68|  12.1k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  12.1k|      num_used_bits_ = nbits - remaining;
   70|  12.1k|      ++pos_;
   71|  12.1k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  12.1k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  12.1k|    }
   74|   547k|    return true;
   75|  8.48M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  8.80M|  bool DecodeNextBit() {
   35|  8.80M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  8.80M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 8.32M, False: 485k]
  ------------------
   37|  8.32M|      return false;
   38|  8.32M|    }
   39|   485k|    const bool bit = *pos_ & selector;
   40|   485k|    ++num_used_bits_;
   41|   485k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 14.9k, False: 470k]
  ------------------
   42|  14.9k|      ++pos_;
   43|  14.9k|      num_used_bits_ = 0;
   44|  14.9k|    }
   45|   485k|    return bit;
   46|  8.80M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    665|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    871|  FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    871|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    544|  bool StartDecoding(DecoderBuffer* source_buffer) {
   34|  12.6k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 12.3k, False: 348]
  ------------------
   35|  12.3k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 196, False: 12.1k]
  ------------------
   36|    196|        return false;
   37|    196|      }
   38|  12.3k|    }
   39|    348|    return bit_decoder_.StartDecoding(source_buffer);
   40|    544|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  3.52M|  void DecodeLeastSignificantBits32(int nbits, uint32_t* value) {
   48|  3.52M|    uint32_t result = 0;
   49|  22.2M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 18.6M, False: 3.52M]
  ------------------
   50|  18.6M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  18.6M|      result = (result << 1) + bit;
   52|  18.6M|    }
   53|  3.52M|    *value = result;
   54|  3.52M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     89|  void EndDecoding() {
   57|  2.93k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 2.84k, False: 89]
  ------------------
   58|  2.84k|      folded_number_decoders_[i].EndDecoding();
   59|  2.84k|    }
   60|     89|    bit_decoder_.EndDecoding();
   61|     89|  }

_ZN5draco14RAnsBitDecoderC2Ev:
   23|  62.4k|RAnsBitDecoder::RAnsBitDecoder() : prob_zero_(0) {}
_ZN5draco14RAnsBitDecoderD2Ev:
   25|  62.4k|RAnsBitDecoder::~RAnsBitDecoder() { Clear(); }
_ZN5draco14RAnsBitDecoder13StartDecodingEPNS_13DecoderBufferE:
   27|  37.7k|bool RAnsBitDecoder::StartDecoding(DecoderBuffer* source_buffer) {
   28|  37.7k|  Clear();
   29|       |
   30|  37.7k|  if (!source_buffer->Decode(&prob_zero_)) {
  ------------------
  |  Branch (30:7): [True: 93, False: 37.6k]
  ------------------
   31|     93|    return false;
   32|     93|  }
   33|       |
   34|  37.6k|  uint32_t size_in_bytes;
   35|  37.6k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  37.6k|  if (source_buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  37.6k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (36:7): [True: 1.29k, False: 36.3k]
  ------------------
   37|  1.29k|    if (!source_buffer->Decode(&size_in_bytes)) {
  ------------------
  |  Branch (37:9): [True: 21, False: 1.27k]
  ------------------
   38|     21|      return false;
   39|     21|    }
   40|       |
   41|  1.29k|  } else
   42|  36.3k|#endif
   43|  36.3k|  {
   44|  36.3k|    if (!DecodeVarint(&size_in_bytes, source_buffer)) {
  ------------------
  |  Branch (44:9): [True: 64, False: 36.3k]
  ------------------
   45|     64|      return false;
   46|     64|    }
   47|  36.3k|  }
   48|       |
   49|  37.5k|  if (size_in_bytes > source_buffer->remaining_size()) {
  ------------------
  |  Branch (49:7): [True: 291, False: 37.2k]
  ------------------
   50|    291|    return false;
   51|    291|  }
   52|       |
   53|  37.2k|  if (ans_read_init(&ans_decoder_,
  ------------------
  |  Branch (53:7): [True: 125, False: 37.1k]
  ------------------
   54|  37.2k|                    reinterpret_cast<uint8_t*>(
   55|  37.2k|                        const_cast<char*>(source_buffer->data_head())),
   56|  37.2k|                    size_in_bytes) != 0) {
   57|    125|    return false;
   58|    125|  }
   59|  37.1k|  source_buffer->Advance(size_in_bytes);
   60|  37.1k|  return true;
   61|  37.2k|}
_ZN5draco14RAnsBitDecoder13DecodeNextBitEv:
   63|   105M|bool RAnsBitDecoder::DecodeNextBit() {
   64|   105M|  const uint8_t bit = rabs_read(&ans_decoder_, prob_zero_);
  ------------------
  |  |  246|   105M|#define rabs_read rabs_desc_read
  ------------------
   65|   105M|  return bit > 0;
   66|   105M|}
_ZN5draco14RAnsBitDecoder28DecodeLeastSignificantBits32EiPj:
   68|  2.21M|void RAnsBitDecoder::DecodeLeastSignificantBits32(int nbits, uint32_t* value) {
   69|  2.21M|  DRACO_DCHECK_EQ(true, nbits <= 32);
   70|  2.21M|  DRACO_DCHECK_EQ(true, nbits > 0);
   71|       |
   72|  2.21M|  uint32_t result = 0;
   73|  8.96M|  while (nbits) {
  ------------------
  |  Branch (73:10): [True: 6.74M, False: 2.21M]
  ------------------
   74|  6.74M|    result = (result << 1) + DecodeNextBit();
   75|  6.74M|    --nbits;
   76|  6.74M|  }
   77|  2.21M|  *value = result;
   78|  2.21M|}
_ZN5draco14RAnsBitDecoder5ClearEv:
   80|   100k|void RAnsBitDecoder::Clear() { ans_read_end(&ans_decoder_); }

_ZN5draco14RAnsBitDecoder11EndDecodingEv:
   44|  11.8k|  void EndDecoding() {}

_ZNK5draco12DracoOptionsINS_17GeometryAttribute4TypeEE16GetAttributeBoolERKS2_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEb:
  195|  3.00k|                                                   bool default_val) const {
  196|  3.00k|  const Options* const att_options = FindAttributeOptions(att_key);
  197|  3.00k|  if (att_options && att_options->IsOptionSet(name)) {
  ------------------
  |  Branch (197:7): [True: 0, False: 3.00k]
  |  Branch (197:22): [True: 0, False: 0]
  ------------------
  198|      0|    return att_options->GetBool(name, default_val);
  199|      0|  }
  200|  3.00k|  return global_options_.GetBool(name, default_val);
  201|  3.00k|}
_ZNK5draco12DracoOptionsINS_17GeometryAttribute4TypeEE20FindAttributeOptionsERKS2_:
  137|  3.00k|    const AttributeKeyT& att_key) const {
  138|  3.00k|  auto it = attribute_options_.find(att_key);
  139|  3.00k|  if (it == attribute_options_.end()) {
  ------------------
  |  Branch (139:7): [True: 3.00k, False: 0]
  ------------------
  140|  3.00k|    return nullptr;
  141|  3.00k|  }
  142|      0|  return &it->second;
  143|  3.00k|}

_ZN5draco23CreatePointCloudDecoderEa:
   33|  3.47k|    int8_t method) {
   34|  3.47k|  if (method == POINT_CLOUD_SEQUENTIAL_ENCODING) {
  ------------------
  |  Branch (34:7): [True: 465, False: 3.00k]
  ------------------
   35|    465|    return std::unique_ptr<PointCloudDecoder>(
   36|    465|        new PointCloudSequentialDecoder());
   37|  3.00k|  } else if (method == POINT_CLOUD_KD_TREE_ENCODING) {
  ------------------
  |  Branch (37:14): [True: 3.00k, False: 9]
  ------------------
   38|  3.00k|    return std::unique_ptr<PointCloudDecoder>(new PointCloudKdTreeDecoder());
   39|  3.00k|  }
   40|      9|  return Status(Status::DRACO_ERROR, "Unsupported encoding method.");
   41|  3.47k|}
_ZN5draco17CreateMeshDecoderEh:
   45|  17.0k|StatusOr<std::unique_ptr<MeshDecoder>> CreateMeshDecoder(uint8_t method) {
   46|  17.0k|  if (method == MESH_SEQUENTIAL_ENCODING) {
  ------------------
  |  Branch (46:7): [True: 5.64k, False: 11.3k]
  ------------------
   47|  5.64k|    return std::unique_ptr<MeshDecoder>(new MeshSequentialDecoder());
   48|  11.3k|  } else if (method == MESH_EDGEBREAKER_ENCODING) {
  ------------------
  |  Branch (48:14): [True: 11.3k, False: 10]
  ------------------
   49|  11.3k|    return std::unique_ptr<MeshDecoder>(new MeshEdgebreakerDecoder());
   50|  11.3k|  }
   51|     10|  return Status(Status::DRACO_ERROR, "Unsupported encoding method.");
   52|  17.0k|}
_ZN5draco7Decoder22GetEncodedGeometryTypeEPNS_13DecoderBufferE:
   56|  20.5k|    DecoderBuffer* in_buffer) {
   57|  20.5k|  DecoderBuffer temp_buffer(*in_buffer);
   58|  20.5k|  DracoHeader header;
   59|  20.5k|  DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header));
  ------------------
  |  |   74|  20.5k|  {                                                   \
  |  |   75|  20.5k|    const draco::Status _local_status = (expression); \
  |  |   76|  20.5k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 53, False: 20.4k]
  |  |  ------------------
  |  |   77|     53|      return _local_status;                           \
  |  |   78|     53|    }                                                 \
  |  |   79|  20.5k|  }
  ------------------
   60|  20.4k|  if (header.encoder_type >= NUM_ENCODED_GEOMETRY_TYPES) {
  ------------------
  |  Branch (60:7): [True: 8, False: 20.4k]
  ------------------
   61|      8|    return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
   62|      8|  }
   63|  20.4k|  return static_cast<EncodedGeometryType>(header.encoder_type);
   64|  20.4k|}
_ZN5draco7Decoder26DecodePointCloudFromBufferEPNS_13DecoderBufferE:
   67|  20.5k|    DecoderBuffer* in_buffer) {
   68|  20.5k|  DRACO_ASSIGN_OR_RETURN(EncodedGeometryType type,
  ------------------
  |  |   66|  20.5k|  DRACO_ASSIGN_OR_RETURN_IMPL_(DRACO_MACROS_IMPL_CONCAT_(_statusor, __LINE__), \
  |  |  ------------------
  |  |  |  |   71|  20.5k|  auto statusor = (expression);                                             \
  |  |  |  |   72|  20.5k|  if (!statusor.ok()) {                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (72:7): [True: 61, False: 20.4k]
  |  |  |  |  ------------------
  |  |  |  |   73|     61|    auto _status = std::move(statusor.status());                            \
  |  |  |  |   74|     61|    (void)_status; /* error_expression may not use it */                    \
  |  |  |  |   75|     61|    return error_expr;                                                      \
  |  |  |  |   76|     61|  }                                                                         \
  |  |  |  |   77|  20.5k|  lhs = std::move(statusor).value();
  |  |  ------------------
  |  |   67|  20.4k|                               lhs, expression, _status)
  ------------------
   69|  20.4k|                         GetEncodedGeometryType(in_buffer))
   70|  20.4k|  if (type == POINT_CLOUD) {
  ------------------
  |  Branch (70:7): [True: 3.47k, False: 17.0k]
  ------------------
   71|  3.47k|#ifdef DRACO_POINT_CLOUD_COMPRESSION_SUPPORTED
   72|  3.47k|    std::unique_ptr<PointCloud> point_cloud(new PointCloud());
   73|  3.47k|    DRACO_RETURN_IF_ERROR(DecodeBufferToGeometry(in_buffer, point_cloud.get()))
  ------------------
  |  |   74|  3.47k|  {                                                   \
  |  |   75|  3.47k|    const draco::Status _local_status = (expression); \
  |  |   76|  3.47k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 3.35k, False: 124]
  |  |  ------------------
  |  |   77|  3.35k|      return _local_status;                           \
  |  |   78|  3.35k|    }                                                 \
  |  |   79|  3.47k|  }
  ------------------
   74|    124|    return std::move(point_cloud);
   75|  3.47k|#endif
   76|  17.0k|  } else if (type == TRIANGULAR_MESH) {
  ------------------
  |  Branch (76:14): [True: 17.0k, False: 0]
  ------------------
   77|  17.0k|#ifdef DRACO_MESH_COMPRESSION_SUPPORTED
   78|  17.0k|    std::unique_ptr<Mesh> mesh(new Mesh());
   79|  17.0k|    DRACO_RETURN_IF_ERROR(DecodeBufferToGeometry(in_buffer, mesh.get()))
  ------------------
  |  |   74|  17.0k|  {                                                   \
  |  |   75|  17.0k|    const draco::Status _local_status = (expression); \
  |  |   76|  17.0k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 15.5k, False: 1.48k]
  |  |  ------------------
  |  |   77|  15.5k|      return _local_status;                           \
  |  |   78|  15.5k|    }                                                 \
  |  |   79|  17.0k|  }
  ------------------
   80|  1.48k|    return static_cast<std::unique_ptr<PointCloud>>(std::move(mesh));
   81|  17.0k|#endif
   82|  17.0k|  }
   83|      0|  return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
   84|  20.4k|}
_ZN5draco7Decoder22DecodeBufferToGeometryEPNS_13DecoderBufferEPNS_10PointCloudE:
   94|  3.47k|                                       PointCloud* out_geometry) {
   95|  3.47k|#ifdef DRACO_POINT_CLOUD_COMPRESSION_SUPPORTED
   96|  3.47k|  DecoderBuffer temp_buffer(*in_buffer);
   97|  3.47k|  DracoHeader header;
   98|  3.47k|  DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header))
  ------------------
  |  |   74|  3.47k|  {                                                   \
  |  |   75|  3.47k|    const draco::Status _local_status = (expression); \
  |  |   76|  3.47k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 0, False: 3.47k]
  |  |  ------------------
  |  |   77|      0|      return _local_status;                           \
  |  |   78|      0|    }                                                 \
  |  |   79|  3.47k|  }
  ------------------
   99|  3.47k|  if (header.encoder_type != POINT_CLOUD) {
  ------------------
  |  Branch (99:7): [True: 0, False: 3.47k]
  ------------------
  100|      0|    return Status(Status::DRACO_ERROR, "Input is not a point cloud.");
  101|      0|  }
  102|  6.93k|  DRACO_ASSIGN_OR_RETURN(std::unique_ptr<PointCloudDecoder> decoder,
  ------------------
  |  |   66|  3.47k|  DRACO_ASSIGN_OR_RETURN_IMPL_(DRACO_MACROS_IMPL_CONCAT_(_statusor, __LINE__), \
  |  |  ------------------
  |  |  |  |   71|  3.47k|  auto statusor = (expression);                                             \
  |  |  |  |   72|  3.47k|  if (!statusor.ok()) {                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (72:7): [True: 9, False: 3.46k]
  |  |  |  |  ------------------
  |  |  |  |   73|      9|    auto _status = std::move(statusor.status());                            \
  |  |  |  |   74|      9|    (void)_status; /* error_expression may not use it */                    \
  |  |  |  |   75|      9|    return error_expr;                                                      \
  |  |  |  |   76|      9|  }                                                                         \
  |  |  |  |   77|  3.47k|  lhs = std::move(statusor).value();
  |  |  ------------------
  |  |   67|  3.46k|                               lhs, expression, _status)
  ------------------
  103|  6.93k|                         CreatePointCloudDecoder(header.encoder_method))
  104|       |
  105|  6.93k|  DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry))
  ------------------
  |  |   74|  3.46k|  {                                                   \
  |  |   75|  3.46k|    const draco::Status _local_status = (expression); \
  |  |   76|  3.46k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 3.34k, False: 124]
  |  |  ------------------
  |  |   77|  3.34k|      return _local_status;                           \
  |  |   78|  3.34k|    }                                                 \
  |  |   79|  3.46k|  }
  ------------------
  106|    124|  return OkStatus();
  107|       |#else
  108|       |  return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
  109|       |#endif
  110|  6.93k|}
_ZN5draco7Decoder22DecodeBufferToGeometryEPNS_13DecoderBufferEPNS_4MeshE:
  113|  17.0k|                                       Mesh* out_geometry) {
  114|  17.0k|#ifdef DRACO_MESH_COMPRESSION_SUPPORTED
  115|  17.0k|  DecoderBuffer temp_buffer(*in_buffer);
  116|  17.0k|  DracoHeader header;
  117|  17.0k|  DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header))
  ------------------
  |  |   74|  17.0k|  {                                                   \
  |  |   75|  17.0k|    const draco::Status _local_status = (expression); \
  |  |   76|  17.0k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 0, False: 17.0k]
  |  |  ------------------
  |  |   77|      0|      return _local_status;                           \
  |  |   78|      0|    }                                                 \
  |  |   79|  17.0k|  }
  ------------------
  118|  17.0k|  if (header.encoder_type != TRIANGULAR_MESH) {
  ------------------
  |  Branch (118:7): [True: 0, False: 17.0k]
  ------------------
  119|      0|    return Status(Status::DRACO_ERROR, "Input is not a mesh.");
  120|      0|  }
  121|  34.0k|  DRACO_ASSIGN_OR_RETURN(std::unique_ptr<MeshDecoder> decoder,
  ------------------
  |  |   66|  17.0k|  DRACO_ASSIGN_OR_RETURN_IMPL_(DRACO_MACROS_IMPL_CONCAT_(_statusor, __LINE__), \
  |  |  ------------------
  |  |  |  |   71|  17.0k|  auto statusor = (expression);                                             \
  |  |  |  |   72|  17.0k|  if (!statusor.ok()) {                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (72:7): [True: 10, False: 17.0k]
  |  |  |  |  ------------------
  |  |  |  |   73|     10|    auto _status = std::move(statusor.status());                            \
  |  |  |  |   74|     10|    (void)_status; /* error_expression may not use it */                    \
  |  |  |  |   75|     10|    return error_expr;                                                      \
  |  |  |  |   76|     10|  }                                                                         \
  |  |  |  |   77|  17.0k|  lhs = std::move(statusor).value();
  |  |  ------------------
  |  |   67|  17.0k|                               lhs, expression, _status)
  ------------------
  122|  34.0k|                         CreateMeshDecoder(header.encoder_method))
  123|       |
  124|  34.0k|  DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry))
  ------------------
  |  |   74|  17.0k|  {                                                   \
  |  |   75|  17.0k|    const draco::Status _local_status = (expression); \
  |  |   76|  17.0k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 15.5k, False: 1.48k]
  |  |  ------------------
  |  |   77|  15.5k|      return _local_status;                           \
  |  |   78|  15.5k|    }                                                 \
  |  |   79|  17.0k|  }
  ------------------
  125|  1.48k|  return OkStatus();
  126|       |#else
  127|       |  return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
  128|       |#endif
  129|  34.0k|}

_ZN5draco10AnsDecoderC2Ev:
   56|  72.5k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  37.2k|                                const uint8_t* const buf, int offset) {
  301|  37.2k|  unsigned x;
  302|  37.2k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 85, False: 37.2k]
  ------------------
  303|     85|    return 1;
  304|     85|  }
  305|  37.2k|  ans->buf = buf;
  306|  37.2k|  x = buf[offset - 1] >> 6;
  307|  37.2k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 33.1k, False: 4.07k]
  ------------------
  308|  33.1k|    ans->buf_offset = offset - 1;
  309|  33.1k|    ans->state = buf[offset - 1] & 0x3F;
  310|  33.1k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 3.81k, False: 265]
  ------------------
  311|  3.81k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 8, False: 3.80k]
  ------------------
  312|      8|      return 1;
  313|      8|    }
  314|  3.80k|    ans->buf_offset = offset - 2;
  315|  3.80k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  3.80k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 244, False: 21]
  ------------------
  317|    244|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 4, False: 240]
  ------------------
  318|      4|      return 1;
  319|      4|    }
  320|    240|    ans->buf_offset = offset - 3;
  321|    240|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    240|  } else {
  323|     21|    return 1;
  324|     21|  }
  325|  37.1k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  37.1k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  37.1k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  37.1k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  37.1k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 7, False: 37.1k]
  ------------------
  327|      7|    return 1;
  328|      7|  }
  329|  37.1k|  return 0;
  330|  37.1k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  3.80k|static uint32_t mem_get_le16(const void* vmem) {
   68|  3.80k|  uint32_t val;
   69|  3.80k|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|  3.80k|  val = mem[1] << 8;
   72|  3.80k|  val |= mem[0];
   73|  3.80k|  return val;
   74|  3.80k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    240|static uint32_t mem_get_le24(const void* vmem) {
   77|    240|  uint32_t val;
   78|    240|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    240|  val = mem[2] << 16;
   81|    240|  val |= mem[1] << 8;
   82|    240|  val |= mem[0];
   83|    240|  return val;
   84|    240|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|   105M|static inline int rabs_desc_read(struct AnsDecoder* ans, AnsP8 p0) {
  167|   105M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|   105M|  unsigned quot, rem, x, xn;
  172|   105M|#endif
  173|   105M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|   105M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|   105M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|   210M|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 82.4M, False: 22.7M]
  |  Branch (174:40): [True: 105k, False: 82.3M]
  ------------------
  175|   105k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   105k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   105k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|   105M|  x = ans->state;
  184|   105M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   105M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|   105M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   105M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|   105M|  xn = quot * p;
  187|   105M|  val = rem < p;
  188|   105M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|   210M|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 87.8M, False: 17.3M]
  |  |  ------------------
  ------------------
  189|  87.8M|    ans->state = xn + rem;
  190|  87.8M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  17.3M|    ans->state = x - xn - p;
  193|  17.3M|  }
  194|   105M|#endif
  195|   105M|  return val;
  196|   105M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|   100k|static inline int ans_read_end(struct AnsDecoder* const ans) {
  333|   100k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|   100k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|   100k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  5.10k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  484|  2.66k|                                       uint32_t num_symbols) {
  485|  2.66k|    lut_table_.resize(rans_precision);
  486|  2.66k|    probability_table_.resize(num_symbols);
  487|  2.66k|    uint32_t cum_prob = 0;
  488|  2.66k|    uint32_t act_prob = 0;
  489|  30.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 27.5k, False: 2.49k]
  ------------------
  490|  27.5k|      probability_table_[i].prob = token_probs[i];
  491|  27.5k|      probability_table_[i].cum_prob = cum_prob;
  492|  27.5k|      cum_prob += token_probs[i];
  493|  27.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 162, False: 27.3k]
  ------------------
  494|    162|        return false;
  495|    162|      }
  496|  9.30M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 9.28M, False: 27.3k]
  ------------------
  497|  9.28M|        lut_table_[j] = i;
  498|  9.28M|      }
  499|  27.3k|      act_prob = cum_prob;
  500|  27.3k|    }
  501|  2.49k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 296, False: 2.20k]
  ------------------
  502|    296|      return false;
  503|    296|    }
  504|  2.20k|    return true;
  505|  2.49k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  2.09k|  inline int read_init(const uint8_t* const buf, int offset) {
  422|  2.09k|    unsigned x;
  423|  2.09k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 142, False: 1.94k]
  ------------------
  424|    142|      return 1;
  425|    142|    }
  426|  1.94k|    ans_.buf = buf;
  427|  1.94k|    x = buf[offset - 1] >> 6;
  428|  1.94k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1.20k, False: 745]
  ------------------
  429|  1.20k|      ans_.buf_offset = offset - 1;
  430|  1.20k|      ans_.state = buf[offset - 1] & 0x3F;
  431|  1.20k|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 295, False: 450]
  ------------------
  432|    295|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 64, False: 231]
  ------------------
  433|     64|        return 1;
  434|     64|      }
  435|    231|      ans_.buf_offset = offset - 2;
  436|    231|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    450|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 318, False: 132]
  ------------------
  438|    318|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 84, False: 234]
  ------------------
  439|     84|        return 1;
  440|     84|      }
  441|    234|      ans_.buf_offset = offset - 3;
  442|    234|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    234|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 132, False: 0]
  ------------------
  444|    132|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 35, False: 97]
  ------------------
  445|     35|        return 1;
  446|     35|      }
  447|     97|      ans_.buf_offset = offset - 4;
  448|     97|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     97|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|  1.76k|    ans_.state += l_rans_base;
  453|  1.76k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.76k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 99, False: 1.66k]
  ------------------
  454|     99|      return 1;
  455|     99|    }
  456|  1.66k|    return 0;
  457|  1.76k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    374|static uint32_t mem_get_le16(const void* vmem) {
   68|    374|  uint32_t val;
   69|    374|  const uint8_t* mem = (const uint8_t*)vmem;
   70|       |
   71|    374|  val = mem[1] << 8;
   72|    374|  val |= mem[0];
   73|    374|  return val;
   74|    374|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    377|static uint32_t mem_get_le24(const void* vmem) {
   77|    377|  uint32_t val;
   78|    377|  const uint8_t* mem = (const uint8_t*)vmem;
   79|       |
   80|    377|  val = mem[2] << 16;
   81|    377|  val |= mem[1] << 8;
   82|    377|  val |= mem[0];
   83|    377|  return val;
   84|    377|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    372|static inline uint32_t mem_get_le32(const void* vmem) {
   87|    372|  uint32_t val;
   88|    372|  const uint8_t* mem = (const uint8_t*)vmem;
   89|       |
   90|    372|  val = mem[3] << 24;
   91|    372|  val |= mem[2] << 16;
   92|    372|  val |= mem[1] << 8;
   93|    372|  val |= mem[0];
   94|    372|  return val;
   95|    372|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  465|   500M|  inline int rans_read() {
  466|   500M|    unsigned rem;
  467|   500M|    unsigned quo;
  468|   500M|    struct rans_dec_sym sym;
  469|   500M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 486M, False: 13.6M]
  |  Branch (469:40): [True: 34.0k, False: 486M]
  ------------------
  470|  34.0k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  34.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  34.0k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   500M|    quo = ans_.state / rans_precision;
  475|   500M|    rem = ans_.state % rans_precision;
  476|   500M|    fetch_sym(&sym, rem);
  477|   500M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   500M|    return sym.val;
  479|   500M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  508|   500M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   500M|    uint32_t symbol = lut_table_[rem];
  510|   500M|    out->val = symbol;
  511|   500M|    out->prob = probability_table_[symbol].prob;
  512|   500M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   500M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  459|  1.57k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    450|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  484|    297|                                       uint32_t num_symbols) {
  485|    297|    lut_table_.resize(rans_precision);
  486|    297|    probability_table_.resize(num_symbols);
  487|    297|    uint32_t cum_prob = 0;
  488|    297|    uint32_t act_prob = 0;
  489|  7.61k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 7.35k, False: 261]
  ------------------
  490|  7.35k|      probability_table_[i].prob = token_probs[i];
  491|  7.35k|      probability_table_[i].cum_prob = cum_prob;
  492|  7.35k|      cum_prob += token_probs[i];
  493|  7.35k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 36, False: 7.32k]
  ------------------
  494|     36|        return false;
  495|     36|      }
  496|  1.85M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 1.84M, False: 7.32k]
  ------------------
  497|  1.84M|        lut_table_[j] = i;
  498|  1.84M|      }
  499|  7.32k|      act_prob = cum_prob;
  500|  7.32k|    }
  501|    261|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 53, False: 208]
  ------------------
  502|     53|      return false;
  503|     53|    }
  504|    208|    return true;
  505|    261|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|    165|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    165|    unsigned x;
  423|    165|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 159]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|    159|    ans_.buf = buf;
  427|    159|    x = buf[offset - 1] >> 6;
  428|    159|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 95, False: 64]
  ------------------
  429|     95|      ans_.buf_offset = offset - 1;
  430|     95|      ans_.state = buf[offset - 1] & 0x3F;
  431|     95|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 23, False: 41]
  ------------------
  432|     23|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 11, False: 12]
  ------------------
  433|     11|        return 1;
  434|     11|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     41|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 17, False: 24]
  ------------------
  438|     17|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 8, False: 9]
  ------------------
  439|      8|        return 1;
  440|      8|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     24|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 24, False: 0]
  ------------------
  444|     24|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 10, False: 14]
  ------------------
  445|     10|        return 1;
  446|     10|      }
  447|     14|      ans_.buf_offset = offset - 4;
  448|     14|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     14|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    130|    ans_.state += l_rans_base;
  453|    130|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    130|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 11, False: 119]
  ------------------
  454|     11|      return 1;
  455|     11|    }
  456|    119|    return 0;
  457|    130|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  465|   213k|  inline int rans_read() {
  466|   213k|    unsigned rem;
  467|   213k|    unsigned quo;
  468|   213k|    struct rans_dec_sym sym;
  469|   215k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 176k, False: 39.3k]
  |  Branch (469:40): [True: 2.37k, False: 174k]
  ------------------
  470|  2.37k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.37k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  2.37k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   213k|    quo = ans_.state / rans_precision;
  475|   213k|    rem = ans_.state % rans_precision;
  476|   213k|    fetch_sym(&sym, rem);
  477|   213k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   213k|    return sym.val;
  479|   213k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  508|   213k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   213k|    uint32_t symbol = lut_table_[rem];
  510|   213k|    out->val = symbol;
  511|   213k|    out->prob = probability_table_[symbol].prob;
  512|   213k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   213k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  459|    119|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    544|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  484|    335|                                       uint32_t num_symbols) {
  485|    335|    lut_table_.resize(rans_precision);
  486|    335|    probability_table_.resize(num_symbols);
  487|    335|    uint32_t cum_prob = 0;
  488|    335|    uint32_t act_prob = 0;
  489|  5.34k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 5.04k, False: 307]
  ------------------
  490|  5.04k|      probability_table_[i].prob = token_probs[i];
  491|  5.04k|      probability_table_[i].cum_prob = cum_prob;
  492|  5.04k|      cum_prob += token_probs[i];
  493|  5.04k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 28, False: 5.01k]
  ------------------
  494|     28|        return false;
  495|     28|      }
  496|  8.86M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 8.86M, False: 5.01k]
  ------------------
  497|  8.86M|        lut_table_[j] = i;
  498|  8.86M|      }
  499|  5.01k|      act_prob = cum_prob;
  500|  5.01k|    }
  501|    307|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 55, False: 252]
  ------------------
  502|     55|      return false;
  503|     55|    }
  504|    252|    return true;
  505|    307|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|    152|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    152|    unsigned x;
  423|    152|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 13, False: 139]
  ------------------
  424|     13|      return 1;
  425|     13|    }
  426|    139|    ans_.buf = buf;
  427|    139|    x = buf[offset - 1] >> 6;
  428|    139|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 66, False: 73]
  ------------------
  429|     66|      ans_.buf_offset = offset - 1;
  430|     66|      ans_.state = buf[offset - 1] & 0x3F;
  431|     73|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 21, False: 52]
  ------------------
  432|     21|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 11, False: 10]
  ------------------
  433|     11|        return 1;
  434|     11|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     52|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 25, False: 27]
  ------------------
  438|     25|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 7, False: 18]
  ------------------
  439|      7|        return 1;
  440|      7|      }
  441|     18|      ans_.buf_offset = offset - 3;
  442|     18|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     27|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 27, False: 0]
  ------------------
  444|     27|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 9, False: 18]
  ------------------
  445|      9|        return 1;
  446|      9|      }
  447|     18|      ans_.buf_offset = offset - 4;
  448|     18|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     18|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    112|    ans_.state += l_rans_base;
  453|    112|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    112|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 17, False: 95]
  ------------------
  454|     17|      return 1;
  455|     17|    }
  456|     95|    return 0;
  457|    112|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  465|   684k|  inline int rans_read() {
  466|   684k|    unsigned rem;
  467|   684k|    unsigned quo;
  468|   684k|    struct rans_dec_sym sym;
  469|   712k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 445k, False: 267k]
  |  Branch (469:40): [True: 27.9k, False: 417k]
  ------------------
  470|  27.9k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  27.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  27.9k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   684k|    quo = ans_.state / rans_precision;
  475|   684k|    rem = ans_.state % rans_precision;
  476|   684k|    fetch_sym(&sym, rem);
  477|   684k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   684k|    return sym.val;
  479|   684k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  508|   684k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   684k|    uint32_t symbol = lut_table_[rem];
  510|   684k|    out->val = symbol;
  511|   684k|    out->prob = probability_table_[symbol].prob;
  512|   684k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   684k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  459|     95|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    481|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  484|    270|                                       uint32_t num_symbols) {
  485|    270|    lut_table_.resize(rans_precision);
  486|    270|    probability_table_.resize(num_symbols);
  487|    270|    uint32_t cum_prob = 0;
  488|    270|    uint32_t act_prob = 0;
  489|  15.3k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 15.1k, False: 234]
  ------------------
  490|  15.1k|      probability_table_[i].prob = token_probs[i];
  491|  15.1k|      probability_table_[i].cum_prob = cum_prob;
  492|  15.1k|      cum_prob += token_probs[i];
  493|  15.1k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 36, False: 15.0k]
  ------------------
  494|     36|        return false;
  495|     36|      }
  496|  12.8M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 12.8M, False: 15.0k]
  ------------------
  497|  12.8M|        lut_table_[j] = i;
  498|  12.8M|      }
  499|  15.0k|      act_prob = cum_prob;
  500|  15.0k|    }
  501|    234|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 63, False: 171]
  ------------------
  502|     63|      return false;
  503|     63|    }
  504|    171|    return true;
  505|    234|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     85|  inline int read_init(const uint8_t* const buf, int offset) {
  422|     85|    unsigned x;
  423|     85|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 79]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     79|    ans_.buf = buf;
  427|     79|    x = buf[offset - 1] >> 6;
  428|     79|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 33, False: 46]
  ------------------
  429|     33|      ans_.buf_offset = offset - 1;
  430|     33|      ans_.state = buf[offset - 1] & 0x3F;
  431|     46|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 7, False: 39]
  ------------------
  432|      7|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 6]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     39|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 5, False: 34]
  ------------------
  438|      5|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 4]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     34|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 34, False: 0]
  ------------------
  444|     34|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 11, False: 23]
  ------------------
  445|     11|        return 1;
  446|     11|      }
  447|     23|      ans_.buf_offset = offset - 4;
  448|     23|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     23|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     66|    ans_.state += l_rans_base;
  453|     66|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     66|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 21, False: 45]
  ------------------
  454|     21|      return 1;
  455|     21|    }
  456|     45|    return 0;
  457|     66|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  465|   320k|  inline int rans_read() {
  466|   320k|    unsigned rem;
  467|   320k|    unsigned quo;
  468|   320k|    struct rans_dec_sym sym;
  469|   320k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 201k, False: 119k]
  |  Branch (469:40): [True: 635, False: 200k]
  ------------------
  470|    635|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    635|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    635|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   320k|    quo = ans_.state / rans_precision;
  475|   320k|    rem = ans_.state % rans_precision;
  476|   320k|    fetch_sym(&sym, rem);
  477|   320k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   320k|    return sym.val;
  479|   320k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  508|   320k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   320k|    uint32_t symbol = lut_table_[rem];
  510|   320k|    out->val = symbol;
  511|   320k|    out->prob = probability_table_[symbol].prob;
  512|   320k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   320k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  459|     45|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    480|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  484|    302|                                       uint32_t num_symbols) {
  485|    302|    lut_table_.resize(rans_precision);
  486|    302|    probability_table_.resize(num_symbols);
  487|    302|    uint32_t cum_prob = 0;
  488|    302|    uint32_t act_prob = 0;
  489|  21.6k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 21.3k, False: 271]
  ------------------
  490|  21.3k|      probability_table_[i].prob = token_probs[i];
  491|  21.3k|      probability_table_[i].cum_prob = cum_prob;
  492|  21.3k|      cum_prob += token_probs[i];
  493|  21.3k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 31, False: 21.3k]
  ------------------
  494|     31|        return false;
  495|     31|      }
  496|  55.2M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 55.2M, False: 21.3k]
  ------------------
  497|  55.2M|        lut_table_[j] = i;
  498|  55.2M|      }
  499|  21.3k|      act_prob = cum_prob;
  500|  21.3k|    }
  501|    271|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 72, False: 199]
  ------------------
  502|     72|      return false;
  503|     72|    }
  504|    199|    return true;
  505|    271|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|    115|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    115|    unsigned x;
  423|    115|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 105]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|    105|    ans_.buf = buf;
  427|    105|    x = buf[offset - 1] >> 6;
  428|    105|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 29, False: 76]
  ------------------
  429|     29|      ans_.buf_offset = offset - 1;
  430|     29|      ans_.state = buf[offset - 1] & 0x3F;
  431|     76|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 25, False: 51]
  ------------------
  432|     25|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 12, False: 13]
  ------------------
  433|     12|        return 1;
  434|     12|      }
  435|     13|      ans_.buf_offset = offset - 2;
  436|     13|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     51|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 13, False: 38]
  ------------------
  438|     13|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 12]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     38|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 38, False: 0]
  ------------------
  444|     38|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 10, False: 28]
  ------------------
  445|     10|        return 1;
  446|     10|      }
  447|     28|      ans_.buf_offset = offset - 4;
  448|     28|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     28|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     82|    ans_.state += l_rans_base;
  453|     82|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     82|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 11, False: 71]
  ------------------
  454|     11|      return 1;
  455|     11|    }
  456|     71|    return 0;
  457|     82|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  465|   211k|  inline int rans_read() {
  466|   211k|    unsigned rem;
  467|   211k|    unsigned quo;
  468|   211k|    struct rans_dec_sym sym;
  469|   211k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 193k, False: 18.3k]
  |  Branch (469:40): [True: 820, False: 192k]
  ------------------
  470|    820|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    820|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    820|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   211k|    quo = ans_.state / rans_precision;
  475|   211k|    rem = ans_.state % rans_precision;
  476|   211k|    fetch_sym(&sym, rem);
  477|   211k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   211k|    return sym.val;
  479|   211k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  508|   211k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   211k|    uint32_t symbol = lut_table_[rem];
  510|   211k|    out->val = symbol;
  511|   211k|    out->prob = probability_table_[symbol].prob;
  512|   211k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   211k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  459|     71|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    540|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  484|    326|                                       uint32_t num_symbols) {
  485|    326|    lut_table_.resize(rans_precision);
  486|    326|    probability_table_.resize(num_symbols);
  487|    326|    uint32_t cum_prob = 0;
  488|    326|    uint32_t act_prob = 0;
  489|  4.60k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 4.30k, False: 300]
  ------------------
  490|  4.30k|      probability_table_[i].prob = token_probs[i];
  491|  4.30k|      probability_table_[i].cum_prob = cum_prob;
  492|  4.30k|      cum_prob += token_probs[i];
  493|  4.30k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 26, False: 4.27k]
  ------------------
  494|     26|        return false;
  495|     26|      }
  496|   120M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 120M, False: 4.27k]
  ------------------
  497|   120M|        lut_table_[j] = i;
  498|   120M|      }
  499|  4.27k|      act_prob = cum_prob;
  500|  4.27k|    }
  501|    300|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 95, False: 205]
  ------------------
  502|     95|      return false;
  503|     95|    }
  504|    205|    return true;
  505|    300|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|    101|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    101|    unsigned x;
  423|    101|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 100]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|    100|    ans_.buf = buf;
  427|    100|    x = buf[offset - 1] >> 6;
  428|    100|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 35, False: 65]
  ------------------
  429|     35|      ans_.buf_offset = offset - 1;
  430|     35|      ans_.state = buf[offset - 1] & 0x3F;
  431|     65|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 7, False: 58]
  ------------------
  432|      7|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 6]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     58|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 26, False: 32]
  ------------------
  438|     26|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 11, False: 15]
  ------------------
  439|     11|        return 1;
  440|     11|      }
  441|     15|      ans_.buf_offset = offset - 3;
  442|     15|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     32|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 32, False: 0]
  ------------------
  444|     32|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 1, False: 31]
  ------------------
  445|      1|        return 1;
  446|      1|      }
  447|     31|      ans_.buf_offset = offset - 4;
  448|     31|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|     31|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|     87|    ans_.state += l_rans_base;
  453|     87|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     87|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 11, False: 76]
  ------------------
  454|     11|      return 1;
  455|     11|    }
  456|     76|    return 0;
  457|     87|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  465|   257k|  inline int rans_read() {
  466|   257k|    unsigned rem;
  467|   257k|    unsigned quo;
  468|   257k|    struct rans_dec_sym sym;
  469|   258k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 51.4k, False: 206k]
  |  Branch (469:40): [True: 578, False: 50.8k]
  ------------------
  470|    578|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    578|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|    578|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|   257k|    quo = ans_.state / rans_precision;
  475|   257k|    rem = ans_.state % rans_precision;
  476|   257k|    fetch_sym(&sym, rem);
  477|   257k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|   257k|    return sym.val;
  479|   257k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  508|   257k|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|   257k|    uint32_t symbol = lut_table_[rem];
  510|   257k|    out->val = symbol;
  511|   257k|    out->prob = probability_table_[symbol].prob;
  512|   257k|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|   257k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  459|     76|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  2.50k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  484|  1.42k|                                       uint32_t num_symbols) {
  485|  1.42k|    lut_table_.resize(rans_precision);
  486|  1.42k|    probability_table_.resize(num_symbols);
  487|  1.42k|    uint32_t cum_prob = 0;
  488|  1.42k|    uint32_t act_prob = 0;
  489|  29.5k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (489:26): [True: 28.1k, False: 1.36k]
  ------------------
  490|  28.1k|      probability_table_[i].prob = token_probs[i];
  491|  28.1k|      probability_table_[i].cum_prob = cum_prob;
  492|  28.1k|      cum_prob += token_probs[i];
  493|  28.1k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (493:11): [True: 59, False: 28.0k]
  ------------------
  494|     59|        return false;
  495|     59|      }
  496|  1.32G|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (496:35): [True: 1.32G, False: 28.0k]
  ------------------
  497|  1.32G|        lut_table_[j] = i;
  498|  1.32G|      }
  499|  28.0k|      act_prob = cum_prob;
  500|  28.0k|    }
  501|  1.36k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (501:9): [True: 145, False: 1.21k]
  ------------------
  502|    145|      return false;
  503|    145|    }
  504|  1.21k|    return true;
  505|  1.36k|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    623|  inline int read_init(const uint8_t* const buf, int offset) {
  422|    623|    unsigned x;
  423|    623|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 40, False: 583]
  ------------------
  424|     40|      return 1;
  425|     40|    }
  426|    583|    ans_.buf = buf;
  427|    583|    x = buf[offset - 1] >> 6;
  428|    583|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 169, False: 414]
  ------------------
  429|    169|      ans_.buf_offset = offset - 1;
  430|    169|      ans_.state = buf[offset - 1] & 0x3F;
  431|    414|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 123, False: 291]
  ------------------
  432|    123|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 27, False: 96]
  ------------------
  433|     27|        return 1;
  434|     27|      }
  435|     96|      ans_.buf_offset = offset - 2;
  436|     96|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    291|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 116, False: 175]
  ------------------
  438|    116|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 31, False: 85]
  ------------------
  439|     31|        return 1;
  440|     31|      }
  441|     85|      ans_.buf_offset = offset - 3;
  442|     85|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    175|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 175, False: 0]
  ------------------
  444|    175|      if (offset < 4) {
  ------------------
  |  Branch (444:11): [True: 14, False: 161]
  ------------------
  445|     14|        return 1;
  446|     14|      }
  447|    161|      ans_.buf_offset = offset - 4;
  448|    161|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  449|    161|    } else {
  450|      0|      return 1;
  451|      0|    }
  452|    511|    ans_.state += l_rans_base;
  453|    511|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    511|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (453:9): [True: 46, False: 465]
  ------------------
  454|     46|      return 1;
  455|     46|    }
  456|    465|    return 0;
  457|    511|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  465|  77.6M|  inline int rans_read() {
  466|  77.6M|    unsigned rem;
  467|  77.6M|    unsigned quo;
  468|  77.6M|    struct rans_dec_sym sym;
  469|  77.6M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (469:12): [True: 67.0M, False: 10.6M]
  |  Branch (469:40): [True: 8.65k, False: 67.0M]
  ------------------
  470|  8.65k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  8.65k|#define DRACO_ANS_IO_BASE 256
  ------------------
  471|  8.65k|    }
  472|       |    // |rans_precision| is a power of two compile time constant, and the below
  473|       |    // division and modulo are going to be optimized by the compiler.
  474|  77.6M|    quo = ans_.state / rans_precision;
  475|  77.6M|    rem = ans_.state % rans_precision;
  476|  77.6M|    fetch_sym(&sym, rem);
  477|  77.6M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  478|  77.6M|    return sym.val;
  479|  77.6M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  508|  77.6M|  inline void fetch_sym(struct rans_dec_sym* out, uint32_t rem) {
  509|  77.6M|    uint32_t symbol = lut_table_[rem];
  510|  77.6M|    out->val = symbol;
  511|  77.6M|    out->prob = probability_table_[symbol].prob;
  512|  77.6M|    out->cum_prob = probability_table_[symbol].cum_prob;
  513|  77.6M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  459|    465|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.67k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.67k|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.67k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.67k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.67k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.67k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.67k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 130, False: 1.54k]
  ------------------
   67|    130|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 13, False: 117]
  ------------------
   68|     13|      return false;
   69|     13|    }
   70|       |
   71|    130|  } else
   72|  1.54k|#endif
   73|  1.54k|  {
   74|  1.54k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 53, False: 1.49k]
  ------------------
   75|     53|      return false;
   76|     53|    }
   77|  1.54k|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|  1.60k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 109, False: 1.50k]
  ------------------
   83|    109|    return false;
   84|    109|  }
   85|  1.50k|  probability_table_.resize(num_symbols_);
   86|  1.50k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 521, False: 979]
  ------------------
   87|    521|    return true;
   88|    521|  }
   89|       |  // Decode the table.
   90|   731k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 730k, False: 619]
  ------------------
   91|   730k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   730k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 102, False: 730k]
  ------------------
   95|    102|      return false;
   96|    102|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   730k|    const int token = prob_data & 3;
  102|   730k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 193k, False: 537k]
  ------------------
  103|   193k|      const uint32_t offset = prob_data >> 2;
  104|   193k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 200, False: 193k]
  ------------------
  105|    200|        return false;
  106|    200|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.65M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.46M, False: 193k]
  ------------------
  109|  8.46M|        probability_table_[i + j] = 0;
  110|  8.46M|      }
  111|   193k|      i += offset;
  112|   537k|    } else {
  113|   537k|      const int extra_bytes = token;
  114|   537k|      uint32_t prob = prob_data >> 2;
  115|  1.00M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 466k, False: 537k]
  ------------------
  116|   466k|        uint8_t eb;
  117|   466k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 58, False: 466k]
  ------------------
  118|     58|          return false;
  119|     58|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   466k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   466k|      }
  124|   537k|      probability_table_[i] = prob;
  125|   537k|    }
  126|   730k|  }
  127|    619|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 196, False: 423]
  ------------------
  128|    196|    return false;
  129|    196|  }
  130|    423|  return true;
  131|    619|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    851|    DecoderBuffer* buffer) {
  136|    851|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    851|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    851|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    851|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 67, False: 784]
  ------------------
  140|     67|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 11, False: 56]
  ------------------
  141|     11|      return false;
  142|     11|    }
  143|       |
  144|     67|  } else
  145|    784|#endif
  146|    784|  {
  147|    784|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 28, False: 756]
  ------------------
  148|     28|      return false;
  149|     28|    }
  150|    784|  }
  151|    812|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 170, False: 642]
  ------------------
  152|    170|    return false;
  153|    170|  }
  154|    642|  const uint8_t* const data_head =
  155|    642|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    642|  buffer->Advance(bytes_encoded);
  158|    642|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 152, False: 490]
  ------------------
  159|    152|    return false;
  160|    152|  }
  161|    490|  return true;
  162|    642|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    596|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  7.59M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    398|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    398|  ans_.read_end();
  167|    398|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    660|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    660|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    660|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 660]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    660|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    660|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    660|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 618]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 5, False: 37]
  ------------------
   68|      5|      return false;
   69|      5|    }
   70|       |
   71|     42|  } else
   72|    618|#endif
   73|    618|  {
   74|    618|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 14, False: 604]
  ------------------
   75|     14|      return false;
   76|     14|    }
   77|    618|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    641|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 42, False: 599]
  ------------------
   83|     42|    return false;
   84|     42|  }
   85|    599|  probability_table_.resize(num_symbols_);
   86|    599|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 33, False: 566]
  ------------------
   87|     33|    return true;
   88|     33|  }
   89|       |  // Decode the table.
   90|  66.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 65.8k, False: 405]
  ------------------
   91|  65.8k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  65.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 62, False: 65.7k]
  ------------------
   95|     62|      return false;
   96|     62|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  65.7k|    const int token = prob_data & 3;
  102|  65.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.07k, False: 56.7k]
  ------------------
  103|  9.07k|      const uint32_t offset = prob_data >> 2;
  104|  9.07k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 60, False: 9.01k]
  ------------------
  105|     60|        return false;
  106|     60|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   426k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 417k, False: 9.01k]
  ------------------
  109|   417k|        probability_table_[i + j] = 0;
  110|   417k|      }
  111|  9.01k|      i += offset;
  112|  56.7k|    } else {
  113|  56.7k|      const int extra_bytes = token;
  114|  56.7k|      uint32_t prob = prob_data >> 2;
  115|  67.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.7k, False: 56.6k]
  ------------------
  116|  10.7k|        uint8_t eb;
  117|  10.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 39, False: 10.7k]
  ------------------
  118|     39|          return false;
  119|     39|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.7k|      }
  124|  56.6k|      probability_table_[i] = prob;
  125|  56.6k|    }
  126|  65.7k|  }
  127|    405|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 106, False: 299]
  ------------------
  128|    106|    return false;
  129|    106|  }
  130|    299|  return true;
  131|    405|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    332|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    299|    DecoderBuffer* buffer) {
  136|    299|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    299|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    299|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    299|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 293]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 5]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      6|  } else
  145|    293|#endif
  146|    293|  {
  147|    293|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 17, False: 276]
  ------------------
  148|     17|      return false;
  149|     17|    }
  150|    293|  }
  151|    281|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 21, False: 260]
  ------------------
  152|     21|    return false;
  153|     21|  }
  154|    260|  const uint8_t* const data_head =
  155|    260|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    260|  buffer->Advance(bytes_encoded);
  158|    260|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 233]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|    233|  return true;
  162|    260|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|   233M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    233|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    233|  ans_.read_end();
  167|    233|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    442|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    442|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    442|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 442]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    442|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    442|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    442|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 37, False: 405]
  ------------------
   67|     37|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 34]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     37|  } else
   72|    405|#endif
   73|    405|  {
   74|    405|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 398]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    405|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    432|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 27, False: 405]
  ------------------
   83|     27|    return false;
   84|     27|  }
   85|    405|  probability_table_.resize(num_symbols_);
   86|    405|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 16, False: 389]
  ------------------
   87|     16|    return true;
   88|     16|  }
   89|       |  // Decode the table.
   90|   473k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 473k, False: 240]
  ------------------
   91|   473k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   473k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 69, False: 473k]
  ------------------
   95|     69|      return false;
   96|     69|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   473k|    const int token = prob_data & 3;
  102|   473k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 20.7k, False: 452k]
  ------------------
  103|  20.7k|      const uint32_t offset = prob_data >> 2;
  104|  20.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 39, False: 20.7k]
  ------------------
  105|     39|        return false;
  106|     39|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   694k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 673k, False: 20.7k]
  ------------------
  109|   673k|        probability_table_[i + j] = 0;
  110|   673k|      }
  111|  20.7k|      i += offset;
  112|   452k|    } else {
  113|   452k|      const int extra_bytes = token;
  114|   452k|      uint32_t prob = prob_data >> 2;
  115|  1.01M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 566k, False: 452k]
  ------------------
  116|   566k|        uint8_t eb;
  117|   566k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 41, False: 566k]
  ------------------
  118|     41|          return false;
  119|     41|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   566k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   566k|      }
  124|   452k|      probability_table_[i] = prob;
  125|   452k|    }
  126|   473k|  }
  127|    240|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 211]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|    211|  return true;
  131|    240|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    227|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    211|    DecoderBuffer* buffer) {
  136|    211|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    211|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    211|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    211|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 188]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 22]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     23|  } else
  145|    188|#endif
  146|    188|  {
  147|    188|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 186]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    188|  }
  151|    208|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 35, False: 173]
  ------------------
  152|     35|    return false;
  153|     35|  }
  154|    173|  const uint8_t* const data_head =
  155|    173|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    173|  buffer->Advance(bytes_encoded);
  158|    173|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 41, False: 132]
  ------------------
  159|     41|    return false;
  160|     41|  }
  161|    132|  return true;
  162|    173|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|   115M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    132|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    132|  ans_.read_end();
  167|    132|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    511|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    511|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    511|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 511]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    511|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    511|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    511|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 46, False: 465]
  ------------------
   67|     46|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 45]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     46|  } else
   72|    465|#endif
   73|    465|  {
   74|    465|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 456]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    465|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    501|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 25, False: 476]
  ------------------
   83|     25|    return false;
   84|     25|  }
   85|    476|  probability_table_.resize(num_symbols_);
   86|    476|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 15, False: 461]
  ------------------
   87|     15|    return true;
   88|     15|  }
   89|       |  // Decode the table.
   90|  39.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 38.7k, False: 321]
  ------------------
   91|  38.7k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  38.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 82, False: 38.6k]
  ------------------
   95|     82|      return false;
   96|     82|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  38.6k|    const int token = prob_data & 3;
  102|  38.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 14.8k, False: 23.8k]
  ------------------
  103|  14.8k|      const uint32_t offset = prob_data >> 2;
  104|  14.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 38, False: 14.8k]
  ------------------
  105|     38|        return false;
  106|     38|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   592k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 577k, False: 14.8k]
  ------------------
  109|   577k|        probability_table_[i + j] = 0;
  110|   577k|      }
  111|  14.8k|      i += offset;
  112|  23.8k|    } else {
  113|  23.8k|      const int extra_bytes = token;
  114|  23.8k|      uint32_t prob = prob_data >> 2;
  115|  46.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 23.0k, False: 23.7k]
  ------------------
  116|  23.0k|        uint8_t eb;
  117|  23.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 23.0k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  23.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  23.0k|      }
  124|  23.7k|      probability_table_[i] = prob;
  125|  23.7k|    }
  126|  38.6k|  }
  127|    321|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 38, False: 283]
  ------------------
  128|     38|    return false;
  129|     38|  }
  130|    283|  return true;
  131|    321|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    298|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    283|    DecoderBuffer* buffer) {
  136|    283|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    283|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    283|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    283|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 24, False: 259]
  ------------------
  140|     24|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 21]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     24|  } else
  145|    259|#endif
  146|    259|  {
  147|    259|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 255]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    259|  }
  151|    276|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 32, False: 244]
  ------------------
  152|     32|    return false;
  153|     32|  }
  154|    244|  const uint8_t* const data_head =
  155|    244|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    244|  buffer->Advance(bytes_encoded);
  158|    244|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 200]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|    200|  return true;
  162|    244|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  46.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    200|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    200|  ans_.read_end();
  167|    200|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    516|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    516|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    516|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 516]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    516|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    516|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    516|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 49, False: 467]
  ------------------
   67|     49|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 46]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     49|  } else
   72|    467|#endif
   73|    467|  {
   74|    467|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 14, False: 453]
  ------------------
   75|     14|      return false;
   76|     14|    }
   77|    467|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    499|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 64, False: 435]
  ------------------
   83|     64|    return false;
   84|     64|  }
   85|    435|  probability_table_.resize(num_symbols_);
   86|    435|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 20, False: 415]
  ------------------
   87|     20|    return true;
   88|     20|  }
   89|       |  // Decode the table.
   90|  6.25k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 5.95k, False: 295]
  ------------------
   91|  5.95k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  5.95k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 58, False: 5.90k]
  ------------------
   95|     58|      return false;
   96|     58|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  5.90k|    const int token = prob_data & 3;
  102|  5.90k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.29k, False: 2.60k]
  ------------------
  103|  3.29k|      const uint32_t offset = prob_data >> 2;
  104|  3.29k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 3.26k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   113k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 110k, False: 3.26k]
  ------------------
  109|   110k|        probability_table_[i + j] = 0;
  110|   110k|      }
  111|  3.26k|      i += offset;
  112|  3.26k|    } else {
  113|  2.60k|      const int extra_bytes = token;
  114|  2.60k|      uint32_t prob = prob_data >> 2;
  115|  4.47k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.89k, False: 2.57k]
  ------------------
  116|  1.89k|        uint8_t eb;
  117|  1.89k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 32, False: 1.86k]
  ------------------
  118|     32|          return false;
  119|     32|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.86k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.86k|      }
  124|  2.57k|      probability_table_[i] = prob;
  125|  2.57k|    }
  126|  5.90k|  }
  127|    295|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 279]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|    279|  return true;
  131|    295|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    299|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    279|    DecoderBuffer* buffer) {
  136|    279|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    279|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    279|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    279|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 277]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 1]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      2|  } else
  145|    277|#endif
  146|    277|  {
  147|    277|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 273]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    277|  }
  151|    274|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 30, False: 244]
  ------------------
  152|     30|    return false;
  153|     30|  }
  154|    244|  const uint8_t* const data_head =
  155|    244|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    244|  buffer->Advance(bytes_encoded);
  158|    244|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 206]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|    206|  return true;
  162|    244|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  5.43M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    206|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    206|  ans_.read_end();
  167|    206|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    410|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    410|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    410|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 410]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    410|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    410|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    410|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 384]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 25]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     26|  } else
   72|    384|#endif
   73|    384|  {
   74|    384|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 378]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    384|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    403|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 377]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    377|  probability_table_.resize(num_symbols_);
   86|    377|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 369]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  7.16k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.92k, False: 238]
  ------------------
   91|  6.92k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.92k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 71, False: 6.85k]
  ------------------
   95|     71|      return false;
   96|     71|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  6.85k|    const int token = prob_data & 3;
  102|  6.85k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.00k, False: 2.85k]
  ------------------
  103|  4.00k|      const uint32_t offset = prob_data >> 2;
  104|  4.00k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 3.97k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   124k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 120k, False: 3.97k]
  ------------------
  109|   120k|        probability_table_[i + j] = 0;
  110|   120k|      }
  111|  3.97k|      i += offset;
  112|  3.97k|    } else {
  113|  2.85k|      const int extra_bytes = token;
  114|  2.85k|      uint32_t prob = prob_data >> 2;
  115|  5.01k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.19k, False: 2.82k]
  ------------------
  116|  2.19k|        uint8_t eb;
  117|  2.19k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 2.16k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.16k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.16k|      }
  124|  2.82k|      probability_table_[i] = prob;
  125|  2.82k|    }
  126|  6.85k|  }
  127|    238|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 30, False: 208]
  ------------------
  128|     30|    return false;
  129|     30|  }
  130|    208|  return true;
  131|    238|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    216|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    208|    DecoderBuffer* buffer) {
  136|    208|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    208|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    208|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    208|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 194]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 12]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     14|  } else
  145|    194|#endif
  146|    194|  {
  147|    194|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 191]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    194|  }
  151|    203|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 50, False: 153]
  ------------------
  152|     50|    return false;
  153|     50|  }
  154|    153|  const uint8_t* const data_head =
  155|    153|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    153|  buffer->Advance(bytes_encoded);
  158|    153|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 43, False: 110]
  ------------------
  159|     43|    return false;
  160|     43|  }
  161|    110|  return true;
  162|    153|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  59.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    110|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    110|  ans_.read_end();
  167|    110|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    470|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    470|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    470|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 470]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    470|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    470|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    470|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 25, False: 445]
  ------------------
   67|     25|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 23]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     25|  } else
   72|    445|#endif
   73|    445|  {
   74|    445|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 439]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    445|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    462|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 448]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    448|  probability_table_.resize(num_symbols_);
   86|    448|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 437]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  6.49k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.18k, False: 310]
  ------------------
   91|  6.18k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.18k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 72, False: 6.10k]
  ------------------
   95|     72|      return false;
   96|     72|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  6.10k|    const int token = prob_data & 3;
  102|  6.10k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.28k, False: 2.82k]
  ------------------
  103|  3.28k|      const uint32_t offset = prob_data >> 2;
  104|  3.28k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 3.25k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   102k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 99.1k, False: 3.25k]
  ------------------
  109|  99.1k|        probability_table_[i + j] = 0;
  110|  99.1k|      }
  111|  3.25k|      i += offset;
  112|  3.25k|    } else {
  113|  2.82k|      const int extra_bytes = token;
  114|  2.82k|      uint32_t prob = prob_data >> 2;
  115|  4.71k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.91k, False: 2.80k]
  ------------------
  116|  1.91k|        uint8_t eb;
  117|  1.91k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 1.89k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.89k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.89k|      }
  124|  2.80k|      probability_table_[i] = prob;
  125|  2.80k|    }
  126|  6.10k|  }
  127|    310|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 22, False: 288]
  ------------------
  128|     22|    return false;
  129|     22|  }
  130|    288|  return true;
  131|    310|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    299|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    288|    DecoderBuffer* buffer) {
  136|    288|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    288|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    288|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    288|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 268]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 16]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     20|  } else
  145|    268|#endif
  146|    268|  {
  147|    268|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 267]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    268|  }
  151|    283|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 48, False: 235]
  ------------------
  152|     48|    return false;
  153|     48|  }
  154|    235|  const uint8_t* const data_head =
  155|    235|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    235|  buffer->Advance(bytes_encoded);
  158|    235|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 191]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|    191|  return true;
  162|    235|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  14.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    191|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    191|  ans_.read_end();
  167|    191|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    422|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    422|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    422|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 422]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    422|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    422|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    422|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 396]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 24]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     26|  } else
   72|    396|#endif
   73|    396|  {
   74|    396|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 19, False: 377]
  ------------------
   75|     19|      return false;
   76|     19|    }
   77|    396|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    401|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 380]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    380|  probability_table_.resize(num_symbols_);
   86|    380|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 368]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   118k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 118k, False: 232]
  ------------------
   91|   118k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   118k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 86, False: 118k]
  ------------------
   95|     86|      return false;
   96|     86|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   118k|    const int token = prob_data & 3;
  102|   118k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 49.7k, False: 68.8k]
  ------------------
  103|  49.7k|      const uint32_t offset = prob_data >> 2;
  104|  49.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 49.7k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.95M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.90M, False: 49.7k]
  ------------------
  109|  1.90M|        probability_table_[i + j] = 0;
  110|  1.90M|      }
  111|  49.7k|      i += offset;
  112|  68.8k|    } else {
  113|  68.8k|      const int extra_bytes = token;
  114|  68.8k|      uint32_t prob = prob_data >> 2;
  115|   140k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 71.3k, False: 68.7k]
  ------------------
  116|  71.3k|        uint8_t eb;
  117|  71.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 71.3k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  71.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  71.3k|      }
  124|  68.7k|      probability_table_[i] = prob;
  125|  68.7k|    }
  126|   118k|  }
  127|    232|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 211]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    211|  return true;
  131|    232|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    223|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    211|    DecoderBuffer* buffer) {
  136|    211|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    211|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    211|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    211|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 21, False: 190]
  ------------------
  140|     21|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 17]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     21|  } else
  145|    190|#endif
  146|    190|  {
  147|    190|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 11, False: 179]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|    190|  }
  151|    196|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 57, False: 139]
  ------------------
  152|     57|    return false;
  153|     57|  }
  154|    139|  const uint8_t* const data_head =
  155|    139|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    139|  buffer->Advance(bytes_encoded);
  158|    139|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 104]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|    104|  return true;
  162|    139|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  17.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|    104|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    104|  ans_.read_end();
  167|    104|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    450|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    450|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    450|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 450]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    450|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    450|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    450|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 435]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 14]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     15|  } else
   72|    435|#endif
   73|    435|  {
   74|    435|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 431]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    435|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    445|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 429]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    429|  probability_table_.resize(num_symbols_);
   86|    429|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 421]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  20.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 20.5k, False: 297]
  ------------------
   91|  20.5k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  20.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 64, False: 20.4k]
  ------------------
   95|     64|      return false;
   96|     64|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  20.4k|    const int token = prob_data & 3;
  102|  20.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.58k, False: 14.9k]
  ------------------
  103|  5.58k|      const uint32_t offset = prob_data >> 2;
  104|  5.58k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 5.54k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   218k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 212k, False: 5.54k]
  ------------------
  109|   212k|        probability_table_[i + j] = 0;
  110|   212k|      }
  111|  5.54k|      i += offset;
  112|  14.9k|    } else {
  113|  14.9k|      const int extra_bytes = token;
  114|  14.9k|      uint32_t prob = prob_data >> 2;
  115|  22.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.11k, False: 14.8k]
  ------------------
  116|  8.11k|        uint8_t eb;
  117|  8.11k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 8.08k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.08k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.08k|      }
  124|  14.8k|      probability_table_[i] = prob;
  125|  14.8k|    }
  126|  20.4k|  }
  127|    297|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 89, False: 208]
  ------------------
  128|     89|    return false;
  129|     89|  }
  130|    208|  return true;
  131|    297|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    216|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    208|    DecoderBuffer* buffer) {
  136|    208|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    208|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    208|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    208|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 205]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 2]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      3|  } else
  145|    205|#endif
  146|    205|  {
  147|    205|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 195]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    205|  }
  151|    197|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 32, False: 165]
  ------------------
  152|     32|    return false;
  153|     32|  }
  154|    165|  const uint8_t* const data_head =
  155|    165|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    165|  buffer->Advance(bytes_encoded);
  158|    165|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 46, False: 119]
  ------------------
  159|     46|    return false;
  160|     46|  }
  161|    119|  return true;
  162|    165|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   213k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|    119|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    119|  ans_.read_end();
  167|    119|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    544|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    544|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    544|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 544]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    544|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    544|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    544|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 41, False: 503]
  ------------------
   67|     41|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 5, False: 36]
  ------------------
   68|      5|      return false;
   69|      5|    }
   70|       |
   71|     41|  } else
   72|    503|#endif
   73|    503|  {
   74|    503|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 19, False: 484]
  ------------------
   75|     19|      return false;
   76|     19|    }
   77|    503|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    520|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 28, False: 492]
  ------------------
   83|     28|    return false;
   84|     28|  }
   85|    492|  probability_table_.resize(num_symbols_);
   86|    492|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 480]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|  12.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.7k, False: 335]
  ------------------
   91|  11.7k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  11.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 71, False: 11.6k]
  ------------------
   95|     71|      return false;
   96|     71|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  11.6k|    const int token = prob_data & 3;
  102|  11.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.31k, False: 6.31k]
  ------------------
  103|  5.31k|      const uint32_t offset = prob_data >> 2;
  104|  5.31k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 5.28k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   219k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 214k, False: 5.28k]
  ------------------
  109|   214k|        probability_table_[i + j] = 0;
  110|   214k|      }
  111|  5.28k|      i += offset;
  112|  6.31k|    } else {
  113|  6.31k|      const int extra_bytes = token;
  114|  6.31k|      uint32_t prob = prob_data >> 2;
  115|  10.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.06k, False: 6.27k]
  ------------------
  116|  4.06k|        uint8_t eb;
  117|  4.06k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 41, False: 4.02k]
  ------------------
  118|     41|          return false;
  119|     41|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.02k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.02k|      }
  124|  6.27k|      probability_table_[i] = prob;
  125|  6.27k|    }
  126|  11.6k|  }
  127|    335|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 83, False: 252]
  ------------------
  128|     83|    return false;
  129|     83|  }
  130|    252|  return true;
  131|    335|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    264|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    252|    DecoderBuffer* buffer) {
  136|    252|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    252|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    252|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    252|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 236]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 15]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     16|  } else
  145|    236|#endif
  146|    236|  {
  147|    236|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 235]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    236|  }
  151|    250|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 98, False: 152]
  ------------------
  152|     98|    return false;
  153|     98|  }
  154|    152|  const uint8_t* const data_head =
  155|    152|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    152|  buffer->Advance(bytes_encoded);
  158|    152|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 57, False: 95]
  ------------------
  159|     57|    return false;
  160|     57|  }
  161|     95|  return true;
  162|    152|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   684k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     95|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     95|  ans_.read_end();
  167|     95|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    481|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    481|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    481|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 481]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    481|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    481|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    481|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 56, False: 425]
  ------------------
   67|     56|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 53]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     56|  } else
   72|    425|#endif
   73|    425|  {
   74|    425|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 15, False: 410]
  ------------------
   75|     15|      return false;
   76|     15|    }
   77|    425|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    463|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 66, False: 397]
  ------------------
   83|     66|    return false;
   84|     66|  }
   85|    397|  probability_table_.resize(num_symbols_);
   86|    397|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 389]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  14.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 14.6k, False: 270]
  ------------------
   91|  14.6k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  14.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 67, False: 14.5k]
  ------------------
   95|     67|      return false;
   96|     67|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  14.5k|    const int token = prob_data & 3;
  102|  14.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.58k, False: 9.00k]
  ------------------
  103|  5.58k|      const uint32_t offset = prob_data >> 2;
  104|  5.58k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 5.55k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   188k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 182k, False: 5.55k]
  ------------------
  109|   182k|        probability_table_[i + j] = 0;
  110|   182k|      }
  111|  5.55k|      i += offset;
  112|  9.00k|    } else {
  113|  9.00k|      const int extra_bytes = token;
  114|  9.00k|      uint32_t prob = prob_data >> 2;
  115|  15.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.17k, False: 8.97k]
  ------------------
  116|  6.17k|        uint8_t eb;
  117|  6.17k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 6.14k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.14k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.14k|      }
  124|  8.97k|      probability_table_[i] = prob;
  125|  8.97k|    }
  126|  14.5k|  }
  127|    270|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 99, False: 171]
  ------------------
  128|     99|    return false;
  129|     99|  }
  130|    171|  return true;
  131|    270|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    179|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    171|    DecoderBuffer* buffer) {
  136|    171|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    171|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    171|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    171|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 167]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 3]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      4|  } else
  145|    167|#endif
  146|    167|  {
  147|    167|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 166]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    167|  }
  151|    169|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 84, False: 85]
  ------------------
  152|     84|    return false;
  153|     84|  }
  154|     85|  const uint8_t* const data_head =
  155|     85|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     85|  buffer->Advance(bytes_encoded);
  158|     85|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 40, False: 45]
  ------------------
  159|     40|    return false;
  160|     40|  }
  161|     45|  return true;
  162|     85|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   320k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     45|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     45|  ans_.read_end();
  167|     45|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    480|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    480|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    480|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 480]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    480|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    480|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    480|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 20, False: 460]
  ------------------
   67|     20|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 19]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     20|  } else
   72|    460|#endif
   73|    460|  {
   74|    460|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 451]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    460|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    470|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 454]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    454|  probability_table_.resize(num_symbols_);
   86|    454|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 447]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  43.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 42.8k, False: 302]
  ------------------
   91|  42.8k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  42.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 80, False: 42.7k]
  ------------------
   95|     80|      return false;
   96|     80|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  42.7k|    const int token = prob_data & 3;
  102|  42.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.16k, False: 36.6k]
  ------------------
  103|  6.16k|      const uint32_t offset = prob_data >> 2;
  104|  6.16k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 39, False: 6.12k]
  ------------------
  105|     39|        return false;
  106|     39|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   234k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 228k, False: 6.12k]
  ------------------
  109|   228k|        probability_table_[i + j] = 0;
  110|   228k|      }
  111|  6.12k|      i += offset;
  112|  36.6k|    } else {
  113|  36.6k|      const int extra_bytes = token;
  114|  36.6k|      uint32_t prob = prob_data >> 2;
  115|  67.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 31.2k, False: 36.5k]
  ------------------
  116|  31.2k|        uint8_t eb;
  117|  31.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 31.2k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  31.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  31.2k|      }
  124|  36.5k|      probability_table_[i] = prob;
  125|  36.5k|    }
  126|  42.7k|  }
  127|    302|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 103, False: 199]
  ------------------
  128|    103|    return false;
  129|    103|  }
  130|    199|  return true;
  131|    302|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    206|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    199|    DecoderBuffer* buffer) {
  136|    199|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    199|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    199|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    199|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 183]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 15]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     16|  } else
  145|    183|#endif
  146|    183|  {
  147|    183|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 182]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    183|  }
  151|    197|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 82, False: 115]
  ------------------
  152|     82|    return false;
  153|     82|  }
  154|    115|  const uint8_t* const data_head =
  155|    115|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    115|  buffer->Advance(bytes_encoded);
  158|    115|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 71]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|     71|  return true;
  162|    115|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   211k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     71|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     71|  ans_.read_end();
  167|     71|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    540|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    540|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    540|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 540]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    540|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    540|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    540|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 524]
  ------------------
   67|     16|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 14]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     16|  } else
   72|    524|#endif
   73|    524|  {
   74|    524|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 21, False: 503]
  ------------------
   75|     21|      return false;
   76|     21|    }
   77|    524|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    517|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 28, False: 489]
  ------------------
   83|     28|    return false;
   84|     28|  }
   85|    489|  probability_table_.resize(num_symbols_);
   86|    489|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 477]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|  48.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 48.0k, False: 326]
  ------------------
   91|  48.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  48.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 83, False: 47.9k]
  ------------------
   95|     83|      return false;
   96|     83|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  47.9k|    const int token = prob_data & 3;
  102|  47.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.9k, False: 37.0k]
  ------------------
  103|  10.9k|      const uint32_t offset = prob_data >> 2;
  104|  10.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 40, False: 10.9k]
  ------------------
  105|     40|        return false;
  106|     40|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   279k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 268k, False: 10.9k]
  ------------------
  109|   268k|        probability_table_[i + j] = 0;
  110|   268k|      }
  111|  10.9k|      i += offset;
  112|  37.0k|    } else {
  113|  37.0k|      const int extra_bytes = token;
  114|  37.0k|      uint32_t prob = prob_data >> 2;
  115|  86.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 49.3k, False: 37.0k]
  ------------------
  116|  49.3k|        uint8_t eb;
  117|  49.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 49.3k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  49.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  49.3k|      }
  124|  37.0k|      probability_table_[i] = prob;
  125|  37.0k|    }
  126|  47.9k|  }
  127|    326|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 121, False: 205]
  ------------------
  128|    121|    return false;
  129|    121|  }
  130|    205|  return true;
  131|    326|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    217|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    205|    DecoderBuffer* buffer) {
  136|    205|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    205|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    205|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    205|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 205]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|    205|#endif
  146|    205|  {
  147|    205|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 200]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    205|  }
  151|    200|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 99, False: 101]
  ------------------
  152|     99|    return false;
  153|     99|  }
  154|    101|  const uint8_t* const data_head =
  155|    101|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    101|  buffer->Advance(bytes_encoded);
  158|    101|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 76]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     76|  return true;
  162|    101|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   257k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     76|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     76|  ans_.read_end();
  167|     76|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    544|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    544|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    544|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 544]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    544|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    544|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    544|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 98, False: 446]
  ------------------
   67|     98|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 96]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     98|  } else
   72|    446|#endif
   73|    446|  {
   74|    446|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 433]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    446|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    529|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 37, False: 492]
  ------------------
   83|     37|    return false;
   84|     37|  }
   85|    492|  probability_table_.resize(num_symbols_);
   86|    492|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 489]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  1.73M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.73M, False: 293]
  ------------------
   91|  1.73M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.73M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 90, False: 1.73M]
  ------------------
   95|     90|      return false;
   96|     90|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.73M|    const int token = prob_data & 3;
  102|  1.73M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 370k, False: 1.36M]
  ------------------
  103|   370k|      const uint32_t offset = prob_data >> 2;
  104|   370k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 57, False: 370k]
  ------------------
  105|     57|        return false;
  106|     57|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  18.3M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 17.9M, False: 370k]
  ------------------
  109|  17.9M|        probability_table_[i + j] = 0;
  110|  17.9M|      }
  111|   370k|      i += offset;
  112|  1.36M|    } else {
  113|  1.36M|      const int extra_bytes = token;
  114|  1.36M|      uint32_t prob = prob_data >> 2;
  115|  3.04M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.67M, False: 1.36M]
  ------------------
  116|  1.67M|        uint8_t eb;
  117|  1.67M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 49, False: 1.67M]
  ------------------
  118|     49|          return false;
  119|     49|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.67M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.67M|      }
  124|  1.36M|      probability_table_[i] = prob;
  125|  1.36M|    }
  126|  1.73M|  }
  127|    293|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 56, False: 237]
  ------------------
  128|     56|    return false;
  129|     56|  }
  130|    237|  return true;
  131|    293|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    240|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    237|    DecoderBuffer* buffer) {
  136|    237|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    237|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    237|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    237|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 38, False: 199]
  ------------------
  140|     38|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 36]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     38|  } else
  145|    199|#endif
  146|    199|  {
  147|    199|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 198]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    199|  }
  151|    234|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 116, False: 118]
  ------------------
  152|    116|    return false;
  153|    116|  }
  154|    118|  const uint8_t* const data_head =
  155|    118|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    118|  buffer->Advance(bytes_encoded);
  158|    118|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 88]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|     88|  return true;
  162|    118|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|   298k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     88|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     88|  ans_.read_end();
  167|     88|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    513|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    513|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    513|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 513]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    513|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    513|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    513|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 87, False: 426]
  ------------------
   67|     87|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 85]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     87|  } else
   72|    426|#endif
   73|    426|  {
   74|    426|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 416]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    426|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    501|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 34, False: 467]
  ------------------
   83|     34|    return false;
   84|     34|  }
   85|    467|  probability_table_.resize(num_symbols_);
   86|    467|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 463]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  1.23M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.23M, False: 297]
  ------------------
   91|  1.23M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.23M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 88, False: 1.23M]
  ------------------
   95|     88|      return false;
   96|     88|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.23M|    const int token = prob_data & 3;
  102|  1.23M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 82.3k, False: 1.15M]
  ------------------
  103|  82.3k|      const uint32_t offset = prob_data >> 2;
  104|  82.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 44, False: 82.2k]
  ------------------
  105|     44|        return false;
  106|     44|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.91M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.83M, False: 82.2k]
  ------------------
  109|  2.83M|        probability_table_[i + j] = 0;
  110|  2.83M|      }
  111|  82.2k|      i += offset;
  112|  1.15M|    } else {
  113|  1.15M|      const int extra_bytes = token;
  114|  1.15M|      uint32_t prob = prob_data >> 2;
  115|  2.25M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.10M, False: 1.15M]
  ------------------
  116|  1.10M|        uint8_t eb;
  117|  1.10M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 34, False: 1.10M]
  ------------------
  118|     34|          return false;
  119|     34|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.10M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.10M|      }
  124|  1.15M|      probability_table_[i] = prob;
  125|  1.15M|    }
  126|  1.23M|  }
  127|    297|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 40, False: 257]
  ------------------
  128|     40|    return false;
  129|     40|  }
  130|    257|  return true;
  131|    297|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    261|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    257|    DecoderBuffer* buffer) {
  136|    257|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    257|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    257|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    257|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 72, False: 185]
  ------------------
  140|     72|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 70]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     72|  } else
  145|    185|#endif
  146|    185|  {
  147|    185|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 182]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    185|  }
  151|    252|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 112, False: 140]
  ------------------
  152|    112|    return false;
  153|    112|  }
  154|    140|  const uint8_t* const data_head =
  155|    140|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    140|  buffer->Advance(bytes_encoded);
  158|    140|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 107]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|    107|  return true;
  162|    140|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  36.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|    107|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    107|  ans_.read_end();
  167|    107|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    511|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    511|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    511|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 511]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    511|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    511|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    511|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 24, False: 487]
  ------------------
   67|     24|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 23]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     24|  } else
   72|    487|#endif
   73|    487|  {
   74|    487|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 14, False: 473]
  ------------------
   75|     14|      return false;
   76|     14|    }
   77|    487|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    496|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 40, False: 456]
  ------------------
   83|     40|    return false;
   84|     40|  }
   85|    456|  probability_table_.resize(num_symbols_);
   86|    456|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 446]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  10.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 10.1k, False: 301]
  ------------------
   91|  10.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  10.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 83, False: 10.0k]
  ------------------
   95|     83|      return false;
   96|     83|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  10.0k|    const int token = prob_data & 3;
  102|  10.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.60k, False: 5.42k]
  ------------------
  103|  4.60k|      const uint32_t offset = prob_data >> 2;
  104|  4.60k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 4.56k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   161k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 157k, False: 4.56k]
  ------------------
  109|   157k|        probability_table_[i + j] = 0;
  110|   157k|      }
  111|  4.56k|      i += offset;
  112|  5.42k|    } else {
  113|  5.42k|      const int extra_bytes = token;
  114|  5.42k|      uint32_t prob = prob_data >> 2;
  115|  10.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.69k, False: 5.39k]
  ------------------
  116|  4.69k|        uint8_t eb;
  117|  4.69k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 4.66k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.66k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.66k|      }
  124|  5.39k|      probability_table_[i] = prob;
  125|  5.39k|    }
  126|  10.0k|  }
  127|    301|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 34, False: 267]
  ------------------
  128|     34|    return false;
  129|     34|  }
  130|    267|  return true;
  131|    301|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    277|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    267|    DecoderBuffer* buffer) {
  136|    267|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    267|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    267|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    267|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 251]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 15]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     16|  } else
  145|    251|#endif
  146|    251|  {
  147|    251|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 17, False: 234]
  ------------------
  148|     17|      return false;
  149|     17|    }
  150|    251|  }
  151|    249|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 114, False: 135]
  ------------------
  152|    114|    return false;
  153|    114|  }
  154|    135|  const uint8_t* const data_head =
  155|    135|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    135|  buffer->Advance(bytes_encoded);
  158|    135|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 104]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|    104|  return true;
  162|    135|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  29.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|    104|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    104|  ans_.read_end();
  167|    104|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    457|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    457|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    457|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 457]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    457|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    457|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    457|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 39, False: 418]
  ------------------
   67|     39|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 37]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     39|  } else
   72|    418|#endif
   73|    418|  {
   74|    418|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 22, False: 396]
  ------------------
   75|     22|      return false;
   76|     22|    }
   77|    418|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    433|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 409]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    409|  probability_table_.resize(num_symbols_);
   86|    409|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 398]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  1.03M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.03M, False: 234]
  ------------------
   91|  1.03M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.03M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 94, False: 1.03M]
  ------------------
   95|     94|      return false;
   96|     94|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.03M|    const int token = prob_data & 3;
  102|  1.03M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 379k, False: 652k]
  ------------------
  103|   379k|      const uint32_t offset = prob_data >> 2;
  104|   379k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 44, False: 379k]
  ------------------
  105|     44|        return false;
  106|     44|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  16.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 16.1M, False: 379k]
  ------------------
  109|  16.1M|        probability_table_[i + j] = 0;
  110|  16.1M|      }
  111|   379k|      i += offset;
  112|   652k|    } else {
  113|   652k|      const int extra_bytes = token;
  114|   652k|      uint32_t prob = prob_data >> 2;
  115|  1.11M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 461k, False: 652k]
  ------------------
  116|   461k|        uint8_t eb;
  117|   461k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 461k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   461k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   461k|      }
  124|   652k|      probability_table_[i] = prob;
  125|   652k|    }
  126|  1.03M|  }
  127|    234|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 32, False: 202]
  ------------------
  128|     32|    return false;
  129|     32|  }
  130|    202|  return true;
  131|    234|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    213|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    202|    DecoderBuffer* buffer) {
  136|    202|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    202|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    202|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    202|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 199]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 2]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      3|  } else
  145|    199|#endif
  146|    199|  {
  147|    199|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 196]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    199|  }
  151|    198|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 90, False: 108]
  ------------------
  152|     90|    return false;
  153|     90|  }
  154|    108|  const uint8_t* const data_head =
  155|    108|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    108|  buffer->Advance(bytes_encoded);
  158|    108|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 77]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|     77|  return true;
  162|    108|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  8.08M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     77|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     77|  ans_.read_end();
  167|     77|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    484|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    484|    DecoderBuffer* buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    484|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 484]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    484|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    484|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    484|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 76, False: 408]
  ------------------
   67|     76|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 73]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     76|  } else
   72|    408|#endif
   73|    408|  {
   74|    408|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 395]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    408|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    468|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 453]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    453|  probability_table_.resize(num_symbols_);
   86|    453|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 447]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   343k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 343k, False: 296]
  ------------------
   91|   343k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   343k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 86, False: 343k]
  ------------------
   95|     86|      return false;
   96|     86|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   343k|    const int token = prob_data & 3;
  102|   343k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.50k, False: 333k]
  ------------------
  103|  9.50k|      const uint32_t offset = prob_data >> 2;
  104|  9.50k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 31, False: 9.47k]
  ------------------
  105|     31|        return false;
  106|     31|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   380k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 371k, False: 9.47k]
  ------------------
  109|   371k|        probability_table_[i + j] = 0;
  110|   371k|      }
  111|  9.47k|      i += offset;
  112|   333k|    } else {
  113|   333k|      const int extra_bytes = token;
  114|   333k|      uint32_t prob = prob_data >> 2;
  115|   671k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 337k, False: 333k]
  ------------------
  116|   337k|        uint8_t eb;
  117|   337k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 34, False: 337k]
  ------------------
  118|     34|          return false;
  119|     34|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   337k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   337k|      }
  124|   333k|      probability_table_[i] = prob;
  125|   333k|    }
  126|   343k|  }
  127|    296|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 42, False: 254]
  ------------------
  128|     42|    return false;
  129|     42|  }
  130|    254|  return true;
  131|    296|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    260|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    254|    DecoderBuffer* buffer) {
  136|    254|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    254|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    254|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    254|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 51, False: 203]
  ------------------
  140|     51|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 50]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     51|  } else
  145|    203|#endif
  146|    203|  {
  147|    203|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 11, False: 192]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|    203|  }
  151|    242|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 120, False: 122]
  ------------------
  152|    120|    return false;
  153|    120|  }
  154|    122|  const uint8_t* const data_head =
  155|    122|      reinterpret_cast<const uint8_t*>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    122|  buffer->Advance(bytes_encoded);
  158|    122|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 89]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     89|  return true;
  162|    122|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  3.33M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     89|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     89|  ans_.read_end();
  167|     89|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  13.9k|                   DecoderBuffer* src_buffer, uint32_t* out_values) {
   34|  13.9k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 44, False: 13.9k]
  ------------------
   35|     44|    return true;
   36|     44|  }
   37|       |  // Decode which scheme to use.
   38|  13.9k|  uint8_t scheme;
   39|  13.9k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 292, False: 13.6k]
  ------------------
   40|    292|    return false;
   41|    292|  }
   42|  13.6k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.43k, False: 12.2k]
  ------------------
   43|  1.43k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.43k|                                                  src_buffer, out_values);
   45|  12.2k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 9.06k, False: 3.13k]
  ------------------
   46|  9.06k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  9.06k|                                               out_values);
   48|  9.06k|  }
   49|  3.13k|  return false;
   50|  13.6k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.43k|                         DecoderBuffer* src_buffer, uint32_t* out_values) {
   55|       |  // Decode the encoded data.
   56|  1.43k|  SymbolDecoderT<5> tag_decoder;
   57|  1.43k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 681, False: 753]
  ------------------
   58|    681|    return false;
   59|    681|  }
   60|       |
   61|    753|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 348, False: 405]
  ------------------
   62|    348|    return false;
   63|    348|  }
   64|       |
   65|    405|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 405, False: 0]
  |  Branch (65:25): [True: 91, False: 314]
  ------------------
   66|     91|    return false;  // Wrong number of symbols.
   67|     91|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    314|  src_buffer->StartBitDecoding(false, nullptr);
   72|    314|  int value_id = 0;
   73|   628k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 627k, False: 313]
  ------------------
   74|       |    // Decode the tag.
   75|   627k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  1.26M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 636k, False: 627k]
  ------------------
   78|   636k|      uint32_t val;
   79|   636k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 1, False: 636k]
  ------------------
   80|      1|        return false;
   81|      1|      }
   82|   636k|      out_values[value_id++] = val;
   83|   636k|    }
   84|   627k|  }
   85|    313|  tag_decoder.EndDecoding();
   86|    313|  src_buffer->EndBitDecoding();
   87|    313|  return true;
   88|    314|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  9.06k|                      uint32_t* out_values) {
  117|  9.06k|  uint8_t max_bit_length;
  118|  9.06k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 51, False: 9.01k]
  ------------------
  119|     51|    return false;
  120|     51|  }
  121|  9.01k|  switch (max_bit_length) {
  122|    660|    case 1:
  ------------------
  |  Branch (122:5): [True: 660, False: 8.35k]
  ------------------
  123|    660|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    660|                                                         out_values);
  125|    442|    case 2:
  ------------------
  |  Branch (125:5): [True: 442, False: 8.57k]
  ------------------
  126|    442|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    442|                                                         out_values);
  128|    511|    case 3:
  ------------------
  |  Branch (128:5): [True: 511, False: 8.50k]
  ------------------
  129|    511|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    511|                                                         out_values);
  131|    516|    case 4:
  ------------------
  |  Branch (131:5): [True: 516, False: 8.49k]
  ------------------
  132|    516|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    516|                                                         out_values);
  134|    241|    case 5:
  ------------------
  |  Branch (134:5): [True: 241, False: 8.77k]
  ------------------
  135|    241|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    241|                                                         out_values);
  137|    410|    case 6:
  ------------------
  |  Branch (137:5): [True: 410, False: 8.60k]
  ------------------
  138|    410|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    410|                                                         out_values);
  140|    470|    case 7:
  ------------------
  |  Branch (140:5): [True: 470, False: 8.54k]
  ------------------
  141|    470|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    470|                                                         out_values);
  143|    422|    case 8:
  ------------------
  |  Branch (143:5): [True: 422, False: 8.59k]
  ------------------
  144|    422|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    422|                                                         out_values);
  146|    450|    case 9:
  ------------------
  |  Branch (146:5): [True: 450, False: 8.56k]
  ------------------
  147|    450|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    450|                                                         out_values);
  149|    544|    case 10:
  ------------------
  |  Branch (149:5): [True: 544, False: 8.47k]
  ------------------
  150|    544|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    544|          num_values, src_buffer, out_values);
  152|    481|    case 11:
  ------------------
  |  Branch (152:5): [True: 481, False: 8.53k]
  ------------------
  153|    481|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    481|          num_values, src_buffer, out_values);
  155|    480|    case 12:
  ------------------
  |  Branch (155:5): [True: 480, False: 8.53k]
  ------------------
  156|    480|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    480|          num_values, src_buffer, out_values);
  158|    540|    case 13:
  ------------------
  |  Branch (158:5): [True: 540, False: 8.47k]
  ------------------
  159|    540|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    540|          num_values, src_buffer, out_values);
  161|    544|    case 14:
  ------------------
  |  Branch (161:5): [True: 544, False: 8.47k]
  ------------------
  162|    544|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    544|          num_values, src_buffer, out_values);
  164|    513|    case 15:
  ------------------
  |  Branch (164:5): [True: 513, False: 8.50k]
  ------------------
  165|    513|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    513|          num_values, src_buffer, out_values);
  167|    511|    case 16:
  ------------------
  |  Branch (167:5): [True: 511, False: 8.50k]
  ------------------
  168|    511|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    511|          num_values, src_buffer, out_values);
  170|    457|    case 17:
  ------------------
  |  Branch (170:5): [True: 457, False: 8.55k]
  ------------------
  171|    457|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    457|          num_values, src_buffer, out_values);
  173|    484|    case 18:
  ------------------
  |  Branch (173:5): [True: 484, False: 8.53k]
  ------------------
  174|    484|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    484|          num_values, src_buffer, out_values);
  176|    338|    default:
  ------------------
  |  Branch (176:5): [True: 338, False: 8.67k]
  ------------------
  177|    338|      return false;
  178|  9.01k|  }
  179|  9.01k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    660|                              uint32_t* out_values) {
   93|    660|  SymbolDecoderT decoder;
   94|    660|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 328, False: 332]
  ------------------
   95|    328|    return false;
   96|    328|  }
   97|       |
   98|    332|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 332, False: 0]
  |  Branch (98:25): [True: 33, False: 299]
  ------------------
   99|     33|    return false;  // Wrong number of symbols.
  100|     33|  }
  101|       |
  102|    299|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 66, False: 233]
  ------------------
  103|     66|    return false;
  104|     66|  }
  105|   233M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 233M, False: 233]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   233M|    const uint32_t value = decoder.DecodeSymbol();
  108|   233M|    out_values[i] = value;
  109|   233M|  }
  110|    233|  decoder.EndDecoding();
  111|    233|  return true;
  112|    299|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    442|                              uint32_t* out_values) {
   93|    442|  SymbolDecoderT decoder;
   94|    442|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 215, False: 227]
  ------------------
   95|    215|    return false;
   96|    215|  }
   97|       |
   98|    227|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 227, False: 0]
  |  Branch (98:25): [True: 16, False: 211]
  ------------------
   99|     16|    return false;  // Wrong number of symbols.
  100|     16|  }
  101|       |
  102|    211|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 79, False: 132]
  ------------------
  103|     79|    return false;
  104|     79|  }
  105|   115M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 115M, False: 132]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   115M|    const uint32_t value = decoder.DecodeSymbol();
  108|   115M|    out_values[i] = value;
  109|   115M|  }
  110|    132|  decoder.EndDecoding();
  111|    132|  return true;
  112|    211|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    511|                              uint32_t* out_values) {
   93|    511|  SymbolDecoderT decoder;
   94|    511|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 213, False: 298]
  ------------------
   95|    213|    return false;
   96|    213|  }
   97|       |
   98|    298|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 298, False: 0]
  |  Branch (98:25): [True: 15, False: 283]
  ------------------
   99|     15|    return false;  // Wrong number of symbols.
  100|     15|  }
  101|       |
  102|    283|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 83, False: 200]
  ------------------
  103|     83|    return false;
  104|     83|  }
  105|  46.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 46.5M, False: 200]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  46.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  46.5M|    out_values[i] = value;
  109|  46.5M|  }
  110|    200|  decoder.EndDecoding();
  111|    200|  return true;
  112|    283|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    516|                              uint32_t* out_values) {
   93|    516|  SymbolDecoderT decoder;
   94|    516|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 217, False: 299]
  ------------------
   95|    217|    return false;
   96|    217|  }
   97|       |
   98|    299|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 299, False: 0]
  |  Branch (98:25): [True: 20, False: 279]
  ------------------
   99|     20|    return false;  // Wrong number of symbols.
  100|     20|  }
  101|       |
  102|    279|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 73, False: 206]
  ------------------
  103|     73|    return false;
  104|     73|  }
  105|  5.43M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.43M, False: 206]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.43M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.43M|    out_values[i] = value;
  109|  5.43M|  }
  110|    206|  decoder.EndDecoding();
  111|    206|  return true;
  112|    279|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    241|                              uint32_t* out_values) {
   93|    241|  SymbolDecoderT decoder;
   94|    241|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 50, False: 191]
  ------------------
   95|     50|    return false;
   96|     50|  }
   97|       |
   98|    191|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 191, False: 0]
  |  Branch (98:25): [True: 93, False: 98]
  ------------------
   99|     93|    return false;  // Wrong number of symbols.
  100|     93|  }
  101|       |
  102|     98|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 13, False: 85]
  ------------------
  103|     13|    return false;
  104|     13|  }
  105|  6.96M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.96M, False: 85]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.96M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.96M|    out_values[i] = value;
  109|  6.96M|  }
  110|     85|  decoder.EndDecoding();
  111|     85|  return true;
  112|     98|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    410|                              uint32_t* out_values) {
   93|    410|  SymbolDecoderT decoder;
   94|    410|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 194, False: 216]
  ------------------
   95|    194|    return false;
   96|    194|  }
   97|       |
   98|    216|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 216, False: 0]
  |  Branch (98:25): [True: 8, False: 208]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    208|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 98, False: 110]
  ------------------
  103|     98|    return false;
  104|     98|  }
  105|  59.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 59.3M, False: 110]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  59.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  59.3M|    out_values[i] = value;
  109|  59.3M|  }
  110|    110|  decoder.EndDecoding();
  111|    110|  return true;
  112|    208|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    470|                              uint32_t* out_values) {
   93|    470|  SymbolDecoderT decoder;
   94|    470|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 171, False: 299]
  ------------------
   95|    171|    return false;
   96|    171|  }
   97|       |
   98|    299|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 299, False: 0]
  |  Branch (98:25): [True: 11, False: 288]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    288|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 97, False: 191]
  ------------------
  103|     97|    return false;
  104|     97|  }
  105|  14.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 14.7M, False: 191]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  14.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  14.7M|    out_values[i] = value;
  109|  14.7M|  }
  110|    191|  decoder.EndDecoding();
  111|    191|  return true;
  112|    288|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    422|                              uint32_t* out_values) {
   93|    422|  SymbolDecoderT decoder;
   94|    422|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 199, False: 223]
  ------------------
   95|    199|    return false;
   96|    199|  }
   97|       |
   98|    223|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 223, False: 0]
  |  Branch (98:25): [True: 12, False: 211]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    211|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 107, False: 104]
  ------------------
  103|    107|    return false;
  104|    107|  }
  105|  17.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 17.5M, False: 104]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  17.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  17.5M|    out_values[i] = value;
  109|  17.5M|  }
  110|    104|  decoder.EndDecoding();
  111|    104|  return true;
  112|    211|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    450|                              uint32_t* out_values) {
   93|    450|  SymbolDecoderT decoder;
   94|    450|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 234, False: 216]
  ------------------
   95|    234|    return false;
   96|    234|  }
   97|       |
   98|    216|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 216, False: 0]
  |  Branch (98:25): [True: 8, False: 208]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    208|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 89, False: 119]
  ------------------
  103|     89|    return false;
  104|     89|  }
  105|   213k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 213k, False: 119]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   213k|    const uint32_t value = decoder.DecodeSymbol();
  108|   213k|    out_values[i] = value;
  109|   213k|  }
  110|    119|  decoder.EndDecoding();
  111|    119|  return true;
  112|    208|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    544|                              uint32_t* out_values) {
   93|    544|  SymbolDecoderT decoder;
   94|    544|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 280, False: 264]
  ------------------
   95|    280|    return false;
   96|    280|  }
   97|       |
   98|    264|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 264, False: 0]
  |  Branch (98:25): [True: 12, False: 252]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    252|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 157, False: 95]
  ------------------
  103|    157|    return false;
  104|    157|  }
  105|   684k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 684k, False: 95]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   684k|    const uint32_t value = decoder.DecodeSymbol();
  108|   684k|    out_values[i] = value;
  109|   684k|  }
  110|     95|  decoder.EndDecoding();
  111|     95|  return true;
  112|    252|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    481|                              uint32_t* out_values) {
   93|    481|  SymbolDecoderT decoder;
   94|    481|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 302, False: 179]
  ------------------
   95|    302|    return false;
   96|    302|  }
   97|       |
   98|    179|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 179, False: 0]
  |  Branch (98:25): [True: 8, False: 171]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    171|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 126, False: 45]
  ------------------
  103|    126|    return false;
  104|    126|  }
  105|   320k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 320k, False: 45]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   320k|    const uint32_t value = decoder.DecodeSymbol();
  108|   320k|    out_values[i] = value;
  109|   320k|  }
  110|     45|  decoder.EndDecoding();
  111|     45|  return true;
  112|    171|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    480|                              uint32_t* out_values) {
   93|    480|  SymbolDecoderT decoder;
   94|    480|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 274, False: 206]
  ------------------
   95|    274|    return false;
   96|    274|  }
   97|       |
   98|    206|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 206, False: 0]
  |  Branch (98:25): [True: 7, False: 199]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    199|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 128, False: 71]
  ------------------
  103|    128|    return false;
  104|    128|  }
  105|   211k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 211k, False: 71]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   211k|    const uint32_t value = decoder.DecodeSymbol();
  108|   211k|    out_values[i] = value;
  109|   211k|  }
  110|     71|  decoder.EndDecoding();
  111|     71|  return true;
  112|    199|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    540|                              uint32_t* out_values) {
   93|    540|  SymbolDecoderT decoder;
   94|    540|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 323, False: 217]
  ------------------
   95|    323|    return false;
   96|    323|  }
   97|       |
   98|    217|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 217, False: 0]
  |  Branch (98:25): [True: 12, False: 205]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    205|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 129, False: 76]
  ------------------
  103|    129|    return false;
  104|    129|  }
  105|   257k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 257k, False: 76]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   257k|    const uint32_t value = decoder.DecodeSymbol();
  108|   257k|    out_values[i] = value;
  109|   257k|  }
  110|     76|  decoder.EndDecoding();
  111|     76|  return true;
  112|    205|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    544|                              uint32_t* out_values) {
   93|    544|  SymbolDecoderT decoder;
   94|    544|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 304, False: 240]
  ------------------
   95|    304|    return false;
   96|    304|  }
   97|       |
   98|    240|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 240, False: 0]
  |  Branch (98:25): [True: 3, False: 237]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    237|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 149, False: 88]
  ------------------
  103|    149|    return false;
  104|    149|  }
  105|   298k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 298k, False: 88]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   298k|    const uint32_t value = decoder.DecodeSymbol();
  108|   298k|    out_values[i] = value;
  109|   298k|  }
  110|     88|  decoder.EndDecoding();
  111|     88|  return true;
  112|    237|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    513|                              uint32_t* out_values) {
   93|    513|  SymbolDecoderT decoder;
   94|    513|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 252, False: 261]
  ------------------
   95|    252|    return false;
   96|    252|  }
   97|       |
   98|    261|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 261, False: 0]
  |  Branch (98:25): [True: 4, False: 257]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    257|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 150, False: 107]
  ------------------
  103|    150|    return false;
  104|    150|  }
  105|  36.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 36.4M, False: 107]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  36.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  36.4M|    out_values[i] = value;
  109|  36.4M|  }
  110|    107|  decoder.EndDecoding();
  111|    107|  return true;
  112|    257|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    511|                              uint32_t* out_values) {
   93|    511|  SymbolDecoderT decoder;
   94|    511|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 234, False: 277]
  ------------------
   95|    234|    return false;
   96|    234|  }
   97|       |
   98|    277|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 277, False: 0]
  |  Branch (98:25): [True: 10, False: 267]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    267|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 163, False: 104]
  ------------------
  103|    163|    return false;
  104|    163|  }
  105|  29.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 29.5M, False: 104]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  29.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  29.5M|    out_values[i] = value;
  109|  29.5M|  }
  110|    104|  decoder.EndDecoding();
  111|    104|  return true;
  112|    267|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    457|                              uint32_t* out_values) {
   93|    457|  SymbolDecoderT decoder;
   94|    457|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 244, False: 213]
  ------------------
   95|    244|    return false;
   96|    244|  }
   97|       |
   98|    213|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 213, False: 0]
  |  Branch (98:25): [True: 11, False: 202]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    202|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 125, False: 77]
  ------------------
  103|    125|    return false;
  104|    125|  }
  105|  8.08M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.08M, False: 77]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.08M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.08M|    out_values[i] = value;
  109|  8.08M|  }
  110|     77|  decoder.EndDecoding();
  111|     77|  return true;
  112|    202|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    484|                              uint32_t* out_values) {
   93|    484|  SymbolDecoderT decoder;
   94|    484|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 224, False: 260]
  ------------------
   95|    224|    return false;
   96|    224|  }
   97|       |
   98|    260|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 260, False: 0]
  |  Branch (98:25): [True: 6, False: 254]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    254|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 165, False: 89]
  ------------------
  103|    165|    return false;
  104|    165|  }
  105|  3.33M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.33M, False: 89]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.33M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.33M|    out_values[i] = value;
  109|  3.33M|  }
  110|     89|  decoder.EndDecoding();
  111|     89|  return true;
  112|    254|}

_ZN5draco11MeshDecoderC2Ev:
   19|  17.0k|MeshDecoder::MeshDecoder() : mesh_(nullptr) {}
_ZN5draco11MeshDecoder6DecodeERKNS_12DracoOptionsINS_17GeometryAttribute4TypeEEEPNS_13DecoderBufferEPNS_4MeshE:
   22|  17.0k|                           DecoderBuffer* in_buffer, Mesh* out_mesh) {
   23|  17.0k|  mesh_ = out_mesh;
   24|  17.0k|  return PointCloudDecoder::Decode(options, in_buffer, out_mesh);
   25|  17.0k|}
_ZN5draco11MeshDecoder18DecodeGeometryDataEv:
   27|  16.1k|bool MeshDecoder::DecodeGeometryData() {
   28|  16.1k|  if (mesh_ == nullptr) {
  ------------------
  |  Branch (28:7): [True: 0, False: 16.1k]
  ------------------
   29|      0|    return false;
   30|      0|  }
   31|  16.1k|  if (!DecodeConnectivity()) {
  ------------------
  |  Branch (31:7): [True: 9.79k, False: 6.38k]
  ------------------
   32|  9.79k|    return false;
   33|  9.79k|  }
   34|  6.38k|  return PointCloudDecoder::DecodeGeometryData();
   35|  16.1k|}

_ZNK5draco11MeshDecoder15GetGeometryTypeEv:
   31|  30.8k|  EncodedGeometryType GetGeometryType() const override {
   32|  30.8k|    return TRIANGULAR_MESH;
   33|  30.8k|  }
_ZNK5draco11MeshDecoder14GetCornerTableEv:
   41|    337|  virtual const CornerTable* GetCornerTable() const { return nullptr; }
_ZNK5draco11MeshDecoder24GetAttributeEncodingDataEi:
   52|    337|      int /* att_id */) const {
   53|    337|    return nullptr;
   54|    337|  }
_ZNK5draco11MeshDecoder4meshEv:
   56|  23.6M|  Mesh* mesh() const { return mesh_; }

_ZN5draco22MeshEdgebreakerDecoderC2Ev:
   23|  11.3k|MeshEdgebreakerDecoder::MeshEdgebreakerDecoder() = default;
_ZN5draco22MeshEdgebreakerDecoder23CreateAttributesDecoderEi:
   25|  5.40k|bool MeshEdgebreakerDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
   26|  5.40k|  return impl_->CreateAttributesDecoder(att_decoder_id);
   27|  5.40k|}
_ZN5draco22MeshEdgebreakerDecoder17InitializeDecoderEv:
   29|  10.7k|bool MeshEdgebreakerDecoder::InitializeDecoder() {
   30|  10.7k|  uint8_t traversal_decoder_type;
   31|  10.7k|  if (!buffer()->Decode(&traversal_decoder_type)) {
  ------------------
  |  Branch (31:7): [True: 3, False: 10.7k]
  ------------------
   32|      3|    return false;
   33|      3|  }
   34|  10.7k|  impl_ = nullptr;
   35|  10.7k|  if (traversal_decoder_type == MESH_EDGEBREAKER_STANDARD_ENCODING) {
  ------------------
  |  Branch (35:7): [True: 4.82k, False: 5.96k]
  ------------------
   36|  4.82k|#ifdef DRACO_STANDARD_EDGEBREAKER_SUPPORTED
   37|  4.82k|    impl_ = std::unique_ptr<MeshEdgebreakerDecoderImplInterface>(
   38|  4.82k|        new MeshEdgebreakerDecoderImpl<MeshEdgebreakerTraversalDecoder>());
   39|  4.82k|#endif
   40|  5.96k|  } else if (traversal_decoder_type == MESH_EDGEBREAKER_PREDICTIVE_ENCODING) {
  ------------------
  |  Branch (40:14): [True: 2.65k, False: 3.31k]
  ------------------
   41|  2.65k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   42|  2.65k|#ifdef DRACO_PREDICTIVE_EDGEBREAKER_SUPPORTED
   43|  2.65k|    impl_ = std::unique_ptr<MeshEdgebreakerDecoderImplInterface>(
   44|  2.65k|        new MeshEdgebreakerDecoderImpl<
   45|  2.65k|            MeshEdgebreakerTraversalPredictiveDecoder>());
   46|  2.65k|#endif
   47|  2.65k|#endif
   48|  3.31k|  } else if (traversal_decoder_type == MESH_EDGEBREAKER_VALENCE_ENCODING) {
  ------------------
  |  Branch (48:14): [True: 3.30k, False: 11]
  ------------------
   49|  3.30k|    impl_ = std::unique_ptr<MeshEdgebreakerDecoderImplInterface>(
   50|  3.30k|        new MeshEdgebreakerDecoderImpl<
   51|  3.30k|            MeshEdgebreakerTraversalValenceDecoder>());
   52|  3.30k|  }
   53|  10.7k|  if (!impl_) {
  ------------------
  |  Branch (53:7): [True: 11, False: 10.7k]
  ------------------
   54|     11|    return false;
   55|     11|  }
   56|  10.7k|  if (!impl_->Init(this)) {
  ------------------
  |  Branch (56:7): [True: 0, False: 10.7k]
  ------------------
   57|      0|    return false;
   58|      0|  }
   59|  10.7k|  return true;
   60|  10.7k|}
_ZN5draco22MeshEdgebreakerDecoder18DecodeConnectivityEv:
   62|  10.7k|bool MeshEdgebreakerDecoder::DecodeConnectivity() {
   63|  10.7k|  return impl_->DecodeConnectivity();
   64|  10.7k|}
_ZN5draco22MeshEdgebreakerDecoder19OnAttributesDecodedEv:
   66|  1.22k|bool MeshEdgebreakerDecoder::OnAttributesDecoded() {
   67|  1.22k|  return impl_->OnAttributesDecoded();
   68|  1.22k|}

_ZNK5draco22MeshEdgebreakerDecoder14GetCornerTableEv:
   29|  6.24k|  const CornerTable* GetCornerTable() const override {
   30|  6.24k|    return impl_->GetCornerTable();
   31|  6.24k|  }
_ZNK5draco22MeshEdgebreakerDecoder23GetAttributeCornerTableEi:
   34|  6.24k|      int att_id) const override {
   35|  6.24k|    return impl_->GetAttributeCornerTable(att_id);
   36|  6.24k|  }
_ZNK5draco22MeshEdgebreakerDecoder24GetAttributeEncodingDataEi:
   39|  6.24k|      int att_id) const override {
   40|  6.24k|    return impl_->GetAttributeEncodingData(att_id);
   41|  6.24k|  }

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  4.82k|    : decoder_(nullptr),
   49|  4.82k|      last_symbol_id_(-1),
   50|  4.82k|      last_vert_id_(-1),
   51|  4.82k|      last_face_id_(-1),
   52|  4.82k|      num_new_vertices_(0),
   53|  4.82k|      num_encoded_vertices_(0),
   54|  4.82k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  4.82k|    MeshEdgebreakerDecoder* decoder) {
   59|  4.82k|  decoder_ = decoder;
   60|  4.82k|  return true;
   61|  4.82k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  4.19k|    int att_id) const {
   67|  5.79k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 5.27k, False: 522]
  ------------------
   68|  5.27k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  5.27k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.60k, False: 3.66k]
  |  Branch (69:27): [True: 0, False: 3.66k]
  ------------------
   70|  1.60k|      continue;
   71|  1.60k|    }
   72|  3.66k|    const AttributesDecoderInterface* const dec =
   73|  3.66k|        decoder_->attributes_decoder(decoder_id);
   74|  6.26k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 6.26k, False: 1]
  ------------------
   75|  6.26k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 3.66k, False: 2.60k]
  ------------------
   76|  3.66k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 2.10k, False: 1.56k]
  ------------------
   77|  2.10k|          return &attribute_data_[i].connectivity_data;
   78|  2.10k|        }
   79|  1.56k|        return nullptr;
   80|  3.66k|      }
   81|  6.26k|    }
   82|  3.66k|  }
   83|    522|  return nullptr;
   84|  4.19k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  4.19k|    int att_id) const {
   90|  5.79k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 5.27k, False: 522]
  ------------------
   91|  5.27k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  5.27k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.60k, False: 3.66k]
  |  Branch (92:27): [True: 0, False: 3.66k]
  ------------------
   93|  1.60k|      continue;
   94|  1.60k|    }
   95|  3.66k|    const AttributesDecoderInterface* const dec =
   96|  3.66k|        decoder_->attributes_decoder(decoder_id);
   97|  6.26k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 6.26k, False: 1]
  ------------------
   98|  6.26k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 3.66k, False: 2.60k]
  ------------------
   99|  3.66k|        return &attribute_data_[i].encoding_data;
  100|  3.66k|      }
  101|  6.26k|    }
  102|  3.66k|  }
  103|    522|  return &pos_encoding_data_;
  104|  4.19k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  3.59k|    int32_t att_decoder_id) {
  131|  3.59k|  int8_t att_data_id;
  132|  3.59k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 30, False: 3.56k]
  ------------------
  133|     30|    return false;
  134|     30|  }
  135|  3.56k|  uint8_t decoder_type;
  136|  3.56k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 19, False: 3.54k]
  ------------------
  137|     19|    return false;
  138|     19|  }
  139|       |
  140|  3.54k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 3.06k, False: 473]
  ------------------
  141|  3.06k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 94, False: 2.97k]
  ------------------
  142|     94|      return false;  // Unexpected attribute data.
  143|     94|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  2.97k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 17, False: 2.95k]
  ------------------
  148|     17|      return false;
  149|     17|    }
  150|       |
  151|  2.95k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  2.95k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    473|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 4, False: 469]
  ------------------
  155|      4|      return false;  // Some other decoder is already using the data. Error.
  156|      4|    }
  157|    469|    pos_data_decoder_id_ = att_decoder_id;
  158|    469|  }
  159|       |
  160|  3.42k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  3.42k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  3.42k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 3.42k, False: 1]
  ------------------
  162|  3.42k|    uint8_t traversal_method_encoded;
  163|  3.42k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 13, False: 3.41k]
  ------------------
  164|     13|      return false;
  165|     13|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  3.41k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 54, False: 3.35k]
  ------------------
  168|     54|      return false;
  169|     54|    }
  170|  3.35k|    traversal_method =
  171|  3.35k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  3.35k|  }
  173|       |
  174|  3.36k|  const Mesh* mesh = decoder_->mesh();
  175|  3.36k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  3.36k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.69k, False: 1.66k]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.69k|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|  1.69k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 419, False: 1.27k]
  ------------------
  182|    419|      encoding_data = &pos_encoding_data_;
  183|  1.27k|    } else {
  184|  1.27k|      encoding_data = &attribute_data_[att_data_id].encoding_data;
  185|       |      // Mark the attribute connectivity data invalid to ensure it's not used
  186|       |      // later on.
  187|  1.27k|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|  1.27k|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.69k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 379, False: 1.31k]
  ------------------
  191|    379|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    379|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    379|          AttTraverser;
  194|    379|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|  1.31k|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 1.31k, False: 0]
  ------------------
  196|  1.31k|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|  1.31k|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|  1.31k|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|  1.31k|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.69k|  } else {
  203|  1.66k|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 11, False: 1.65k]
  ------------------
  204|     11|      return false;  // Unsupported method.
  205|     11|    }
  206|  1.65k|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 13, False: 1.64k]
  ------------------
  207|     13|      return false;  // Attribute data must be specified.
  208|     13|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|  1.64k|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|  1.64k|        AttObserver;
  214|  1.64k|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|  1.64k|        AttTraverser;
  216|       |
  217|  1.64k|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|  1.64k|        &attribute_data_[att_data_id].encoding_data;
  219|  1.64k|    const MeshAttributeCornerTable* const corner_table =
  220|  1.64k|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|  1.64k|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|  1.64k|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|  1.64k|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|  1.64k|                             encoding_data);
  227|       |
  228|  1.64k|    AttTraverser att_traverser;
  229|  1.64k|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|  1.64k|    traversal_sequencer->SetTraverser(att_traverser);
  232|  1.64k|    sequencer = std::move(traversal_sequencer);
  233|  1.64k|  }
  234|       |
  235|  3.33k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 3.33k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  3.33k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  3.33k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  3.33k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  3.33k|                                        std::move(att_controller));
  244|  3.33k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  4.82k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  4.82k|  num_new_vertices_ = 0;
  249|  4.82k|  new_to_parent_vertex_map_.clear();
  250|  4.82k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  4.82k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.82k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 695, False: 4.13k]
  ------------------
  252|    695|    uint32_t num_new_verts;
  253|    695|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    695|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 269, False: 426]
  ------------------
  254|    269|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 8, False: 261]
  ------------------
  255|      8|        return false;
  256|      8|      }
  257|    426|    } else {
  258|    426|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 5, False: 421]
  ------------------
  259|      5|        return false;
  260|      5|      }
  261|    426|    }
  262|    682|    num_new_vertices_ = num_new_verts;
  263|    682|  }
  264|  4.81k|#endif
  265|       |
  266|  4.81k|  uint32_t num_encoded_vertices;
  267|  4.81k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  4.81k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.81k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 261, False: 4.55k]
  ------------------
  269|    261|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 1, False: 260]
  ------------------
  270|      1|      return false;
  271|      1|    }
  272|       |
  273|    261|  } else
  274|  4.55k|#endif
  275|  4.55k|  {
  276|  4.55k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 5, False: 4.54k]
  ------------------
  277|      5|      return false;
  278|      5|    }
  279|  4.55k|  }
  280|  4.80k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  4.80k|  uint32_t num_faces;
  283|  4.80k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  4.80k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.80k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 260, False: 4.54k]
  ------------------
  285|    260|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 4, False: 256]
  ------------------
  286|      4|      return false;
  287|      4|    }
  288|       |
  289|    260|  } else
  290|  4.54k|#endif
  291|  4.54k|  {
  292|  4.54k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 3, False: 4.54k]
  ------------------
  293|      3|      return false;
  294|      3|    }
  295|  4.54k|  }
  296|  4.80k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 9, False: 4.79k]
  ------------------
  297|      9|    return false;  // Draco cannot handle this many faces.
  298|      9|  }
  299|       |
  300|  4.79k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 31, False: 4.76k]
  ------------------
  301|     31|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     31|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  4.76k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  4.76k|  const uint64_t num_encoded_vertices_64 =
  311|  4.76k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  4.76k|  const uint64_t max_num_vertex_edges =
  313|  4.76k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  4.76k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 31, False: 4.73k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     31|    return false;
  317|     31|  }
  318|       |
  319|  4.73k|  uint8_t num_attribute_data;
  320|  4.73k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 54, False: 4.67k]
  ------------------
  321|     54|    return false;
  322|     54|  }
  323|       |
  324|  4.67k|  uint32_t num_encoded_symbols;
  325|  4.67k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  4.67k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.67k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 225, False: 4.45k]
  ------------------
  327|    225|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 23, False: 202]
  ------------------
  328|     23|      return false;
  329|     23|    }
  330|       |
  331|    225|  } else
  332|  4.45k|#endif
  333|  4.45k|  {
  334|  4.45k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 5, False: 4.44k]
  ------------------
  335|      5|      return false;
  336|      5|    }
  337|  4.45k|  }
  338|       |
  339|  4.64k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 34, False: 4.61k]
  ------------------
  340|       |    // Number of faces needs to be the same or greater than the number of
  341|       |    // symbols (it can be greater because the initial face may not be encoded as
  342|       |    // a symbol).
  343|     34|    return false;
  344|     34|  }
  345|  4.61k|  const uint32_t max_encoded_faces =
  346|  4.61k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  4.61k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 51, False: 4.56k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|     51|    return false;
  352|     51|  }
  353|       |
  354|  4.56k|  uint32_t num_encoded_split_symbols;
  355|  4.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  4.56k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 180, False: 4.38k]
  ------------------
  357|    180|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 6, False: 174]
  ------------------
  358|      6|      return false;
  359|      6|    }
  360|       |
  361|    180|  } else
  362|  4.38k|#endif
  363|  4.38k|  {
  364|  4.38k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 3, False: 4.38k]
  ------------------
  365|      3|      return false;
  366|      3|    }
  367|  4.38k|  }
  368|       |
  369|  4.55k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 50, False: 4.50k]
  ------------------
  370|     50|    return false;  // Split symbols are a sub-set of all symbols.
  371|     50|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  4.50k|  vertex_traversal_length_.clear();
  375|  4.50k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  4.50k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 4.50k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  4.50k|  processed_corner_ids_.clear();
  380|  4.50k|  processed_corner_ids_.reserve(num_faces);
  381|  4.50k|  processed_connectivity_corners_.clear();
  382|  4.50k|  processed_connectivity_corners_.reserve(num_faces);
  383|  4.50k|  topology_split_data_.clear();
  384|  4.50k|  hole_event_data_.clear();
  385|  4.50k|  init_face_configurations_.clear();
  386|  4.50k|  init_corners_.clear();
  387|       |
  388|  4.50k|  last_symbol_id_ = -1;
  389|  4.50k|  last_face_id_ = -1;
  390|  4.50k|  last_vert_id_ = -1;
  391|       |
  392|  4.50k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  4.50k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  4.50k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 4.50k]
  ------------------
  397|  4.50k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      1|    return false;
  399|      1|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  4.50k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  4.50k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  4.50k|  int32_t topology_split_decoded_bytes = -1;
  410|  4.50k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 562, False: 3.94k]
  ------------------
  411|    562|    uint32_t encoded_connectivity_size;
  412|    562|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    562|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 166, False: 396]
  ------------------
  413|    166|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 3, False: 163]
  ------------------
  414|      3|        return false;
  415|      3|      }
  416|    396|    } else {
  417|    396|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 4, False: 392]
  ------------------
  418|      4|        return false;
  419|      4|      }
  420|    396|    }
  421|    555|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 553]
  ------------------
  422|    553|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 57, False: 496]
  ------------------
  423|     59|      return false;
  424|     59|    }
  425|    496|    DecoderBuffer event_buffer;
  426|    496|    event_buffer.Init(
  427|    496|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    496|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    496|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    496|    topology_split_decoded_bytes =
  432|    496|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    496|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 163, False: 333]
  ------------------
  434|    163|      return false;
  435|    163|    }
  436|       |
  437|    496|  } else
  438|  3.94k|#endif
  439|  3.94k|  {
  440|  3.94k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 110, False: 3.83k]
  ------------------
  441|    110|      return false;
  442|    110|    }
  443|  3.94k|  }
  444|       |
  445|  4.16k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  4.16k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  4.16k|                                           num_encoded_split_symbols);
  449|  4.16k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  4.16k|  DecoderBuffer traversal_end_buffer;
  452|  4.16k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 263, False: 3.90k]
  ------------------
  453|    263|    return false;
  454|    263|  }
  455|       |
  456|  3.90k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  3.90k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 329, False: 3.57k]
  ------------------
  458|    329|    return false;
  459|    329|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  3.57k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  3.57k|                           traversal_end_buffer.remaining_size(),
  464|  3.57k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  3.57k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  3.57k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.57k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 181, False: 3.39k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    181|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    181|  }
  471|  3.57k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  3.57k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 3.47k, False: 97]
  ------------------
  475|  3.47k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  3.47k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  3.47k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 174, False: 3.30k]
  ------------------
  477|  1.83k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.65k, False: 174]
  ------------------
  478|  1.65k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.65k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.65k|      }
  482|       |
  483|    174|    } else
  484|  3.30k|#endif
  485|  3.30k|    {
  486|   189k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 185k, False: 3.30k]
  ------------------
  487|   185k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 185k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   185k|      }
  491|  3.30k|    }
  492|  3.47k|  }
  493|  3.57k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  10.8k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 7.25k, False: 3.57k]
  ------------------
  498|  7.25k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  1.42M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 1.42M, False: 7.25k]
  ------------------
  501|  1.42M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  1.42M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  7.25k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 7.25k]
  ------------------
  505|  7.25k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  7.25k|  }
  509|       |
  510|  3.57k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  10.8k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 7.25k, False: 3.57k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  7.25k|    int32_t att_connectivity_verts =
  517|  7.25k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  7.25k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 788, False: 6.46k]
  ------------------
  519|    788|      att_connectivity_verts = corner_table_->num_vertices();
  520|    788|    }
  521|  7.25k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  7.25k|  }
  523|  3.57k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 14, False: 3.55k]
  ------------------
  524|     14|    return false;
  525|     14|  }
  526|  3.55k|  return true;
  527|  3.57k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    814|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    814|  return true;
  532|    814|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  3.90k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  3.90k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  3.90k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  3.90k|  std::vector<VertexIndex> invalid_vertices;
  558|  3.90k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  3.90k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  3.90k|  int num_faces = 0;
  562|  4.65M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 4.65M, False: 3.64k]
  ------------------
  563|  4.65M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  4.65M|    bool check_topology_split = false;
  566|  4.65M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  4.65M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 2.24M, False: 2.40M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  2.24M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 2, False: 2.24M]
  ------------------
  588|      2|        return -1;
  589|      2|      }
  590|       |
  591|  2.24M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  2.24M|      const VertexIndex vertex_x =
  593|  2.24M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  2.24M|      const CornerIndex corner_b =
  595|  2.24M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  2.24M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 169, False: 2.24M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    169|        return -1;
  600|    169|      }
  601|  2.24M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 2.24M]
  |  Branch (601:11): [True: 0, False: 2.24M]
  ------------------
  602|  2.24M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 2.24M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  2.24M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  2.24M|      SetOppositeCorners(corner_a, corner + 1);
  612|  2.24M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  2.24M|      const VertexIndex vert_a_prev =
  616|  2.24M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  2.24M|      const VertexIndex vert_b_next =
  618|  2.24M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  2.24M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 2.24M]
  |  Branch (619:38): [True: 0, False: 2.24M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  2.24M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  2.24M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  2.24M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  2.24M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  2.24M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  2.24M|      active_corner_stack.back() = corner;
  631|  2.40M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 243k, False: 2.16M]
  |  Branch (631:40): [True: 131k, False: 2.03M]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|   374k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 2, False: 374k]
  ------------------
  647|      2|        return -1;
  648|      2|      }
  649|   374k|      const CornerIndex corner_a = active_corner_stack.back();
  650|   374k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 374k]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|   374k|      const CornerIndex corner(3 * face.value());
  658|   374k|      CornerIndex opp_corner, corner_l, corner_r;
  659|   374k|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 243k, False: 131k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|   243k|        opp_corner = corner + 2;
  662|   243k|        corner_l = corner + 1;
  663|   243k|        corner_r = corner;
  664|   243k|      } else {
  665|       |        // "l" is the new first corner.
  666|   131k|        opp_corner = corner + 1;
  667|   131k|        corner_l = corner;
  668|   131k|        corner_r = corner + 2;
  669|   131k|      }
  670|   374k|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|   374k|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|   374k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 2, False: 374k]
  ------------------
  675|      2|        return -1;  // Unexpected number of decoded vertices.
  676|      2|      }
  677|       |
  678|   374k|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|   374k|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|   374k|      const VertexIndex vertex_r =
  682|   374k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|   374k|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|   374k|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|   374k|      corner_table_->MapCornerToVertex(
  688|   374k|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|   374k|      active_corner_stack.back() = corner;
  690|   374k|      check_topology_split = true;
  691|  2.03M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 975k, False: 1.05M]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|   975k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 2, False: 975k]
  ------------------
  703|      2|        return -1;
  704|      2|      }
  705|   975k|      const CornerIndex corner_b = active_corner_stack.back();
  706|   975k|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|   975k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|   975k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 51, False: 975k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     51|        active_corner_stack.push_back(it->second);
  714|     51|      }
  715|   975k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 23, False: 975k]
  ------------------
  716|     23|        return -1;
  717|     23|      }
  718|   975k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|   975k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 975k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|   975k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 11, False: 975k]
  |  Branch (724:11): [True: 11, False: 975k]
  ------------------
  725|   975k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 975k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|     11|        return -1;
  729|     11|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|   975k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|   975k|      SetOppositeCorners(corner_a, corner + 2);
  735|   975k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|   975k|      const VertexIndex vertex_p =
  739|   975k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|   975k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|   975k|      corner_table_->MapCornerToVertex(
  742|   975k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|   975k|      const VertexIndex vert_b_prev =
  744|   975k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|   975k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|   975k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|   975k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|   975k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|   975k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|   975k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|   975k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|   975k|      const CornerIndex first_corner = corner_n;
  757|  6.19M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 5.21M, False: 975k]
  ------------------
  758|  5.21M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  5.21M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  5.21M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 2, False: 5.21M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      2|          return -1;
  764|      2|        }
  765|  5.21M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|   975k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|   975k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 965k, False: 9.81k]
  ------------------
  770|   965k|        invalid_vertices.push_back(vertex_n);
  771|   965k|      }
  772|   975k|      active_corner_stack.back() = corner;
  773|  1.05M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 1.05M, False: 0]
  ------------------
  774|  1.05M|      const CornerIndex corner(3 * face.value());
  775|  1.05M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  1.05M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  1.05M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  1.05M|                                       corner_table_->AddNewVertex());
  780|  1.05M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  1.05M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  1.05M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 6, False: 1.05M]
  ------------------
  784|      6|        return -1;  // Unexpected number of decoded vertices.
  785|      6|      }
  786|       |
  787|  1.05M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  1.05M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  1.05M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  1.05M|      active_corner_stack.push_back(corner);
  792|  1.05M|      check_topology_split = true;
  793|  1.05M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  4.64M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  4.64M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 1.42M, False: 3.22M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  1.42M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  1.42M|      EdgeFaceName split_edge;
  812|  1.42M|      int encoder_split_symbol_id;
  813|  1.43M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.95k, False: 1.42M]
  ------------------
  814|  1.43M|                             &encoder_split_symbol_id)) {
  815|  1.95k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 39, False: 1.91k]
  ------------------
  816|     39|          return -1;  // Wrong split symbol id.
  817|     39|        }
  818|       |        // Symbol was part of a topology split. Now we need to determine which
  819|       |        // edge should be added to the active edges stack.
  820|  1.91k|        const CornerIndex act_top_corner = active_corner_stack.back();
  821|       |        // The current symbol has one active edge (stored in act_top_corner) and
  822|       |        // two remaining inactive edges that are attached to it.
  823|       |        //              *
  824|       |        //             / \
  825|       |        //  left_edge /   \ right_edge
  826|       |        //           /     \
  827|       |        //          *.......*
  828|       |        //         active_edge
  829|       |
  830|  1.91k|        CornerIndex new_active_corner;
  831|  1.91k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 611, False: 1.30k]
  ------------------
  832|    611|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.30k|        } else {
  834|  1.30k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.30k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.91k|        const int decoder_split_symbol_id =
  839|  1.91k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.91k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.91k|            new_active_corner;
  842|  1.91k|      }
  843|  1.42M|    }
  844|  4.64M|  }
  845|  3.64k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 3.64k]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  34.2k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 30.6k, False: 3.59k]
  ------------------
  850|  30.6k|    const CornerIndex corner = active_corner_stack.back();
  851|  30.6k|    active_corner_stack.pop_back();
  852|  30.6k|    const bool interior_face =
  853|  30.6k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  30.6k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 9.10k, False: 21.5k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  9.10k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 4, False: 9.10k]
  ------------------
  877|      4|        return -1;  // More faces than expected added to the mesh.
  878|      4|      }
  879|       |
  880|  9.10k|      const CornerIndex corner_a = corner;
  881|  9.10k|      const VertexIndex vert_n =
  882|  9.10k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  9.10k|      const CornerIndex corner_b =
  884|  9.10k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  9.10k|      const VertexIndex vert_x =
  887|  9.10k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  9.10k|      const CornerIndex corner_c =
  889|  9.10k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  9.10k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 23, False: 9.08k]
  |  Branch (891:33): [True: 21, False: 9.05k]
  |  Branch (891:55): [True: 0, False: 9.05k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     44|        return -1;
  894|     44|      }
  895|  9.05k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 9.05k]
  |  Branch (895:11): [True: 3, False: 9.05k]
  ------------------
  896|  9.05k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 1, False: 9.05k]
  ------------------
  897|  9.05k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 1, False: 9.05k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      3|        return -1;
  901|      3|      }
  902|       |
  903|  9.05k|      const VertexIndex vert_p =
  904|  9.05k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  9.05k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  9.05k|      const CornerIndex new_corner(3 * face.value());
  909|  9.05k|      SetOppositeCorners(new_corner, corner);
  910|  9.05k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  9.05k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  9.05k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  9.05k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  9.05k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  36.2k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 27.1k, False: 9.05k]
  ------------------
  920|  27.1k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  27.1k|      }
  922|       |
  923|  9.05k|      init_face_configurations_.push_back(true);
  924|  9.05k|      init_corners_.push_back(new_corner);
  925|  21.5k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  21.5k|      init_face_configurations_.push_back(false);
  930|  21.5k|      init_corners_.push_back(corner);
  931|  21.5k|    }
  932|  30.6k|  }
  933|  3.59k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 13, False: 3.57k]
  ------------------
  934|     13|    return -1;  // Unexpected number of decoded faces.
  935|     13|  }
  936|       |
  937|  3.57k|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  3.85k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 3.85k, False: 3.57k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  3.85k|    VertexIndex src_vert(num_vertices - 1);
  943|  4.18k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 332, False: 3.85k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    332|      src_vert = VertexIndex(--num_vertices - 1);
  946|    332|    }
  947|  3.85k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 297, False: 3.55k]
  ------------------
  948|    297|      continue;  // No need to swap anything.
  949|    297|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  3.55k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  15.8k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 12.2k, False: 3.55k]
  ------------------
  954|  12.2k|      const CornerIndex cid = vcit.Corner();
  955|  12.2k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 7, False: 12.2k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      7|        return -1;
  959|      7|      }
  960|  12.2k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  12.2k|    }
  962|  3.55k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  3.55k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  3.55k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  3.55k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  3.55k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  3.55k|    num_vertices--;
  972|  3.55k|  }
  973|  3.57k|  return num_vertices;
  974|  3.57k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  4.43k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  4.43k|  uint32_t num_topology_splits;
  982|  4.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  4.43k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 135, False: 4.30k]
  ------------------
  984|    135|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 134]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    135|  } else
  989|  4.30k|#endif
  990|  4.30k|  {
  991|  4.30k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 16, False: 4.28k]
  ------------------
  992|     16|      return -1;
  993|     16|    }
  994|  4.30k|  }
  995|  4.42k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.91k, False: 2.50k]
  ------------------
  996|  1.91k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 75, False: 1.83k]
  ------------------
  997|  1.91k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     75|      return -1;
  999|     75|    }
 1000|  1.83k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.83k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.83k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 65, False: 1.77k]
  ------------------
 1002|  36.0k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 35.9k, False: 20]
  ------------------
 1003|  35.9k|        TopologySplitEventData event_data;
 1004|  35.9k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 29, False: 35.9k]
  ------------------
 1005|     29|          return -1;
 1006|     29|        }
 1007|  35.9k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 12, False: 35.9k]
  ------------------
 1008|     12|          return -1;
 1009|     12|        }
 1010|  35.9k|        uint8_t edge_data;
 1011|  35.9k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 35.9k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|  35.9k|        event_data.source_edge = edge_data & 1;
 1015|  35.9k|        topology_split_data_.push_back(event_data);
 1016|  35.9k|      }
 1017|       |
 1018|     65|    } else
 1019|  1.77k|#endif
 1020|  1.77k|    {
 1021|       |      // Decode source and split symbol ids using delta and varint coding. See
 1022|       |      // description in mesh_edgebreaker_encoder_impl.cc for more details.
 1023|  1.77k|      int last_source_symbol_id = 0;
 1024|  6.63k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.90k, False: 1.72k]
  ------------------
 1025|  4.90k|        TopologySplitEventData event_data;
 1026|  4.90k|        uint32_t delta;
 1027|  4.90k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 16, False: 4.89k]
  ------------------
 1028|     16|          return -1;
 1029|     16|        }
 1030|  4.89k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.89k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 6, False: 4.88k]
  ------------------
 1032|      6|          return -1;
 1033|      6|        }
 1034|  4.88k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 29, False: 4.85k]
  ------------------
 1035|     29|          return -1;
 1036|     29|        }
 1037|  4.85k|        event_data.split_symbol_id =
 1038|  4.85k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.85k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.85k|        topology_split_data_.push_back(event_data);
 1041|  4.85k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.72k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  5.92k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.20k, False: 1.72k]
  ------------------
 1045|  4.20k|        uint32_t edge_data;
 1046|  4.20k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.20k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 460, False: 3.74k]
  ------------------
 1047|    460|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.74k|        } else {
 1049|  3.74k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.74k|        }
 1051|  4.20k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  4.20k|        event_data.source_edge = edge_data & 1;
 1053|  4.20k|      }
 1054|  1.72k|      decoder_buffer->EndBitDecoding();
 1055|  1.72k|    }
 1056|  1.83k|  }
 1057|  4.24k|  uint32_t num_hole_events = 0;
 1058|  4.24k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  4.24k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  4.24k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 69, False: 4.18k]
  ------------------
 1060|     69|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 1, False: 68]
  ------------------
 1061|      1|      return -1;
 1062|      1|    }
 1063|  4.18k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  4.18k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 340, False: 3.84k]
  ------------------
 1064|    340|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 10, False: 330]
  ------------------
 1065|     10|      return -1;
 1066|     10|    }
 1067|    340|  }
 1068|  4.23k|#endif
 1069|  4.23k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 104, False: 4.13k]
  ------------------
 1070|    104|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|    104|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    104|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 53, False: 51]
  ------------------
 1072|   110k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 110k, False: 4]
  ------------------
 1073|   110k|        HoleEventData event_data;
 1074|   110k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 49, False: 110k]
  ------------------
 1075|     49|          return -1;
 1076|     49|        }
 1077|   110k|        hole_event_data_.push_back(event_data);
 1078|   110k|      }
 1079|       |
 1080|     53|    } else
 1081|     51|#endif
 1082|     51|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     51|      int last_symbol_id = 0;
 1085|  20.0k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 20.0k, False: 26]
  ------------------
 1086|  20.0k|        HoleEventData event_data;
 1087|  20.0k|        uint32_t delta;
 1088|  20.0k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 25, False: 19.9k]
  ------------------
 1089|     25|          return -1;
 1090|     25|        }
 1091|  19.9k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  19.9k|        last_symbol_id = event_data.symbol_id;
 1093|  19.9k|        hole_event_data_.push_back(event_data);
 1094|  19.9k|      }
 1095|     51|    }
 1096|    104|  }
 1097|  4.16k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  4.23k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.65k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.65k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.65k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  6.63k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 4.97k, False: 1.65k]
  ------------------
 1109|  4.97k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  4.97k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.03k, False: 3.93k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  2.37k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.34k, False: 1.03k]
  ------------------
 1114|  1.34k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.34k|      }
 1116|  1.03k|      continue;
 1117|  1.03k|    }
 1118|       |
 1119|  10.5k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 6.59k, False: 3.93k]
  ------------------
 1120|  6.59k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  6.59k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 4.01k, False: 2.57k]
  ------------------
 1122|  4.01k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  4.01k|      }
 1124|  6.59k|    }
 1125|  3.93k|  }
 1126|  1.65k|  return true;
 1127|  1.65k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   185k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   185k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   185k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   185k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|   743k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 557k, False: 185k]
  ------------------
 1139|   557k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   557k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 48.2k, False: 509k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   278k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 230k, False: 48.2k]
  ------------------
 1144|   230k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   230k|      }
 1146|  48.2k|      continue;
 1147|  48.2k|    }
 1148|   509k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   509k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 254k, False: 254k]
  ------------------
 1151|   254k|      continue;
 1152|   254k|    }
 1153|       |
 1154|  1.66M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 1.41M, False: 254k]
  ------------------
 1155|  1.41M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  1.41M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 1.19M, False: 220k]
  ------------------
 1157|  1.19M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  1.19M|      }
 1159|  1.41M|    }
 1160|   254k|  }
 1161|   185k|  return true;
 1162|   185k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  3.57k|    int num_connectivity_verts) {
 1167|       |  // Map between the existing and deduplicated point ids.
 1168|       |  // Note that at this point we have one point id for each corner of the
 1169|       |  // mesh so there is corner_table_->num_corners() point ids.
 1170|  3.57k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  3.57k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 97, False: 3.47k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  54.5k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 54.4k, False: 97]
  ------------------
 1176|  54.4k|      Mesh::Face face;
 1177|  54.4k|      const CornerIndex start_corner(3 * f.value());
 1178|   217k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 163k, False: 54.4k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   163k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   163k|        face[c] = vert_id;
 1182|   163k|      }
 1183|  54.4k|      decoder_->mesh()->SetFace(f, face);
 1184|  54.4k|    }
 1185|     97|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     97|    return true;
 1187|     97|  }
 1188|       |  // Else we need to deduplicate multiple attributes.
 1189|       |
 1190|       |  // Map between point id and an associated corner id. Only one corner for
 1191|       |  // each point is stored. The corners are used to sample the attribute values
 1192|       |  // in the last stage of the deduplication.
 1193|  3.47k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  3.47k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   126k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 123k, False: 3.46k]
  ------------------
 1197|   123k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   123k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 8.11k, False: 115k]
  ------------------
 1199|  8.11k|      continue;  // Isolated vertex.
 1200|  8.11k|    }
 1201|   115k|    CornerIndex deduplication_first_corner = c;
 1202|   115k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 43.6k, False: 71.4k]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|  43.6k|      deduplication_first_corner = c;
 1206|  71.4k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  88.6k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 80.2k, False: 8.44k]
  ------------------
 1210|  80.2k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 11.5k, False: 68.6k]
  ------------------
 1211|  11.5k|          continue;  // No seam for this attribute, ignore it.
 1212|  11.5k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|  68.6k|        const VertexIndex vert_id =
 1217|  68.6k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  68.6k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  68.6k|        bool seam_found = false;
 1220|  87.1k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 81.4k, False: 5.65k]
  ------------------
 1221|  81.4k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 14, False: 81.4k]
  ------------------
 1222|     14|            return false;
 1223|     14|          }
 1224|  81.4k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 63.0k, False: 18.4k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  63.0k|            deduplication_first_corner = act_c;
 1227|  63.0k|            seam_found = true;
 1228|  63.0k|            break;
 1229|  63.0k|          }
 1230|  18.4k|          act_c = corner_table_->SwingRight(act_c);
 1231|  18.4k|        }
 1232|  68.6k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 63.0k, False: 5.65k]
  ------------------
 1233|  63.0k|          break;  // No reason to process other attributes if we found a seam.
 1234|  63.0k|        }
 1235|  68.6k|      }
 1236|  71.4k|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|   115k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   115k|    corner_to_point_map[c.value()] =
 1246|   115k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   115k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   115k|    CornerIndex prev_c = c;
 1250|   115k|    c = corner_table_->SwingRight(c);
 1251|   514k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 470k, False: 44.1k]
  |  Branch (1251:40): [True: 399k, False: 70.8k]
  ------------------
 1252|   399k|      bool attribute_seam = false;
 1253|   499k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 454k, False: 45.0k]
  ------------------
 1254|   454k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 354k, False: 99.6k]
  ------------------
 1255|   454k|            attribute_data_[i].connectivity_data.Vertex(prev_c)) {
 1256|       |          // Attribute index changed from the previous corner. We need to add a
 1257|       |          // new point here.
 1258|   354k|          attribute_seam = true;
 1259|   354k|          break;
 1260|   354k|        }
 1261|   454k|      }
 1262|   399k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 354k, False: 45.0k]
  ------------------
 1263|   354k|        corner_to_point_map[c.value()] =
 1264|   354k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   354k|        point_to_corner_map.push_back(c.value());
 1266|   354k|      } else {
 1267|  45.0k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  45.0k|      }
 1269|   399k|      prev_c = c;
 1270|   399k|      c = corner_table_->SwingRight(c);
 1271|   399k|    }
 1272|   115k|  }
 1273|       |  // Add faces.
 1274|   165k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 162k, False: 3.46k]
  ------------------
 1275|   162k|    Mesh::Face face;
 1276|   648k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 486k, False: 162k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   486k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   486k|    }
 1280|   162k|    decoder_->mesh()->SetFace(f, face);
 1281|   162k|  }
 1282|  3.46k|  decoder_->point_cloud()->set_num_points(
 1283|  3.46k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  3.46k|  return true;
 1285|  3.47k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.65k|    : decoder_(nullptr),
   49|  2.65k|      last_symbol_id_(-1),
   50|  2.65k|      last_vert_id_(-1),
   51|  2.65k|      last_face_id_(-1),
   52|  2.65k|      num_new_vertices_(0),
   53|  2.65k|      num_encoded_vertices_(0),
   54|  2.65k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.65k|    MeshEdgebreakerDecoder* decoder) {
   59|  2.65k|  decoder_ = decoder;
   60|  2.65k|  return true;
   61|  2.65k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  1.80k|    int att_id) const {
   67|  2.94k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.18k, False: 759]
  ------------------
   68|  2.18k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.18k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.13k, False: 1.04k]
  |  Branch (69:27): [True: 0, False: 1.04k]
  ------------------
   70|  1.13k|      continue;
   71|  1.13k|    }
   72|  1.04k|    const AttributesDecoderInterface* const dec =
   73|  1.04k|        decoder_->attributes_decoder(decoder_id);
   74|  2.13k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 2.13k, False: 0]
  ------------------
   75|  2.13k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.04k, False: 1.08k]
  ------------------
   76|  1.04k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 750, False: 298]
  ------------------
   77|    750|          return &attribute_data_[i].connectivity_data;
   78|    750|        }
   79|    298|        return nullptr;
   80|  1.04k|      }
   81|  2.13k|    }
   82|  1.04k|  }
   83|    759|  return nullptr;
   84|  1.80k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  1.80k|    int att_id) const {
   90|  2.94k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.18k, False: 759]
  ------------------
   91|  2.18k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.18k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.13k, False: 1.04k]
  |  Branch (92:27): [True: 0, False: 1.04k]
  ------------------
   93|  1.13k|      continue;
   94|  1.13k|    }
   95|  1.04k|    const AttributesDecoderInterface* const dec =
   96|  1.04k|        decoder_->attributes_decoder(decoder_id);
   97|  2.13k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 2.13k, False: 0]
  ------------------
   98|  2.13k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.04k, False: 1.08k]
  ------------------
   99|  1.04k|        return &attribute_data_[i].encoding_data;
  100|  1.04k|      }
  101|  2.13k|    }
  102|  1.04k|  }
  103|    759|  return &pos_encoding_data_;
  104|  1.80k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.59k|    int32_t att_decoder_id) {
  131|  1.59k|  int8_t att_data_id;
  132|  1.59k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 59, False: 1.53k]
  ------------------
  133|     59|    return false;
  134|     59|  }
  135|  1.53k|  uint8_t decoder_type;
  136|  1.53k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 32, False: 1.50k]
  ------------------
  137|     32|    return false;
  138|     32|  }
  139|       |
  140|  1.50k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 987, False: 514]
  ------------------
  141|    987|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 57, False: 930]
  ------------------
  142|     57|      return false;  // Unexpected attribute data.
  143|     57|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    930|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 11, False: 919]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|       |
  151|    919|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    919|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    514|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 513]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    513|    pos_data_decoder_id_ = att_decoder_id;
  158|    513|  }
  159|       |
  160|  1.43k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.43k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.43k, False: 0]
  ------------------
  162|  1.43k|    uint8_t traversal_method_encoded;
  163|  1.43k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 15, False: 1.41k]
  ------------------
  164|     15|      return false;
  165|     15|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.41k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 22, False: 1.39k]
  ------------------
  168|     22|      return false;
  169|     22|    }
  170|  1.39k|    traversal_method =
  171|  1.39k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.39k|  }
  173|       |
  174|  1.39k|  const Mesh* mesh = decoder_->mesh();
  175|  1.39k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.39k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 741, False: 654]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    741|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|    741|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 480, False: 261]
  ------------------
  182|    480|      encoding_data = &pos_encoding_data_;
  183|    480|    } else {
  184|    261|      encoding_data = &attribute_data_[att_data_id].encoding_data;
  185|       |      // Mark the attribute connectivity data invalid to ensure it's not used
  186|       |      // later on.
  187|    261|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    261|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    741|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 257, False: 484]
  ------------------
  191|    257|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    257|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    257|          AttTraverser;
  194|    257|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    484|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 484, False: 0]
  ------------------
  196|    484|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    484|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    484|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    484|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    741|  } else {
  203|    654|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 4, False: 650]
  ------------------
  204|      4|      return false;  // Unsupported method.
  205|      4|    }
  206|    650|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 9, False: 641]
  ------------------
  207|      9|      return false;  // Attribute data must be specified.
  208|      9|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    641|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    641|        AttObserver;
  214|    641|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    641|        AttTraverser;
  216|       |
  217|    641|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|    641|        &attribute_data_[att_data_id].encoding_data;
  219|    641|    const MeshAttributeCornerTable* const corner_table =
  220|    641|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    641|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    641|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    641|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    641|                             encoding_data);
  227|       |
  228|    641|    AttTraverser att_traverser;
  229|    641|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    641|    traversal_sequencer->SetTraverser(att_traverser);
  232|    641|    sequencer = std::move(traversal_sequencer);
  233|    641|  }
  234|       |
  235|  1.38k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.38k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.38k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.38k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.38k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.38k|                                        std::move(att_controller));
  244|  1.38k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.65k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.65k|  num_new_vertices_ = 0;
  249|  2.65k|  new_to_parent_vertex_map_.clear();
  250|  2.65k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.65k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.65k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 501, False: 2.15k]
  ------------------
  252|    501|    uint32_t num_new_verts;
  253|    501|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    501|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 241, False: 260]
  ------------------
  254|    241|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 11, False: 230]
  ------------------
  255|     11|        return false;
  256|     11|      }
  257|    260|    } else {
  258|    260|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 1, False: 259]
  ------------------
  259|      1|        return false;
  260|      1|      }
  261|    260|    }
  262|    489|    num_new_vertices_ = num_new_verts;
  263|    489|  }
  264|  2.64k|#endif
  265|       |
  266|  2.64k|  uint32_t num_encoded_vertices;
  267|  2.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.64k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 230, False: 2.41k]
  ------------------
  269|    230|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 4, False: 226]
  ------------------
  270|      4|      return false;
  271|      4|    }
  272|       |
  273|    230|  } else
  274|  2.41k|#endif
  275|  2.41k|  {
  276|  2.41k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 4, False: 2.40k]
  ------------------
  277|      4|      return false;
  278|      4|    }
  279|  2.41k|  }
  280|  2.63k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.63k|  uint32_t num_faces;
  283|  2.63k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.63k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.63k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 226, False: 2.40k]
  ------------------
  285|    226|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 4, False: 222]
  ------------------
  286|      4|      return false;
  287|      4|    }
  288|       |
  289|    226|  } else
  290|  2.40k|#endif
  291|  2.40k|  {
  292|  2.40k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 3, False: 2.40k]
  ------------------
  293|      3|      return false;
  294|      3|    }
  295|  2.40k|  }
  296|  2.62k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 4, False: 2.62k]
  ------------------
  297|      4|    return false;  // Draco cannot handle this many faces.
  298|      4|  }
  299|       |
  300|  2.62k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 33, False: 2.58k]
  ------------------
  301|     33|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     33|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.58k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  2.58k|  const uint64_t num_encoded_vertices_64 =
  311|  2.58k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.58k|  const uint64_t max_num_vertex_edges =
  313|  2.58k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.58k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 21, False: 2.56k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     21|    return false;
  317|     21|  }
  318|       |
  319|  2.56k|  uint8_t num_attribute_data;
  320|  2.56k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 44, False: 2.52k]
  ------------------
  321|     44|    return false;
  322|     44|  }
  323|       |
  324|  2.52k|  uint32_t num_encoded_symbols;
  325|  2.52k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.52k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.52k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 196, False: 2.32k]
  ------------------
  327|    196|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 11, False: 185]
  ------------------
  328|     11|      return false;
  329|     11|    }
  330|       |
  331|    196|  } else
  332|  2.32k|#endif
  333|  2.32k|  {
  334|  2.32k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 3, False: 2.32k]
  ------------------
  335|      3|      return false;
  336|      3|    }
  337|  2.32k|  }
  338|       |
  339|  2.51k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 26, False: 2.48k]
  ------------------
  340|       |    // Number of faces needs to be the same or greater than the number of
  341|       |    // symbols (it can be greater because the initial face may not be encoded as
  342|       |    // a symbol).
  343|     26|    return false;
  344|     26|  }
  345|  2.48k|  const uint32_t max_encoded_faces =
  346|  2.48k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.48k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 54, False: 2.43k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|     54|    return false;
  352|     54|  }
  353|       |
  354|  2.43k|  uint32_t num_encoded_split_symbols;
  355|  2.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.43k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 158, False: 2.27k]
  ------------------
  357|    158|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 6, False: 152]
  ------------------
  358|      6|      return false;
  359|      6|    }
  360|       |
  361|    158|  } else
  362|  2.27k|#endif
  363|  2.27k|  {
  364|  2.27k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 6, False: 2.26k]
  ------------------
  365|      6|      return false;
  366|      6|    }
  367|  2.27k|  }
  368|       |
  369|  2.41k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 37, False: 2.38k]
  ------------------
  370|     37|    return false;  // Split symbols are a sub-set of all symbols.
  371|     37|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.38k|  vertex_traversal_length_.clear();
  375|  2.38k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.38k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.38k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.38k|  processed_corner_ids_.clear();
  380|  2.38k|  processed_corner_ids_.reserve(num_faces);
  381|  2.38k|  processed_connectivity_corners_.clear();
  382|  2.38k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.38k|  topology_split_data_.clear();
  384|  2.38k|  hole_event_data_.clear();
  385|  2.38k|  init_face_configurations_.clear();
  386|  2.38k|  init_corners_.clear();
  387|       |
  388|  2.38k|  last_symbol_id_ = -1;
  389|  2.38k|  last_face_id_ = -1;
  390|  2.38k|  last_vert_id_ = -1;
  391|       |
  392|  2.38k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.38k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.38k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 2.38k]
  ------------------
  397|  2.38k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      1|    return false;
  399|      1|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  2.38k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.38k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.38k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.38k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.38k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 393, False: 1.98k]
  ------------------
  411|    393|    uint32_t encoded_connectivity_size;
  412|    393|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    393|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 145, False: 248]
  ------------------
  413|    145|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 8, False: 137]
  ------------------
  414|      8|        return false;
  415|      8|      }
  416|    248|    } else {
  417|    248|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 3, False: 245]
  ------------------
  418|      3|        return false;
  419|      3|      }
  420|    248|    }
  421|    382|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 5, False: 377]
  ------------------
  422|    377|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 35, False: 342]
  ------------------
  423|     40|      return false;
  424|     40|    }
  425|    342|    DecoderBuffer event_buffer;
  426|    342|    event_buffer.Init(
  427|    342|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    342|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    342|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    342|    topology_split_decoded_bytes =
  432|    342|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    342|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 137, False: 205]
  ------------------
  434|    137|      return false;
  435|    137|    }
  436|       |
  437|    342|  } else
  438|  1.98k|#endif
  439|  1.98k|  {
  440|  1.98k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 123, False: 1.86k]
  ------------------
  441|    123|      return false;
  442|    123|    }
  443|  1.98k|  }
  444|       |
  445|  2.06k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.06k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.06k|                                           num_encoded_split_symbols);
  449|  2.06k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.06k|  DecoderBuffer traversal_end_buffer;
  452|  2.06k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 189, False: 1.88k]
  ------------------
  453|    189|    return false;
  454|    189|  }
  455|       |
  456|  1.88k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.88k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 216, False: 1.66k]
  ------------------
  458|    216|    return false;
  459|    216|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.66k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.66k|                           traversal_end_buffer.remaining_size(),
  464|  1.66k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.66k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.66k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.66k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 152, False: 1.51k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    152|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    152|  }
  471|  1.66k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.66k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.51k, False: 148]
  ------------------
  475|  1.51k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.51k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.51k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 152, False: 1.36k]
  ------------------
  477|   561k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 561k, False: 152]
  ------------------
  478|   561k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 561k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|   561k|      }
  482|       |
  483|    152|    } else
  484|  1.36k|#endif
  485|  1.36k|    {
  486|  9.04M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 9.04M, False: 1.36k]
  ------------------
  487|  9.04M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 9.04M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  9.04M|      }
  491|  1.36k|    }
  492|  1.51k|  }
  493|  1.66k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  3.58k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 1.91k, False: 1.66k]
  ------------------
  498|  1.91k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  13.9M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 13.9M, False: 1.91k]
  ------------------
  501|  13.9M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  13.9M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  1.91k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 1.91k]
  ------------------
  505|  1.91k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  1.91k|  }
  509|       |
  510|  1.66k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  3.58k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 1.91k, False: 1.66k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  1.91k|    int32_t att_connectivity_verts =
  517|  1.91k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  1.91k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 219, False: 1.69k]
  ------------------
  519|    219|      att_connectivity_verts = corner_table_->num_vertices();
  520|    219|    }
  521|  1.91k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  1.91k|  }
  523|  1.66k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 13, False: 1.65k]
  ------------------
  524|     13|    return false;
  525|     13|  }
  526|  1.65k|  return true;
  527|  1.66k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    394|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    394|  return true;
  532|    394|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  1.88k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  1.88k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  1.88k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  1.88k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.88k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.88k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.88k|  int num_faces = 0;
  562|  52.8M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 52.8M, False: 1.77k]
  ------------------
  563|  52.8M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  52.8M|    bool check_topology_split = false;
  566|  52.8M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  52.8M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 26.2M, False: 26.5M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  26.2M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 26.2M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  26.2M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  26.2M|      const VertexIndex vertex_x =
  593|  26.2M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  26.2M|      const CornerIndex corner_b =
  595|  26.2M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  26.2M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 30, False: 26.2M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     30|        return -1;
  600|     30|      }
  601|  26.2M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 26.2M]
  |  Branch (601:11): [True: 0, False: 26.2M]
  ------------------
  602|  26.2M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 26.2M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  26.2M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  26.2M|      SetOppositeCorners(corner_a, corner + 1);
  612|  26.2M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  26.2M|      const VertexIndex vert_a_prev =
  616|  26.2M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  26.2M|      const VertexIndex vert_b_next =
  618|  26.2M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  26.2M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 26.2M]
  |  Branch (619:38): [True: 0, False: 26.2M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  26.2M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  26.2M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  26.2M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  26.2M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  26.2M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  26.2M|      active_corner_stack.back() = corner;
  631|  26.5M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 26.5M, False: 36.3k]
  |  Branch (631:40): [True: 6.82k, False: 29.5k]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  26.5M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 26.5M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  26.5M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  26.5M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 26.5M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  26.5M|      const CornerIndex corner(3 * face.value());
  658|  26.5M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  26.5M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 26.5M, False: 6.82k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  26.5M|        opp_corner = corner + 2;
  662|  26.5M|        corner_l = corner + 1;
  663|  26.5M|        corner_r = corner;
  664|  26.5M|      } else {
  665|       |        // "l" is the new first corner.
  666|  6.82k|        opp_corner = corner + 1;
  667|  6.82k|        corner_l = corner;
  668|  6.82k|        corner_r = corner + 2;
  669|  6.82k|      }
  670|  26.5M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  26.5M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  26.5M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 11, False: 26.5M]
  ------------------
  675|     11|        return -1;  // Unexpected number of decoded vertices.
  676|     11|      }
  677|       |
  678|  26.5M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  26.5M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  26.5M|      const VertexIndex vertex_r =
  682|  26.5M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  26.5M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  26.5M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  26.5M|      corner_table_->MapCornerToVertex(
  688|  26.5M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  26.5M|      active_corner_stack.back() = corner;
  690|  26.5M|      check_topology_split = true;
  691|  26.5M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 7.85k, False: 21.6k]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  7.85k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 7.85k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  7.85k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  7.85k|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  7.85k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  7.85k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 10, False: 7.84k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     10|        active_corner_stack.push_back(it->second);
  714|     10|      }
  715|  7.85k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 14, False: 7.83k]
  ------------------
  716|     14|        return -1;
  717|     14|      }
  718|  7.83k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  7.83k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 7.83k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  7.83k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 4, False: 7.83k]
  |  Branch (724:11): [True: 4, False: 7.83k]
  ------------------
  725|  7.83k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 7.83k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      4|        return -1;
  729|      4|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  7.83k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  7.83k|      SetOppositeCorners(corner_a, corner + 2);
  735|  7.83k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  7.83k|      const VertexIndex vertex_p =
  739|  7.83k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  7.83k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  7.83k|      corner_table_->MapCornerToVertex(
  742|  7.83k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  7.83k|      const VertexIndex vert_b_prev =
  744|  7.83k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  7.83k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  7.83k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  7.83k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  7.83k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  7.83k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  7.83k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  7.83k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  7.83k|      const CornerIndex first_corner = corner_n;
  757|  32.5k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 24.6k, False: 7.83k]
  ------------------
  758|  24.6k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  24.6k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  24.6k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 24.6k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  24.6k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  7.83k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  7.83k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 3.28k, False: 4.55k]
  ------------------
  770|  3.28k|        invalid_vertices.push_back(vertex_n);
  771|  3.28k|      }
  772|  7.83k|      active_corner_stack.back() = corner;
  773|  21.6k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 21.6k, False: 0]
  ------------------
  774|  21.6k|      const CornerIndex corner(3 * face.value());
  775|  21.6k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  21.6k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  21.6k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  21.6k|                                       corner_table_->AddNewVertex());
  780|  21.6k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  21.6k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  21.6k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 4, False: 21.6k]
  ------------------
  784|      4|        return -1;  // Unexpected number of decoded vertices.
  785|      4|      }
  786|       |
  787|  21.6k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  21.6k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  21.6k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  21.6k|      active_corner_stack.push_back(corner);
  792|  21.6k|      check_topology_split = true;
  793|  21.6k|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  52.8M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  52.8M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 26.5M, False: 26.2M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  26.5M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  26.5M|      EdgeFaceName split_edge;
  812|  26.5M|      int encoder_split_symbol_id;
  813|  26.5M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.17k, False: 26.5M]
  ------------------
  814|  26.5M|                             &encoder_split_symbol_id)) {
  815|  1.17k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 41, False: 1.13k]
  ------------------
  816|     41|          return -1;  // Wrong split symbol id.
  817|     41|        }
  818|       |        // Symbol was part of a topology split. Now we need to determine which
  819|       |        // edge should be added to the active edges stack.
  820|  1.13k|        const CornerIndex act_top_corner = active_corner_stack.back();
  821|       |        // The current symbol has one active edge (stored in act_top_corner) and
  822|       |        // two remaining inactive edges that are attached to it.
  823|       |        //              *
  824|       |        //             / \
  825|       |        //  left_edge /   \ right_edge
  826|       |        //           /     \
  827|       |        //          *.......*
  828|       |        //         active_edge
  829|       |
  830|  1.13k|        CornerIndex new_active_corner;
  831|  1.13k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 432, False: 699]
  ------------------
  832|    432|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    699|        } else {
  834|    699|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    699|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.13k|        const int decoder_split_symbol_id =
  839|  1.13k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.13k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.13k|            new_active_corner;
  842|  1.13k|      }
  843|  26.5M|    }
  844|  52.8M|  }
  845|  1.77k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.77k]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  13.5k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 11.8k, False: 1.74k]
  ------------------
  850|  11.8k|    const CornerIndex corner = active_corner_stack.back();
  851|  11.8k|    active_corner_stack.pop_back();
  852|  11.8k|    const bool interior_face =
  853|  11.8k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  11.8k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 5.00k, False: 6.85k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  5.00k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 10, False: 4.99k]
  ------------------
  877|     10|        return -1;  // More faces than expected added to the mesh.
  878|     10|      }
  879|       |
  880|  4.99k|      const CornerIndex corner_a = corner;
  881|  4.99k|      const VertexIndex vert_n =
  882|  4.99k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  4.99k|      const CornerIndex corner_b =
  884|  4.99k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  4.99k|      const VertexIndex vert_x =
  887|  4.99k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  4.99k|      const CornerIndex corner_c =
  889|  4.99k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  4.99k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 3, False: 4.99k]
  |  Branch (891:33): [True: 15, False: 4.97k]
  |  Branch (891:55): [True: 0, False: 4.97k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     18|        return -1;
  894|     18|      }
  895|  4.97k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 2, False: 4.97k]
  |  Branch (895:11): [True: 2, False: 4.97k]
  ------------------
  896|  4.97k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 4.97k]
  ------------------
  897|  4.97k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 4.97k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      2|        return -1;
  901|      2|      }
  902|       |
  903|  4.97k|      const VertexIndex vert_p =
  904|  4.97k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  4.97k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  4.97k|      const CornerIndex new_corner(3 * face.value());
  909|  4.97k|      SetOppositeCorners(new_corner, corner);
  910|  4.97k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  4.97k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  4.97k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  4.97k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  4.97k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  19.8k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 14.9k, False: 4.97k]
  ------------------
  920|  14.9k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  14.9k|      }
  922|       |
  923|  4.97k|      init_face_configurations_.push_back(true);
  924|  4.97k|      init_corners_.push_back(new_corner);
  925|  6.85k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  6.85k|      init_face_configurations_.push_back(false);
  930|  6.85k|      init_corners_.push_back(corner);
  931|  6.85k|    }
  932|  11.8k|  }
  933|  1.74k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 71, False: 1.67k]
  ------------------
  934|     71|    return -1;  // Unexpected number of decoded faces.
  935|     71|  }
  936|       |
  937|  1.67k|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  1.67k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 1.31k, False: 1.66k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  1.31k|    VertexIndex src_vert(num_vertices - 1);
  943|  1.40k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 95, False: 1.31k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     95|      src_vert = VertexIndex(--num_vertices - 1);
  946|     95|    }
  947|  1.31k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 95, False: 1.21k]
  ------------------
  948|     95|      continue;  // No need to swap anything.
  949|     95|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  1.21k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  5.77k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 4.56k, False: 1.21k]
  ------------------
  954|  4.56k|      const CornerIndex cid = vcit.Corner();
  955|  4.56k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 7, False: 4.55k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      7|        return -1;
  959|      7|      }
  960|  4.55k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  4.55k|    }
  962|  1.21k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  1.21k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  1.21k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  1.21k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  1.21k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  1.21k|    num_vertices--;
  972|  1.21k|  }
  973|  1.66k|  return num_vertices;
  974|  1.67k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.32k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.32k|  uint32_t num_topology_splits;
  982|  2.32k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.32k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.32k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 115, False: 2.21k]
  ------------------
  984|    115|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 113]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    115|  } else
  989|  2.21k|#endif
  990|  2.21k|  {
  991|  2.21k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 20, False: 2.19k]
  ------------------
  992|     20|      return -1;
  993|     20|    }
  994|  2.21k|  }
  995|  2.30k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 749, False: 1.55k]
  ------------------
  996|    749|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 68, False: 681]
  ------------------
  997|    749|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     68|      return -1;
  999|     68|    }
 1000|    681|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    681|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    681|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 50, False: 631]
  ------------------
 1002|  29.2k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 29.1k, False: 16]
  ------------------
 1003|  29.1k|        TopologySplitEventData event_data;
 1004|  29.1k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 21, False: 29.1k]
  ------------------
 1005|     21|          return -1;
 1006|     21|        }
 1007|  29.1k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 11, False: 29.1k]
  ------------------
 1008|     11|          return -1;
 1009|     11|        }
 1010|  29.1k|        uint8_t edge_data;
 1011|  29.1k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 2, False: 29.1k]
  ------------------
 1012|      2|          return -1;
 1013|      2|        }
 1014|  29.1k|        event_data.source_edge = edge_data & 1;
 1015|  29.1k|        topology_split_data_.push_back(event_data);
 1016|  29.1k|      }
 1017|       |
 1018|     50|    } else
 1019|    631|#endif
 1020|    631|    {
 1021|       |      // Decode source and split symbol ids using delta and varint coding. See
 1022|       |      // description in mesh_edgebreaker_encoder_impl.cc for more details.
 1023|    631|      int last_source_symbol_id = 0;
 1024|  4.55k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.99k, False: 566]
  ------------------
 1025|  3.99k|        TopologySplitEventData event_data;
 1026|  3.99k|        uint32_t delta;
 1027|  3.99k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 25, False: 3.96k]
  ------------------
 1028|     25|          return -1;
 1029|     25|        }
 1030|  3.96k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.96k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 15, False: 3.95k]
  ------------------
 1032|     15|          return -1;
 1033|     15|        }
 1034|  3.95k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 25, False: 3.92k]
  ------------------
 1035|     25|          return -1;
 1036|     25|        }
 1037|  3.92k|        event_data.split_symbol_id =
 1038|  3.92k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.92k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.92k|        topology_split_data_.push_back(event_data);
 1041|  3.92k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    566|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.03k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.47k, False: 566]
  ------------------
 1045|  2.47k|        uint32_t edge_data;
 1046|  2.47k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.47k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.13k, False: 1.34k]
  ------------------
 1047|  1.13k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  1.34k|        } else {
 1049|  1.34k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  1.34k|        }
 1051|  2.47k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  2.47k|        event_data.source_edge = edge_data & 1;
 1053|  2.47k|      }
 1054|    566|      decoder_buffer->EndBitDecoding();
 1055|    566|    }
 1056|    681|  }
 1057|  2.14k|  uint32_t num_hole_events = 0;
 1058|  2.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.14k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 59, False: 2.08k]
  ------------------
 1060|     59|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 56]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  2.08k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 215, False: 1.86k]
  ------------------
 1064|    215|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 12, False: 203]
  ------------------
 1065|     12|      return -1;
 1066|     12|    }
 1067|    215|  }
 1068|  2.12k|#endif
 1069|  2.12k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 90, False: 2.03k]
  ------------------
 1070|     90|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     90|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     90|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 36, False: 54]
  ------------------
 1072|   656k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 656k, False: 1]
  ------------------
 1073|   656k|        HoleEventData event_data;
 1074|   656k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 35, False: 656k]
  ------------------
 1075|     35|          return -1;
 1076|     35|        }
 1077|   656k|        hole_event_data_.push_back(event_data);
 1078|   656k|      }
 1079|       |
 1080|     36|    } else
 1081|     54|#endif
 1082|     54|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     54|      int last_symbol_id = 0;
 1085|  38.3k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 38.3k, False: 33]
  ------------------
 1086|  38.3k|        HoleEventData event_data;
 1087|  38.3k|        uint32_t delta;
 1088|  38.3k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 21, False: 38.3k]
  ------------------
 1089|     21|          return -1;
 1090|     21|        }
 1091|  38.3k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  38.3k|        last_symbol_id = event_data.symbol_id;
 1093|  38.3k|        hole_event_data_.push_back(event_data);
 1094|  38.3k|      }
 1095|     54|    }
 1096|     90|  }
 1097|  2.06k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.12k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|   561k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|   561k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|   561k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  2.24M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 1.68M, False: 561k]
  ------------------
 1109|  1.68M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  1.68M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 9.12k, False: 1.67M]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  18.3k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 9.24k, False: 9.12k]
  ------------------
 1114|  9.24k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  9.24k|      }
 1116|  9.12k|      continue;
 1117|  9.12k|    }
 1118|       |
 1119|  3.35M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 1.67M, False: 1.67M]
  ------------------
 1120|  1.67M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  1.67M|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 607k, False: 1.06M]
  ------------------
 1122|   607k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|   607k|      }
 1124|  1.67M|    }
 1125|  1.67M|  }
 1126|   561k|  return true;
 1127|   561k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  9.04M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  9.04M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  9.04M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  9.04M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  36.1M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 27.1M, False: 9.04M]
  ------------------
 1139|  27.1M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  27.1M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 111k, False: 27.0M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   250k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 139k, False: 111k]
  ------------------
 1144|   139k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   139k|      }
 1146|   111k|      continue;
 1147|   111k|    }
 1148|  27.0M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  27.0M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 13.5M, False: 13.5M]
  ------------------
 1151|  13.5M|      continue;
 1152|  13.5M|    }
 1153|       |
 1154|  28.4M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 14.9M, False: 13.5M]
  ------------------
 1155|  14.9M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  14.9M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 13.2M, False: 1.75M]
  ------------------
 1157|  13.2M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  13.2M|      }
 1159|  14.9M|    }
 1160|  13.5M|  }
 1161|  9.04M|  return true;
 1162|  9.04M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  1.66k|    int num_connectivity_verts) {
 1167|       |  // Map between the existing and deduplicated point ids.
 1168|       |  // Note that at this point we have one point id for each corner of the
 1169|       |  // mesh so there is corner_table_->num_corners() point ids.
 1170|  1.66k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.66k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 148, False: 1.51k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  1.53M|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 1.53M, False: 148]
  ------------------
 1176|  1.53M|      Mesh::Face face;
 1177|  1.53M|      const CornerIndex start_corner(3 * f.value());
 1178|  6.12M|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 4.59M, False: 1.53M]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  4.59M|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  4.59M|        face[c] = vert_id;
 1182|  4.59M|      }
 1183|  1.53M|      decoder_->mesh()->SetFace(f, face);
 1184|  1.53M|    }
 1185|    148|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|    148|    return true;
 1187|    148|  }
 1188|       |  // Else we need to deduplicate multiple attributes.
 1189|       |
 1190|       |  // Map between point id and an associated corner id. Only one corner for
 1191|       |  // each point is stored. The corners are used to sample the attribute values
 1192|       |  // in the last stage of the deduplication.
 1193|  1.51k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.51k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  4.86M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 4.86M, False: 1.50k]
  ------------------
 1197|  4.86M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  4.86M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 2.99k, False: 4.85M]
  ------------------
 1199|  2.99k|      continue;  // Isolated vertex.
 1200|  2.99k|    }
 1201|  4.85M|    CornerIndex deduplication_first_corner = c;
 1202|  4.85M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 119k, False: 4.73M]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|   119k|      deduplication_first_corner = c;
 1206|  4.73M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  5.35M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 4.75M, False: 599k]
  ------------------
 1210|  4.75M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 596k, False: 4.15M]
  ------------------
 1211|   596k|          continue;  // No seam for this attribute, ignore it.
 1212|   596k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|  4.15M|        const VertexIndex vert_id =
 1217|  4.15M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  4.15M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  4.15M|        bool seam_found = false;
 1220|  4.28M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 4.27M, False: 14.5k]
  ------------------
 1221|  4.27M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 13, False: 4.27M]
  ------------------
 1222|     13|            return false;
 1223|     13|          }
 1224|  4.27M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 4.14M, False: 129k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  4.14M|            deduplication_first_corner = act_c;
 1227|  4.14M|            seam_found = true;
 1228|  4.14M|            break;
 1229|  4.14M|          }
 1230|   129k|          act_c = corner_table_->SwingRight(act_c);
 1231|   129k|        }
 1232|  4.15M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 4.14M, False: 14.5k]
  ------------------
 1233|  4.14M|          break;  // No reason to process other attributes if we found a seam.
 1234|  4.14M|        }
 1235|  4.15M|      }
 1236|  4.73M|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|  4.85M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  4.85M|    corner_to_point_map[c.value()] =
 1246|  4.85M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  4.85M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  4.85M|    CornerIndex prev_c = c;
 1250|  4.85M|    c = corner_table_->SwingRight(c);
 1251|  28.7M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 28.6M, False: 121k]
  |  Branch (1251:40): [True: 23.9M, False: 4.73M]
  ------------------
 1252|  23.9M|      bool attribute_seam = false;
 1253|  27.0M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 23.9M, False: 3.09M]
  ------------------
 1254|  23.9M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 20.8M, False: 3.15M]
  ------------------
 1255|  23.9M|            attribute_data_[i].connectivity_data.Vertex(prev_c)) {
 1256|       |          // Attribute index changed from the previous corner. We need to add a
 1257|       |          // new point here.
 1258|  20.8M|          attribute_seam = true;
 1259|  20.8M|          break;
 1260|  20.8M|        }
 1261|  23.9M|      }
 1262|  23.9M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 20.8M, False: 3.09M]
  ------------------
 1263|  20.8M|        corner_to_point_map[c.value()] =
 1264|  20.8M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  20.8M|        point_to_corner_map.push_back(c.value());
 1266|  20.8M|      } else {
 1267|  3.09M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  3.09M|      }
 1269|  23.9M|      prev_c = c;
 1270|  23.9M|      c = corner_table_->SwingRight(c);
 1271|  23.9M|    }
 1272|  4.85M|  }
 1273|       |  // Add faces.
 1274|  9.57M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 9.57M, False: 1.50k]
  ------------------
 1275|  9.57M|    Mesh::Face face;
 1276|  38.2M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 28.7M, False: 9.57M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  28.7M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  28.7M|    }
 1280|  9.57M|    decoder_->mesh()->SetFace(f, face);
 1281|  9.57M|  }
 1282|  1.50k|  decoder_->point_cloud()->set_num_points(
 1283|  1.50k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.50k|  return true;
 1285|  1.51k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  3.30k|    : decoder_(nullptr),
   49|  3.30k|      last_symbol_id_(-1),
   50|  3.30k|      last_vert_id_(-1),
   51|  3.30k|      last_face_id_(-1),
   52|  3.30k|      num_new_vertices_(0),
   53|  3.30k|      num_encoded_vertices_(0),
   54|  3.30k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  3.30k|    MeshEdgebreakerDecoder* decoder) {
   59|  3.30k|  decoder_ = decoder;
   60|  3.30k|  return true;
   61|  3.30k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    249|    int att_id) const {
   67|    376|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 185, False: 191]
  ------------------
   68|    185|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    185|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 127, False: 58]
  |  Branch (69:27): [True: 0, False: 58]
  ------------------
   70|    127|      continue;
   71|    127|    }
   72|     58|    const AttributesDecoderInterface* const dec =
   73|     58|        decoder_->attributes_decoder(decoder_id);
   74|    508|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 508, False: 0]
  ------------------
   75|    508|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 58, False: 450]
  ------------------
   76|     58|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 55, False: 3]
  ------------------
   77|     55|          return &attribute_data_[i].connectivity_data;
   78|     55|        }
   79|      3|        return nullptr;
   80|     58|      }
   81|    508|    }
   82|     58|  }
   83|    191|  return nullptr;
   84|    249|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    249|    int att_id) const {
   90|    376|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 185, False: 191]
  ------------------
   91|    185|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    185|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 127, False: 58]
  |  Branch (92:27): [True: 0, False: 58]
  ------------------
   93|    127|      continue;
   94|    127|    }
   95|     58|    const AttributesDecoderInterface* const dec =
   96|     58|        decoder_->attributes_decoder(decoder_id);
   97|    508|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 508, False: 0]
  ------------------
   98|    508|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 58, False: 450]
  ------------------
   99|     58|        return &attribute_data_[i].encoding_data;
  100|     58|      }
  101|    508|    }
  102|     58|  }
  103|    191|  return &pos_encoding_data_;
  104|    249|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    225|    int32_t att_decoder_id) {
  131|    225|  int8_t att_data_id;
  132|    225|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 10, False: 215]
  ------------------
  133|     10|    return false;
  134|     10|  }
  135|    215|  uint8_t decoder_type;
  136|    215|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 8, False: 207]
  ------------------
  137|      8|    return false;
  138|      8|  }
  139|       |
  140|    207|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 84, False: 123]
  ------------------
  141|     84|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 29, False: 55]
  ------------------
  142|     29|      return false;  // Unexpected attribute data.
  143|     29|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     55|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 4, False: 51]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|       |
  151|     51|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    123|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    123|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 121]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|    121|    pos_data_decoder_id_ = att_decoder_id;
  158|    121|  }
  159|       |
  160|    172|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    172|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    172|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 172, False: 0]
  ------------------
  162|    172|    uint8_t traversal_method_encoded;
  163|    172|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 2, False: 170]
  ------------------
  164|      2|      return false;
  165|      2|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    170|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 16, False: 154]
  ------------------
  168|     16|      return false;
  169|     16|    }
  170|    154|    traversal_method =
  171|    154|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    154|  }
  173|       |
  174|    154|  const Mesh* mesh = decoder_->mesh();
  175|    154|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    154|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 126, False: 28]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    126|    MeshAttributeIndicesEncodingData* encoding_data = nullptr;
  181|    126|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 105, False: 21]
  ------------------
  182|    105|      encoding_data = &pos_encoding_data_;
  183|    105|    } else {
  184|     21|      encoding_data = &attribute_data_[att_data_id].encoding_data;
  185|       |      // Mark the attribute connectivity data invalid to ensure it's not used
  186|       |      // later on.
  187|     21|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     21|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    126|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 38, False: 88]
  ------------------
  191|     38|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     38|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     38|          AttTraverser;
  194|     38|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     88|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 88, False: 0]
  ------------------
  196|     88|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     88|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     88|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     88|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    126|  } else {
  203|     28|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 4, False: 24]
  ------------------
  204|      4|      return false;  // Unsupported method.
  205|      4|    }
  206|     24|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 22]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     22|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     22|        AttObserver;
  214|     22|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     22|        AttTraverser;
  216|       |
  217|     22|    MeshAttributeIndicesEncodingData* const encoding_data =
  218|     22|        &attribute_data_[att_data_id].encoding_data;
  219|     22|    const MeshAttributeCornerTable* const corner_table =
  220|     22|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     22|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     22|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     22|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     22|                             encoding_data);
  227|       |
  228|     22|    AttTraverser att_traverser;
  229|     22|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     22|    traversal_sequencer->SetTraverser(att_traverser);
  232|     22|    sequencer = std::move(traversal_sequencer);
  233|     22|  }
  234|       |
  235|    148|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 148]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|    148|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|    148|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|    148|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|    148|                                        std::move(att_controller));
  244|    148|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  3.30k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  3.30k|  num_new_vertices_ = 0;
  249|  3.30k|  new_to_parent_vertex_map_.clear();
  250|  3.30k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  3.30k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 652, False: 2.64k]
  ------------------
  252|    652|    uint32_t num_new_verts;
  253|    652|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    652|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 397, False: 255]
  ------------------
  254|    397|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 11, False: 386]
  ------------------
  255|     11|        return false;
  256|     11|      }
  257|    397|    } else {
  258|    255|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 1, False: 254]
  ------------------
  259|      1|        return false;
  260|      1|      }
  261|    255|    }
  262|    640|    num_new_vertices_ = num_new_verts;
  263|    640|  }
  264|  3.28k|#endif
  265|       |
  266|  3.28k|  uint32_t num_encoded_vertices;
  267|  3.28k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  3.28k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.28k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 386, False: 2.90k]
  ------------------
  269|    386|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 4, False: 382]
  ------------------
  270|      4|      return false;
  271|      4|    }
  272|       |
  273|    386|  } else
  274|  2.90k|#endif
  275|  2.90k|  {
  276|  2.90k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 4, False: 2.89k]
  ------------------
  277|      4|      return false;
  278|      4|    }
  279|  2.90k|  }
  280|  3.28k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  3.28k|  uint32_t num_faces;
  283|  3.28k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  3.28k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.28k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 382, False: 2.89k]
  ------------------
  285|    382|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 4, False: 378]
  ------------------
  286|      4|      return false;
  287|      4|    }
  288|       |
  289|    382|  } else
  290|  2.89k|#endif
  291|  2.89k|  {
  292|  2.89k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 2, False: 2.89k]
  ------------------
  293|      2|      return false;
  294|      2|    }
  295|  2.89k|  }
  296|  3.27k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 4, False: 3.27k]
  ------------------
  297|      4|    return false;  // Draco cannot handle this many faces.
  298|      4|  }
  299|       |
  300|  3.27k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 30, False: 3.24k]
  ------------------
  301|     30|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     30|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  3.24k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  3.24k|  const uint64_t num_encoded_vertices_64 =
  311|  3.24k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  3.24k|  const uint64_t max_num_vertex_edges =
  313|  3.24k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  3.24k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 14, False: 3.22k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     14|    return false;
  317|     14|  }
  318|       |
  319|  3.22k|  uint8_t num_attribute_data;
  320|  3.22k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 37, False: 3.19k]
  ------------------
  321|     37|    return false;
  322|     37|  }
  323|       |
  324|  3.19k|  uint32_t num_encoded_symbols;
  325|  3.19k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  3.19k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.19k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 358, False: 2.83k]
  ------------------
  327|    358|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 15, False: 343]
  ------------------
  328|     15|      return false;
  329|     15|    }
  330|       |
  331|    358|  } else
  332|  2.83k|#endif
  333|  2.83k|  {
  334|  2.83k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 6, False: 2.82k]
  ------------------
  335|      6|      return false;
  336|      6|    }
  337|  2.83k|  }
  338|       |
  339|  3.16k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 27, False: 3.14k]
  ------------------
  340|       |    // Number of faces needs to be the same or greater than the number of
  341|       |    // symbols (it can be greater because the initial face may not be encoded as
  342|       |    // a symbol).
  343|     27|    return false;
  344|     27|  }
  345|  3.14k|  const uint32_t max_encoded_faces =
  346|  3.14k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  3.14k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 49, False: 3.09k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|     49|    return false;
  352|     49|  }
  353|       |
  354|  3.09k|  uint32_t num_encoded_split_symbols;
  355|  3.09k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  3.09k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.09k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 323, False: 2.77k]
  ------------------
  357|    323|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 1, False: 322]
  ------------------
  358|      1|      return false;
  359|      1|    }
  360|       |
  361|    323|  } else
  362|  2.77k|#endif
  363|  2.77k|  {
  364|  2.77k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 4, False: 2.76k]
  ------------------
  365|      4|      return false;
  366|      4|    }
  367|  2.77k|  }
  368|       |
  369|  3.08k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 42, False: 3.04k]
  ------------------
  370|     42|    return false;  // Split symbols are a sub-set of all symbols.
  371|     42|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  3.04k|  vertex_traversal_length_.clear();
  375|  3.04k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  3.04k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 3.04k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  3.04k|  processed_corner_ids_.clear();
  380|  3.04k|  processed_corner_ids_.reserve(num_faces);
  381|  3.04k|  processed_connectivity_corners_.clear();
  382|  3.04k|  processed_connectivity_corners_.reserve(num_faces);
  383|  3.04k|  topology_split_data_.clear();
  384|  3.04k|  hole_event_data_.clear();
  385|  3.04k|  init_face_configurations_.clear();
  386|  3.04k|  init_corners_.clear();
  387|       |
  388|  3.04k|  last_symbol_id_ = -1;
  389|  3.04k|  last_face_id_ = -1;
  390|  3.04k|  last_vert_id_ = -1;
  391|       |
  392|  3.04k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  3.04k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  3.04k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 3.04k]
  ------------------
  397|  3.04k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      1|    return false;
  399|      1|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  3.04k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  3.04k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  3.04k|  int32_t topology_split_decoded_bytes = -1;
  410|  3.04k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.04k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 553, False: 2.49k]
  ------------------
  411|    553|    uint32_t encoded_connectivity_size;
  412|    553|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    553|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 311, False: 242]
  ------------------
  413|    311|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 6, False: 305]
  ------------------
  414|      6|        return false;
  415|      6|      }
  416|    311|    } else {
  417|    242|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 2, False: 240]
  ------------------
  418|      2|        return false;
  419|      2|      }
  420|    242|    }
  421|    545|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 544]
  ------------------
  422|    544|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 36, False: 508]
  ------------------
  423|     37|      return false;
  424|     37|    }
  425|    508|    DecoderBuffer event_buffer;
  426|    508|    event_buffer.Init(
  427|    508|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    508|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    508|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    508|    topology_split_decoded_bytes =
  432|    508|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    508|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 162, False: 346]
  ------------------
  434|    162|      return false;
  435|    162|    }
  436|       |
  437|    508|  } else
  438|  2.49k|#endif
  439|  2.49k|  {
  440|  2.49k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 106, False: 2.38k]
  ------------------
  441|    106|      return false;
  442|    106|    }
  443|  2.49k|  }
  444|       |
  445|  2.73k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.73k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.73k|                                           num_encoded_split_symbols);
  449|  2.73k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.73k|  DecoderBuffer traversal_end_buffer;
  452|  2.73k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 1.54k, False: 1.18k]
  ------------------
  453|  1.54k|    return false;
  454|  1.54k|  }
  455|       |
  456|  1.18k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.18k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 913, False: 275]
  ------------------
  458|    913|    return false;
  459|    913|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    275|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    275|                           traversal_end_buffer.remaining_size(),
  464|    275|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    275|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    275|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    275|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 5, False: 270]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      5|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      5|  }
  471|    275|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    275|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 179, False: 96]
  ------------------
  475|    179|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    179|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    179|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 5, False: 174]
  ------------------
  477|     15|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 10, False: 5]
  ------------------
  478|     10|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 10]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|     10|      }
  482|       |
  483|      5|    } else
  484|    174|#endif
  485|    174|    {
  486|   461k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 461k, False: 174]
  ------------------
  487|   461k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 461k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   461k|      }
  491|    174|    }
  492|    179|  }
  493|    275|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    627|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 352, False: 275]
  ------------------
  498|    352|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  1.09M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 1.09M, False: 352]
  ------------------
  501|  1.09M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  1.09M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    352|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 352]
  ------------------
  505|    352|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    352|  }
  509|       |
  510|    275|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    627|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 352, False: 275]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|    352|    int32_t att_connectivity_verts =
  517|    352|        attribute_data_[i].connectivity_data.num_vertices();
  518|    352|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 7, False: 345]
  ------------------
  519|      7|      att_connectivity_verts = corner_table_->num_vertices();
  520|      7|    }
  521|    352|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    352|  }
  523|    275|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 19, False: 256]
  ------------------
  524|     19|    return false;
  525|     19|  }
  526|    256|  return true;
  527|    275|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     21|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     21|  return true;
  532|     21|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|  1.18k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  1.18k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  1.18k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  1.18k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.18k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.18k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.18k|  int num_faces = 0;
  562|  67.8M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 67.8M, False: 396]
  ------------------
  563|  67.8M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  67.8M|    bool check_topology_split = false;
  566|  67.8M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  67.8M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 2.36M, False: 65.4M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  2.36M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 60, False: 2.36M]
  ------------------
  588|     60|        return -1;
  589|     60|      }
  590|       |
  591|  2.36M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  2.36M|      const VertexIndex vertex_x =
  593|  2.36M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  2.36M|      const CornerIndex corner_b =
  595|  2.36M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  2.36M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 292, False: 2.36M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    292|        return -1;
  600|    292|      }
  601|  2.36M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 2.36M]
  |  Branch (601:11): [True: 0, False: 2.36M]
  ------------------
  602|  2.36M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 2.36M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  2.36M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  2.36M|      SetOppositeCorners(corner_a, corner + 1);
  612|  2.36M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  2.36M|      const VertexIndex vert_a_prev =
  616|  2.36M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  2.36M|      const VertexIndex vert_b_next =
  618|  2.36M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  2.36M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 2.36M]
  |  Branch (619:38): [True: 0, False: 2.36M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  2.36M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  2.36M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  2.36M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  2.36M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  2.36M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  2.36M|      active_corner_stack.back() = corner;
  631|  65.4M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 31.3k, False: 65.4M]
  |  Branch (631:40): [True: 57.8M, False: 7.61M]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  57.8M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 57.8M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  57.8M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  57.8M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 57.8M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  57.8M|      const CornerIndex corner(3 * face.value());
  658|  57.8M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  57.8M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 31.3k, False: 57.8M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  31.3k|        opp_corner = corner + 2;
  662|  31.3k|        corner_l = corner + 1;
  663|  31.3k|        corner_r = corner;
  664|  57.8M|      } else {
  665|       |        // "l" is the new first corner.
  666|  57.8M|        opp_corner = corner + 1;
  667|  57.8M|        corner_l = corner;
  668|  57.8M|        corner_r = corner + 2;
  669|  57.8M|      }
  670|  57.8M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  57.8M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  57.8M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 11, False: 57.8M]
  ------------------
  675|     11|        return -1;  // Unexpected number of decoded vertices.
  676|     11|      }
  677|       |
  678|  57.8M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  57.8M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  57.8M|      const VertexIndex vertex_r =
  682|  57.8M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  57.8M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  57.8M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  57.8M|      corner_table_->MapCornerToVertex(
  688|  57.8M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  57.8M|      active_corner_stack.back() = corner;
  690|  57.8M|      check_topology_split = true;
  691|  57.8M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 27.2k, False: 7.59M]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  27.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 27.2k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  27.2k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  27.2k|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  27.2k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  27.2k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 26, False: 27.2k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     26|        active_corner_stack.push_back(it->second);
  714|     26|      }
  715|  27.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 75, False: 27.2k]
  ------------------
  716|     75|        return -1;
  717|     75|      }
  718|  27.2k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  27.2k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 27.2k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  27.2k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 1, False: 27.2k]
  |  Branch (724:11): [True: 1, False: 27.2k]
  ------------------
  725|  27.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 27.2k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      1|        return -1;
  729|      1|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  27.2k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  27.2k|      SetOppositeCorners(corner_a, corner + 2);
  735|  27.2k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  27.2k|      const VertexIndex vertex_p =
  739|  27.2k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  27.2k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  27.2k|      corner_table_->MapCornerToVertex(
  742|  27.2k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  27.2k|      const VertexIndex vert_b_prev =
  744|  27.2k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  27.2k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  27.2k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  27.2k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  27.2k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  27.2k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  27.2k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  27.2k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  27.2k|      const CornerIndex first_corner = corner_n;
  757|  94.2k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 67.0k, False: 27.2k]
  ------------------
  758|  67.0k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  67.0k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  67.0k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 3, False: 67.0k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      3|          return -1;
  764|      3|        }
  765|  67.0k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  27.2k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  27.2k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 26.8k, False: 326]
  ------------------
  770|  26.8k|        invalid_vertices.push_back(vertex_n);
  771|  26.8k|      }
  772|  27.2k|      active_corner_stack.back() = corner;
  773|  7.59M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 7.59M, False: 299]
  ------------------
  774|  7.59M|      const CornerIndex corner(3 * face.value());
  775|  7.59M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  7.59M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  7.59M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  7.59M|                                       corner_table_->AddNewVertex());
  780|  7.59M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  7.59M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  7.59M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 8, False: 7.59M]
  ------------------
  784|      8|        return -1;  // Unexpected number of decoded vertices.
  785|      8|      }
  786|       |
  787|  7.59M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  7.59M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  7.59M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  7.59M|      active_corner_stack.push_back(corner);
  792|  7.59M|      check_topology_split = true;
  793|  7.59M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    299|      return -1;
  796|    299|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  67.8M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  67.8M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 65.4M, False: 2.39M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  65.4M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  65.4M|      EdgeFaceName split_edge;
  812|  65.4M|      int encoder_split_symbol_id;
  813|  65.4M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.54k, False: 65.4M]
  ------------------
  814|  65.4M|                             &encoder_split_symbol_id)) {
  815|  1.54k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 42, False: 1.49k]
  ------------------
  816|     42|          return -1;  // Wrong split symbol id.
  817|     42|        }
  818|       |        // Symbol was part of a topology split. Now we need to determine which
  819|       |        // edge should be added to the active edges stack.
  820|  1.49k|        const CornerIndex act_top_corner = active_corner_stack.back();
  821|       |        // The current symbol has one active edge (stored in act_top_corner) and
  822|       |        // two remaining inactive edges that are attached to it.
  823|       |        //              *
  824|       |        //             / \
  825|       |        //  left_edge /   \ right_edge
  826|       |        //           /     \
  827|       |        //          *.......*
  828|       |        //         active_edge
  829|       |
  830|  1.49k|        CornerIndex new_active_corner;
  831|  1.49k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 481, False: 1.01k]
  ------------------
  832|    481|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.01k|        } else {
  834|  1.01k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.01k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.49k|        const int decoder_split_symbol_id =
  839|  1.49k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.49k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.49k|            new_active_corner;
  842|  1.49k|      }
  843|  65.4M|    }
  844|  67.8M|  }
  845|    396|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 396]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  2.65M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 2.65M, False: 359]
  ------------------
  850|  2.65M|    const CornerIndex corner = active_corner_stack.back();
  851|  2.65M|    active_corner_stack.pop_back();
  852|  2.65M|    const bool interior_face =
  853|  2.65M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  2.65M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 2.54M, False: 108k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  2.54M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 29, False: 2.54M]
  ------------------
  877|     29|        return -1;  // More faces than expected added to the mesh.
  878|     29|      }
  879|       |
  880|  2.54M|      const CornerIndex corner_a = corner;
  881|  2.54M|      const VertexIndex vert_n =
  882|  2.54M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  2.54M|      const CornerIndex corner_b =
  884|  2.54M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  2.54M|      const VertexIndex vert_x =
  887|  2.54M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  2.54M|      const CornerIndex corner_c =
  889|  2.54M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  2.54M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 5, False: 2.54M]
  |  Branch (891:33): [True: 3, False: 2.54M]
  |  Branch (891:55): [True: 0, False: 2.54M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      8|        return -1;
  894|      8|      }
  895|  2.54M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 2.54M]
  |  Branch (895:11): [True: 0, False: 2.54M]
  ------------------
  896|  2.54M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 2.54M]
  ------------------
  897|  2.54M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 2.54M]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      0|        return -1;
  901|      0|      }
  902|       |
  903|  2.54M|      const VertexIndex vert_p =
  904|  2.54M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  2.54M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  2.54M|      const CornerIndex new_corner(3 * face.value());
  909|  2.54M|      SetOppositeCorners(new_corner, corner);
  910|  2.54M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  2.54M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  2.54M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  2.54M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  2.54M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  10.1M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 7.63M, False: 2.54M]
  ------------------
  920|  7.63M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  7.63M|      }
  922|       |
  923|  2.54M|      init_face_configurations_.push_back(true);
  924|  2.54M|      init_corners_.push_back(new_corner);
  925|  2.54M|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|   108k|      init_face_configurations_.push_back(false);
  930|   108k|      init_corners_.push_back(corner);
  931|   108k|    }
  932|  2.65M|  }
  933|    359|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 82, False: 277]
  ------------------
  934|     82|    return -1;  // Unexpected number of decoded faces.
  935|     82|  }
  936|       |
  937|    277|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  2.41k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 2.41k, False: 275]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  2.41k|    VertexIndex src_vert(num_vertices - 1);
  943|  2.73k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 324, False: 2.41k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    324|      src_vert = VertexIndex(--num_vertices - 1);
  946|    324|    }
  947|  2.41k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 157, False: 2.25k]
  ------------------
  948|    157|      continue;  // No need to swap anything.
  949|    157|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.25k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  9.57k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 7.31k, False: 2.25k]
  ------------------
  954|  7.31k|      const CornerIndex cid = vcit.Corner();
  955|  7.31k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 2, False: 7.31k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      2|        return -1;
  959|      2|      }
  960|  7.31k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  7.31k|    }
  962|  2.25k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.25k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.25k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.25k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.25k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.25k|    num_vertices--;
  972|  2.25k|  }
  973|    275|  return num_vertices;
  974|    277|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  3.00k|    DecoderBuffer* decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  3.00k|  uint32_t num_topology_splits;
  982|  3.00k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  3.00k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.00k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 285, False: 2.71k]
  ------------------
  984|    285|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 283]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    285|  } else
  989|  2.71k|#endif
  990|  2.71k|  {
  991|  2.71k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 19, False: 2.69k]
  ------------------
  992|     19|      return -1;
  993|     19|    }
  994|  2.71k|  }
  995|  2.97k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 613, False: 2.36k]
  ------------------
  996|    613|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 67, False: 546]
  ------------------
  997|    613|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     67|      return -1;
  999|     67|    }
 1000|    546|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    546|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    546|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 61, False: 485]
  ------------------
 1002|   120k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 120k, False: 17]
  ------------------
 1003|   120k|        TopologySplitEventData event_data;
 1004|   120k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 27, False: 120k]
  ------------------
 1005|     27|          return -1;
 1006|     27|        }
 1007|   120k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 15, False: 120k]
  ------------------
 1008|     15|          return -1;
 1009|     15|        }
 1010|   120k|        uint8_t edge_data;
 1011|   120k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 2, False: 120k]
  ------------------
 1012|      2|          return -1;
 1013|      2|        }
 1014|   120k|        event_data.source_edge = edge_data & 1;
 1015|   120k|        topology_split_data_.push_back(event_data);
 1016|   120k|      }
 1017|       |
 1018|     61|    } else
 1019|    485|#endif
 1020|    485|    {
 1021|       |      // Decode source and split symbol ids using delta and varint coding. See
 1022|       |      // description in mesh_edgebreaker_encoder_impl.cc for more details.
 1023|    485|      int last_source_symbol_id = 0;
 1024|  20.7k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 20.2k, False: 433]
  ------------------
 1025|  20.2k|        TopologySplitEventData event_data;
 1026|  20.2k|        uint32_t delta;
 1027|  20.2k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 23, False: 20.2k]
  ------------------
 1028|     23|          return -1;
 1029|     23|        }
 1030|  20.2k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  20.2k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 11, False: 20.2k]
  ------------------
 1032|     11|          return -1;
 1033|     11|        }
 1034|  20.2k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 18, False: 20.2k]
  ------------------
 1035|     18|          return -1;
 1036|     18|        }
 1037|  20.2k|        event_data.split_symbol_id =
 1038|  20.2k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  20.2k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  20.2k|        topology_split_data_.push_back(event_data);
 1041|  20.2k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    433|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.93k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 3.50k, False: 433]
  ------------------
 1045|  3.50k|        uint32_t edge_data;
 1046|  3.50k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 708, False: 2.79k]
  ------------------
 1047|    708|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.79k|        } else {
 1049|  2.79k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.79k|        }
 1051|  3.50k|        TopologySplitEventData& event_data = topology_split_data_[i];
 1052|  3.50k|        event_data.source_edge = edge_data & 1;
 1053|  3.50k|      }
 1054|    433|      decoder_buffer->EndBitDecoding();
 1055|    433|    }
 1056|    546|  }
 1057|  2.81k|  uint32_t num_hole_events = 0;
 1058|  2.81k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.81k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.81k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 216, False: 2.60k]
  ------------------
 1060|    216|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 214]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  2.60k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.60k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 187, False: 2.41k]
  ------------------
 1064|    187|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 12, False: 175]
  ------------------
 1065|     12|      return -1;
 1066|     12|    }
 1067|    187|  }
 1068|  2.80k|#endif
 1069|  2.80k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 91, False: 2.71k]
  ------------------
 1070|     91|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     91|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     91|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 47, False: 44]
  ------------------
 1072|   138k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 138k, False: 6]
  ------------------
 1073|   138k|        HoleEventData event_data;
 1074|   138k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 41, False: 138k]
  ------------------
 1075|     41|          return -1;
 1076|     41|        }
 1077|   138k|        hole_event_data_.push_back(event_data);
 1078|   138k|      }
 1079|       |
 1080|     47|    } else
 1081|     44|#endif
 1082|     44|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     44|      int last_symbol_id = 0;
 1085|  17.7k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 17.7k, False: 15]
  ------------------
 1086|  17.7k|        HoleEventData event_data;
 1087|  17.7k|        uint32_t delta;
 1088|  17.7k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 29, False: 17.7k]
  ------------------
 1089|     29|          return -1;
 1090|     29|        }
 1091|  17.7k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  17.7k|        last_symbol_id = event_data.symbol_id;
 1093|  17.7k|        hole_event_data_.push_back(event_data);
 1094|  17.7k|      }
 1095|     44|    }
 1096|     91|  }
 1097|  2.73k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.80k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|     10|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|     10|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|     10|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     40|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 30, False: 10]
  ------------------
 1109|     30|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     30|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 10, False: 20]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     20|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 10, False: 10]
  ------------------
 1114|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|     10|      }
 1116|     10|      continue;
 1117|     10|    }
 1118|       |
 1119|     40|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 20, False: 20]
  ------------------
 1120|     20|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     20|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 9, False: 11]
  ------------------
 1122|      9|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|      9|      }
 1124|     20|    }
 1125|     20|  }
 1126|     10|  return true;
 1127|     10|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   461k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   461k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   461k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   461k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.84M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 1.38M, False: 461k]
  ------------------
 1139|  1.38M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  1.38M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 130k, False: 1.25M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   319k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 188k, False: 130k]
  ------------------
 1144|   188k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   188k|      }
 1146|   130k|      continue;
 1147|   130k|    }
 1148|  1.25M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  1.25M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 627k, False: 627k]
  ------------------
 1151|   627k|      continue;
 1152|   627k|    }
 1153|       |
 1154|  1.72M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 1.10M, False: 627k]
  ------------------
 1155|  1.10M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  1.10M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 911k, False: 191k]
  ------------------
 1157|   911k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   911k|      }
 1159|  1.10M|    }
 1160|   627k|  }
 1161|   461k|  return true;
 1162|   461k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    275|    int num_connectivity_verts) {
 1167|       |  // Map between the existing and deduplicated point ids.
 1168|       |  // Note that at this point we have one point id for each corner of the
 1169|       |  // mesh so there is corner_table_->num_corners() point ids.
 1170|    275|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    275|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 96, False: 179]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  73.5k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 73.4k, False: 96]
  ------------------
 1176|  73.4k|      Mesh::Face face;
 1177|  73.4k|      const CornerIndex start_corner(3 * f.value());
 1178|   293k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 220k, False: 73.4k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   220k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   220k|        face[c] = vert_id;
 1182|   220k|      }
 1183|  73.4k|      decoder_->mesh()->SetFace(f, face);
 1184|  73.4k|    }
 1185|     96|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     96|    return true;
 1187|     96|  }
 1188|       |  // Else we need to deduplicate multiple attributes.
 1189|       |
 1190|       |  // Map between point id and an associated corner id. Only one corner for
 1191|       |  // each point is stored. The corners are used to sample the attribute values
 1192|       |  // in the last stage of the deduplication.
 1193|    179|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    179|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   312k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 312k, False: 160]
  ------------------
 1197|   312k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   312k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 114, False: 312k]
  ------------------
 1199|    114|      continue;  // Isolated vertex.
 1200|    114|    }
 1201|   312k|    CornerIndex deduplication_first_corner = c;
 1202|   312k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 130k, False: 182k]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|   130k|      deduplication_first_corner = c;
 1206|   182k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   214k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 211k, False: 3.63k]
  ------------------
 1210|   211k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 31.4k, False: 179k]
  ------------------
 1211|  31.4k|          continue;  // No seam for this attribute, ignore it.
 1212|  31.4k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|   179k|        const VertexIndex vert_id =
 1217|   179k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   179k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   179k|        bool seam_found = false;
 1220|   184k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 183k, False: 653]
  ------------------
 1221|   183k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 19, False: 183k]
  ------------------
 1222|     19|            return false;
 1223|     19|          }
 1224|   183k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 178k, False: 4.93k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   178k|            deduplication_first_corner = act_c;
 1227|   178k|            seam_found = true;
 1228|   178k|            break;
 1229|   178k|          }
 1230|  4.93k|          act_c = corner_table_->SwingRight(act_c);
 1231|  4.93k|        }
 1232|   179k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 178k, False: 653]
  ------------------
 1233|   178k|          break;  // No reason to process other attributes if we found a seam.
 1234|   178k|        }
 1235|   179k|      }
 1236|   182k|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|   312k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   312k|    corner_to_point_map[c.value()] =
 1246|   312k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   312k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   312k|    CornerIndex prev_c = c;
 1250|   312k|    c = corner_table_->SwingRight(c);
 1251|  1.37M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 1.24M, False: 130k]
  |  Branch (1251:40): [True: 1.06M, False: 182k]
  ------------------
 1252|  1.06M|      bool attribute_seam = false;
 1253|  1.45M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 1.25M, False: 199k]
  ------------------
 1254|  1.25M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 866k, False: 386k]
  ------------------
 1255|  1.25M|            attribute_data_[i].connectivity_data.Vertex(prev_c)) {
 1256|       |          // Attribute index changed from the previous corner. We need to add a
 1257|       |          // new point here.
 1258|   866k|          attribute_seam = true;
 1259|   866k|          break;
 1260|   866k|        }
 1261|  1.25M|      }
 1262|  1.06M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 866k, False: 199k]
  ------------------
 1263|   866k|        corner_to_point_map[c.value()] =
 1264|   866k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   866k|        point_to_corner_map.push_back(c.value());
 1266|   866k|      } else {
 1267|   199k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   199k|      }
 1269|  1.06M|      prev_c = c;
 1270|  1.06M|      c = corner_table_->SwingRight(c);
 1271|  1.06M|    }
 1272|   312k|  }
 1273|       |  // Add faces.
 1274|   398k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 398k, False: 160]
  ------------------
 1275|   398k|    Mesh::Face face;
 1276|  1.59M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 1.19M, False: 398k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  1.19M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  1.19M|    }
 1280|   398k|    decoder_->mesh()->SetFace(f, face);
 1281|   398k|  }
 1282|    160|  decoder_->point_cloud()->set_num_points(
 1283|    160|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    160|  return true;
 1285|    179|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    379|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    379|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    379|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    379|  const Mesh* mesh = decoder_->mesh();
  115|    379|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    379|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    379|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    379|                           encoding_data);
  120|       |
  121|    379|  TraverserT att_traverser;
  122|    379|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    379|  traversal_sequencer->SetTraverser(att_traverser);
  125|    379|  return std::move(traversal_sequencer);
  126|    379|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|  1.31k|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|  1.31k|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|  1.31k|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|  1.31k|  const Mesh* mesh = decoder_->mesh();
  115|  1.31k|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|  1.31k|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|  1.31k|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|  1.31k|                           encoding_data);
  120|       |
  121|  1.31k|  TraverserT att_traverser;
  122|  1.31k|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|  1.31k|  traversal_sequencer->SetTraverser(att_traverser);
  125|  1.31k|  return std::move(traversal_sequencer);
  126|  1.31k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    257|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    257|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    257|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    257|  const Mesh* mesh = decoder_->mesh();
  115|    257|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    257|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    257|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    257|                           encoding_data);
  120|       |
  121|    257|  TraverserT att_traverser;
  122|    257|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    257|  traversal_sequencer->SetTraverser(att_traverser);
  125|    257|  return std::move(traversal_sequencer);
  126|    257|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    484|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|    484|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    484|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    484|  const Mesh* mesh = decoder_->mesh();
  115|    484|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    484|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    484|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    484|                           encoding_data);
  120|       |
  121|    484|  TraverserT att_traverser;
  122|    484|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    484|  traversal_sequencer->SetTraverser(att_traverser);
  125|    484|  return std::move(traversal_sequencer);
  126|    484|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     38|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|     38|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     38|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     38|  const Mesh* mesh = decoder_->mesh();
  115|     38|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     38|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     38|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     38|                           encoding_data);
  120|       |
  121|     38|  TraverserT att_traverser;
  122|     38|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     38|  traversal_sequencer->SetTraverser(att_traverser);
  125|     38|  return std::move(traversal_sequencer);
  126|     38|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     88|    MeshAttributeIndicesEncodingData* encoding_data) {
  111|     88|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     88|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     88|  const Mesh* mesh = decoder_->mesh();
  115|     88|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     88|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     88|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     88|                           encoding_data);
  120|       |
  121|     88|  TraverserT att_traverser;
  122|     88|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     88|  traversal_sequencer->SetTraverser(att_traverser);
  125|     88|  return std::move(traversal_sequencer);
  126|     88|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  12.4k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  4.19k|  const CornerTable* GetCornerTable() const override {
   67|  4.19k|    return corner_table_.get();
   68|  4.19k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  1.43M|                       int* out_encoder_split_symbol_id) {
   87|  1.43M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.16M, False: 265k]
  ------------------
   88|  1.16M|      return false;
   89|  1.16M|    }
   90|   265k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 39, False: 265k]
  ------------------
   91|   265k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     39|      *out_encoder_split_symbol_id = -1;
   98|     39|      return true;
   99|     39|    }
  100|   265k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 263k, False: 1.91k]
  ------------------
  101|   263k|      return false;
  102|   263k|    }
  103|  1.91k|    *out_face_edge =
  104|  1.91k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.91k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.91k|    topology_split_data_.pop_back();
  108|  1.91k|    return true;
  109|   265k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  6.84M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  6.84M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  6.84M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  6.84M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  21.0k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  6.20k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  3.87k|  const CornerTable* GetCornerTable() const override {
   67|  3.87k|    return corner_table_.get();
   68|  3.87k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  26.5M|                       int* out_encoder_split_symbol_id) {
   87|  26.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 26.1M, False: 412k]
  ------------------
   88|  26.1M|      return false;
   89|  26.1M|    }
   90|   412k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 41, False: 412k]
  ------------------
   91|   412k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     41|      *out_encoder_split_symbol_id = -1;
   98|     41|      return true;
   99|     41|    }
  100|   412k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 411k, False: 1.13k]
  ------------------
  101|   411k|      return false;
  102|   411k|    }
  103|  1.13k|    *out_face_edge =
  104|  1.13k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.13k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.13k|    topology_split_data_.pop_back();
  108|  1.13k|    return true;
  109|   412k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  79.1M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  79.1M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  79.1M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  79.1M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  13.1k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  14.7k|  MeshEdgebreakerDecoder* GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.98k|  const CornerTable* GetCornerTable() const override {
   67|  2.98k|    return corner_table_.get();
   68|  2.98k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  65.4M|                       int* out_encoder_split_symbol_id) {
   87|  65.4M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 64.8M, False: 625k]
  ------------------
   88|  64.8M|      return false;
   89|  64.8M|    }
   90|   625k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 42, False: 625k]
  ------------------
   91|   625k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     42|      *out_encoder_split_symbol_id = -1;
   98|     42|      return true;
   99|     42|    }
  100|   625k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 624k, False: 1.49k]
  ------------------
  101|   624k|      return false;
  102|   624k|    }
  103|  1.49k|    *out_face_edge =
  104|  1.49k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.49k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.49k|    topology_split_data_.pop_back();
  108|  1.49k|    return true;
  109|   625k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  70.2M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  70.2M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  70.2M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  70.2M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  17.0k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

_ZN5draco35MeshEdgebreakerDecoderImplInterfaceD2Ev:
   30|  10.7k|  virtual ~MeshEdgebreakerDecoderImplInterface() = default;

_ZN5draco13HoleEventDataC2Ev:
  118|   981k|  HoleEventData() : symbol_id(0) {}

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  10.7k|      : attribute_connectivity_decoders_(nullptr),
   34|  10.7k|        num_attribute_data_(0),
   35|  10.7k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  8.96k|  void Init(MeshEdgebreakerDecoderImplInterface* decoder) {
   37|  8.96k|    decoder_impl_ = decoder;
   38|  8.96k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  8.96k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  8.96k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  8.96k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  6.54k|  uint16_t BitstreamVersion() const {
   45|  6.54k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  6.54k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  4.16k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  8.96k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  6.23k|  bool Start(DecoderBuffer* out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  6.23k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 166, False: 6.06k]
  ------------------
   63|    166|      return false;
   64|    166|    }
   65|       |
   66|  6.06k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 146, False: 5.92k]
  ------------------
   67|    146|      return false;
   68|    146|    }
   69|       |
   70|  5.92k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 47, False: 5.87k]
  ------------------
   71|     47|      return false;
   72|     47|    }
   73|  5.87k|    *out_buffer = buffer_;
   74|  5.87k|    return true;
   75|  5.92k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  2.69M|  inline bool DecodeStartFaceConfiguration() {
   79|  2.69M|    uint32_t face_configuration;
   80|  2.69M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  2.69M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.69M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 967, False: 2.69M]
  ------------------
   82|    967|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    967|    } else
   85|  2.69M|#endif
   86|  2.69M|    {
   87|  2.69M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  2.69M|    }
   89|  2.69M|    return face_configuration;
   90|  2.69M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  4.73M|  inline uint32_t DecodeSymbol() {
   94|  4.73M|    uint32_t symbol;
   95|  4.73M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  4.73M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 2.29M, False: 2.44M]
  ------------------
   97|  2.29M|      return symbol;
   98|  2.29M|    }
   99|       |    // Else decode two additional bits.
  100|  2.44M|    uint32_t symbol_suffix;
  101|  2.44M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  2.44M|    symbol |= (symbol_suffix << 1);
  103|  2.44M|    return symbol;
  104|  4.73M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  4.64M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|   975k|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  19.1M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  19.1M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  19.1M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  5.51k|  void Done() {
  123|  5.51k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 5.24k, False: 270]
  ------------------
  124|  5.24k|      symbol_buffer_.EndBitDecoding();
  125|  5.24k|    }
  126|  5.51k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  5.51k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.51k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 338, False: 5.17k]
  ------------------
  128|    338|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    338|    } else
  131|  5.17k|#endif
  132|  5.17k|    {
  133|  5.17k|      start_face_decoder_.EndDecoding();
  134|  5.17k|    }
  135|  5.51k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  2.47k|  DecoderBuffer* buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  6.57k|  bool DecodeTraversalSymbols() {
  141|  6.57k|    uint64_t traversal_size;
  142|  6.57k|    symbol_buffer_ = buffer_;
  143|  6.57k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 58, False: 6.52k]
  ------------------
  144|     58|      return false;
  145|     58|    }
  146|  6.52k|    buffer_ = symbol_buffer_;
  147|  6.52k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 201, False: 6.32k]
  ------------------
  148|    201|      return false;
  149|    201|    }
  150|  6.32k|    buffer_.Advance(traversal_size);
  151|  6.32k|    return true;
  152|  6.52k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  8.70k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  8.70k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  8.70k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  8.70k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 757, False: 7.94k]
  ------------------
  158|    757|      start_face_buffer_ = buffer_;
  159|    757|      uint64_t traversal_size;
  160|    757|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 7, False: 750]
  ------------------
  161|      7|        return false;
  162|      7|      }
  163|    750|      buffer_ = start_face_buffer_;
  164|    750|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 201, False: 549]
  ------------------
  165|    201|        return false;
  166|    201|      }
  167|    549|      buffer_.Advance(traversal_size);
  168|    549|      return true;
  169|    750|    }
  170|  7.94k|#endif
  171|  7.94k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  8.70k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  8.42k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  8.42k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 5.63k, False: 2.79k]
  ------------------
  177|  5.63k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  5.63k|          new BinaryDecoder[num_attribute_data_]);
  179|  16.4k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 10.8k, False: 5.56k]
  ------------------
  180|  10.8k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 76, False: 10.8k]
  ------------------
  181|     76|          return false;
  182|     76|        }
  183|  10.8k|      }
  184|  5.63k|    }
  185|  8.35k|    return true;
  186|  8.42k|  }

_ZN5draco41MeshEdgebreakerTraversalPredictiveDecoderC2Ev:
   32|  2.65k|      : corner_table_(nullptr),
   33|  2.65k|        num_vertices_(0),
   34|  2.65k|        last_symbol_(-1),
   35|  2.65k|        predicted_symbol_(-1) {}
_ZN5draco41MeshEdgebreakerTraversalPredictiveDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  2.06k|  void Init(MeshEdgebreakerDecoderImplInterface* decoder) {
   37|  2.06k|    MeshEdgebreakerTraversalDecoder::Init(decoder);
   38|  2.06k|    corner_table_ = decoder->GetCornerTable();
   39|  2.06k|  }
_ZN5draco41MeshEdgebreakerTraversalPredictiveDecoder21SetNumEncodedVerticesEi:
   40|  2.06k|  void SetNumEncodedVertices(int num_vertices) { num_vertices_ = num_vertices; }
_ZN5draco41MeshEdgebreakerTraversalPredictiveDecoder5StartEPNS_13DecoderBufferE:
   42|  2.06k|  bool Start(DecoderBuffer* out_buffer) {
   43|  2.06k|    if (!MeshEdgebreakerTraversalDecoder::Start(out_buffer)) {
  ------------------
  |  Branch (43:9): [True: 96, False: 1.97k]
  ------------------
   44|     96|      return false;
   45|     96|    }
   46|  1.97k|    int32_t num_split_symbols;
   47|  1.97k|    if (!out_buffer->Decode(&num_split_symbols) || num_split_symbols < 0)
  ------------------
  |  Branch (47:9): [True: 1, False: 1.97k]
  |  Branch (47:52): [True: 34, False: 1.93k]
  ------------------
   48|     35|      return false;
   49|  1.93k|    if (num_split_symbols >= num_vertices_) {
  ------------------
  |  Branch (49:9): [True: 46, False: 1.89k]
  ------------------
   50|     46|      return false;
   51|     46|    }
   52|       |    // Set the valences of all initial vertices to 0.
   53|  1.89k|    vertex_valences_.resize(num_vertices_, 0);
   54|  1.89k|    if (!prediction_decoder_.StartDecoding(out_buffer)) {
  ------------------
  |  Branch (54:9): [True: 12, False: 1.88k]
  ------------------
   55|     12|      return false;
   56|     12|    }
   57|  1.88k|    return true;
   58|  1.89k|  }
_ZN5draco41MeshEdgebreakerTraversalPredictiveDecoder12DecodeSymbolEv:
   60|  52.8M|  inline uint32_t DecodeSymbol() {
   61|       |    // First check if we have a predicted symbol.
   62|  52.8M|    if (predicted_symbol_ != -1) {
  ------------------
  |  Branch (62:9): [True: 52.8M, False: 38.1k]
  ------------------
   63|       |      // Double check that the predicted symbol was predicted correctly.
   64|  52.8M|      if (prediction_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (64:11): [True: 52.7M, False: 49.3k]
  ------------------
   65|  52.7M|        last_symbol_ = predicted_symbol_;
   66|  52.7M|        return predicted_symbol_;
   67|  52.7M|      }
   68|  52.8M|    }
   69|       |    // We don't have a predicted symbol or the symbol was mis-predicted.
   70|       |    // Decode it directly.
   71|  87.5k|    last_symbol_ = MeshEdgebreakerTraversalDecoder::DecodeSymbol();
   72|  87.5k|    return last_symbol_;
   73|  52.8M|  }
_ZN5draco41MeshEdgebreakerTraversalPredictiveDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   75|  52.8M|  inline void NewActiveCornerReached(CornerIndex corner) {
   76|  52.8M|    const CornerIndex next = corner_table_->Next(corner);
   77|  52.8M|    const CornerIndex prev = corner_table_->Previous(corner);
   78|       |    // Update valences.
   79|  52.8M|    switch (last_symbol_) {
   80|  26.2M|      case TOPOLOGY_C:
  ------------------
  |  Branch (80:7): [True: 26.2M, False: 26.5M]
  ------------------
   81|  26.2M|      case TOPOLOGY_S:
  ------------------
  |  Branch (81:7): [True: 7.83k, False: 52.8M]
  ------------------
   82|  26.2M|        vertex_valences_[corner_table_->Vertex(next).value()] += 1;
   83|  26.2M|        vertex_valences_[corner_table_->Vertex(prev).value()] += 1;
   84|  26.2M|        break;
   85|  26.5M|      case TOPOLOGY_R:
  ------------------
  |  Branch (85:7): [True: 26.5M, False: 26.3M]
  ------------------
   86|  26.5M|        vertex_valences_[corner_table_->Vertex(corner).value()] += 1;
   87|  26.5M|        vertex_valences_[corner_table_->Vertex(next).value()] += 1;
   88|  26.5M|        vertex_valences_[corner_table_->Vertex(prev).value()] += 2;
   89|  26.5M|        break;
   90|  6.82k|      case TOPOLOGY_L:
  ------------------
  |  Branch (90:7): [True: 6.82k, False: 52.8M]
  ------------------
   91|  6.82k|        vertex_valences_[corner_table_->Vertex(corner).value()] += 1;
   92|  6.82k|        vertex_valences_[corner_table_->Vertex(next).value()] += 2;
   93|  6.82k|        vertex_valences_[corner_table_->Vertex(prev).value()] += 1;
   94|  6.82k|        break;
   95|  21.6k|      case TOPOLOGY_E:
  ------------------
  |  Branch (95:7): [True: 21.6k, False: 52.8M]
  ------------------
   96|  21.6k|        vertex_valences_[corner_table_->Vertex(corner).value()] += 2;
   97|  21.6k|        vertex_valences_[corner_table_->Vertex(next).value()] += 2;
   98|  21.6k|        vertex_valences_[corner_table_->Vertex(prev).value()] += 2;
   99|  21.6k|        break;
  100|      0|      default:
  ------------------
  |  Branch (100:7): [True: 0, False: 52.8M]
  ------------------
  101|      0|        break;
  102|  52.8M|    }
  103|       |    // Compute the new predicted symbol.
  104|  52.8M|    if (last_symbol_ == TOPOLOGY_C || last_symbol_ == TOPOLOGY_R) {
  ------------------
  |  Branch (104:9): [True: 26.2M, False: 26.5M]
  |  Branch (104:39): [True: 26.5M, False: 36.2k]
  ------------------
  105|  52.8M|      const VertexIndex pivot =
  106|  52.8M|          corner_table_->Vertex(corner_table_->Next(corner));
  107|  52.8M|      if (vertex_valences_[pivot.value()] < 6) {
  ------------------
  |  Branch (107:11): [True: 26.5M, False: 26.2M]
  ------------------
  108|  26.5M|        predicted_symbol_ = TOPOLOGY_R;
  109|  26.5M|      } else {
  110|  26.2M|        predicted_symbol_ = TOPOLOGY_C;
  111|  26.2M|      }
  112|  52.8M|    } else {
  113|  36.2k|      predicted_symbol_ = -1;
  114|  36.2k|    }
  115|  52.8M|  }
_ZN5draco41MeshEdgebreakerTraversalPredictiveDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  117|  7.83k|  inline void MergeVertices(VertexIndex dest, VertexIndex source) {
  118|       |    // Update valences on the merged vertices.
  119|  7.83k|    vertex_valences_[dest.value()] += vertex_valences_[source.value()];
  120|  7.83k|  }

_ZN5draco38MeshEdgebreakerTraversalValenceDecoderC2Ev:
   33|  3.30k|      : corner_table_(nullptr),
   34|  3.30k|        num_vertices_(0),
   35|  3.30k|        last_symbol_(-1),
   36|  3.30k|        active_context_(-1),
   37|  3.30k|        min_valence_(2),
   38|  3.30k|        max_valence_(7) {}
_ZN5draco38MeshEdgebreakerTraversalValenceDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   39|  2.73k|  void Init(MeshEdgebreakerDecoderImplInterface* decoder) {
   40|  2.73k|    MeshEdgebreakerTraversalDecoder::Init(decoder);
   41|  2.73k|    corner_table_ = decoder->GetCornerTable();
   42|  2.73k|  }
_ZN5draco38MeshEdgebreakerTraversalValenceDecoder21SetNumEncodedVerticesEi:
   43|  2.73k|  void SetNumEncodedVertices(int num_vertices) { num_vertices_ = num_vertices; }
_ZN5draco38MeshEdgebreakerTraversalValenceDecoder5StartEPNS_13DecoderBufferE:
   45|  2.73k|  bool Start(DecoderBuffer* out_buffer) {
   46|  2.73k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   47|  2.73k|    if (BitstreamVersion() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.73k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (47:9): [True: 346, False: 2.38k]
  ------------------
   48|    346|      if (!MeshEdgebreakerTraversalDecoder::DecodeTraversalSymbols()) {
  ------------------
  |  Branch (48:11): [True: 93, False: 253]
  ------------------
   49|     93|        return false;
   50|     93|      }
   51|    346|    }
   52|  2.63k|#endif
   53|  2.63k|    if (!MeshEdgebreakerTraversalDecoder::DecodeStartFaces()) {
  ------------------
  |  Branch (53:9): [True: 133, False: 2.50k]
  ------------------
   54|    133|      return false;
   55|    133|    }
   56|  2.50k|    if (!MeshEdgebreakerTraversalDecoder::DecodeAttributeSeams()) {
  ------------------
  |  Branch (56:9): [True: 29, False: 2.47k]
  ------------------
   57|     29|      return false;
   58|     29|    }
   59|  2.47k|    *out_buffer = *buffer();
   60|       |
   61|  2.47k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   62|  2.47k|    if (BitstreamVersion() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.47k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (62:9): [True: 163, False: 2.31k]
  ------------------
   63|    163|      uint32_t num_split_symbols;
   64|    163|      if (BitstreamVersion() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    163|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (64:11): [True: 143, False: 20]
  ------------------
   65|    143|        if (!out_buffer->Decode(&num_split_symbols)) {
  ------------------
  |  Branch (65:13): [True: 1, False: 142]
  ------------------
   66|      1|          return false;
   67|      1|        }
   68|    143|      } else {
   69|     20|        if (!DecodeVarint(&num_split_symbols, out_buffer)) {
  ------------------
  |  Branch (69:13): [True: 1, False: 19]
  ------------------
   70|      1|          return false;
   71|      1|        }
   72|     20|      }
   73|    161|      if (num_split_symbols >= static_cast<uint32_t>(num_vertices_)) {
  ------------------
  |  Branch (73:11): [True: 4, False: 157]
  ------------------
   74|      4|        return false;
   75|      4|      }
   76|       |
   77|    157|      int8_t mode;
   78|    157|      if (!out_buffer->Decode(&mode)) {
  ------------------
  |  Branch (78:11): [True: 2, False: 155]
  ------------------
   79|      2|        return false;
   80|      2|      }
   81|    155|      if (mode == EDGEBREAKER_VALENCE_MODE_2_7) {
  ------------------
  |  Branch (81:11): [True: 152, False: 3]
  ------------------
   82|    152|        min_valence_ = 2;
   83|    152|        max_valence_ = 7;
   84|    152|      } else {
   85|       |        // Unsupported mode.
   86|      3|        return false;
   87|      3|      }
   88|       |
   89|    155|    } else
   90|  2.31k|#endif
   91|  2.31k|    {
   92|  2.31k|      min_valence_ = 2;
   93|  2.31k|      max_valence_ = 7;
   94|  2.31k|    }
   95|       |
   96|  2.46k|    if (num_vertices_ < 0) {
  ------------------
  |  Branch (96:9): [True: 0, False: 2.46k]
  ------------------
   97|      0|      return false;
   98|      0|    }
   99|       |    // Set the valences of all initial vertices to 0.
  100|  2.46k|    vertex_valences_.resize(num_vertices_, 0);
  101|       |
  102|  2.46k|    const int num_unique_valences = max_valence_ - min_valence_ + 1;
  103|       |
  104|       |    // Decode all symbols for all contexts.
  105|  2.46k|    context_symbols_.resize(num_unique_valences);
  106|  2.46k|    context_counters_.resize(context_symbols_.size());
  107|  13.4k|    for (int i = 0; i < context_symbols_.size(); ++i) {
  ------------------
  |  Branch (107:21): [True: 12.2k, False: 1.18k]
  ------------------
  108|  12.2k|      uint32_t num_symbols;
  109|  12.2k|      if (!DecodeVarint<uint32_t>(&num_symbols, out_buffer)) {
  ------------------
  |  Branch (109:11): [True: 1.08k, False: 11.1k]
  ------------------
  110|  1.08k|        return false;
  111|  1.08k|      }
  112|  11.1k|      if (num_symbols > static_cast<uint32_t>(corner_table_->num_faces())) {
  ------------------
  |  Branch (112:11): [True: 190, False: 10.9k]
  ------------------
  113|    190|        return false;
  114|    190|      }
  115|  10.9k|      if (num_symbols > 0) {
  ------------------
  |  Branch (115:11): [True: 9.03k, False: 1.93k]
  ------------------
  116|  9.03k|        context_symbols_[i].resize(num_symbols);
  117|  9.03k|        DecodeSymbols(num_symbols, 1, out_buffer, context_symbols_[i].data());
  118|       |        // All symbols are going to be processed from the back.
  119|  9.03k|        context_counters_[i] = num_symbols;
  120|  9.03k|      }
  121|  10.9k|    }
  122|  1.18k|    return true;
  123|  2.46k|  }
_ZN5draco38MeshEdgebreakerTraversalValenceDecoder12DecodeSymbolEv:
  125|  67.8M|  inline uint32_t DecodeSymbol() {
  126|       |    // First check if we have a valid context.
  127|  67.8M|    if (active_context_ != -1) {
  ------------------
  |  Branch (127:9): [True: 67.8M, False: 1.17k]
  ------------------
  128|  67.8M|      const int context_counter = --context_counters_[active_context_];
  129|  67.8M|      if (context_counter < 0) {
  ------------------
  |  Branch (129:11): [True: 259, False: 67.8M]
  ------------------
  130|    259|        return TOPOLOGY_INVALID;
  131|    259|      }
  132|  67.8M|      const uint32_t symbol_id =
  133|  67.8M|          context_symbols_[active_context_][context_counter];
  134|  67.8M|      if (symbol_id > 4) {
  ------------------
  |  Branch (134:11): [True: 40, False: 67.8M]
  ------------------
  135|     40|        return TOPOLOGY_INVALID;
  136|     40|      }
  137|  67.8M|      last_symbol_ = edge_breaker_symbol_to_topology_id[symbol_id];
  138|  67.8M|    } else {
  139|  1.17k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  140|  1.17k|      if (BitstreamVersion() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.17k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (140:11): [True: 67, False: 1.10k]
  ------------------
  141|       |        // We don't have a predicted symbol or the symbol was mis-predicted.
  142|       |        // Decode it directly.
  143|     67|        last_symbol_ = MeshEdgebreakerTraversalDecoder::DecodeSymbol();
  144|       |
  145|     67|      } else
  146|  1.10k|#endif
  147|  1.10k|      {
  148|       |        // The first symbol must be E.
  149|  1.10k|        last_symbol_ = TOPOLOGY_E;
  150|  1.10k|      }
  151|  1.17k|    }
  152|  67.8M|    return last_symbol_;
  153|  67.8M|  }
_ZN5draco38MeshEdgebreakerTraversalValenceDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  155|  67.8M|  inline void NewActiveCornerReached(CornerIndex corner) {
  156|  67.8M|    const CornerIndex next = corner_table_->Next(corner);
  157|  67.8M|    const CornerIndex prev = corner_table_->Previous(corner);
  158|       |    // Update valences.
  159|  67.8M|    switch (last_symbol_) {
  160|  2.36M|      case TOPOLOGY_C:
  ------------------
  |  Branch (160:7): [True: 2.36M, False: 65.4M]
  ------------------
  161|  2.39M|      case TOPOLOGY_S:
  ------------------
  |  Branch (161:7): [True: 27.2k, False: 67.8M]
  ------------------
  162|  2.39M|        vertex_valences_[corner_table_->Vertex(next)] += 1;
  163|  2.39M|        vertex_valences_[corner_table_->Vertex(prev)] += 1;
  164|  2.39M|        break;
  165|  31.3k|      case TOPOLOGY_R:
  ------------------
  |  Branch (165:7): [True: 31.3k, False: 67.8M]
  ------------------
  166|  31.3k|        vertex_valences_[corner_table_->Vertex(corner)] += 1;
  167|  31.3k|        vertex_valences_[corner_table_->Vertex(next)] += 1;
  168|  31.3k|        vertex_valences_[corner_table_->Vertex(prev)] += 2;
  169|  31.3k|        break;
  170|  57.8M|      case TOPOLOGY_L:
  ------------------
  |  Branch (170:7): [True: 57.8M, False: 10.0M]
  ------------------
  171|  57.8M|        vertex_valences_[corner_table_->Vertex(corner)] += 1;
  172|  57.8M|        vertex_valences_[corner_table_->Vertex(next)] += 2;
  173|  57.8M|        vertex_valences_[corner_table_->Vertex(prev)] += 1;
  174|  57.8M|        break;
  175|  7.59M|      case TOPOLOGY_E:
  ------------------
  |  Branch (175:7): [True: 7.59M, False: 60.2M]
  ------------------
  176|  7.59M|        vertex_valences_[corner_table_->Vertex(corner)] += 2;
  177|  7.59M|        vertex_valences_[corner_table_->Vertex(next)] += 2;
  178|  7.59M|        vertex_valences_[corner_table_->Vertex(prev)] += 2;
  179|  7.59M|        break;
  180|      0|      default:
  ------------------
  |  Branch (180:7): [True: 0, False: 67.8M]
  ------------------
  181|      0|        break;
  182|  67.8M|    }
  183|       |    // Compute the new context that is going to be used to decode the next
  184|       |    // symbol.
  185|  67.8M|    const int active_valence = vertex_valences_[corner_table_->Vertex(next)];
  186|  67.8M|    int clamped_valence;
  187|  67.8M|    if (active_valence < min_valence_) {
  ------------------
  |  Branch (187:9): [True: 0, False: 67.8M]
  ------------------
  188|      0|      clamped_valence = min_valence_;
  189|  67.8M|    } else if (active_valence > max_valence_) {
  ------------------
  |  Branch (189:16): [True: 2.18M, False: 65.6M]
  ------------------
  190|  2.18M|      clamped_valence = max_valence_;
  191|  65.6M|    } else {
  192|  65.6M|      clamped_valence = active_valence;
  193|  65.6M|    }
  194|       |
  195|  67.8M|    active_context_ = (clamped_valence - min_valence_);
  196|  67.8M|  }
_ZN5draco38MeshEdgebreakerTraversalValenceDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  198|  27.2k|  inline void MergeVertices(VertexIndex dest, VertexIndex source) {
  199|       |    // Update valences on the merged vertices.
  200|  27.2k|    vertex_valences_[dest] += vertex_valences_[source];
  201|  27.2k|  }

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  5.64k|MeshSequentialDecoder::MeshSequentialDecoder() = default;
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  5.39k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  5.39k|  uint32_t num_faces;
   31|  5.39k|  uint32_t num_points;
   32|  5.39k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  5.39k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.39k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 610, False: 4.78k]
  ------------------
   34|    610|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 12, False: 598]
  ------------------
   35|     12|      return false;
   36|     12|    }
   37|    598|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 4, False: 594]
  ------------------
   38|      4|      return false;
   39|      4|    }
   40|       |
   41|    598|  } else
   42|  4.78k|#endif
   43|  4.78k|  {
   44|  4.78k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 16, False: 4.77k]
  ------------------
   45|     16|      return false;
   46|     16|    }
   47|  4.77k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 9, False: 4.76k]
  ------------------
   48|      9|      return false;
   49|      9|    }
   50|  4.77k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  5.35k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  5.35k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 3, False: 5.35k]
  ------------------
   56|      3|    return false;
   57|      3|  }
   58|  5.35k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 53, False: 5.29k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|     53|    return false;
   62|     53|  }
   63|  5.29k|  uint8_t connectivity_method;
   64|  5.29k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 2, False: 5.29k]
  ------------------
   65|      2|    return false;
   66|      2|  }
   67|  5.29k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 4.21k, False: 1.08k]
  ------------------
   68|  4.21k|    if (!DecodeAndDecompressIndices(num_faces, num_points)) {
  ------------------
  |  Branch (68:9): [True: 4.06k, False: 145]
  ------------------
   69|  4.06k|      return false;
   70|  4.06k|    }
   71|  4.21k|  } else {
   72|  1.08k|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 563, False: 523]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  1.00k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 465, False: 536]
  ------------------
   75|    465|        Mesh::Face face;
   76|  1.81k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 1.38k, False: 438]
  ------------------
   77|  1.38k|          uint8_t val;
   78|  1.38k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 14, False: 1.36k]
  ------------------
   79|     14|            return false;
   80|     14|          }
   81|  1.36k|          if (val >= num_points) {
  ------------------
  |  Branch (81:15): [True: 13, False: 1.35k]
  ------------------
   82|     13|            return false;
   83|     13|          }
   84|  1.35k|          face[j] = val;
   85|  1.35k|        }
   86|    438|        mesh()->AddFace(face);
   87|    438|      }
   88|    563|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (88:16): [True: 117, False: 406]
  ------------------
   89|       |      // Decode indices as uint16_t.
   90|    590|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:28): [True: 554, False: 36]
  ------------------
   91|    554|        Mesh::Face face;
   92|  2.05k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (92:25): [True: 1.58k, False: 473]
  ------------------
   93|  1.58k|          uint16_t val;
   94|  1.58k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (94:15): [True: 37, False: 1.54k]
  ------------------
   95|     37|            return false;
   96|     37|          }
   97|  1.54k|          if (val >= num_points) {
  ------------------
  |  Branch (97:15): [True: 44, False: 1.50k]
  ------------------
   98|     44|            return false;
   99|     44|          }
  100|  1.50k|          face[j] = val;
  101|  1.50k|        }
  102|    473|        mesh()->AddFace(face);
  103|    473|      }
  104|    406|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (104:16): [True: 253, False: 153]
  ------------------
  105|    253|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    253|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (105:16): [True: 244, False: 9]
  ------------------
  106|       |      // Decode indices as uint32_t.
  107|  1.26k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (107:28): [True: 1.11k, False: 149]
  ------------------
  108|  1.11k|        Mesh::Face face;
  109|  4.26k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (109:25): [True: 3.24k, False: 1.01k]
  ------------------
  110|  3.24k|          uint32_t val;
  111|  3.24k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (111:15): [True: 29, False: 3.21k]
  ------------------
  112|     29|            return false;
  113|     29|          }
  114|  3.21k|          if (val >= num_points) {
  ------------------
  |  Branch (114:15): [True: 66, False: 3.14k]
  ------------------
  115|     66|            return false;
  116|     66|          }
  117|  3.14k|          face[j] = val;
  118|  3.14k|        }
  119|  1.01k|        mesh()->AddFace(face);
  120|  1.01k|      }
  121|    244|    } else {
  122|       |      // Decode faces as uint32_t (default).
  123|  1.10k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (123:28): [True: 1.05k, False: 51]
  ------------------
  124|  1.05k|        Mesh::Face face;
  125|  3.97k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (125:25): [True: 3.02k, False: 944]
  ------------------
  126|  3.02k|          uint32_t val;
  127|  3.02k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (127:15): [True: 74, False: 2.95k]
  ------------------
  128|     74|            return false;
  129|     74|          }
  130|  2.95k|          if (val >= num_points) {
  ------------------
  |  Branch (130:15): [True: 37, False: 2.91k]
  ------------------
  131|     37|            return false;
  132|     37|          }
  133|  2.91k|          face[j] = val;
  134|  2.91k|        }
  135|    944|        mesh()->AddFace(face);
  136|    944|      }
  137|    162|    }
  138|  1.08k|  }
  139|    917|  point_cloud()->set_num_points(num_points);
  140|    917|  return true;
  141|  5.29k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  143|  18.6k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  144|       |  // Always create the basic attribute decoder.
  145|  18.6k|  return SetAttributesDecoder(
  146|  18.6k|      att_decoder_id,
  147|  18.6k|      std::unique_ptr<AttributesDecoder>(
  148|  18.6k|          new SequentialAttributeDecodersController(
  149|  18.6k|              std::unique_ptr<PointsSequencer>(
  150|  18.6k|                  new LinearSequencer(point_cloud()->num_points())))));
  151|  18.6k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEjj:
  154|  4.21k|                                                       uint32_t num_points) {
  155|       |  // Get decoded indices differences that were encoded with an entropy code.
  156|  4.21k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  157|  4.21k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (157:7): [True: 3.80k, False: 403]
  ------------------
  158|  3.80k|    return false;
  159|  3.80k|  }
  160|       |  // Reconstruct the indices from the differences.
  161|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  162|    403|  int32_t last_index_value = 0;  // This will always be >= 0.
  163|    403|  int vertex_index = 0;
  164|  1.82k|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (164:24): [True: 1.68k, False: 145]
  ------------------
  165|  1.68k|    Mesh::Face face;
  166|  6.10k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (166:21): [True: 4.68k, False: 1.42k]
  ------------------
  167|  4.68k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  168|  4.68k|      int32_t index_diff = (encoded_val >> 1);
  169|  4.68k|      if (encoded_val & 1) {
  ------------------
  |  Branch (169:11): [True: 890, False: 3.79k]
  ------------------
  170|    890|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (170:13): [True: 100, False: 790]
  ------------------
  171|       |          // Subtracting index_diff would result in a negative index.
  172|    100|          return false;
  173|    100|        }
  174|    790|        index_diff = -index_diff;
  175|  3.79k|      } else {
  176|  3.79k|        if (index_diff >
  ------------------
  |  Branch (176:13): [True: 25, False: 3.76k]
  ------------------
  177|  3.79k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  178|       |          // Adding index_diff to last_index_value would overflow.
  179|     25|          return false;
  180|     25|        }
  181|  3.79k|      }
  182|  4.55k|      const int32_t index_value = index_diff + last_index_value;
  183|  4.55k|      if (index_value < 0 || static_cast<uint32_t>(index_value) >= num_points) {
  ------------------
  |  Branch (183:11): [True: 0, False: 4.55k]
  |  Branch (183:30): [True: 133, False: 4.42k]
  ------------------
  184|    133|        return false;
  185|    133|      }
  186|  4.42k|      face[j] = index_value;
  187|  4.42k|      last_index_value = index_value;
  188|  4.42k|    }
  189|  1.42k|    mesh()->AddFace(face);
  190|  1.42k|  }
  191|    145|  return true;
  192|    403|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.80k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.31M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.31M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.31M, False: 6.36k]
  ------------------
   61|  2.31M|      return true;  // Already traversed.
   62|  2.31M|    }
   63|       |
   64|  6.36k|    corner_traversal_stack_.clear();
   65|  6.36k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  6.36k|    const VertexIndex next_vert =
   69|  6.36k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  6.36k|    const VertexIndex prev_vert =
   71|  6.36k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  6.36k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 6.36k]
  |  Branch (72:45): [True: 0, False: 6.36k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  6.36k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 5.73k, False: 627]
  ------------------
   76|  5.73k|      this->MarkVertexVisited(next_vert);
   77|  5.73k|      this->traversal_observer().OnNewVertexVisited(
   78|  5.73k|          next_vert, this->corner_table()->Next(corner_id));
   79|  5.73k|    }
   80|  6.36k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 5.05k, False: 1.30k]
  ------------------
   81|  5.05k|      this->MarkVertexVisited(prev_vert);
   82|  5.05k|      this->traversal_observer().OnNewVertexVisited(
   83|  5.05k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  5.05k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  29.5k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 23.2k, False: 6.36k]
  ------------------
   88|       |      // Currently processed corner.
   89|  23.2k|      corner_id = corner_traversal_stack_.back();
   90|  23.2k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  23.2k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 23.2k]
  |  Branch (92:47): [True: 878, False: 22.3k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    878|        corner_traversal_stack_.pop_back();
   95|    878|        continue;
   96|    878|      }
   97|  2.31M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.31M, Folded]
  ------------------
   98|  2.31M|        this->MarkFaceVisited(face_id);
   99|  2.31M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.31M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.31M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.31M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.31M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.17M, False: 1.14M]
  ------------------
  105|  1.17M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.17M|          this->MarkVertexVisited(vert_id);
  107|  1.17M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.17M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.14M, False: 31.5k]
  ------------------
  109|  1.14M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.14M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.14M|            continue;
  112|  1.14M|          }
  113|  1.17M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  1.17M|        const CornerIndex right_corner_id =
  118|  1.17M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.17M|        const CornerIndex left_corner_id =
  120|  1.17M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.17M|        const FaceIndex right_face_id(
  122|  1.17M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 22.8k, False: 1.15M]
  ------------------
  123|  1.17M|                 ? kInvalidFaceIndex
  124|  1.17M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.17M|        const FaceIndex left_face_id(
  126|  1.17M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 13.8k, False: 1.16M]
  ------------------
  127|  1.17M|                 ? kInvalidFaceIndex
  128|  1.17M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.17M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.14M, False: 32.7k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.14M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 13.9k, False: 1.13M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  13.9k|            corner_traversal_stack_.pop_back();
  134|  13.9k|            break;  // Break from the while (true) loop.
  135|  1.13M|          } else {
  136|       |            // Go to the left face.
  137|  1.13M|            corner_id = left_corner_id;
  138|  1.13M|            face_id = left_face_id;
  139|  1.13M|          }
  140|  1.14M|        } else {
  141|       |          // Right face was not visited.
  142|  32.7k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 24.3k, False: 8.43k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  24.3k|            corner_id = right_corner_id;
  145|  24.3k|            face_id = right_face_id;
  146|  24.3k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  8.43k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  8.43k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  8.43k|            break;
  159|  8.43k|          }
  160|  32.7k|        }
  161|  1.17M|      }
  162|  22.3k|    }
  163|  6.36k|    return true;
  164|  6.36k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.80k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.77k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  2.24k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.90M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.90M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.12M, False: 2.77M]
  ------------------
   61|  1.12M|      return true;  // Already traversed.
   62|  1.12M|    }
   63|       |
   64|  2.77M|    corner_traversal_stack_.clear();
   65|  2.77M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.77M|    const VertexIndex next_vert =
   69|  2.77M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.77M|    const VertexIndex prev_vert =
   71|  2.77M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.77M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.77M]
  |  Branch (72:45): [True: 0, False: 2.77M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.77M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.77M, False: 1.16k]
  ------------------
   76|  2.77M|      this->MarkVertexVisited(next_vert);
   77|  2.77M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.77M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.77M|    }
   80|  2.77M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.77M, False: 1.58k]
  ------------------
   81|  2.77M|      this->MarkVertexVisited(prev_vert);
   82|  2.77M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.77M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.77M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  5.60M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.83M, False: 2.77M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.83M|      corner_id = corner_traversal_stack_.back();
   90|  2.83M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.83M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.83M]
  |  Branch (92:47): [True: 4.83k, False: 2.82M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  4.83k|        corner_traversal_stack_.pop_back();
   95|  4.83k|        continue;
   96|  4.83k|      }
   97|  3.90M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.90M, Folded]
  ------------------
   98|  3.90M|        this->MarkFaceVisited(face_id);
   99|  3.90M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.90M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.90M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.90M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.90M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.35M, False: 546k]
  ------------------
  105|  3.35M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.35M|          this->MarkVertexVisited(vert_id);
  107|  3.35M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.35M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 533k, False: 2.82M]
  ------------------
  109|   533k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   533k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   533k|            continue;
  112|   533k|          }
  113|  3.35M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  3.36M|        const CornerIndex right_corner_id =
  118|  3.36M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.36M|        const CornerIndex left_corner_id =
  120|  3.36M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.36M|        const FaceIndex right_face_id(
  122|  3.36M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.80M, False: 567k]
  ------------------
  123|  3.36M|                 ? kInvalidFaceIndex
  124|  3.36M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.36M|        const FaceIndex left_face_id(
  126|  3.36M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.79M, False: 573k]
  ------------------
  127|  3.36M|                 ? kInvalidFaceIndex
  128|  3.36M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.36M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.32M, False: 47.9k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.32M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.79M, False: 522k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.79M|            corner_traversal_stack_.pop_back();
  134|  2.79M|            break;  // Break from the while (true) loop.
  135|  2.79M|          } else {
  136|       |            // Go to the left face.
  137|   522k|            corner_id = left_corner_id;
  138|   522k|            face_id = left_face_id;
  139|   522k|          }
  140|  3.32M|        } else {
  141|       |          // Right face was not visited.
  142|  47.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 20.1k, False: 27.7k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  20.1k|            corner_id = right_corner_id;
  145|  20.1k|            face_id = right_face_id;
  146|  27.7k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  27.7k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  27.7k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  27.7k|            break;
  159|  27.7k|          }
  160|  47.9k|        }
  161|  3.36M|      }
  162|  2.82M|    }
  163|  2.77M|    return true;
  164|  2.77M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  2.24k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  4.61k|  DepthFirstTraverser() {}

_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   58|    624|  void OnTraversalStart() {
   59|    624|    prediction_degree_.resize(this->corner_table()->num_vertices(), 0);
   60|    624|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.58M|  bool TraverseFromCorner(CornerIndex corner_id) {
   66|  2.58M|    if (prediction_degree_.size() == 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2.58M]
  ------------------
   67|      0|      return true;
   68|      0|    }
   69|       |
   70|       |    // Traversal starts from the |corner_id|. It's going to follow either the
   71|       |    // right or the left neighboring faces to |corner_id| based on their
   72|       |    // prediction degree.
   73|  2.58M|    traversal_stacks_[0].push_back(corner_id);
   74|  2.58M|    best_priority_ = 0;
   75|       |    // For the first face, check the remaining corners as they may not be
   76|       |    // processed yet.
   77|  2.58M|    const VertexIndex next_vert =
   78|  2.58M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   79|  2.58M|    const VertexIndex prev_vert =
   80|  2.58M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   81|  2.58M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (81:9): [True: 14.7k, False: 2.57M]
  ------------------
   82|  14.7k|      this->MarkVertexVisited(next_vert);
   83|  14.7k|      this->traversal_observer().OnNewVertexVisited(
   84|  14.7k|          next_vert, this->corner_table()->Next(corner_id));
   85|  14.7k|    }
   86|  2.58M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (86:9): [True: 3.97k, False: 2.58M]
  ------------------
   87|  3.97k|      this->MarkVertexVisited(prev_vert);
   88|  3.97k|      this->traversal_observer().OnNewVertexVisited(
   89|  3.97k|          prev_vert, this->corner_table()->Previous(corner_id));
   90|  3.97k|    }
   91|  2.58M|    const VertexIndex tip_vertex = this->corner_table()->Vertex(corner_id);
   92|  2.58M|    if (!this->IsVertexVisited(tip_vertex)) {
  ------------------
  |  Branch (92:9): [True: 3.62k, False: 2.58M]
  ------------------
   93|  3.62k|      this->MarkVertexVisited(tip_vertex);
   94|  3.62k|      this->traversal_observer().OnNewVertexVisited(tip_vertex, corner_id);
   95|  3.62k|    }
   96|       |    // Start the actual traversal.
   97|  7.48M|    while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
  ------------------
  |  Branch (97:12): [True: 4.90M, False: 2.58M]
  ------------------
   98|  4.90M|      FaceIndex face_id(corner_id.value() / 3);
   99|       |      // Make sure the face hasn't been visited yet.
  100|  4.90M|      if (this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (100:11): [True: 3.83M, False: 1.06M]
  ------------------
  101|       |        // This face has been already traversed.
  102|  3.83M|        continue;
  103|  3.83M|      }
  104|       |
  105|  2.58M|      while (true) {
  ------------------
  |  Branch (105:14): [True: 2.58M, Folded]
  ------------------
  106|  2.58M|        face_id = FaceIndex(corner_id.value() / 3);
  107|  2.58M|        this->MarkFaceVisited(face_id);
  108|  2.58M|        this->traversal_observer().OnNewFaceVisited(face_id);
  109|       |
  110|       |        // If the newly reached vertex hasn't been visited, mark it and notify
  111|       |        // the observer.
  112|  2.58M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  113|  2.58M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (113:13): [True: 1.30M, False: 1.28M]
  ------------------
  114|  1.30M|          this->MarkVertexVisited(vert_id);
  115|  1.30M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  116|  1.30M|        }
  117|       |
  118|       |        // Check whether we can traverse to the right and left neighboring
  119|       |        // faces.
  120|  2.58M|        const CornerIndex right_corner_id =
  121|  2.58M|            this->corner_table()->GetRightCorner(corner_id);
  122|  2.58M|        const CornerIndex left_corner_id =
  123|  2.58M|            this->corner_table()->GetLeftCorner(corner_id);
  124|  2.58M|        const FaceIndex right_face_id(
  125|  2.58M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (125:14): [True: 21.9k, False: 2.56M]
  ------------------
  126|  2.58M|                 ? kInvalidFaceIndex
  127|  2.58M|                 : FaceIndex(right_corner_id.value() / 3)));
  128|  2.58M|        const FaceIndex left_face_id(
  129|  2.58M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (129:14): [True: 33.4k, False: 2.55M]
  ------------------
  130|  2.58M|                 ? kInvalidFaceIndex
  131|  2.58M|                 : FaceIndex(left_corner_id.value() / 3)));
  132|  2.58M|        const bool is_right_face_visited = this->IsFaceVisited(right_face_id);
  133|  2.58M|        const bool is_left_face_visited = this->IsFaceVisited(left_face_id);
  134|       |
  135|  2.58M|        if (!is_left_face_visited) {
  ------------------
  |  Branch (135:13): [True: 2.03M, False: 552k]
  ------------------
  136|       |          // We can go to the left face.
  137|  2.03M|          const int priority = ComputePriority(left_corner_id);
  138|  2.03M|          if (is_right_face_visited && priority <= best_priority_) {
  ------------------
  |  Branch (138:15): [True: 762k, False: 1.27M]
  |  Branch (138:40): [True: 721k, False: 40.8k]
  ------------------
  139|       |            // Right face has been already visited and the priority is equal or
  140|       |            // better than the best priority. We are sure that the left face
  141|       |            // would be traversed next so there is no need to put it onto the
  142|       |            // stack.
  143|   721k|            corner_id = left_corner_id;
  144|   721k|            continue;
  145|  1.31M|          } else {
  146|  1.31M|            AddCornerToTraversalStack(left_corner_id, priority);
  147|  1.31M|          }
  148|  2.03M|        }
  149|  1.86M|        if (!is_right_face_visited) {
  ------------------
  |  Branch (149:13): [True: 1.80M, False: 61.4k]
  ------------------
  150|       |          // Go to the right face.
  151|  1.80M|          const int priority = ComputePriority(right_corner_id);
  152|  1.80M|          if (priority <= best_priority_) {
  ------------------
  |  Branch (152:15): [True: 794k, False: 1.00M]
  ------------------
  153|       |            // We are sure that the right face would be traversed next so there
  154|       |            // is no need to put it onto the stack.
  155|   794k|            corner_id = right_corner_id;
  156|   794k|            continue;
  157|  1.00M|          } else {
  158|  1.00M|            AddCornerToTraversalStack(right_corner_id, priority);
  159|  1.00M|          }
  160|  1.80M|        }
  161|       |
  162|       |        // Couldn't proceed directly to the next corner
  163|  1.06M|        break;
  164|  1.86M|      }
  165|  1.06M|    }
  166|  2.58M|    return true;
  167|  2.58M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE23PopNextCornerToTraverseEv:
  173|  7.48M|  CornerIndex PopNextCornerToTraverse() {
  174|  15.7M|    for (int i = best_priority_; i < kMaxPriority; ++i) {
  ------------------
  |  Branch (174:34): [True: 13.2M, False: 2.58M]
  ------------------
  175|  13.2M|      if (!traversal_stacks_[i].empty()) {
  ------------------
  |  Branch (175:11): [True: 4.90M, False: 8.29M]
  ------------------
  176|  4.90M|        const CornerIndex ret = traversal_stacks_[i].back();
  177|  4.90M|        traversal_stacks_[i].pop_back();
  178|  4.90M|        best_priority_ = i;
  179|  4.90M|        return ret;
  180|  4.90M|      }
  181|  13.2M|    }
  182|  2.58M|    return kInvalidCornerIndex;
  183|  7.48M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15ComputePriorityENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  194|  3.83M|  inline int ComputePriority(CornerIndex corner_id) {
  195|  3.83M|    const VertexIndex v_tip = this->corner_table()->Vertex(corner_id);
  196|       |    // Priority 0 when traversing to already visited vertices.
  197|  3.83M|    int priority = 0;
  198|  3.83M|    if (!this->IsVertexVisited(v_tip)) {
  ------------------
  |  Branch (198:9): [True: 2.55M, False: 1.27M]
  ------------------
  199|  2.55M|      const int degree = ++prediction_degree_[v_tip];
  200|       |      // Priority 1 when prediction degree > 1, otherwise 2.
  201|  2.55M|      priority = (degree > 1 ? 1 : 2);
  ------------------
  |  Branch (201:19): [True: 1.25M, False: 1.30M]
  ------------------
  202|  2.55M|    }
  203|       |    // Clamp the priority to the maximum number of buckets.
  204|  3.83M|    if (priority >= kMaxPriority) {
  ------------------
  |  Branch (204:9): [True: 0, False: 3.83M]
  ------------------
  205|      0|      priority = kMaxPriority - 1;
  206|      0|    }
  207|  3.83M|    return priority;
  208|  3.83M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE25AddCornerToTraversalStackENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEi:
  185|  2.31M|  inline void AddCornerToTraversalStack(CornerIndex ci, int priority) {
  186|  2.31M|    traversal_stacks_[priority].push_back(ci);
  187|       |    // Make sure that the best available priority is up to date.
  188|  2.31M|    if (priority < best_priority_) {
  ------------------
  |  Branch (188:9): [True: 531k, False: 1.78M]
  ------------------
  189|   531k|      best_priority_ = priority;
  190|   531k|    }
  191|  2.31M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   63|    624|  void OnTraversalEnd() {}
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   55|  1.34k|  MaxPredictionDegreeTraverser() {}

_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEE18OnNewVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS3_IjNS_21CornerIndex_tag_type_EEE:
   50|  2.50M|  inline void OnNewVertexVisited(VertexIndex vertex, CornerIndex corner) {
   51|  2.50M|    const PointIndex point_id =
   52|  2.50M|        mesh_->face(FaceIndex(corner.value() / 3))[corner.value() % 3];
   53|       |    // Append the visited attribute to the encoding order.
   54|  2.50M|    sequencer_->AddPointId(point_id);
   55|       |
   56|       |    // Keep track of visited corners.
   57|  2.50M|    encoding_data_->encoded_attribute_value_index_to_corner_map.push_back(
   58|  2.50M|        corner);
   59|       |
   60|  2.50M|    encoding_data_
   61|  2.50M|        ->vertex_to_encoded_attribute_value_index_map[vertex.value()] =
   62|  2.50M|        encoding_data_->num_values;
   63|       |
   64|  2.50M|    encoding_data_->num_values++;
   65|  2.50M|  }
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEE16OnNewFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   48|  4.90M|  void OnNewFaceVisited(FaceIndex /* face */) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEEC2EPKS1_PKNS_4MeshEPNS_15PointsSequencerEPNS_32MeshAttributeIndicesEncodingDataE:
   41|  2.55k|      : att_connectivity_(connectivity),
   42|  2.55k|        encoding_data_(encoding_data),
   43|  2.55k|        mesh_(mesh),
   44|  2.55k|        sequencer_(sequencer) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEEC2Ev:
   33|  5.11k|      : att_connectivity_(nullptr),
   34|  5.11k|        encoding_data_(nullptr),
   35|  5.11k|        mesh_(nullptr),
   36|  5.11k|        sequencer_(nullptr) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEE18OnNewVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS3_IjNS_21CornerIndex_tag_type_EEE:
   50|  8.90M|  inline void OnNewVertexVisited(VertexIndex vertex, CornerIndex corner) {
   51|  8.90M|    const PointIndex point_id =
   52|  8.90M|        mesh_->face(FaceIndex(corner.value() / 3))[corner.value() % 3];
   53|       |    // Append the visited attribute to the encoding order.
   54|  8.90M|    sequencer_->AddPointId(point_id);
   55|       |
   56|       |    // Keep track of visited corners.
   57|  8.90M|    encoding_data_->encoded_attribute_value_index_to_corner_map.push_back(
   58|  8.90M|        corner);
   59|       |
   60|  8.90M|    encoding_data_
   61|  8.90M|        ->vertex_to_encoded_attribute_value_index_map[vertex.value()] =
   62|  8.90M|        encoding_data_->num_values;
   63|       |
   64|  8.90M|    encoding_data_->num_values++;
   65|  8.90M|  }
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEE16OnNewFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   48|  3.90M|  void OnNewFaceVisited(FaceIndex /* face */) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEEC2EPKS1_PKNS_4MeshEPNS_15PointsSequencerEPNS_32MeshAttributeIndicesEncodingDataE:
   41|  2.30k|      : att_connectivity_(connectivity),
   42|  2.30k|        encoding_data_(encoding_data),
   43|  2.30k|        mesh_(mesh),
   44|  2.30k|        sequencer_(sequencer) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEEC2Ev:
   33|  4.61k|      : att_connectivity_(nullptr),
   34|  4.61k|        encoding_data_(nullptr),
   35|  4.61k|        mesh_(nullptr),
   36|  4.61k|        sequencer_(nullptr) {}

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    674|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.14k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  1.14k|    const auto* corner_table = traverser_.corner_table();
   50|  1.14k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.14k|    const size_t num_faces = mesh_->num_faces();
   52|  1.14k|    const size_t num_points = mesh_->num_points();
   53|  4.35M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.35M, False: 1.14k]
  ------------------
   54|  4.35M|      const auto& face = mesh_->face(f);
   55|  17.4M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.0M, False: 4.35M]
  ------------------
   56|  13.0M|        const PointIndex point_id = face[p];
   57|  13.0M|        const VertexIndex vert_id =
   58|  13.0M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.0M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.0M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.0M|        const AttributeValueIndex att_entry_id(
   63|  13.0M|            encoding_data_
   64|  13.0M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.0M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.0M]
  |  Branch (65:13): [True: 0, False: 13.0M]
  |  Branch (65:39): [True: 0, False: 13.0M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.0M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.0M|      }
   71|  4.35M|    }
   72|  1.14k|    return true;
   73|  1.14k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    624|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|    624|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    624|    traverser_.OnTraversalStart();
   82|    624|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 624]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|    624|    } else {
   89|    624|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.58M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.58M, False: 624]
  ------------------
   91|  2.58M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.58M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.58M|      }
   95|    624|    }
   96|    624|    traverser_.OnTraversalEnd();
   97|    624|    return true;
   98|    624|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.58M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.58M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.58M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    674|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.88k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  6.47k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  6.47k|    const auto* corner_table = traverser_.corner_table();
   50|  6.47k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  6.47k|    const size_t num_faces = mesh_->num_faces();
   52|  6.47k|    const size_t num_points = mesh_->num_points();
   53|  4.32M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.31M, False: 6.47k]
  ------------------
   54|  4.31M|      const auto& face = mesh_->face(f);
   55|  17.2M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 12.9M, False: 4.31M]
  ------------------
   56|  12.9M|        const PointIndex point_id = face[p];
   57|  12.9M|        const VertexIndex vert_id =
   58|  12.9M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  12.9M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 12.9M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  12.9M|        const AttributeValueIndex att_entry_id(
   63|  12.9M|            encoding_data_
   64|  12.9M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  12.9M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 12.9M]
  |  Branch (65:13): [True: 0, False: 12.9M]
  |  Branch (65:39): [True: 0, False: 12.9M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  12.9M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  12.9M|      }
   71|  4.31M|    }
   72|  6.47k|    return true;
   73|  6.47k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.80k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  1.80k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.80k|    traverser_.OnTraversalStart();
   82|  1.80k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.80k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  1.80k|    } else {
   89|  1.80k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.32M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.31M, False: 1.80k]
  ------------------
   91|  2.31M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.31M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.31M|      }
   95|  1.80k|    }
   96|  1.80k|    traverser_.OnTraversalEnd();
   97|  1.80k|    return true;
   98|  1.80k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.31M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.31M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.31M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.88k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  2.30k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.73k|  bool UpdatePointToAttributeIndexMapping(PointAttribute* attribute) override {
   49|  5.73k|    const auto* corner_table = traverser_.corner_table();
   50|  5.73k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.73k|    const size_t num_faces = mesh_->num_faces();
   52|  5.73k|    const size_t num_points = mesh_->num_points();
   53|  6.25M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 6.24M, False: 5.73k]
  ------------------
   54|  6.24M|      const auto& face = mesh_->face(f);
   55|  24.9M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 18.7M, False: 6.24M]
  ------------------
   56|  18.7M|        const PointIndex point_id = face[p];
   57|  18.7M|        const VertexIndex vert_id =
   58|  18.7M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  18.7M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 18.7M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  18.7M|        const AttributeValueIndex att_entry_id(
   63|  18.7M|            encoding_data_
   64|  18.7M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  18.7M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 18.7M]
  |  Branch (65:13): [True: 1, False: 18.7M]
  |  Branch (65:39): [True: 1, False: 18.7M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      1|          return false;
   68|      1|        }
   69|  18.7M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  18.7M|      }
   71|  6.24M|    }
   72|  5.73k|    return true;
   73|  5.73k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  2.24k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  2.24k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  2.24k|    traverser_.OnTraversalStart();
   82|  2.24k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 2.24k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  2.24k|    } else {
   89|  2.24k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.90M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.90M, False: 2.24k]
  ------------------
   91|  3.90M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.90M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.90M|      }
   95|  2.24k|    }
   96|  2.24k|    traverser_.OnTraversalEnd();
   97|  2.24k|    return true;
   98|  2.24k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.90M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.90M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.90M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  2.30k|  void SetTraverser(const TraverserT& t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.61k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  31.5M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  16.5M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  16.5M|    return is_vertex_visited_[vert_id.value()];
   65|  16.5M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.50M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.50M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.50M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  7.41M|  inline TraversalObserverT& traversal_observer() {
   75|  7.41M|    return traversal_observer_;
   76|  7.41M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  12.4M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  12.4M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 92.0k, False: 12.3M]
  ------------------
   47|  92.0k|      return true;  // Invalid faces are always considered as visited.
   48|  92.0k|    }
   49|  12.3M|    return is_face_visited_[face_id.value()];
   50|  12.4M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.90M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.90M|    is_face_visited_[face_id.value()] = true;
   62|  4.90M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  5.11k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  5.11k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.55k|                    TraversalObserver traversal_observer) {
   37|  2.55k|    corner_table_ = corner_table;
   38|  2.55k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.55k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.55k|    traversal_observer_ = traversal_observer;
   41|  2.55k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.31M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.31M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.31M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.31M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.31M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  31.1M|  inline const CornerTable* corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.90M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.90M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.90M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.90M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.90M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  9.45M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  9.45M|    return is_vertex_visited_[vert_id.value()];
   65|  9.45M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  8.90M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  8.90M|    is_vertex_visited_[vert_id.value()] = true;
   68|  8.90M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  12.8M|  inline TraversalObserverT& traversal_observer() {
   75|  12.8M|    return traversal_observer_;
   76|  12.8M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  9.56M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  9.56M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 5.59M, False: 3.97M]
  ------------------
   47|  5.59M|      return true;  // Invalid faces are always considered as visited.
   48|  5.59M|    }
   49|  3.97M|    return is_face_visited_[face_id.value()];
   50|  9.56M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.90M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.90M|    is_face_visited_[face_id.value()] = true;
   62|  3.90M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.61k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.30k|                    TraversalObserver traversal_observer) {
   37|  2.30k|    corner_table_ = corner_table;
   38|  2.30k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.30k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.30k|    traversal_observer_ = traversal_observer;
   41|  2.30k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    518|      : bit_length_(0),
   87|    518|        num_points_(0),
   88|    518|        num_decoded_points_(0),
   89|    518|        dimension_(dimension),
   90|    518|        p_(dimension, 0),
   91|    518|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    344|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    344|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 15, False: 329]
  ------------------
  197|     15|    return false;
  198|     15|  }
  199|    329|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 52, False: 277]
  ------------------
  200|     52|    return false;
  201|     52|  }
  202|    277|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 2, False: 275]
  ------------------
  203|      2|    return false;
  204|      2|  }
  205|    275|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 100, False: 175]
  ------------------
  206|    100|    return true;
  207|    100|  }
  208|    175|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 60, False: 115]
  ------------------
  209|     60|    return false;
  210|     60|  }
  211|    115|  num_decoded_points_ = 0;
  212|       |
  213|    115|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 25, False: 90]
  ------------------
  214|     25|    return false;
  215|     25|  }
  216|     90|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 6, False: 84]
  ------------------
  217|      6|    return false;
  218|      6|  }
  219|     84|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 3, False: 81]
  ------------------
  220|      3|    return false;
  221|      3|  }
  222|     81|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 80]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|     80|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 59, False: 21]
  ------------------
  227|     59|    return false;
  228|     59|  }
  229|       |
  230|     21|  numbers_decoder_.EndDecoding();
  231|     21|  remaining_bits_decoder_.EndDecoding();
  232|     21|  axis_decoder_.EndDecoding();
  233|     21|  half_decoder_.EndDecoding();
  234|       |
  235|     21|  return true;
  236|     80|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     80|    uint32_t num_points, OutputIteratorT& oit) {
  264|     80|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     80|  base_.assign(dimension_, 0);
  278|     80|  levels_.assign(dimension_, 0);
  279|     80|  undo_.clear();
  280|     80|  uint32_t depth = 0;
  281|     80|  DecodingStatus init_status(num_points, 0, 0);
  282|     80|  std::stack<Status> status_stack;
  283|     80|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  4.06M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 4.06M, False: 21]
  ------------------
  287|  4.06M|    const DecodingStatus status = status_stack.top();
  288|  4.06M|    status_stack.pop();
  289|       |
  290|  4.06M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  4.06M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  4.06M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 2.03M, False: 2.03M]
  ------------------
  295|  2.03M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 2.03M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  4.05M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 4.05M, False: 0]
  ------------------
  299|  4.05M|        const SplitUndo& split = undo_.back();
  300|  4.05M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 4.05M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  4.05M|        base_[split.axis] = split.old_base;
  304|  4.05M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 2.03M, False: 2.02M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  2.03M|          break;
  307|  2.03M|        }
  308|  2.02M|        levels_[split.axis] = split.old_level;
  309|  2.02M|        undo_.pop_back();
  310|  2.02M|      }
  311|  2.03M|      depth = status.depth;
  312|  2.03M|    }
  313|  4.06M|    const VectorUint32& old_base = base_;
  314|  4.06M|    const VectorUint32& levels = levels_;
  315|       |
  316|  4.06M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 4.06M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  4.06M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  4.06M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 4.06M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  4.06M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  4.06M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 2.02M, False: 2.03M]
  ------------------
  329|  27.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 25.0M, False: 2.02M]
  ------------------
  330|  25.0M|        *oit = old_base;
  331|  25.0M|        ++oit;
  332|  25.0M|        ++num_decoded_points_;
  333|  25.0M|      }
  334|  2.02M|      continue;
  335|  2.02M|    }
  336|       |
  337|  2.03M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  2.03M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 817, False: 2.03M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    817|      axes_[0] = axis;
  344|  2.53k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.72k, False: 817]
  ------------------
  345|  1.72k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.72k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 180, False: 1.54k]
  |  |  ------------------
  ------------------
  346|  1.72k|      }
  347|  2.19k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.40k, False: 784]
  ------------------
  348|  4.96k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 3.58k, False: 1.37k]
  ------------------
  349|  3.58k|          p_[axes_[j]] = 0;
  350|  3.58k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  3.58k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 2.14k, False: 1.44k]
  ------------------
  352|  2.14k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 33, False: 2.10k]
  ------------------
  353|  2.14k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     33|              return false;
  355|     33|            }
  356|  2.14k|          }
  357|  3.55k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  3.55k|        }
  359|  1.37k|        *oit = p_;
  360|  1.37k|        ++oit;
  361|  1.37k|        ++num_decoded_points_;
  362|  1.37k|      }
  363|    784|      continue;
  364|    817|    }
  365|       |
  366|  2.03M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2.03M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  2.03M|    const int num_remaining_bits = bit_length_ - level;
  371|  2.03M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  2.03M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  2.03M|    uint32_t number = 0;
  376|  2.03M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  2.03M|    uint32_t first_half = num_remaining_points / 2;
  379|  2.03M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 26, False: 2.03M]
  ------------------
  380|       |      // Invalid |number|.
  381|     26|      return false;
  382|     26|    }
  383|  2.03M|    first_half -= number;
  384|  2.03M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  2.03M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.11M, False: 916k]
  ------------------
  387|  1.11M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.11M, False: 3.04k]
  ------------------
  388|  1.11M|        std::swap(first_half, second_half);
  389|  1.11M|      }
  390|  1.11M|    }
  391|       |
  392|  2.03M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 2.03M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  2.03M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  2.03M|    levels_[axis] += 1;
  400|  2.03M|    base_[axis] += modifier;
  401|  2.03M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 2.03M, False: 36]
  ------------------
  402|  2.03M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  2.03M|    }
  404|  2.03M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 2.03M, False: 73]
  ------------------
  405|  2.03M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  2.03M|    }
  407|  2.03M|    ++depth;
  408|  2.03M|  }
  409|     21|  return true;
  410|     80|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  130|  6.19M|        : num_remaining_points(num_remaining_points_),
  131|  6.19M|          last_axis(last_axis_),
  132|  6.19M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  123|  3.09M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  3.09M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  3.09M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  114|    121|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    413|      : bit_length_(0),
   87|    413|        num_points_(0),
   88|    413|        num_decoded_points_(0),
   89|    413|        dimension_(dimension),
   90|    413|        p_(dimension, 0),
   91|    413|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    264|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    264|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 8, False: 256]
  ------------------
  197|      8|    return false;
  198|      8|  }
  199|    256|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 46, False: 210]
  ------------------
  200|     46|    return false;
  201|     46|  }
  202|    210|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 6, False: 204]
  ------------------
  203|      6|    return false;
  204|      6|  }
  205|    204|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 46, False: 158]
  ------------------
  206|     46|    return true;
  207|     46|  }
  208|    158|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 49, False: 109]
  ------------------
  209|     49|    return false;
  210|     49|  }
  211|    109|  num_decoded_points_ = 0;
  212|       |
  213|    109|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 16, False: 93]
  ------------------
  214|     16|    return false;
  215|     16|  }
  216|     93|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 6, False: 87]
  ------------------
  217|      6|    return false;
  218|      6|  }
  219|     87|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 3, False: 84]
  ------------------
  220|      3|    return false;
  221|      3|  }
  222|     84|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 3, False: 81]
  ------------------
  223|      3|    return false;
  224|      3|  }
  225|       |
  226|     81|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 57, False: 24]
  ------------------
  227|     57|    return false;
  228|     57|  }
  229|       |
  230|     24|  numbers_decoder_.EndDecoding();
  231|     24|  remaining_bits_decoder_.EndDecoding();
  232|     24|  axis_decoder_.EndDecoding();
  233|     24|  half_decoder_.EndDecoding();
  234|       |
  235|     24|  return true;
  236|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     81|    uint32_t num_points, OutputIteratorT& oit) {
  264|     81|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     81|  base_.assign(dimension_, 0);
  278|     81|  levels_.assign(dimension_, 0);
  279|     81|  undo_.clear();
  280|     81|  uint32_t depth = 0;
  281|     81|  DecodingStatus init_status(num_points, 0, 0);
  282|     81|  std::stack<Status> status_stack;
  283|     81|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  5.00M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 5.00M, False: 24]
  ------------------
  287|  5.00M|    const DecodingStatus status = status_stack.top();
  288|  5.00M|    status_stack.pop();
  289|       |
  290|  5.00M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  5.00M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  5.00M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 2.50M, False: 2.50M]
  ------------------
  295|  2.50M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 2.50M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  5.00M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 5.00M, False: 0]
  ------------------
  299|  5.00M|        const SplitUndo& split = undo_.back();
  300|  5.00M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 5.00M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  5.00M|        base_[split.axis] = split.old_base;
  304|  5.00M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 2.50M, False: 2.50M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  2.50M|          break;
  307|  2.50M|        }
  308|  2.50M|        levels_[split.axis] = split.old_level;
  309|  2.50M|        undo_.pop_back();
  310|  2.50M|      }
  311|  2.50M|      depth = status.depth;
  312|  2.50M|    }
  313|  5.00M|    const VectorUint32& old_base = base_;
  314|  5.00M|    const VectorUint32& levels = levels_;
  315|       |
  316|  5.00M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 5.00M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  5.00M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  5.00M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 5.00M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  5.00M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  5.00M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 2.50M, False: 2.50M]
  ------------------
  329|   100M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 97.6M, False: 2.50M]
  ------------------
  330|  97.6M|        *oit = old_base;
  331|  97.6M|        ++oit;
  332|  97.6M|        ++num_decoded_points_;
  333|  97.6M|      }
  334|  2.50M|      continue;
  335|  2.50M|    }
  336|       |
  337|  2.50M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  2.50M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 822, False: 2.50M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    822|      axes_[0] = axis;
  344|  2.89k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 2.07k, False: 822]
  ------------------
  345|  2.07k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.07k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 147, False: 1.92k]
  |  |  ------------------
  ------------------
  346|  2.07k|      }
  347|  2.22k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.44k, False: 782]
  ------------------
  348|  4.96k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 3.56k, False: 1.40k]
  ------------------
  349|  3.56k|          p_[axes_[j]] = 0;
  350|  3.56k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  3.56k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 2.06k, False: 1.50k]
  ------------------
  352|  2.06k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 40, False: 2.02k]
  ------------------
  353|  2.06k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     40|              return false;
  355|     40|            }
  356|  2.06k|          }
  357|  3.52k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  3.52k|        }
  359|  1.40k|        *oit = p_;
  360|  1.40k|        ++oit;
  361|  1.40k|        ++num_decoded_points_;
  362|  1.40k|      }
  363|    782|      continue;
  364|    822|    }
  365|       |
  366|  2.50M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2.50M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  2.50M|    const int num_remaining_bits = bit_length_ - level;
  371|  2.50M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  2.50M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  2.50M|    uint32_t number = 0;
  376|  2.50M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  2.50M|    uint32_t first_half = num_remaining_points / 2;
  379|  2.50M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 17, False: 2.50M]
  ------------------
  380|       |      // Invalid |number|.
  381|     17|      return false;
  382|     17|    }
  383|  2.50M|    first_half -= number;
  384|  2.50M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  2.50M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.31M, False: 1.18M]
  ------------------
  387|  1.31M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.31M, False: 4.91k]
  ------------------
  388|  1.31M|        std::swap(first_half, second_half);
  389|  1.31M|      }
  390|  1.31M|    }
  391|       |
  392|  2.50M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 2.50M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  2.50M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  2.50M|    levels_[axis] += 1;
  400|  2.50M|    base_[axis] += modifier;
  401|  2.50M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 2.50M, False: 40]
  ------------------
  402|  2.50M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  2.50M|    }
  404|  2.50M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 2.50M, False: 62]
  ------------------
  405|  2.50M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  2.50M|    }
  407|  2.50M|    ++depth;
  408|  2.50M|  }
  409|     24|  return true;
  410|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  130|  9.68M|        : num_remaining_points(num_remaining_points_),
  131|  9.68M|          last_axis(last_axis_),
  132|  9.68M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  9.68M|    uint32_t last_axis) {
  242|  9.68M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 9.68M, Folded]
  ------------------
  243|  9.68M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  9.68M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 5.01M, False: 4.67M]
  |  |  ------------------
  ------------------
  244|  9.68M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  9.68M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  123|  4.84M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  4.84M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  4.84M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  114|     70|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    361|      : bit_length_(0),
   87|    361|        num_points_(0),
   88|    361|        num_decoded_points_(0),
   89|    361|        dimension_(dimension),
   90|    361|        p_(dimension, 0),
   91|    361|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    203|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    203|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 6, False: 197]
  ------------------
  197|      6|    return false;
  198|      6|  }
  199|    197|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 23, False: 174]
  ------------------
  200|     23|    return false;
  201|     23|  }
  202|    174|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 3, False: 171]
  ------------------
  203|      3|    return false;
  204|      3|  }
  205|    171|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 26, False: 145]
  ------------------
  206|     26|    return true;
  207|     26|  }
  208|    145|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 32, False: 113]
  ------------------
  209|     32|    return false;
  210|     32|  }
  211|    113|  num_decoded_points_ = 0;
  212|       |
  213|    113|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 3, False: 110]
  ------------------
  214|      3|    return false;
  215|      3|  }
  216|    110|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 10, False: 100]
  ------------------
  217|     10|    return false;
  218|     10|  }
  219|    100|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 5, False: 95]
  ------------------
  220|      5|    return false;
  221|      5|  }
  222|     95|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 4, False: 91]
  ------------------
  223|      4|    return false;
  224|      4|  }
  225|       |
  226|     91|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 86, False: 5]
  ------------------
  227|     86|    return false;
  228|     86|  }
  229|       |
  230|      5|  numbers_decoder_.EndDecoding();
  231|      5|  remaining_bits_decoder_.EndDecoding();
  232|      5|  axis_decoder_.EndDecoding();
  233|      5|  half_decoder_.EndDecoding();
  234|       |
  235|      5|  return true;
  236|     91|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     91|    uint32_t num_points, OutputIteratorT& oit) {
  264|     91|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     91|  base_.assign(dimension_, 0);
  278|     91|  levels_.assign(dimension_, 0);
  279|     91|  undo_.clear();
  280|     91|  uint32_t depth = 0;
  281|     91|  DecodingStatus init_status(num_points, 0, 0);
  282|     91|  std::stack<Status> status_stack;
  283|     91|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  30.7k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 30.7k, False: 5]
  ------------------
  287|  30.7k|    const DecodingStatus status = status_stack.top();
  288|  30.7k|    status_stack.pop();
  289|       |
  290|  30.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  30.7k|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  30.7k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 19.2k, False: 11.4k]
  ------------------
  295|  19.2k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 19.2k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  40.4k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 40.4k, False: 0]
  ------------------
  299|  40.4k|        const SplitUndo& split = undo_.back();
  300|  40.4k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 40.4k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  40.4k|        base_[split.axis] = split.old_base;
  304|  40.4k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 19.2k, False: 21.1k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  19.2k|          break;
  307|  19.2k|        }
  308|  21.1k|        levels_[split.axis] = split.old_level;
  309|  21.1k|        undo_.pop_back();
  310|  21.1k|      }
  311|  19.2k|      depth = status.depth;
  312|  19.2k|    }
  313|  30.7k|    const VectorUint32& old_base = base_;
  314|  30.7k|    const VectorUint32& levels = levels_;
  315|       |
  316|  30.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 30.7k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  30.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  30.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 30.7k]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  30.7k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  30.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 7.87k, False: 22.9k]
  ------------------
  329|  3.89M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 3.88M, False: 7.87k]
  ------------------
  330|  3.88M|        *oit = old_base;
  331|  3.88M|        ++oit;
  332|  3.88M|        ++num_decoded_points_;
  333|  3.88M|      }
  334|  7.87k|      continue;
  335|  7.87k|    }
  336|       |
  337|  22.9k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  22.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 847, False: 22.0k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    847|      axes_[0] = axis;
  344|  2.42k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 1.57k, False: 847]
  ------------------
  345|  1.57k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.57k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 162, False: 1.41k]
  |  |  ------------------
  ------------------
  346|  1.57k|      }
  347|  2.38k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 1.55k, False: 825]
  ------------------
  348|  5.39k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 3.86k, False: 1.53k]
  ------------------
  349|  3.86k|          p_[axes_[j]] = 0;
  350|  3.86k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  3.86k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 2.26k, False: 1.59k]
  ------------------
  352|  2.26k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 22, False: 2.24k]
  ------------------
  353|  2.26k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     22|              return false;
  355|     22|            }
  356|  2.26k|          }
  357|  3.83k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  3.83k|        }
  359|  1.53k|        *oit = p_;
  360|  1.53k|        ++oit;
  361|  1.53k|        ++num_decoded_points_;
  362|  1.53k|      }
  363|    825|      continue;
  364|    847|    }
  365|       |
  366|  22.0k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 22.0k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  22.0k|    const int num_remaining_bits = bit_length_ - level;
  371|  22.0k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  22.0k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  22.0k|    uint32_t number = 0;
  376|  22.0k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  22.0k|    uint32_t first_half = num_remaining_points / 2;
  379|  22.0k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 64, False: 21.9k]
  ------------------
  380|       |      // Invalid |number|.
  381|     64|      return false;
  382|     64|    }
  383|  21.9k|    first_half -= number;
  384|  21.9k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  21.9k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 18.0k, False: 3.98k]
  ------------------
  387|  18.0k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 15.1k, False: 2.82k]
  ------------------
  388|  15.1k|        std::swap(first_half, second_half);
  389|  15.1k|      }
  390|  18.0k|    }
  391|       |
  392|  21.9k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 21.9k]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  21.9k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  21.9k|    levels_[axis] += 1;
  400|  21.9k|    base_[axis] += modifier;
  401|  21.9k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 19.7k, False: 2.19k]
  ------------------
  402|  19.7k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  19.7k|    }
  404|  21.9k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 11.4k, False: 10.5k]
  ------------------
  405|  11.4k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  11.4k|    }
  407|  21.9k|    ++depth;
  408|  21.9k|  }
  409|      5|  return true;
  410|     91|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  130|  4.27M|        : num_remaining_points(num_remaining_points_),
  131|  4.27M|          last_axis(last_axis_),
  132|  4.27M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  123|  2.14M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  2.14M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  2.14M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  114|     31|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    325|      : bit_length_(0),
   87|    325|        num_points_(0),
   88|    325|        num_decoded_points_(0),
   89|    325|        dimension_(dimension),
   90|    325|        p_(dimension, 0),
   91|    325|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    173|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    173|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 7, False: 166]
  ------------------
  197|      7|    return false;
  198|      7|  }
  199|    166|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 20, False: 146]
  ------------------
  200|     20|    return false;
  201|     20|  }
  202|    146|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 145]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|    145|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 11, False: 134]
  ------------------
  206|     11|    return true;
  207|     11|  }
  208|    134|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 27, False: 107]
  ------------------
  209|     27|    return false;
  210|     27|  }
  211|    107|  num_decoded_points_ = 0;
  212|       |
  213|    107|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 6, False: 101]
  ------------------
  214|      6|    return false;
  215|      6|  }
  216|    101|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 6, False: 95]
  ------------------
  217|      6|    return false;
  218|      6|  }
  219|     95|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 1, False: 94]
  ------------------
  220|      1|    return false;
  221|      1|  }
  222|     94|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 4, False: 90]
  ------------------
  223|      4|    return false;
  224|      4|  }
  225|       |
  226|     90|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 85, False: 5]
  ------------------
  227|     85|    return false;
  228|     85|  }
  229|       |
  230|      5|  numbers_decoder_.EndDecoding();
  231|      5|  remaining_bits_decoder_.EndDecoding();
  232|      5|  axis_decoder_.EndDecoding();
  233|      5|  half_decoder_.EndDecoding();
  234|       |
  235|      5|  return true;
  236|     90|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     90|    uint32_t num_points, OutputIteratorT& oit) {
  264|     90|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     90|  base_.assign(dimension_, 0);
  278|     90|  levels_.assign(dimension_, 0);
  279|     90|  undo_.clear();
  280|     90|  uint32_t depth = 0;
  281|     90|  DecodingStatus init_status(num_points, 0, 0);
  282|     90|  std::stack<Status> status_stack;
  283|     90|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  31.0k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 31.0k, False: 5]
  ------------------
  287|  31.0k|    const DecodingStatus status = status_stack.top();
  288|  31.0k|    status_stack.pop();
  289|       |
  290|  31.0k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  31.0k|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  31.0k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 23.3k, False: 7.71k]
  ------------------
  295|  23.3k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 23.3k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  50.2k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 50.2k, False: 0]
  ------------------
  299|  50.2k|        const SplitUndo& split = undo_.back();
  300|  50.2k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 50.2k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  50.2k|        base_[split.axis] = split.old_base;
  304|  50.2k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 23.3k, False: 26.9k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  23.3k|          break;
  307|  23.3k|        }
  308|  26.9k|        levels_[split.axis] = split.old_level;
  309|  26.9k|        undo_.pop_back();
  310|  26.9k|      }
  311|  23.3k|      depth = status.depth;
  312|  23.3k|    }
  313|  31.0k|    const VectorUint32& old_base = base_;
  314|  31.0k|    const VectorUint32& levels = levels_;
  315|       |
  316|  31.0k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 31.0k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  31.0k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  31.0k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 31.0k]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  31.0k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  31.0k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 2.60k, False: 28.4k]
  ------------------
  329|  3.86M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 3.86M, False: 2.60k]
  ------------------
  330|  3.86M|        *oit = old_base;
  331|  3.86M|        ++oit;
  332|  3.86M|        ++num_decoded_points_;
  333|  3.86M|      }
  334|  2.60k|      continue;
  335|  2.60k|    }
  336|       |
  337|  28.4k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  28.4k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 505, False: 27.9k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    505|      axes_[0] = axis;
  344|  2.84k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 2.33k, False: 505]
  ------------------
  345|  2.33k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.33k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 89, False: 2.24k]
  |  |  ------------------
  ------------------
  346|  2.33k|      }
  347|  1.32k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 848, False: 481]
  ------------------
  348|  3.49k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 2.66k, False: 824]
  ------------------
  349|  2.66k|          p_[axes_[j]] = 0;
  350|  2.66k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  2.66k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 1.29k, False: 1.37k]
  ------------------
  352|  1.29k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 24, False: 1.27k]
  ------------------
  353|  1.29k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     24|              return false;
  355|     24|            }
  356|  1.29k|          }
  357|  2.64k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  2.64k|        }
  359|    824|        *oit = p_;
  360|    824|        ++oit;
  361|    824|        ++num_decoded_points_;
  362|    824|      }
  363|    481|      continue;
  364|    505|    }
  365|       |
  366|  27.9k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 27.9k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  27.9k|    const int num_remaining_bits = bit_length_ - level;
  371|  27.9k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  27.9k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  27.9k|    uint32_t number = 0;
  376|  27.9k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  27.9k|    uint32_t first_half = num_remaining_points / 2;
  379|  27.9k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 61, False: 27.8k]
  ------------------
  380|       |      // Invalid |number|.
  381|     61|      return false;
  382|     61|    }
  383|  27.8k|    first_half -= number;
  384|  27.8k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  27.8k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 25.7k, False: 2.12k]
  ------------------
  387|  25.7k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 21.2k, False: 4.44k]
  ------------------
  388|  21.2k|        std::swap(first_half, second_half);
  389|  21.2k|      }
  390|  25.7k|    }
  391|       |
  392|  27.8k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 27.8k]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  27.8k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  27.8k|    levels_[axis] += 1;
  400|  27.8k|    base_[axis] += modifier;
  401|  27.8k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 23.9k, False: 3.92k]
  ------------------
  402|  23.9k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  23.9k|    }
  404|  27.8k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 7.62k, False: 20.2k]
  ------------------
  405|  7.62k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  7.62k|    }
  407|  27.8k|    ++depth;
  408|  27.8k|  }
  409|      5|  return true;
  410|     90|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  130|   112k|        : num_remaining_points(num_remaining_points_),
  131|   112k|          last_axis(last_axis_),
  132|   112k|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|   111k|    uint32_t last_axis) {
  242|   111k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 111k, Folded]
  ------------------
  243|   111k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|   111k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 27.5k, False: 83.5k]
  |  |  ------------------
  ------------------
  244|   111k|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|   111k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  123|  68.7k|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  68.7k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  68.7k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  114|     16|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    278|      : bit_length_(0),
   87|    278|        num_points_(0),
   88|    278|        num_decoded_points_(0),
   89|    278|        dimension_(dimension),
   90|    278|        p_(dimension, 0),
   91|    278|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    202|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    202|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 3, False: 199]
  ------------------
  197|      3|    return false;
  198|      3|  }
  199|    199|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 23, False: 176]
  ------------------
  200|     23|    return false;
  201|     23|  }
  202|    176|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 175]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|    175|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 12, False: 163]
  ------------------
  206|     12|    return true;
  207|     12|  }
  208|    163|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 32, False: 131]
  ------------------
  209|     32|    return false;
  210|     32|  }
  211|    131|  num_decoded_points_ = 0;
  212|       |
  213|    131|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 15, False: 116]
  ------------------
  214|     15|    return false;
  215|     15|  }
  216|    116|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 2, False: 114]
  ------------------
  217|      2|    return false;
  218|      2|  }
  219|    114|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 6, False: 108]
  ------------------
  220|      6|    return false;
  221|      6|  }
  222|    108|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 107]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|    107|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 87, False: 20]
  ------------------
  227|     87|    return false;
  228|     87|  }
  229|       |
  230|     20|  numbers_decoder_.EndDecoding();
  231|     20|  remaining_bits_decoder_.EndDecoding();
  232|     20|  axis_decoder_.EndDecoding();
  233|     20|  half_decoder_.EndDecoding();
  234|       |
  235|     20|  return true;
  236|    107|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|    107|    uint32_t num_points, OutputIteratorT& oit) {
  264|    107|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|    107|  base_.assign(dimension_, 0);
  278|    107|  levels_.assign(dimension_, 0);
  279|    107|  undo_.clear();
  280|    107|  uint32_t depth = 0;
  281|    107|  DecodingStatus init_status(num_points, 0, 0);
  282|    107|  std::stack<Status> status_stack;
  283|    107|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  3.58M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 3.58M, False: 20]
  ------------------
  287|  3.58M|    const DecodingStatus status = status_stack.top();
  288|  3.58M|    status_stack.pop();
  289|       |
  290|  3.58M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  3.58M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  3.58M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 1.79M, False: 1.78M]
  ------------------
  295|  1.79M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 1.79M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  3.60M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 3.60M, False: 0]
  ------------------
  299|  3.60M|        const SplitUndo& split = undo_.back();
  300|  3.60M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 3.60M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  3.60M|        base_[split.axis] = split.old_base;
  304|  3.60M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 1.79M, False: 1.80M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  1.79M|          break;
  307|  1.79M|        }
  308|  1.80M|        levels_[split.axis] = split.old_level;
  309|  1.80M|        undo_.pop_back();
  310|  1.80M|      }
  311|  1.79M|      depth = status.depth;
  312|  1.79M|    }
  313|  3.58M|    const VectorUint32& old_base = base_;
  314|  3.58M|    const VectorUint32& levels = levels_;
  315|       |
  316|  3.58M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 3.58M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  3.58M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  3.58M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 3.58M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  3.58M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  3.58M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 1.66M, False: 1.91M]
  ------------------
  329|  80.0M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 78.3M, False: 1.66M]
  ------------------
  330|  78.3M|        *oit = old_base;
  331|  78.3M|        ++oit;
  332|  78.3M|        ++num_decoded_points_;
  333|  78.3M|      }
  334|  1.66M|      continue;
  335|  1.66M|    }
  336|       |
  337|  1.91M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  1.91M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 101k, False: 1.81M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|   101k|      axes_[0] = axis;
  344|   143k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 42.1k, False: 101k]
  ------------------
  345|  42.1k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  42.1k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 15.9k, False: 26.1k]
  |  |  ------------------
  ------------------
  346|  42.1k|      }
  347|   262k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 160k, False: 101k]
  ------------------
  348|   377k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 217k, False: 160k]
  ------------------
  349|   217k|          p_[axes_[j]] = 0;
  350|   217k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|   217k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 199k, False: 18.1k]
  ------------------
  352|   199k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 67, False: 199k]
  ------------------
  353|   199k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     67|              return false;
  355|     67|            }
  356|   199k|          }
  357|   217k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|   217k|        }
  359|   160k|        *oit = p_;
  360|   160k|        ++oit;
  361|   160k|        ++num_decoded_points_;
  362|   160k|      }
  363|   101k|      continue;
  364|   101k|    }
  365|       |
  366|  1.81M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1.81M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  1.81M|    const int num_remaining_bits = bit_length_ - level;
  371|  1.81M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  1.81M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  1.81M|    uint32_t number = 0;
  376|  1.81M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  1.81M|    uint32_t first_half = num_remaining_points / 2;
  379|  1.81M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 20, False: 1.81M]
  ------------------
  380|       |      // Invalid |number|.
  381|     20|      return false;
  382|     20|    }
  383|  1.81M|    first_half -= number;
  384|  1.81M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  1.81M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.74M, False: 70.2k]
  ------------------
  387|  1.74M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.70M, False: 32.4k]
  ------------------
  388|  1.70M|        std::swap(first_half, second_half);
  389|  1.70M|      }
  390|  1.74M|    }
  391|       |
  392|  1.81M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 1.81M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  1.81M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  1.81M|    levels_[axis] += 1;
  400|  1.81M|    base_[axis] += modifier;
  401|  1.81M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 1.79M, False: 13.1k]
  ------------------
  402|  1.79M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  1.79M|    }
  404|  1.81M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 1.78M, False: 28.4k]
  ------------------
  405|  1.78M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  1.78M|    }
  407|  1.81M|    ++depth;
  408|  1.81M|  }
  409|     20|  return true;
  410|    107|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  130|  3.58M|        : num_remaining_points(num_remaining_points_),
  131|  3.58M|          last_axis(last_axis_),
  132|  3.58M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  123|  1.81M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  1.81M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  1.81M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  114|     32|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    292|      : bit_length_(0),
   87|    292|        num_points_(0),
   88|    292|        num_decoded_points_(0),
   89|    292|        dimension_(dimension),
   90|    292|        p_(dimension, 0),
   91|    292|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    258|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    258|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 5, False: 253]
  ------------------
  197|      5|    return false;
  198|      5|  }
  199|    253|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 35, False: 218]
  ------------------
  200|     35|    return false;
  201|     35|  }
  202|    218|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 3, False: 215]
  ------------------
  203|      3|    return false;
  204|      3|  }
  205|    215|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 17, False: 198]
  ------------------
  206|     17|    return true;
  207|     17|  }
  208|    198|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 25, False: 173]
  ------------------
  209|     25|    return false;
  210|     25|  }
  211|    173|  num_decoded_points_ = 0;
  212|       |
  213|    173|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 40, False: 133]
  ------------------
  214|     40|    return false;
  215|     40|  }
  216|    133|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 4, False: 129]
  ------------------
  217|      4|    return false;
  218|      4|  }
  219|    129|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 3, False: 126]
  ------------------
  220|      3|    return false;
  221|      3|  }
  222|    126|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 124]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|    124|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 78, False: 46]
  ------------------
  227|     78|    return false;
  228|     78|  }
  229|       |
  230|     46|  numbers_decoder_.EndDecoding();
  231|     46|  remaining_bits_decoder_.EndDecoding();
  232|     46|  axis_decoder_.EndDecoding();
  233|     46|  half_decoder_.EndDecoding();
  234|       |
  235|     46|  return true;
  236|    124|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|    124|    uint32_t num_points, OutputIteratorT& oit) {
  264|    124|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|    124|  base_.assign(dimension_, 0);
  278|    124|  levels_.assign(dimension_, 0);
  279|    124|  undo_.clear();
  280|    124|  uint32_t depth = 0;
  281|    124|  DecodingStatus init_status(num_points, 0, 0);
  282|    124|  std::stack<Status> status_stack;
  283|    124|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  3.05M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 3.05M, False: 46]
  ------------------
  287|  3.05M|    const DecodingStatus status = status_stack.top();
  288|  3.05M|    status_stack.pop();
  289|       |
  290|  3.05M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  3.05M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  3.05M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 1.53M, False: 1.52M]
  ------------------
  295|  1.53M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 1.53M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  3.06M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 3.06M, False: 0]
  ------------------
  299|  3.06M|        const SplitUndo& split = undo_.back();
  300|  3.06M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 3.06M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  3.06M|        base_[split.axis] = split.old_base;
  304|  3.06M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 1.53M, False: 1.53M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  1.53M|          break;
  307|  1.53M|        }
  308|  1.53M|        levels_[split.axis] = split.old_level;
  309|  1.53M|        undo_.pop_back();
  310|  1.53M|      }
  311|  1.53M|      depth = status.depth;
  312|  1.53M|    }
  313|  3.05M|    const VectorUint32& old_base = base_;
  314|  3.05M|    const VectorUint32& levels = levels_;
  315|       |
  316|  3.05M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 3.05M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  3.05M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  3.05M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 3.05M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  3.05M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  3.05M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 1.40M, False: 1.65M]
  ------------------
  329|   133M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 131M, False: 1.40M]
  ------------------
  330|   131M|        *oit = old_base;
  331|   131M|        ++oit;
  332|   131M|        ++num_decoded_points_;
  333|   131M|      }
  334|  1.40M|      continue;
  335|  1.40M|    }
  336|       |
  337|  1.65M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  1.65M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 108k, False: 1.54M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|   108k|      axes_[0] = axis;
  344|   331k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 223k, False: 108k]
  ------------------
  345|   223k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   223k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 35.4k, False: 187k]
  |  |  ------------------
  ------------------
  346|   223k|      }
  347|   267k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 158k, False: 108k]
  ------------------
  348|   674k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 516k, False: 158k]
  ------------------
  349|   516k|          p_[axes_[j]] = 0;
  350|   516k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|   516k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 252k, False: 263k]
  ------------------
  352|   252k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 75, False: 252k]
  ------------------
  353|   252k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     75|              return false;
  355|     75|            }
  356|   252k|          }
  357|   516k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|   516k|        }
  359|   158k|        *oit = p_;
  360|   158k|        ++oit;
  361|   158k|        ++num_decoded_points_;
  362|   158k|      }
  363|   108k|      continue;
  364|   108k|    }
  365|       |
  366|  1.54M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1.54M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  1.54M|    const int num_remaining_bits = bit_length_ - level;
  371|  1.54M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  1.54M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  1.54M|    uint32_t number = 0;
  376|  1.54M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  1.54M|    uint32_t first_half = num_remaining_points / 2;
  379|  1.54M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 3, False: 1.54M]
  ------------------
  380|       |      // Invalid |number|.
  381|      3|      return false;
  382|      3|    }
  383|  1.54M|    first_half -= number;
  384|  1.54M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  1.54M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.50M, False: 41.9k]
  ------------------
  387|  1.50M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.45M, False: 50.9k]
  ------------------
  388|  1.45M|        std::swap(first_half, second_half);
  389|  1.45M|      }
  390|  1.50M|    }
  391|       |
  392|  1.54M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 1.54M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  1.54M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  1.54M|    levels_[axis] += 1;
  400|  1.54M|    base_[axis] += modifier;
  401|  1.54M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 1.53M, False: 12.7k]
  ------------------
  402|  1.53M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  1.53M|    }
  404|  1.54M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 1.52M, False: 19.2k]
  ------------------
  405|  1.52M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  1.52M|    }
  407|  1.54M|    ++depth;
  408|  1.54M|  }
  409|     46|  return true;
  410|    124|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  130|  3.05M|        : num_remaining_points(num_remaining_points_),
  131|  3.05M|          last_axis(last_axis_),
  132|  3.05M|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  3.05M|    uint32_t last_axis) {
  242|  3.05M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 3.05M, Folded]
  ------------------
  243|  3.05M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.05M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.34M, False: 1.71M]
  |  |  ------------------
  ------------------
  244|  3.05M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  3.05M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  123|  1.54M|  void DecodeNumber(int nbits, uint32_t* value) {
  124|  1.54M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|  1.54M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  114|     63|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    301|      : bit_length_(0),
   87|    301|        num_points_(0),
   88|    301|        num_decoded_points_(0),
   89|    301|        dimension_(dimension),
   90|    301|        p_(dimension, 0),
   91|    301|        axes_(dimension, 0) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  195|    234|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    234|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 4, False: 230]
  ------------------
  197|      4|    return false;
  198|      4|  }
  199|    230|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 29, False: 201]
  ------------------
  200|     29|    return false;
  201|     29|  }
  202|    201|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 5, False: 196]
  ------------------
  203|      5|    return false;
  204|      5|  }
  205|    196|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 22, False: 174]
  ------------------
  206|     22|    return true;
  207|     22|  }
  208|    174|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 53, False: 121]
  ------------------
  209|     53|    return false;
  210|     53|  }
  211|    121|  num_decoded_points_ = 0;
  212|       |
  213|    121|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 23, False: 98]
  ------------------
  214|     23|    return false;
  215|     23|  }
  216|     98|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 4, False: 94]
  ------------------
  217|      4|    return false;
  218|      4|  }
  219|     94|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 10, False: 84]
  ------------------
  220|     10|    return false;
  221|     10|  }
  222|     84|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 83]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|     83|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 60, False: 23]
  ------------------
  227|     60|    return false;
  228|     60|  }
  229|       |
  230|     23|  numbers_decoder_.EndDecoding();
  231|     23|  remaining_bits_decoder_.EndDecoding();
  232|     23|  axis_decoder_.EndDecoding();
  233|     23|  half_decoder_.EndDecoding();
  234|       |
  235|     23|  return true;
  236|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  263|     83|    uint32_t num_points, OutputIteratorT& oit) {
  264|     83|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     83|  base_.assign(dimension_, 0);
  278|     83|  levels_.assign(dimension_, 0);
  279|     83|  undo_.clear();
  280|     83|  uint32_t depth = 0;
  281|     83|  DecodingStatus init_status(num_points, 0, 0);
  282|     83|  std::stack<Status> status_stack;
  283|     83|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|   167k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 167k, False: 23]
  ------------------
  287|   167k|    const DecodingStatus status = status_stack.top();
  288|   167k|    status_stack.pop();
  289|       |
  290|   167k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|   167k|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|   167k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 120k, False: 46.8k]
  ------------------
  295|   120k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 120k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|   278k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 278k, False: 0]
  ------------------
  299|   278k|        const SplitUndo& split = undo_.back();
  300|   278k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 278k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|   278k|        base_[split.axis] = split.old_base;
  304|   278k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 120k, False: 157k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|   120k|          break;
  307|   120k|        }
  308|   157k|        levels_[split.axis] = split.old_level;
  309|   157k|        undo_.pop_back();
  310|   157k|      }
  311|   120k|      depth = status.depth;
  312|   120k|    }
  313|   167k|    const VectorUint32& old_base = base_;
  314|   167k|    const VectorUint32& levels = levels_;
  315|       |
  316|   167k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 167k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|   167k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|   167k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 5, False: 167k]
  ------------------
  322|      5|      return false;
  323|      5|    }
  324|       |
  325|   167k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|   167k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 506, False: 166k]
  ------------------
  329|  74.4k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 73.9k, False: 506]
  ------------------
  330|  73.9k|        *oit = old_base;
  331|  73.9k|        ++oit;
  332|  73.9k|        ++num_decoded_points_;
  333|  73.9k|      }
  334|    506|      continue;
  335|    506|    }
  336|       |
  337|   166k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|   166k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 696, False: 165k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|    696|      axes_[0] = axis;
  344|  46.3k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 45.6k, False: 696]
  ------------------
  345|  45.6k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  45.6k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 680, False: 44.9k]
  |  |  ------------------
  ------------------
  346|  45.6k|      }
  347|  1.60k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 940, False: 666]
  ------------------
  348|  59.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 58.9k, False: 910]
  ------------------
  349|  58.9k|          p_[axes_[j]] = 0;
  350|  58.9k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  58.9k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 58.4k, False: 511]
  ------------------
  352|  58.4k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 30, False: 58.4k]
  ------------------
  353|  58.4k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     30|              return false;
  355|     30|            }
  356|  58.4k|          }
  357|  58.9k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  58.9k|        }
  359|    910|        *oit = p_;
  360|    910|        ++oit;
  361|    910|        ++num_decoded_points_;
  362|    910|      }
  363|    666|      continue;
  364|    696|    }
  365|       |
  366|   165k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 165k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|   165k|    const int num_remaining_bits = bit_length_ - level;
  371|   165k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|   165k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|   165k|    uint32_t number = 0;
  376|   165k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|   165k|    uint32_t first_half = num_remaining_points / 2;
  379|   165k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 25, False: 165k]
  ------------------
  380|       |      // Invalid |number|.
  381|     25|      return false;
  382|     25|    }
  383|   165k|    first_half -= number;
  384|   165k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|   165k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 165k, False: 83]
  ------------------
  387|   165k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 119k, False: 45.8k]
  ------------------
  388|   119k|        std::swap(first_half, second_half);
  389|   119k|      }
  390|   165k|    }
  391|       |
  392|   165k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 165k]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|   165k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|   165k|    levels_[axis] += 1;
  400|   165k|    base_[axis] += modifier;
  401|   165k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 120k, False: 45.4k]
  ------------------
  402|   120k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|   120k|    }
  404|   165k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 46.7k, False: 119k]
  ------------------
  405|  46.7k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  46.7k|    }
  407|   165k|    ++depth;
  408|   165k|  }
  409|     23|  return true;
  410|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  130|   167k|        : num_remaining_points(num_remaining_points_),
  131|   167k|          last_axis(last_axis_),
  132|   167k|          depth(depth_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  123|   165k|  void DecodeNumber(int nbits, uint32_t* value) {
  124|   165k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  125|   165k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  114|     45|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  6.19M|    uint32_t last_axis) {
  242|  6.19M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 6.19M, Folded]
  ------------------
  243|  6.19M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  6.19M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 4.20M, False: 1.98M]
  |  |  ------------------
  ------------------
  244|  6.19M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  6.19M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  4.27M|    uint32_t last_axis) {
  242|  4.27M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 4.27M, Folded]
  ------------------
  243|  4.27M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.27M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.21M, False: 3.05M]
  |  |  ------------------
  ------------------
  244|  4.27M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  4.27M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|  3.58M|    uint32_t last_axis) {
  242|  3.58M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [True: 3.58M, Folded]
  ------------------
  243|  3.58M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.58M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.44M, False: 141k]
  |  |  ------------------
  ------------------
  244|  3.58M|  }
  245|       |
  246|      0|  uint32_t best_axis = 0;
  247|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 0, False: 0]
  ------------------
  248|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 0, False: 0]
  ------------------
  249|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|        best_axis = axis;
  251|      0|      }
  252|      0|    }
  253|      0|  } else {
  254|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|      0|  }
  256|       |
  257|      0|  return best_axis;
  258|  3.58M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  241|   167k|    uint32_t last_axis) {
  242|   167k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (242:7): [Folded, False: 167k]
  ------------------
  243|      0|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  244|      0|  }
  245|       |
  246|   167k|  uint32_t best_axis = 0;
  247|   167k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (247:7): [True: 166k, False: 512]
  ------------------
  248|  23.3M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (248:29): [True: 23.1M, False: 166k]
  ------------------
  249|  23.1M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (249:11): [True: 206k, False: 22.9M]
  ------------------
  250|   206k|        best_axis = axis;
  251|   206k|      }
  252|  23.1M|    }
  253|   166k|  } else {
  254|    512|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  255|    512|  }
  256|       |
  257|   167k|  return best_axis;
  258|   167k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    174|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    174|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    174|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    174|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    174|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 173]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|    173|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 21, False: 152]
  ------------------
  200|     21|    return false;
  201|     21|  }
  202|    152|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 4, False: 148]
  ------------------
  203|      4|    return false;
  204|      4|  }
  205|    148|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 147]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|    147|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 147]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    147|  num_decoded_points_ = 0;
  212|       |
  213|    147|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 57, False: 90]
  ------------------
  214|     57|    return false;
  215|     57|  }
  216|     90|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 7, False: 83]
  ------------------
  217|      7|    return false;
  218|      7|  }
  219|     83|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 1, False: 82]
  ------------------
  220|      1|    return false;
  221|      1|  }
  222|     82|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 81]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|     81|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 65, False: 16]
  ------------------
  227|     65|    return false;
  228|     65|  }
  229|       |
  230|     16|  numbers_decoder_.EndDecoding();
  231|     16|  remaining_bits_decoder_.EndDecoding();
  232|     16|  axis_decoder_.EndDecoding();
  233|     16|  half_decoder_.EndDecoding();
  234|       |
  235|     16|  return true;
  236|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     81|    uint32_t num_points, OutputIteratorT& oit) {
  264|     81|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     81|  base_.assign(dimension_, 0);
  278|     81|  levels_.assign(dimension_, 0);
  279|     81|  undo_.clear();
  280|     81|  uint32_t depth = 0;
  281|     81|  DecodingStatus init_status(num_points, 0, 0);
  282|     81|  std::stack<Status> status_stack;
  283|     81|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  2.13M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 2.13M, False: 16]
  ------------------
  287|  2.13M|    const DecodingStatus status = status_stack.top();
  288|  2.13M|    status_stack.pop();
  289|       |
  290|  2.13M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  2.13M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  2.13M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 1.06M, False: 1.06M]
  ------------------
  295|  1.06M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 1.06M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  2.12M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 2.12M, False: 0]
  ------------------
  299|  2.12M|        const SplitUndo& split = undo_.back();
  300|  2.12M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 2.12M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  2.12M|        base_[split.axis] = split.old_base;
  304|  2.12M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 1.06M, False: 1.06M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  1.06M|          break;
  307|  1.06M|        }
  308|  1.06M|        levels_[split.axis] = split.old_level;
  309|  1.06M|        undo_.pop_back();
  310|  1.06M|      }
  311|  1.06M|      depth = status.depth;
  312|  1.06M|    }
  313|  2.13M|    const VectorUint32& old_base = base_;
  314|  2.13M|    const VectorUint32& levels = levels_;
  315|       |
  316|  2.13M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 2.13M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  2.13M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  2.13M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 2.13M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  2.13M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  2.13M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 1.06M, False: 1.06M]
  ------------------
  329|   185M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 184M, False: 1.06M]
  ------------------
  330|   184M|        *oit = old_base;
  331|   184M|        ++oit;
  332|   184M|        ++num_decoded_points_;
  333|   184M|      }
  334|  1.06M|      continue;
  335|  1.06M|    }
  336|       |
  337|  1.06M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  1.06M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 2.16k, False: 1.06M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|  2.16k|      axes_[0] = axis;
  344|  6.48k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 4.32k, False: 2.16k]
  ------------------
  345|  4.32k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  4.32k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 465, False: 3.86k]
  |  |  ------------------
  ------------------
  346|  4.32k|      }
  347|  6.08k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 3.94k, False: 2.13k]
  ------------------
  348|  15.7k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 11.7k, False: 3.91k]
  ------------------
  349|  11.7k|          p_[axes_[j]] = 0;
  350|  11.7k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  11.7k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 5.23k, False: 6.56k]
  ------------------
  352|  5.23k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 28, False: 5.20k]
  ------------------
  353|  5.23k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     28|              return false;
  355|     28|            }
  356|  5.23k|          }
  357|  11.7k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  11.7k|        }
  359|  3.91k|        *oit = p_;
  360|  3.91k|        ++oit;
  361|  3.91k|        ++num_decoded_points_;
  362|  3.91k|      }
  363|  2.13k|      continue;
  364|  2.16k|    }
  365|       |
  366|  1.06M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 1.06M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  1.06M|    const int num_remaining_bits = bit_length_ - level;
  371|  1.06M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  1.06M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  1.06M|    uint32_t number = 0;
  376|  1.06M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  1.06M|    uint32_t first_half = num_remaining_points / 2;
  379|  1.06M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 37, False: 1.06M]
  ------------------
  380|       |      // Invalid |number|.
  381|     37|      return false;
  382|     37|    }
  383|  1.06M|    first_half -= number;
  384|  1.06M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  1.06M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 472k, False: 592k]
  ------------------
  387|   472k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 456k, False: 16.1k]
  ------------------
  388|   456k|        std::swap(first_half, second_half);
  389|   456k|      }
  390|   472k|    }
  391|       |
  392|  1.06M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 1.06M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  1.06M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  1.06M|    levels_[axis] += 1;
  400|  1.06M|    base_[axis] += modifier;
  401|  1.06M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 1.06M, False: 89]
  ------------------
  402|  1.06M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  1.06M|    }
  404|  1.06M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 1.06M, False: 319]
  ------------------
  405|  1.06M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  1.06M|    }
  407|  1.06M|    ++depth;
  408|  1.06M|  }
  409|     16|  return true;
  410|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    149|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    149|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    149|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    149|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    149|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 148]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|    148|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 22, False: 126]
  ------------------
  200|     22|    return false;
  201|     22|  }
  202|    126|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 3, False: 123]
  ------------------
  203|      3|    return false;
  204|      3|  }
  205|    123|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 4, False: 119]
  ------------------
  206|      4|    return true;
  207|      4|  }
  208|    119|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 119]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    119|  num_decoded_points_ = 0;
  212|       |
  213|    119|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 23, False: 96]
  ------------------
  214|     23|    return false;
  215|     23|  }
  216|     96|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 9, False: 87]
  ------------------
  217|      9|    return false;
  218|      9|  }
  219|     87|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 3, False: 84]
  ------------------
  220|      3|    return false;
  221|      3|  }
  222|     84|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 82]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     82|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 60, False: 22]
  ------------------
  227|     60|    return false;
  228|     60|  }
  229|       |
  230|     22|  numbers_decoder_.EndDecoding();
  231|     22|  remaining_bits_decoder_.EndDecoding();
  232|     22|  axis_decoder_.EndDecoding();
  233|     22|  half_decoder_.EndDecoding();
  234|       |
  235|     22|  return true;
  236|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     82|    uint32_t num_points, OutputIteratorT& oit) {
  264|     82|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     82|  base_.assign(dimension_, 0);
  278|     82|  levels_.assign(dimension_, 0);
  279|     82|  undo_.clear();
  280|     82|  uint32_t depth = 0;
  281|     82|  DecodingStatus init_status(num_points, 0, 0);
  282|     82|  std::stack<Status> status_stack;
  283|     82|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  4.67M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 4.67M, False: 22]
  ------------------
  287|  4.67M|    const DecodingStatus status = status_stack.top();
  288|  4.67M|    status_stack.pop();
  289|       |
  290|  4.67M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  4.67M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  4.67M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 2.33M, False: 2.33M]
  ------------------
  295|  2.33M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 2.33M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  4.67M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 4.67M, False: 0]
  ------------------
  299|  4.67M|        const SplitUndo& split = undo_.back();
  300|  4.67M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 4.67M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  4.67M|        base_[split.axis] = split.old_base;
  304|  4.67M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 2.33M, False: 2.33M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  2.33M|          break;
  307|  2.33M|        }
  308|  2.33M|        levels_[split.axis] = split.old_level;
  309|  2.33M|        undo_.pop_back();
  310|  2.33M|      }
  311|  2.33M|      depth = status.depth;
  312|  2.33M|    }
  313|  4.67M|    const VectorUint32& old_base = base_;
  314|  4.67M|    const VectorUint32& levels = levels_;
  315|       |
  316|  4.67M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 4.67M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  4.67M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  4.67M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 4.67M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  4.67M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  4.67M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 2.33M, False: 2.34M]
  ------------------
  329|  74.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 71.8M, False: 2.33M]
  ------------------
  330|  71.8M|        *oit = old_base;
  331|  71.8M|        ++oit;
  332|  71.8M|        ++num_decoded_points_;
  333|  71.8M|      }
  334|  2.33M|      continue;
  335|  2.33M|    }
  336|       |
  337|  2.34M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  2.34M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 2.09k, False: 2.33M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|  2.09k|      axes_[0] = axis;
  344|  6.27k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 4.18k, False: 2.09k]
  ------------------
  345|  4.18k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  4.18k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 600, False: 3.58k]
  |  |  ------------------
  ------------------
  346|  4.18k|      }
  347|  5.67k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 3.61k, False: 2.05k]
  ------------------
  348|  14.3k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 10.7k, False: 3.58k]
  ------------------
  349|  10.7k|          p_[axes_[j]] = 0;
  350|  10.7k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  10.7k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 5.14k, False: 5.65k]
  ------------------
  352|  5.14k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 34, False: 5.11k]
  ------------------
  353|  5.14k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     34|              return false;
  355|     34|            }
  356|  5.14k|          }
  357|  10.7k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  10.7k|        }
  359|  3.58k|        *oit = p_;
  360|  3.58k|        ++oit;
  361|  3.58k|        ++num_decoded_points_;
  362|  3.58k|      }
  363|  2.05k|      continue;
  364|  2.09k|    }
  365|       |
  366|  2.33M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2.33M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  2.33M|    const int num_remaining_bits = bit_length_ - level;
  371|  2.33M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  2.33M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  2.33M|    uint32_t number = 0;
  376|  2.33M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  2.33M|    uint32_t first_half = num_remaining_points / 2;
  379|  2.33M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 26, False: 2.33M]
  ------------------
  380|       |      // Invalid |number|.
  381|     26|      return false;
  382|     26|    }
  383|  2.33M|    first_half -= number;
  384|  2.33M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  2.33M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 1.42M, False: 914k]
  ------------------
  387|  1.42M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 1.40M, False: 23.2k]
  ------------------
  388|  1.40M|        std::swap(first_half, second_half);
  389|  1.40M|      }
  390|  1.42M|    }
  391|       |
  392|  2.33M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 2.33M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  2.33M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  2.33M|    levels_[axis] += 1;
  400|  2.33M|    base_[axis] += modifier;
  401|  2.33M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 2.33M, False: 229]
  ------------------
  402|  2.33M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  2.33M|    }
  404|  2.33M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 2.33M, False: 245]
  ------------------
  405|  2.33M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  2.33M|    }
  407|  2.33M|    ++depth;
  408|  2.33M|  }
  409|     22|  return true;
  410|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    158|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    158|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    158|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    158|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    158|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 157]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|    157|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 19, False: 138]
  ------------------
  200|     19|    return false;
  201|     19|  }
  202|    138|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 137]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|    137|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 136]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|    136|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 136]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    136|  num_decoded_points_ = 0;
  212|       |
  213|    136|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 39, False: 97]
  ------------------
  214|     39|    return false;
  215|     39|  }
  216|     97|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 4, False: 93]
  ------------------
  217|      4|    return false;
  218|      4|  }
  219|     93|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 4, False: 89]
  ------------------
  220|      4|    return false;
  221|      4|  }
  222|     89|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 2, False: 87]
  ------------------
  223|      2|    return false;
  224|      2|  }
  225|       |
  226|     87|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 80, False: 7]
  ------------------
  227|     80|    return false;
  228|     80|  }
  229|       |
  230|      7|  numbers_decoder_.EndDecoding();
  231|      7|  remaining_bits_decoder_.EndDecoding();
  232|      7|  axis_decoder_.EndDecoding();
  233|      7|  half_decoder_.EndDecoding();
  234|       |
  235|      7|  return true;
  236|     87|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     87|    uint32_t num_points, OutputIteratorT& oit) {
  264|     87|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     87|  base_.assign(dimension_, 0);
  278|     87|  levels_.assign(dimension_, 0);
  279|     87|  undo_.clear();
  280|     87|  uint32_t depth = 0;
  281|     87|  DecodingStatus init_status(num_points, 0, 0);
  282|     87|  std::stack<Status> status_stack;
  283|     87|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  4.24M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 4.24M, False: 7]
  ------------------
  287|  4.24M|    const DecodingStatus status = status_stack.top();
  288|  4.24M|    status_stack.pop();
  289|       |
  290|  4.24M|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  4.24M|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  4.24M|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 2.12M, False: 2.12M]
  ------------------
  295|  2.12M|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 2.12M]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  4.24M|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 4.24M, False: 0]
  ------------------
  299|  4.24M|        const SplitUndo& split = undo_.back();
  300|  4.24M|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 4.24M]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  4.24M|        base_[split.axis] = split.old_base;
  304|  4.24M|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 2.12M, False: 2.12M]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  2.12M|          break;
  307|  2.12M|        }
  308|  2.12M|        levels_[split.axis] = split.old_level;
  309|  2.12M|        undo_.pop_back();
  310|  2.12M|      }
  311|  2.12M|      depth = status.depth;
  312|  2.12M|    }
  313|  4.24M|    const VectorUint32& old_base = base_;
  314|  4.24M|    const VectorUint32& levels = levels_;
  315|       |
  316|  4.24M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 4.24M]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  4.24M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  4.24M|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 4.24M]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  4.24M|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  4.24M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 2.11M, False: 2.12M]
  ------------------
  329|  34.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 32.4M, False: 2.11M]
  ------------------
  330|  32.4M|        *oit = old_base;
  331|  32.4M|        ++oit;
  332|  32.4M|        ++num_decoded_points_;
  333|  32.4M|      }
  334|  2.11M|      continue;
  335|  2.11M|    }
  336|       |
  337|  2.12M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  2.12M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 2.04k, False: 2.12M]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|  2.04k|      axes_[0] = axis;
  344|  6.12k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 4.08k, False: 2.04k]
  ------------------
  345|  4.08k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  4.08k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.08k, False: 3.00k]
  |  |  ------------------
  ------------------
  346|  4.08k|      }
  347|  5.48k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 3.45k, False: 2.02k]
  ------------------
  348|  13.7k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 10.3k, False: 3.43k]
  ------------------
  349|  10.3k|          p_[axes_[j]] = 0;
  350|  10.3k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  10.3k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 7.73k, False: 2.60k]
  ------------------
  352|  7.73k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 20, False: 7.71k]
  ------------------
  353|  7.73k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     20|              return false;
  355|     20|            }
  356|  7.73k|          }
  357|  10.3k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  10.3k|        }
  359|  3.43k|        *oit = p_;
  360|  3.43k|        ++oit;
  361|  3.43k|        ++num_decoded_points_;
  362|  3.43k|      }
  363|  2.02k|      continue;
  364|  2.04k|    }
  365|       |
  366|  2.12M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 2.12M]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  2.12M|    const int num_remaining_bits = bit_length_ - level;
  371|  2.12M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  2.12M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  2.12M|    uint32_t number = 0;
  376|  2.12M|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  2.12M|    uint32_t first_half = num_remaining_points / 2;
  379|  2.12M|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 60, False: 2.12M]
  ------------------
  380|       |      // Invalid |number|.
  381|     60|      return false;
  382|     60|    }
  383|  2.12M|    first_half -= number;
  384|  2.12M|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  2.12M|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 997k, False: 1.12M]
  ------------------
  387|   997k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 992k, False: 5.27k]
  ------------------
  388|   992k|        std::swap(first_half, second_half);
  389|   992k|      }
  390|   997k|    }
  391|       |
  392|  2.12M|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 2.12M]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  2.12M|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  2.12M|    levels_[axis] += 1;
  400|  2.12M|    base_[axis] += modifier;
  401|  2.12M|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 2.12M, False: 95]
  ------------------
  402|  2.12M|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  2.12M|    }
  404|  2.12M|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 2.12M, False: 157]
  ------------------
  405|  2.12M|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  2.12M|    }
  407|  2.12M|    ++depth;
  408|  2.12M|  }
  409|      7|  return true;
  410|     87|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|    152|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|    152|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|    152|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|    152|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|    152|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 2, False: 150]
  ------------------
  197|      2|    return false;
  198|      2|  }
  199|    150|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 3, False: 147]
  ------------------
  200|      3|    return false;
  201|      3|  }
  202|    147|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 146]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|    146|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 145]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|    145|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 145]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|    145|  num_decoded_points_ = 0;
  212|       |
  213|    145|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 46, False: 99]
  ------------------
  214|     46|    return false;
  215|     46|  }
  216|     99|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 6, False: 93]
  ------------------
  217|      6|    return false;
  218|      6|  }
  219|     93|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 13, False: 80]
  ------------------
  220|     13|    return false;
  221|     13|  }
  222|     80|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 1, False: 79]
  ------------------
  223|      1|    return false;
  224|      1|  }
  225|       |
  226|     79|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 74, False: 5]
  ------------------
  227|     74|    return false;
  228|     74|  }
  229|       |
  230|      5|  numbers_decoder_.EndDecoding();
  231|      5|  remaining_bits_decoder_.EndDecoding();
  232|      5|  axis_decoder_.EndDecoding();
  233|      5|  half_decoder_.EndDecoding();
  234|       |
  235|      5|  return true;
  236|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  263|     79|    uint32_t num_points, OutputIteratorT& oit) {
  264|     79|  typedef DecodingStatus Status;
  265|       |  // The tree can be 32 * dimension levels deep, so keeping a base and levels
  266|       |  // vector per level takes memory quadratic in the dimension. The walk keeps
  267|       |  // one of each instead. A split at depth d raises one level of the node at
  268|       |  // d, and the node at d + 1 has the same levels and one more base bit set.
  269|       |  // Each split is logged in |undo_|, and on reaching a node at depth t the
  270|       |  // walk undoes the splits deeper than t and the base bit of the last split
  271|       |  // at t.
  272|       |  //
  273|       |  // A split takes its node off the top of |status_stack|, where every node
  274|       |  // below is shallower, and pushes its halves at d and d + 1. So the depths
  275|       |  // on the stack strictly increase towards its top, and a node is reached
  276|       |  // only after everything deeper than it has been decoded.
  277|     79|  base_.assign(dimension_, 0);
  278|     79|  levels_.assign(dimension_, 0);
  279|     79|  undo_.clear();
  280|     79|  uint32_t depth = 0;
  281|     79|  DecodingStatus init_status(num_points, 0, 0);
  282|     79|  std::stack<Status> status_stack;
  283|     79|  status_stack.push(init_status);
  284|       |
  285|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  286|  80.1k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (286:10): [True: 80.1k, False: 5]
  ------------------
  287|  80.1k|    const DecodingStatus status = status_stack.top();
  288|  80.1k|    status_stack.pop();
  289|       |
  290|  80.1k|    const uint32_t num_remaining_points = status.num_remaining_points;
  291|  80.1k|    const uint32_t last_axis = status.last_axis;
  292|       |    // A node at the current depth is the second half of the split just made,
  293|       |    // and nothing needs to be undone for it.
  294|  80.1k|    if (status.depth != depth) {
  ------------------
  |  Branch (294:9): [True: 39.4k, False: 40.6k]
  ------------------
  295|  39.4k|      if (status.depth > depth) {
  ------------------
  |  Branch (295:11): [True: 0, False: 39.4k]
  ------------------
  296|      0|        return false;
  297|      0|      }
  298|  78.7k|      while (!undo_.empty()) {
  ------------------
  |  Branch (298:14): [True: 78.7k, False: 0]
  ------------------
  299|  78.7k|        const SplitUndo& split = undo_.back();
  300|  78.7k|        if (split.depth < status.depth) {
  ------------------
  |  Branch (300:13): [True: 0, False: 78.7k]
  ------------------
  301|      0|          break;
  302|      0|        }
  303|  78.7k|        base_[split.axis] = split.old_base;
  304|  78.7k|        if (split.depth == status.depth) {
  ------------------
  |  Branch (304:13): [True: 39.4k, False: 39.3k]
  ------------------
  305|       |          // The node's own split, whose level stays raised.
  306|  39.4k|          break;
  307|  39.4k|        }
  308|  39.3k|        levels_[split.axis] = split.old_level;
  309|  39.3k|        undo_.pop_back();
  310|  39.3k|      }
  311|  39.4k|      depth = status.depth;
  312|  39.4k|    }
  313|  80.1k|    const VectorUint32& old_base = base_;
  314|  80.1k|    const VectorUint32& levels = levels_;
  315|       |
  316|  80.1k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (316:9): [True: 0, False: 80.1k]
  ------------------
  317|      0|      return false;
  318|      0|    }
  319|       |
  320|  80.1k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  321|  80.1k|    if (axis >= dimension_) {
  ------------------
  |  Branch (321:9): [True: 0, False: 80.1k]
  ------------------
  322|      0|      return false;
  323|      0|    }
  324|       |
  325|  80.1k|    const uint32_t level = levels[axis];
  326|       |
  327|       |    // All axes have been fully subdivided, just output points.
  328|  80.1k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (328:9): [True: 37.2k, False: 42.8k]
  ------------------
  329|   109M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (329:28): [True: 109M, False: 37.2k]
  ------------------
  330|   109M|        *oit = old_base;
  331|   109M|        ++oit;
  332|   109M|        ++num_decoded_points_;
  333|   109M|      }
  334|  37.2k|      continue;
  335|  37.2k|    }
  336|       |
  337|  42.8k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  338|       |
  339|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  340|  42.8k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (340:9): [True: 2.02k, False: 40.8k]
  ------------------
  341|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  342|       |      // bitstream!
  343|  2.02k|      axes_[0] = axis;
  344|  6.07k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (344:28): [True: 4.04k, False: 2.02k]
  ------------------
  345|  4.04k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  4.04k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M) - 1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 757, False: 3.29k]
  |  |  ------------------
  ------------------
  346|  4.04k|      }
  347|  5.68k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (347:28): [True: 3.67k, False: 2.01k]
  ------------------
  348|  14.6k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (348:30): [True: 10.9k, False: 3.65k]
  ------------------
  349|  10.9k|          p_[axes_[j]] = 0;
  350|  10.9k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  351|  10.9k|          if (num_remaining_bits) {
  ------------------
  |  Branch (351:15): [True: 6.15k, False: 4.83k]
  ------------------
  352|  6.15k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (352:17): [True: 14, False: 6.14k]
  ------------------
  353|  6.15k|                    num_remaining_bits, &p_[axes_[j]])) {
  354|     14|              return false;
  355|     14|            }
  356|  6.15k|          }
  357|  10.9k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  358|  10.9k|        }
  359|  3.65k|        *oit = p_;
  360|  3.65k|        ++oit;
  361|  3.65k|        ++num_decoded_points_;
  362|  3.65k|      }
  363|  2.01k|      continue;
  364|  2.02k|    }
  365|       |
  366|  40.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (366:9): [True: 0, False: 40.8k]
  ------------------
  367|      0|      return false;
  368|      0|    }
  369|       |
  370|  40.8k|    const int num_remaining_bits = bit_length_ - level;
  371|  40.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  372|       |
  373|  40.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  374|       |
  375|  40.8k|    uint32_t number = 0;
  376|  40.8k|    DecodeNumber(incoming_bits, &number);
  377|       |
  378|  40.8k|    uint32_t first_half = num_remaining_points / 2;
  379|  40.8k|    if (first_half < number) {
  ------------------
  |  Branch (379:9): [True: 60, False: 40.7k]
  ------------------
  380|       |      // Invalid |number|.
  381|     60|      return false;
  382|     60|    }
  383|  40.7k|    first_half -= number;
  384|  40.7k|    uint32_t second_half = num_remaining_points - first_half;
  385|       |
  386|  40.7k|    if (first_half != second_half) {
  ------------------
  |  Branch (386:9): [True: 24.1k, False: 16.5k]
  ------------------
  387|  24.1k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (387:11): [True: 15.1k, False: 9.04k]
  ------------------
  388|  15.1k|        std::swap(first_half, second_half);
  389|  15.1k|      }
  390|  24.1k|    }
  391|       |
  392|  40.7k|    if (depth == std::numeric_limits<uint32_t>::max()) {
  ------------------
  |  Branch (392:9): [True: 0, False: 40.7k]
  ------------------
  393|      0|      return false;
  394|      0|    }
  395|       |    // Both halves see |axis| one level deeper. The first half stays at this
  396|       |    // depth and keeps the base, the second goes one deeper with the split bit
  397|       |    // set in its base.
  398|  40.7k|    undo_.push_back({depth, axis, levels_[axis], base_[axis]});
  399|  40.7k|    levels_[axis] += 1;
  400|  40.7k|    base_[axis] += modifier;
  401|  40.7k|    if (first_half) {
  ------------------
  |  Branch (401:9): [True: 40.6k, False: 109]
  ------------------
  402|  40.6k|      status_stack.push(DecodingStatus(first_half, axis, depth));
  403|  40.6k|    }
  404|  40.7k|    if (second_half) {
  ------------------
  |  Branch (404:9): [True: 40.6k, False: 152]
  ------------------
  405|  40.6k|      status_stack.push(DecodingStatus(second_half, axis, depth + 1));
  406|  40.6k|    }
  407|  40.7k|    ++depth;
  408|  40.7k|  }
  409|      5|  return true;
  410|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|     76|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|     76|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|     76|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|     76|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|     76|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 2, False: 74]
  ------------------
  197|      2|    return false;
  198|      2|  }
  199|     74|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 26, False: 48]
  ------------------
  200|     26|    return false;
  201|     26|  }
  202|     48|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 47]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|     47|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 46]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|     46|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 46]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|     46|  num_decoded_points_ = 0;
  212|       |
  213|     46|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 46, False: 0]
  ------------------
  214|     46|    return false;
  215|     46|  }
  216|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 0, False: 0]
  ------------------
  220|      0|    return false;
  221|      0|  }
  222|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 0, False: 0]
  ------------------
  223|      0|    return false;
  224|      0|  }
  225|       |
  226|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 0, False: 0]
  ------------------
  227|      0|    return false;
  228|      0|  }
  229|       |
  230|      0|  numbers_decoder_.EndDecoding();
  231|      0|  remaining_bits_decoder_.EndDecoding();
  232|      0|  axis_decoder_.EndDecoding();
  233|      0|  half_decoder_.EndDecoding();
  234|       |
  235|      0|  return true;
  236|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|     34|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|     34|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|     34|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|     34|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|     34|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 1, False: 33]
  ------------------
  197|      1|    return false;
  198|      1|  }
  199|     33|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 7, False: 26]
  ------------------
  200|      7|    return false;
  201|      7|  }
  202|     26|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 1, False: 25]
  ------------------
  203|      1|    return false;
  204|      1|  }
  205|     25|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 24]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|     24|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 24]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|     24|  num_decoded_points_ = 0;
  212|       |
  213|     24|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 24, False: 0]
  ------------------
  214|     24|    return false;
  215|     24|  }
  216|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 0, False: 0]
  ------------------
  220|      0|    return false;
  221|      0|  }
  222|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 0, False: 0]
  ------------------
  223|      0|    return false;
  224|      0|  }
  225|       |
  226|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 0, False: 0]
  ------------------
  227|      0|    return false;
  228|      0|  }
  229|       |
  230|      0|  numbers_decoder_.EndDecoding();
  231|      0|  remaining_bits_decoder_.EndDecoding();
  232|      0|  axis_decoder_.EndDecoding();
  233|      0|  half_decoder_.EndDecoding();
  234|       |
  235|      0|  return true;
  236|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  188|     67|    DecoderBuffer* buffer, OutputIteratorT& oit) {
  189|     67|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  190|     67|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  195|     67|    DecoderBuffer* buffer, OutputIteratorT& oit, uint32_t oit_max_points) {
  196|     67|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (196:7): [True: 3, False: 64]
  ------------------
  197|      3|    return false;
  198|      3|  }
  199|     64|  if (bit_length_ > 32) {
  ------------------
  |  Branch (199:7): [True: 14, False: 50]
  ------------------
  200|     14|    return false;
  201|     14|  }
  202|     50|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (202:7): [True: 0, False: 50]
  ------------------
  203|      0|    return false;
  204|      0|  }
  205|     50|  if (num_points_ == 0) {
  ------------------
  |  Branch (205:7): [True: 1, False: 49]
  ------------------
  206|      1|    return true;
  207|      1|  }
  208|     49|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (208:7): [True: 0, False: 49]
  ------------------
  209|      0|    return false;
  210|      0|  }
  211|     49|  num_decoded_points_ = 0;
  212|       |
  213|     49|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (213:7): [True: 49, False: 0]
  ------------------
  214|     49|    return false;
  215|     49|  }
  216|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (219:7): [True: 0, False: 0]
  ------------------
  220|      0|    return false;
  221|      0|  }
  222|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (222:7): [True: 0, False: 0]
  ------------------
  223|      0|    return false;
  224|      0|  }
  225|       |
  226|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (226:7): [True: 0, False: 0]
  ------------------
  227|      0|    return false;
  228|      0|  }
  229|       |
  230|      0|  numbers_decoder_.EndDecoding();
  231|      0|  remaining_bits_decoder_.EndDecoding();
  232|      0|  axis_decoder_.EndDecoding();
  233|      0|  half_decoder_.EndDecoding();
  234|       |
  235|      0|  return true;
  236|      0|}

_ZN5draco22FloatPointsTreeDecoderC2Ev:
   65|    981|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    981|  qinfo_.quantization_bits = 0;
   67|    981|  qinfo_.range = 0;
   68|    981|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    929|    DecoderBuffer* buffer, std::vector<Point3ui>* qpoints) {
   72|    929|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 1, False: 928]
  ------------------
   73|      1|    return false;
   74|      1|  }
   75|    928|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 32, False: 896]
  ------------------
   76|     32|    return false;
   77|     32|  }
   78|    896|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 1, False: 895]
  ------------------
   79|      1|    return false;
   80|      1|  }
   81|    895|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 1, False: 894]
  ------------------
   82|      1|    return false;
   83|      1|  }
   84|    894|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 47, False: 847]
  |  Branch (84:38): [True: 36, False: 11]
  ------------------
   85|     36|    return false;
   86|     36|  }
   87|    858|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 3, False: 855]
  ------------------
   88|      3|    return false;
   89|      3|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    855|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 42, False: 813]
  ------------------
   93|     42|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|     42|#define DRACO_LOGE printf
  ------------------
   94|     42|               compression_level_);
   95|     42|    return false;
   96|     42|  }
   97|       |
   98|    813|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    813|      std::back_inserter(*qpoints);
  100|    813|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    813|                           Converter>
  102|    813|      oit(oit_qpoints);
  103|    813|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 810, False: 3]
  ------------------
  104|    810|    qpoints->reserve(num_points_);
  105|    810|    switch (compression_level_) {
  106|    174|      case 0: {
  ------------------
  |  Branch (106:7): [True: 174, False: 636]
  ------------------
  107|    174|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|    174|        qpoints_decoder.DecodePoints(buffer, oit);
  109|    174|        break;
  110|      0|      }
  111|    149|      case 1: {
  ------------------
  |  Branch (111:7): [True: 149, False: 661]
  ------------------
  112|    149|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|    149|        qpoints_decoder.DecodePoints(buffer, oit);
  114|    149|        break;
  115|      0|      }
  116|    158|      case 2: {
  ------------------
  |  Branch (116:7): [True: 158, False: 652]
  ------------------
  117|    158|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|    158|        qpoints_decoder.DecodePoints(buffer, oit);
  119|    158|        break;
  120|      0|      }
  121|    152|      case 3: {
  ------------------
  |  Branch (121:7): [True: 152, False: 658]
  ------------------
  122|    152|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    152|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    152|        break;
  125|      0|      }
  126|     76|      case 4: {
  ------------------
  |  Branch (126:7): [True: 76, False: 734]
  ------------------
  127|     76|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     76|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     76|        break;
  130|      0|      }
  131|     34|      case 5: {
  ------------------
  |  Branch (131:7): [True: 34, False: 776]
  ------------------
  132|     34|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     34|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     34|        break;
  135|      0|      }
  136|     67|      case 6: {
  ------------------
  |  Branch (136:7): [True: 67, False: 743]
  ------------------
  137|     67|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     67|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     67|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 810]
  ------------------
  142|      0|        return false;
  143|    810|    }
  144|    810|  }
  145|       |
  146|    813|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 802, False: 11]
  ------------------
  147|    802|    return false;
  148|    802|  }
  149|     11|  return true;
  150|    813|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    813|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   398M|  Self& operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   398M|  const Self& operator=(const SourceType& source) {
   56|   398M|    *oit_ = Converter()(source);
   57|   398M|    return *this;
   58|   398M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   398M|  Point3ui operator()(const std::vector<uint32_t>& v) {
   30|   398M|    return Point3ui(v[0], v[1], v[2]);
   31|   398M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   398M|  const Self& operator++() {
   46|   398M|    ++oit_;
   47|   398M|    return *this;
   48|   398M|  }

_ZN5draco22FloatPointsTreeDecoder26set_num_points_from_headerEj:
   69|    981|  void set_num_points_from_header(uint32_t num_points) {
   70|    981|    num_points_from_header_ = num_points;
   71|    981|  }
_ZN5draco22FloatPointsTreeDecoder16DecodePointCloudINS_34PointAttributeVectorOutputIteratorIfEEEEbPNS_13DecoderBufferERT_:
  102|    981|                                              OutputIteratorT& out) {
  103|    981|  std::vector<Point3ui> qpoints;
  104|       |
  105|    981|  uint32_t decoded_version;
  106|    981|  if (!buffer->Decode(&decoded_version)) {
  ------------------
  |  Branch (106:7): [True: 5, False: 976]
  ------------------
  107|      5|    return false;
  108|      5|  }
  109|       |
  110|    976|  if (decoded_version == 3) {
  ------------------
  |  Branch (110:7): [True: 6, False: 970]
  ------------------
  111|      6|    int8_t method_number;
  112|      6|    if (!buffer->Decode(&method_number)) {
  ------------------
  |  Branch (112:9): [True: 1, False: 5]
  ------------------
  113|      1|      return false;
  114|      1|    }
  115|       |
  116|      5|    method_ = method_number;
  117|       |
  118|      5|    if (method_ == KDTREE) {
  ------------------
  |  Branch (118:9): [True: 1, False: 4]
  ------------------
  119|      1|      if (!DecodePointCloudKdTreeInternal(buffer, &qpoints)) {
  ------------------
  |  Branch (119:11): [True: 1, False: 0]
  ------------------
  120|      1|        return false;
  121|      1|      }
  122|      4|    } else {  // Unsupported method.
  123|      4|      fprintf(stderr, "Method not supported. \n");
  124|      4|      return false;
  125|      4|    }
  126|    970|  } else if (decoded_version == 2) {  // Version 2 only uses KDTREE method.
  ------------------
  |  Branch (126:14): [True: 928, False: 42]
  ------------------
  127|    928|    if (!DecodePointCloudKdTreeInternal(buffer, &qpoints)) {
  ------------------
  |  Branch (127:9): [True: 917, False: 11]
  ------------------
  128|    917|      return false;
  129|    917|    }
  130|    928|  } else {  // Unsupported version.
  131|     42|    fprintf(stderr, "Version not supported. \n");
  132|     42|    return false;
  133|     42|  }
  134|       |
  135|     11|  DequantizePoints3(qpoints.begin(), qpoints.end(), qinfo_, out);
  136|     11|  return true;
  137|    976|}

_ZN5draco17DequantizePoints3INSt3__111__wrap_iterIPNS_7VectorDIjLi3EEEEENS_34PointAttributeVectorOutputIteratorIfEEEEvRKT_SB_RKNS_16QuantizationInfoERT0_:
   63|     11|                       const QuantizationInfo& info, OutputIterator& oit) {
   64|     11|  DRACO_DCHECK_GE(info.quantization_bits, 0);
   65|     11|  DRACO_DCHECK_GE(info.range, 0);
   66|       |
   67|     11|  const uint32_t quantization_bits = info.quantization_bits;
   68|     11|  const float range = info.range;
   69|     11|  const uint32_t max_quantized_value((1u << quantization_bits) - 1);
   70|     11|  Dequantizer dequantize;
   71|     11|  dequantize.Init(range, max_quantized_value);
   72|       |
   73|     70|  for (auto it = begin; it != end; ++it) {
  ------------------
  |  Branch (73:25): [True: 59, False: 11]
  ------------------
   74|     59|    const float x = dequantize((*it)[0] - max_quantized_value);
   75|     59|    const float y = dequantize((*it)[1] - max_quantized_value);
   76|     59|    const float z = dequantize((*it)[2] - max_quantized_value);
   77|     59|    *oit = Point3f(x, y, z);
   78|     59|    ++oit;
   79|     59|  }
   80|     11|}

_ZN5draco17PointCloudDecoderC2Ev:
   22|  20.4k|    : point_cloud_(nullptr),
   23|  20.4k|      buffer_(nullptr),
   24|  20.4k|      version_major_(0),
   25|  20.4k|      version_minor_(0),
   26|  20.4k|      options_(nullptr) {}
_ZN5draco17PointCloudDecoder12DecodeHeaderEPNS_13DecoderBufferEPNS_11DracoHeaderE:
   29|  61.4k|                                       DracoHeader* out_header) {
   30|  61.4k|  constexpr char kIoErrorMsg[] = "Failed to parse Draco header.";
   31|  61.4k|  if (!buffer->Decode(out_header->draco_string, 5)) {
  ------------------
  |  Branch (31:7): [True: 3, False: 61.4k]
  ------------------
   32|      3|    return Status(Status::IO_ERROR, kIoErrorMsg);
   33|      3|  }
   34|  61.4k|  if (memcmp(out_header->draco_string, "DRACO", 5) != 0) {
  ------------------
  |  Branch (34:7): [True: 44, False: 61.4k]
  ------------------
   35|     44|    return Status(Status::DRACO_ERROR, "Not a Draco file.");
   36|     44|  }
   37|  61.4k|  if (!buffer->Decode(&(out_header->version_major))) {
  ------------------
  |  Branch (37:7): [True: 1, False: 61.4k]
  ------------------
   38|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   39|      1|  }
   40|  61.4k|  if (!buffer->Decode(&(out_header->version_minor))) {
  ------------------
  |  Branch (40:7): [True: 1, False: 61.4k]
  ------------------
   41|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   42|      1|  }
   43|  61.4k|  if (!buffer->Decode(&(out_header->encoder_type))) {
  ------------------
  |  Branch (43:7): [True: 1, False: 61.4k]
  ------------------
   44|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   45|      1|  }
   46|  61.4k|  if (!buffer->Decode(&(out_header->encoder_method))) {
  ------------------
  |  Branch (46:7): [True: 1, False: 61.4k]
  ------------------
   47|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   48|      1|  }
   49|  61.4k|  if (!buffer->Decode(&(out_header->flags))) {
  ------------------
  |  Branch (49:7): [True: 2, False: 61.4k]
  ------------------
   50|      2|    return Status(Status::IO_ERROR, kIoErrorMsg);
   51|      2|  }
   52|  61.4k|  return OkStatus();
   53|  61.4k|}
_ZN5draco17PointCloudDecoder14DecodeMetadataEv:
   55|  1.23k|Status PointCloudDecoder::DecodeMetadata() {
   56|  1.23k|  std::unique_ptr<GeometryMetadata> metadata =
   57|  1.23k|      std::unique_ptr<GeometryMetadata>(new GeometryMetadata());
   58|  1.23k|  MetadataDecoder metadata_decoder;
   59|  1.23k|  if (!metadata_decoder.DecodeGeometryMetadata(buffer_, metadata.get())) {
  ------------------
  |  Branch (59:7): [True: 1.12k, False: 114]
  ------------------
   60|  1.12k|    return Status(Status::DRACO_ERROR, "Failed to decode metadata.");
   61|  1.12k|  }
   62|    114|  point_cloud_->AddMetadata(std::move(metadata));
   63|    114|  return OkStatus();
   64|  1.23k|}
_ZN5draco17PointCloudDecoder6DecodeERKNS_12DracoOptionsINS_17GeometryAttribute4TypeEEEPNS_13DecoderBufferEPNS_10PointCloudE:
   68|  20.4k|                                 PointCloud* out_point_cloud) {
   69|  20.4k|  options_ = &options;
   70|  20.4k|  buffer_ = in_buffer;
   71|  20.4k|  point_cloud_ = out_point_cloud;
   72|  20.4k|  DracoHeader header;
   73|  20.4k|  DRACO_RETURN_IF_ERROR(DecodeHeader(buffer_, &header))
  ------------------
  |  |   74|  20.4k|  {                                                   \
  |  |   75|  20.4k|    const draco::Status _local_status = (expression); \
  |  |   76|  20.4k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 0, False: 20.4k]
  |  |  ------------------
  |  |   77|      0|      return _local_status;                           \
  |  |   78|      0|    }                                                 \
  |  |   79|  20.4k|  }
  ------------------
   74|       |  // Sanity check that we are really using the right decoder (mostly for cases
   75|       |  // where the Decode method was called manually outside of our main API.
   76|  20.4k|  if (header.encoder_type != GetGeometryType()) {
  ------------------
  |  Branch (76:7): [True: 0, False: 20.4k]
  ------------------
   77|      0|    return Status(Status::DRACO_ERROR,
   78|      0|                  "Using incompatible decoder for the input geometry.");
   79|      0|  }
   80|       |  // TODO(ostava): We should check the method as well, but currently decoders
   81|       |  // don't expose the decoding method id.
   82|  20.4k|  version_major_ = header.version_major;
   83|  20.4k|  version_minor_ = header.version_minor;
   84|       |
   85|  20.4k|  const uint8_t max_supported_major_version =
   86|  20.4k|      header.encoder_type == POINT_CLOUD ? kDracoPointCloudBitstreamVersionMajor
  ------------------
  |  Branch (86:7): [True: 3.46k, False: 17.0k]
  ------------------
   87|  20.4k|                                         : kDracoMeshBitstreamVersionMajor;
   88|  20.4k|  const uint8_t max_supported_minor_version =
   89|  20.4k|      header.encoder_type == POINT_CLOUD ? kDracoPointCloudBitstreamVersionMinor
  ------------------
  |  Branch (89:7): [True: 3.46k, False: 17.0k]
  ------------------
   90|  20.4k|                                         : kDracoMeshBitstreamVersionMinor;
   91|       |
   92|       |  // Check for version compatibility.
   93|  20.4k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   94|  20.4k|  if (version_major_ < 1 || version_major_ > max_supported_major_version) {
  ------------------
  |  Branch (94:7): [True: 1, False: 20.4k]
  |  Branch (94:29): [True: 10, False: 20.4k]
  ------------------
   95|     11|    return Status(Status::UNKNOWN_VERSION, "Unknown major version.");
   96|     11|  }
   97|  20.4k|  if (version_major_ == max_supported_major_version &&
  ------------------
  |  Branch (97:7): [True: 18.6k, False: 1.78k]
  ------------------
   98|  18.6k|      version_minor_ > max_supported_minor_version) {
  ------------------
  |  Branch (98:7): [True: 6, False: 18.6k]
  ------------------
   99|      6|    return Status(Status::UNKNOWN_VERSION, "Unknown minor version.");
  100|      6|  }
  101|       |#else
  102|       |  if (version_major_ != max_supported_major_version) {
  103|       |    return Status(Status::UNKNOWN_VERSION, "Unsupported major version.");
  104|       |  }
  105|       |  if (version_minor_ != max_supported_minor_version) {
  106|       |    return Status(Status::UNKNOWN_VERSION, "Unsupported minor version.");
  107|       |  }
  108|       |#endif
  109|  20.4k|  buffer_->set_bitstream_version(
  110|  20.4k|      DRACO_BITSTREAM_VERSION(version_major_, version_minor_));
  ------------------
  |  |  115|  20.4k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  111|       |
  112|  20.4k|  if (bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 3) &&
  ------------------
  |  |  115|  40.8k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (112:7): [True: 19.5k, False: 877]
  ------------------
  113|  19.5k|      (header.flags & METADATA_FLAG_MASK)) {
  ------------------
  |  |  151|  19.5k|#define METADATA_FLAG_MASK 0x8000
  ------------------
  |  Branch (113:7): [True: 1.23k, False: 18.3k]
  ------------------
  114|  1.23k|    DRACO_RETURN_IF_ERROR(DecodeMetadata())
  ------------------
  |  |   74|  1.23k|  {                                                   \
  |  |   75|  1.23k|    const draco::Status _local_status = (expression); \
  |  |   76|  1.23k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 1.12k, False: 114]
  |  |  ------------------
  |  |   77|  1.12k|      return _local_status;                           \
  |  |   78|  1.12k|    }                                                 \
  |  |   79|  1.23k|  }
  ------------------
  115|  1.23k|  }
  116|  19.3k|  if (!InitializeDecoder()) {
  ------------------
  |  Branch (116:7): [True: 14, False: 19.3k]
  ------------------
  117|     14|    return Status(Status::DRACO_ERROR, "Failed to initialize the decoder.");
  118|     14|  }
  119|  19.3k|  if (!DecodeGeometryData()) {
  ------------------
  |  Branch (119:7): [True: 9.86k, False: 9.44k]
  ------------------
  120|  9.86k|    return Status(Status::DRACO_ERROR, "Failed to decode geometry data.");
  121|  9.86k|  }
  122|  9.44k|  if (!DecodePointAttributes()) {
  ------------------
  |  Branch (122:7): [True: 7.83k, False: 1.61k]
  ------------------
  123|  7.83k|    return Status(Status::DRACO_ERROR, "Failed to decode point attributes.");
  124|  7.83k|  }
  125|  1.61k|  return OkStatus();
  126|  9.44k|}
_ZN5draco17PointCloudDecoder21DecodePointAttributesEv:
  128|  9.44k|bool PointCloudDecoder::DecodePointAttributes() {
  129|  9.44k|  uint8_t num_attributes_decoders;
  130|  9.44k|  if (!buffer_->Decode(&num_attributes_decoders)) {
  ------------------
  |  Branch (130:7): [True: 258, False: 9.18k]
  ------------------
  131|    258|    return false;
  132|    258|  }
  133|       |  // Create all attribute decoders. This is implementation specific and the
  134|       |  // derived classes can use any data encoded in the
  135|       |  // PointCloudEncoder::EncodeAttributesEncoderIdentifier() call.
  136|  52.8k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (136:19): [True: 44.2k, False: 8.64k]
  ------------------
  137|  44.2k|    if (!CreateAttributesDecoder(i)) {
  ------------------
  |  Branch (137:9): [True: 542, False: 43.6k]
  ------------------
  138|    542|      return false;
  139|    542|    }
  140|  44.2k|  }
  141|       |
  142|       |  // Initialize all attributes decoders. No data is decoded here.
  143|  43.5k|  for (auto& att_dec : attributes_decoders_) {
  ------------------
  |  Branch (143:22): [True: 43.5k, False: 8.64k]
  ------------------
  144|  43.5k|    if (!att_dec->Init(this, point_cloud_)) {
  ------------------
  |  Branch (144:9): [True: 0, False: 43.5k]
  ------------------
  145|      0|      return false;
  146|      0|    }
  147|  43.5k|  }
  148|       |
  149|       |  // Decode any data needed by the attribute decoders.
  150|  20.9k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (150:19): [True: 12.6k, False: 8.22k]
  ------------------
  151|  12.6k|    if (!attributes_decoders_[i]->DecodeAttributesDecoderData(buffer_)) {
  ------------------
  |  Branch (151:9): [True: 420, False: 12.2k]
  ------------------
  152|    420|      return false;
  153|    420|    }
  154|  12.6k|  }
  155|       |
  156|       |  // Create map between attribute and decoder ids.
  157|  17.9k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (157:19): [True: 9.69k, False: 8.22k]
  ------------------
  158|  9.69k|    const int32_t num_attributes = attributes_decoders_[i]->GetNumAttributes();
  159|  32.1k|    for (int j = 0; j < num_attributes; ++j) {
  ------------------
  |  Branch (159:21): [True: 22.4k, False: 9.69k]
  ------------------
  160|  22.4k|      int att_id = attributes_decoders_[i]->GetAttributeId(j);
  161|  22.4k|      if (att_id >= attribute_to_decoder_map_.size()) {
  ------------------
  |  Branch (161:11): [True: 22.4k, False: 0]
  ------------------
  162|  22.4k|        attribute_to_decoder_map_.resize(att_id + 1);
  163|  22.4k|      }
  164|  22.4k|      attribute_to_decoder_map_[att_id] = i;
  165|  22.4k|    }
  166|  9.69k|  }
  167|       |
  168|       |  // Decode the actual attributes using the created attribute decoders.
  169|  8.22k|  if (!DecodeAllAttributes()) {
  ------------------
  |  Branch (169:7): [True: 6.61k, False: 1.61k]
  ------------------
  170|  6.61k|    return false;
  171|  6.61k|  }
  172|       |
  173|  1.61k|  if (!OnAttributesDecoded()) {
  ------------------
  |  Branch (173:7): [True: 0, False: 1.61k]
  ------------------
  174|      0|    return false;
  175|      0|  }
  176|  1.61k|  return true;
  177|  1.61k|}
_ZN5draco17PointCloudDecoder19DecodeAllAttributesEv:
  179|  8.22k|bool PointCloudDecoder::DecodeAllAttributes() {
  180|  8.31k|  for (auto& att_dec : attributes_decoders_) {
  ------------------
  |  Branch (180:22): [True: 8.31k, False: 1.61k]
  ------------------
  181|  8.31k|    if (!att_dec->DecodeAttributes(buffer_)) {
  ------------------
  |  Branch (181:9): [True: 6.61k, False: 1.70k]
  ------------------
  182|  6.61k|      return false;
  183|  6.61k|    }
  184|  8.31k|  }
  185|  1.61k|  return true;
  186|  8.22k|}
_ZN5draco17PointCloudDecoder20GetPortableAttributeEi:
  189|  2.55k|    int32_t parent_att_id) {
  190|  2.55k|  if (parent_att_id < 0 || parent_att_id >= point_cloud_->num_attributes()) {
  ------------------
  |  Branch (190:7): [True: 0, False: 2.55k]
  |  Branch (190:28): [True: 0, False: 2.55k]
  ------------------
  191|      0|    return nullptr;
  192|      0|  }
  193|  2.55k|  const int32_t parent_att_decoder_id =
  194|  2.55k|      attribute_to_decoder_map_[parent_att_id];
  195|  2.55k|  return attributes_decoders_[parent_att_decoder_id]->GetPortableAttribute(
  196|  2.55k|      parent_att_id);
  197|  2.55k|}

_ZNK5draco17PointCloudDecoder15GetGeometryTypeEv:
   33|  3.59k|  virtual EncodedGeometryType GetGeometryType() const { return POINT_CLOUD; }
_ZN5draco17PointCloudDecoder20SetAttributesDecoderEiNSt3__110unique_ptrINS_26AttributesDecoderInterfaceENS1_14default_deleteIS3_EEEE:
   44|  43.6k|      int att_decoder_id, std::unique_ptr<AttributesDecoderInterface> decoder) {
   45|  43.6k|    if (att_decoder_id < 0) {
  ------------------
  |  Branch (45:9): [True: 0, False: 43.6k]
  ------------------
   46|      0|      return false;
   47|      0|    }
   48|  43.6k|    if (att_decoder_id >= static_cast<int>(attributes_decoders_.size())) {
  ------------------
  |  Branch (48:9): [True: 43.6k, False: 0]
  ------------------
   49|  43.6k|      attributes_decoders_.resize(att_decoder_id + 1);
   50|  43.6k|    }
   51|  43.6k|    attributes_decoders_[att_decoder_id] = std::move(decoder);
   52|  43.6k|    return true;
   53|  43.6k|  }
_ZNK5draco17PointCloudDecoder17bitstream_versionEv:
   63|   221k|  uint16_t bitstream_version() const {
   64|   221k|    return DRACO_BITSTREAM_VERSION(version_major_, version_minor_);
  ------------------
  |  |  115|   221k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
   65|   221k|  }
_ZN5draco17PointCloudDecoder18attributes_decoderEi:
   67|  9.55k|  const AttributesDecoderInterface* attributes_decoder(int dec_id) {
   68|  9.55k|    return attributes_decoders_[dec_id].get();
   69|  9.55k|  }
_ZNK5draco17PointCloudDecoder23num_attributes_decodersEv:
   70|  9.55k|  int32_t num_attributes_decoders() const {
   71|  9.55k|    return static_cast<int32_t>(attributes_decoders_.size());
   72|  9.55k|  }
_ZN5draco17PointCloudDecoder11point_cloudEv:
   76|  75.5k|  PointCloud* point_cloud() { return point_cloud_; }
_ZNK5draco17PointCloudDecoder11point_cloudEv:
   77|  13.9k|  const PointCloud* point_cloud() const { return point_cloud_; }
_ZN5draco17PointCloudDecoder6bufferEv:
   79|   172k|  DecoderBuffer* buffer() { return buffer_; }
_ZNK5draco17PointCloudDecoder7optionsEv:
   80|  6.11k|  const DecoderOptions* options() const { return options_; }
_ZN5draco17PointCloudDecoder17InitializeDecoderEv:
   85|  8.53k|  virtual bool InitializeDecoder() { return true; }
_ZN5draco17PointCloudDecoder18DecodeGeometryDataEv:
   89|  6.38k|  virtual bool DecodeGeometryData() { return true; }
_ZN5draco17PointCloudDecoder19OnAttributesDecodedEv:
   93|    382|  virtual bool OnAttributesDecoded() { return true; }
_ZN5draco17PointCloudDecoderD2Ev:
   31|  20.4k|  virtual ~PointCloudDecoder() = default;

_ZN5draco23PointCloudKdTreeDecoder18DecodeGeometryDataEv:
   21|  2.77k|bool PointCloudKdTreeDecoder::DecodeGeometryData() {
   22|  2.77k|  int32_t num_points;
   23|  2.77k|  if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (23:7): [True: 1, False: 2.77k]
  ------------------
   24|      1|    return false;
   25|      1|  }
   26|  2.77k|  if (num_points < 0) {
  ------------------
  |  Branch (26:7): [True: 36, False: 2.73k]
  ------------------
   27|     36|    return false;
   28|     36|  }
   29|  2.73k|  point_cloud()->set_num_points(num_points);
   30|  2.73k|  return true;
   31|  2.77k|}
_ZN5draco23PointCloudKdTreeDecoder23CreateAttributesDecoderEi:
   33|  13.7k|bool PointCloudKdTreeDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
   34|       |  // Always create the basic attribute decoder.
   35|  13.7k|  return SetAttributesDecoder(
   36|  13.7k|      att_decoder_id,
   37|  13.7k|      std::unique_ptr<AttributesDecoder>(new KdTreeAttributesDecoder()));
   38|  13.7k|}

_ZN5draco27PointCloudSequentialDecoder18DecodeGeometryDataEv:
   22|    365|bool PointCloudSequentialDecoder::DecodeGeometryData() {
   23|    365|  int32_t num_points;
   24|    365|  if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (24:7): [True: 6, False: 359]
  ------------------
   25|      6|    return false;
   26|      6|  }
   27|    359|  if (num_points < 0) {
  ------------------
  |  Branch (27:7): [True: 30, False: 329]
  ------------------
   28|     30|    return false;
   29|     30|  }
   30|    329|  point_cloud()->set_num_points(num_points);
   31|    329|  return true;
   32|    359|}
_ZN5draco27PointCloudSequentialDecoder23CreateAttributesDecoderEi:
   35|  6.38k|    int32_t att_decoder_id) {
   36|       |  // Always create the basic attribute decoder.
   37|  6.38k|  return SetAttributesDecoder(
   38|  6.38k|      att_decoder_id,
   39|  6.38k|      std::unique_ptr<AttributesDecoder>(
   40|  6.38k|          new SequentialAttributeDecodersController(
   41|  6.38k|              std::unique_ptr<PointsSequencer>(
   42|  6.38k|                  new LinearSequencer(point_cloud()->num_points())))));
   43|  6.38k|}

_ZN5draco26ConvertSymbolsToSignedIntsEPKjiPi:
   30|  8.30k|                                int32_t* out) {
   31|  3.40G|  for (int i = 0; i < in_values; ++i) {
  ------------------
  |  Branch (31:19): [True: 3.40G, False: 8.30k]
  ------------------
   32|  3.40G|    out[i] = ConvertSymbolToSignedInt(in[i]);
   33|  3.40G|  }
   34|  8.30k|}

_ZN5draco18MostSignificantBitEj:
   58|  13.6M|inline int MostSignificantBit(uint32_t n) {
   59|  13.6M|#if defined(__GNUC__)
   60|  13.6M|  return 31 ^ __builtin_clz(n);
   61|       |#elif defined(_MSC_VER)
   62|       |
   63|       |  unsigned long where;
   64|       |  _BitScanReverse(&where, n);
   65|       |  return (int)where;
   66|       |#else
   67|       |  uint32_t msb = 0;
   68|       |  if (n) {
   69|       |    if (0xFFFF0000 & n) {
   70|       |      n >>= (1 << 4);
   71|       |      msb |= (1 << 4);
   72|       |    }
   73|       |    if (0x0000FF00 & n) {
   74|       |      n >>= (1 << 3);
   75|       |      msb |= (1 << 3);
   76|       |    }
   77|       |    if (0x000000F0 & n) {
   78|       |      n >>= (1 << 2);
   79|       |      msb |= (1 << 2);
   80|       |    }
   81|       |    if (0x0000000C & n) {
   82|       |      n >>= (1 << 1);
   83|       |      msb |= (1 << 1);
   84|       |    }
   85|       |    if (0x00000002 & n) {
   86|       |      msb |= (1 << 0);
   87|       |    }
   88|       |  } else {
   89|       |    msb = -1;
   90|       |  }
   91|       |  return msb;
   92|       |#endif
   93|  13.6M|}
_ZN5draco24ConvertSymbolToSignedIntIjEENSt3__111make_signedIT_E4typeES3_:
  127|  3.40G|    IntTypeT val) {
  128|  3.40G|  static_assert(std::is_integral<IntTypeT>::value, "IntTypeT is not integral.");
  129|  3.40G|  typedef typename std::make_signed<IntTypeT>::type SignedType;
  130|  3.40G|  const bool is_positive = !static_cast<bool>(val & 1);
  131|  3.40G|  val >>= 1;
  132|  3.40G|  if (is_positive) {
  ------------------
  |  Branch (132:7): [True: 3.15G, False: 252M]
  ------------------
  133|  3.15G|    return static_cast<SignedType>(val);
  134|  3.15G|  }
  135|   252M|  SignedType ret = static_cast<SignedType>(val);
  136|   252M|  ret = -ret - 1;
  137|   252M|  return ret;
  138|  3.40G|}

_ZN5draco10DataBufferC2Ev:
   21|  25.3k|DataBuffer::DataBuffer() = default;
_ZN5draco10DataBuffer6UpdateEPKvl:
   23|  24.6k|bool DataBuffer::Update(const void* data, int64_t size) {
   24|  24.6k|  const int64_t offset = 0;
   25|  24.6k|  return this->Update(data, size, offset);
   26|  24.6k|}
_ZN5draco10DataBuffer6UpdateEPKvll:
   28|  24.6k|bool DataBuffer::Update(const void* data, int64_t size, int64_t offset) {
   29|  24.6k|  if (data == nullptr) {
  ------------------
  |  Branch (29:7): [True: 24.6k, False: 0]
  ------------------
   30|  24.6k|    if (size + offset < 0) {
  ------------------
  |  Branch (30:9): [True: 0, False: 24.6k]
  ------------------
   31|      0|      return false;
   32|      0|    }
   33|       |    // If no data is provided, just resize the buffer.
   34|  24.6k|    data_.resize(size + offset);
   35|  24.6k|  } else {
   36|      0|    if (size < 0) {
  ------------------
  |  Branch (36:9): [True: 0, False: 0]
  ------------------
   37|      0|      return false;
   38|      0|    }
   39|      0|    if (size + offset > static_cast<int64_t>(data_.size())) {
  ------------------
  |  Branch (39:9): [True: 0, False: 0]
  ------------------
   40|      0|      data_.resize(size + offset);
   41|      0|    }
   42|      0|    const uint8_t* const byte_data = static_cast<const uint8_t*>(data);
   43|      0|    std::copy(byte_data, byte_data + size, data_.data() + offset);
   44|      0|  }
   45|  24.6k|  descriptor_.buffer_update_count++;
   46|  24.6k|  return true;
   47|  24.6k|}
_ZN5draco10DataBuffer6ResizeEl:
   49|  6.20k|void DataBuffer::Resize(int64_t size) {
   50|  6.20k|  data_.resize(size);
   51|  6.20k|  descriptor_.buffer_update_count++;
   52|  6.20k|}

_ZN5draco20DataBufferDescriptorC2Ev:
   28|  65.9k|  DataBufferDescriptor() : buffer_id(0), buffer_update_count(0) {}
_ZNK5draco10DataBuffer4ReadElPvm:
   47|    118|  void Read(int64_t byte_pos, void* out_data, size_t data_size) const {
   48|    118|    memcpy(out_data, data() + byte_pos, data_size);
   49|    118|  }
_ZN5draco10DataBuffer5WriteElPKvm:
   53|  1.31G|  void Write(int64_t byte_pos, const void* in_data, size_t data_size) {
   54|  1.31G|    memcpy(const_cast<uint8_t*>(data()) + byte_pos, in_data, data_size);
   55|  1.31G|  }
_ZNK5draco10DataBuffer12update_countEv:
   67|  24.6k|  int64_t update_count() const { return descriptor_.buffer_update_count; }
_ZNK5draco10DataBuffer9data_sizeEv:
   68|  48.6M|  size_t data_size() const { return data_.size(); }
_ZNK5draco10DataBuffer4dataEv:
   69|    118|  const uint8_t* data() const { return data_.data(); }
_ZN5draco10DataBuffer4dataEv:
   70|  1.37G|  uint8_t* data() { return data_.data(); }
_ZNK5draco10DataBuffer9buffer_idEv:
   71|  24.6k|  int64_t buffer_id() const { return descriptor_.buffer_id; }

_ZN5draco13DecoderBufferC2Ev:
   23|  63.1k|    : data_(nullptr),
   24|  63.1k|      data_size_(0),
   25|  63.1k|      pos_(0),
   26|  63.1k|      bit_mode_(false),
   27|  63.1k|      bitstream_version_(0) {}
_ZN5draco13DecoderBuffer4InitEPKcm:
   29|  20.5k|void DecoderBuffer::Init(const char* data, size_t data_size) {
   30|  20.5k|  Init(data, data_size, bitstream_version_);
   31|  20.5k|}
_ZN5draco13DecoderBuffer4InitEPKcmt:
   33|  36.3k|void DecoderBuffer::Init(const char* data, size_t data_size, uint16_t version) {
   34|  36.3k|  data_ = data;
   35|  36.3k|  data_size_ = data_size;
   36|  36.3k|  bitstream_version_ = version;
   37|  36.3k|  pos_ = 0;
   38|  36.3k|}
_ZN5draco13DecoderBuffer16StartBitDecodingEbPm:
   40|  10.3k|bool DecoderBuffer::StartBitDecoding(bool decode_size, uint64_t* out_size) {
   41|  10.3k|  if (decode_size) {
  ------------------
  |  Branch (41:7): [True: 7.33k, False: 3.03k]
  ------------------
   42|  7.33k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   43|  7.33k|    if (bitstream_version_ < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  7.33k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (43:9): [True: 1.64k, False: 5.69k]
  ------------------
   44|  1.64k|      if (!Decode(out_size)) {
  ------------------
  |  Branch (44:11): [True: 13, False: 1.62k]
  ------------------
   45|     13|        return false;
   46|     13|      }
   47|  1.64k|    } else
   48|  5.69k|#endif
   49|  5.69k|    {
   50|  5.69k|      if (!DecodeVarint(out_size, this)) {
  ------------------
  |  Branch (50:11): [True: 52, False: 5.64k]
  ------------------
   51|     52|        return false;
   52|     52|      }
   53|  5.69k|    }
   54|  7.33k|  }
   55|  10.3k|  bit_mode_ = true;
   56|  10.3k|  bit_decoder_.reset(data_head(), remaining_size());
   57|  10.3k|  return true;
   58|  10.3k|}
_ZN5draco13DecoderBuffer14EndBitDecodingEv:
   60|  8.61k|void DecoderBuffer::EndBitDecoding() {
   61|  8.61k|  bit_mode_ = false;
   62|  8.61k|  const uint64_t bits_decoded = bit_decoder_.BitsDecoded();
   63|  8.61k|  const uint64_t bytes_decoded = (bits_decoded + 7) / 8;
   64|  8.61k|  pos_ += bytes_decoded;
   65|  8.61k|}
_ZN5draco13DecoderBuffer10BitDecoderC2Ev:
   68|  63.1k|    : bit_buffer_(nullptr), bit_buffer_end_(nullptr), bit_offset_(0) {}
_ZN5draco13DecoderBuffer10BitDecoderD2Ev:
   70|   104k|DecoderBuffer::BitDecoder::~BitDecoder() = default;

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  7.83M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t* out_value) {
   58|  7.83M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 7.83M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  7.83M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  7.83M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  3.34G|  bool Decode(void* out_data, size_t size_to_decode) {
   77|  3.34G|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 580, False: 3.34G]
  ------------------
   78|    580|      return false;  // Buffer overflow.
   79|    580|    }
   80|  3.34G|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  3.34G|    pos_ += size_to_decode;
   82|  3.34G|    return true;
   83|  3.34G|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  47.7k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  20.4k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  66.7k|  const char* data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   355k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  8.96k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  7.83M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.79M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  10.3k|    void reset(const void* b, size_t s) {
  131|  10.3k|      bit_offset_ = 0;
  132|  10.3k|      bit_buffer_ = static_cast<const uint8_t*>(b);
  133|  10.3k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  10.3k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  8.61k|    uint64_t BitsDecoded() const { return static_cast<uint64_t>(bit_offset_); }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  158|  7.83M|    bool GetBits(uint32_t nbits, uint32_t* x) {
  159|  7.83M|      if (nbits > 32) {
  ------------------
  |  Branch (159:11): [True: 1, False: 7.83M]
  ------------------
  160|      1|        return false;
  161|      1|      }
  162|  7.83M|      uint32_t value = 0;
  163|  18.4M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (163:30): [True: 10.6M, False: 7.83M]
  ------------------
  164|  10.6M|        value |= GetBit() << bit;
  165|  10.6M|      }
  166|  7.83M|      *x = value;
  167|  7.83M|      return true;
  168|  7.83M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  173|  10.6M|    int GetBit() {
  174|  10.6M|      const size_t off = bit_offset_;
  175|  10.6M|      const size_t byte_offset = off >> 3;
  176|  10.6M|      const int bit_shift = static_cast<int>(off & 0x7);
  177|  10.6M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (177:11): [True: 9.59M, False: 1.01M]
  ------------------
  178|  9.59M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  179|  9.59M|        bit_offset_ = off + 1;
  180|  9.59M|        return bit;
  181|  9.59M|      }
  182|  1.01M|      return 0;
  183|  10.6M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  12.3M|  bool Decode(T* out_val) {
   69|  12.3M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 5.74k, False: 12.3M]
  ------------------
   70|  5.74k|      return false;
   71|  5.74k|    }
   72|  12.3M|    pos_ += sizeof(T);
   73|  12.3M|    return true;
   74|  12.3M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  12.3M|  bool Peek(T* out_val) {
   88|  12.3M|    const size_t size_to_decode = sizeof(T);
   89|  12.3M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 5.74k, False: 12.3M]
  ------------------
   90|  5.74k|      return false;  // Buffer overflow.
   91|  5.74k|    }
   92|  12.3M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  12.3M|    return true;
   94|  12.3M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  18.0k|  bool Decode(T* out_val) {
   69|  18.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 156, False: 17.8k]
  ------------------
   70|    156|      return false;
   71|    156|    }
   72|  17.8k|    pos_ += sizeof(T);
   73|  17.8k|    return true;
   74|  18.0k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  18.0k|  bool Peek(T* out_val) {
   88|  18.0k|    const size_t size_to_decode = sizeof(T);
   89|  18.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 156, False: 17.8k]
  ------------------
   90|    156|      return false;  // Buffer overflow.
   91|    156|    }
   92|  17.8k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  17.8k|    return true;
   94|  18.0k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   397k|  bool Decode(T* out_val) {
   69|   397k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 590, False: 396k]
  ------------------
   70|    590|      return false;
   71|    590|    }
   72|   396k|    pos_ += sizeof(T);
   73|   396k|    return true;
   74|   397k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   397k|  bool Peek(T* out_val) {
   88|   397k|    const size_t size_to_decode = sizeof(T);
   89|   397k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 590, False: 396k]
  ------------------
   90|    590|      return false;  // Buffer overflow.
   91|    590|    }
   92|   396k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   396k|    return true;
   94|   397k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  25.7k|  bool Decode(T* out_val) {
   69|  25.7k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 371, False: 25.4k]
  ------------------
   70|    371|      return false;
   71|    371|    }
   72|  25.4k|    pos_ += sizeof(T);
   73|  25.4k|    return true;
   74|  25.7k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  25.7k|  bool Peek(T* out_val) {
   88|  25.7k|    const size_t size_to_decode = sizeof(T);
   89|  25.7k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 371, False: 25.4k]
  ------------------
   90|    371|      return false;  // Buffer overflow.
   91|    371|    }
   92|  25.4k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  25.4k|    return true;
   94|  25.7k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   905k|  bool Decode(T* out_val) {
   69|   905k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 125, False: 905k]
  ------------------
   70|    125|      return false;
   71|    125|    }
   72|   905k|    pos_ += sizeof(T);
   73|   905k|    return true;
   74|   905k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   905k|  bool Peek(T* out_val) {
   88|   905k|    const size_t size_to_decode = sizeof(T);
   89|   905k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 125, False: 905k]
  ------------------
   90|    125|      return false;  // Buffer overflow.
   91|    125|    }
   92|   905k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   905k|    return true;
   94|   905k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  63.0k|  bool Decode(T* out_val) {
   69|  63.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 40, False: 63.0k]
  ------------------
   70|     40|      return false;
   71|     40|    }
   72|  63.0k|    pos_ += sizeof(T);
   73|  63.0k|    return true;
   74|  63.0k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  63.0k|  bool Peek(T* out_val) {
   88|  63.0k|    const size_t size_to_decode = sizeof(T);
   89|  63.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 40, False: 63.0k]
  ------------------
   90|     40|      return false;  // Buffer overflow.
   91|     40|    }
   92|  63.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  63.0k|    return true;
   94|  63.0k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  2.03k|  bool Decode(T* out_val) {
   69|  2.03k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 51, False: 1.98k]
  ------------------
   70|     51|      return false;
   71|     51|    }
   72|  1.98k|    pos_ += sizeof(T);
   73|  1.98k|    return true;
   74|  2.03k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  2.03k|  bool Peek(T* out_val) {
   88|  2.03k|    const size_t size_to_decode = sizeof(T);
   89|  2.03k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 51, False: 1.98k]
  ------------------
   90|     51|      return false;  // Buffer overflow.
   91|     51|    }
   92|  1.98k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.98k|    return true;
   94|  2.03k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|  1.14k|  bool Decode(T* out_val) {
   69|  1.14k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 12, False: 1.13k]
  ------------------
   70|     12|      return false;
   71|     12|    }
   72|  1.13k|    pos_ += sizeof(T);
   73|  1.13k|    return true;
   74|  1.14k|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|  1.14k|  bool Peek(T* out_val) {
   88|  1.14k|    const size_t size_to_decode = sizeof(T);
   89|  1.14k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 12, False: 1.13k]
  ------------------
   90|     12|      return false;  // Buffer overflow.
   91|     12|    }
   92|  1.13k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.13k|    return true;
   94|  1.14k|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   487M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   498M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  11.7M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  11.7M|    return value_ >= val;
  100|  11.7M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   267M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  3.26G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  26.7M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  95.6M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  95.6M|    value_ = i.value_;
  153|  95.6M|    return *this;
  154|  95.6M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  2.83G|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  2.83G|    value_ = i.value_;
  153|  2.83G|    return *this;
  154|  2.83G|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  26.7M|  inline ThisIndexType& operator++() {
  103|  26.7M|    ++value_;
  104|  26.7M|    return *this;
  105|  26.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.42G|  constexpr bool operator==(const IndexType& i) const {
   76|  2.42G|    return value_ == i.value_;
   77|  2.42G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   993M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  7.58k|  constexpr bool operator<(const IndexType& i) const {
   88|  7.58k|    return value_ < i.value_;
   89|  7.58k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   118M|  constexpr bool operator==(const IndexType& i) const {
   76|   118M|    return value_ == i.value_;
   77|   118M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   183M|  constexpr ThisIndexType operator-(const ValueTypeT& val) const {
  132|   183M|    return ThisIndexType(value_ - val);
  133|   183M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   721M|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|   721M|    return ThisIndexType(value_ + val);
  127|   721M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  22.0M|  constexpr bool operator==(const IndexType& i) const {
   76|  22.0M|    return value_ == i.value_;
   77|  22.0M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   258M|  constexpr bool operator!=(const IndexType& i) const {
   82|   258M|    return value_ != i.value_;
   83|   258M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   342M|  constexpr bool operator!=(const IndexType& i) const {
   82|   342M|    return value_ != i.value_;
   83|   342M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   507M|  inline ThisIndexType& operator++() {
  103|   507M|    ++value_;
  104|   507M|    return *this;
  105|   507M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   426M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|   426M|    value_ = i.value_;
  153|   426M|    return *this;
  154|   426M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.07G|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  1.07G|    value_ = i.value_;
  153|  1.07G|    return *this;
  154|  1.07G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  44.7M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|  44.7M|    return value_ >= val;
  100|  44.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  10.2M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.10G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  21.6G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   198M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  16.6G|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   266M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  17.3M|  constexpr ThisIndexType operator+(const ValueTypeT& val) const {
  126|  17.3M|    return ThisIndexType(value_ + val);
  127|  17.3M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   170M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  28.7M|  constexpr bool operator<(const IndexType& i) const {
   88|  28.7M|    return value_ < i.value_;
   89|  28.7M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   629M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  2.83G|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  72.0M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   466M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   688M|  constexpr IndexType(const IndexType& i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  5.95M|  inline ThisIndexType& operator=(const ThisIndexType& i) {
  152|  5.95M|    value_ = i.value_;
  153|  5.95M|    return *this;
  154|  5.95M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  10.2M|  inline ThisIndexType operator+=(const ValueTypeT& val) {
  140|  10.2M|    value_ += val;
  141|  10.2M|    return *this;
  142|  10.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  35.3M|  inline ThisIndexType& operator=(const ValueTypeT& val) {
  156|  35.3M|    value_ = val;
  157|  35.3M|    return *this;
  158|  35.3M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  2.79G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  6.66M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  6.65M|  inline ThisIndexType& operator++() {
  103|  6.65M|    ++value_;
  104|  6.65M|    return *this;
  105|  6.65M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  24.6M|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    219|  constexpr bool operator<(const ValueTypeT& val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   365M|  inline ThisIndexType& operator++() {
  103|   365M|    ++value_;
  104|   365M|    return *this;
  105|   365M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|    118|  inline ThisIndexType& operator++() {
  103|    118|    ++value_;
  104|    118|    return *this;
  105|    118|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   388M|  constexpr bool operator>=(const ValueTypeT& val) const {
   99|   388M|    return value_ >= val;
  100|   388M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  40.8M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  40.8M|    return vector_[index.value()];
   75|  40.8M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  24.6M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  15.3k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  17.9k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  69.4M|  inline reference operator[](const IndexTypeT& index) {
   71|  69.4M|    return vector_[index.value()];
   72|  69.4M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  4.29k|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  23.6M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  5.51k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  11.7M|  inline reference operator[](const IndexTypeT& index) {
   71|  11.7M|    return vector_[index.value()];
   72|  11.7M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  26.3M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  26.3M|    return vector_[index.value()];
   75|  26.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   216M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  12.8M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   312M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|   312M|    return vector_[index.value()];
   75|   312M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   879M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|   879M|    return vector_[index.value()];
   75|   879M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   389M|  inline reference operator[](const IndexTypeT& index) {
   71|   389M|    return vector_[index.value()];
   72|   389M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  50.1M|  inline const_reference operator[](const IndexTypeT& index) const {
   74|  50.1M|    return vector_[index.value()];
   75|  50.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   312M|  inline reference operator[](const IndexTypeT& index) {
   71|   312M|    return vector_[index.value()];
   72|   312M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   110M|  void push_back(const ValueTypeT& val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   229M|  inline reference operator[](const IndexTypeT& index) {
   71|   229M|    return vector_[index.value()];
   72|   229M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  3.09k|  void resize(size_t size, const ValueTypeT& val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   271M|  inline reference operator[](const IndexTypeT& index) {
   71|   271M|    return vector_[index.value()];
   72|   271M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  85.2k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.58M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  80.6k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  9.93k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  9.93k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  9.93k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  9.93k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  19.4k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  19.4k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  19.4k|    vector_.swap(arg.vector_);
   57|  19.4k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  19.4k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  19.4k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT>& arg) {
   56|  19.4k|    vector_.swap(arg.vector_);
   57|  19.4k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  9.92k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  9.92k|  void assign(size_t size, const ValueTypeT& val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  9.92k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  17.0k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  40.6k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  78.4k|int32_t DataTypeLength(DataType dt) {
   20|  78.4k|  switch (dt) {
   21|  19.1k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 19.1k, False: 59.2k]
  ------------------
   22|  26.3k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 7.19k, False: 71.2k]
  ------------------
   23|  26.3k|      return 1;
   24|  4.34k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 4.34k, False: 74.0k]
  ------------------
   25|  10.8k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 6.45k, False: 71.9k]
  ------------------
   26|  10.8k|      return 2;
   27|  31.2k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 31.2k, False: 47.1k]
  ------------------
   28|  33.6k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 2.37k, False: 76.0k]
  ------------------
   29|  33.6k|      return 4;
   30|    848|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 848, False: 77.5k]
  ------------------
   31|  1.51k|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 667, False: 77.7k]
  ------------------
   32|  1.51k|      return 8;
   33|  5.38k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 5.38k, False: 73.0k]
  ------------------
   34|  5.38k|      return 4;
   35|    118|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 118, False: 78.2k]
  ------------------
   36|    118|      return 8;
   37|    635|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 635, False: 77.7k]
  ------------------
   38|    635|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 78.4k]
  ------------------
   40|      0|      return -1;
   41|  78.4k|  }
   42|  78.4k|}

_ZN5draco13AddAsUnsignedIiTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEES3_S3_S3_:
   14|  92.0M|inline DataTypeT AddAsUnsigned(DataTypeT a, DataTypeT b) {
   15|  92.0M|  typedef typename std::make_unsigned<DataTypeT>::type DataTypeUT;
   16|  92.0M|  return static_cast<DataTypeT>(static_cast<DataTypeUT>(a) +
   17|  92.0M|                                static_cast<DataTypeUT>(b));
   18|  92.0M|}

_ZN5draco7IntSqrtEm:
   31|  2.94k|inline uint64_t IntSqrt(uint64_t number) {
   32|  2.94k|  if (number == 0) {
  ------------------
  |  Branch (32:7): [True: 246, False: 2.69k]
  ------------------
   33|    246|    return 0;
   34|    246|  }
   35|       |  // First estimate good initial value of the square root as log2(number).
   36|  2.69k|  uint64_t act_number = number;
   37|  2.69k|  uint64_t square_root = 1;
   38|  44.6k|  while (act_number >= 2) {
  ------------------
  |  Branch (38:10): [True: 41.9k, False: 2.69k]
  ------------------
   39|       |    // Double the square root until |square_root * square_root > number|.
   40|  41.9k|    square_root *= 2;
   41|  41.9k|    act_number /= 4;
   42|  41.9k|  }
   43|       |  // Perform Newton's (or Babylonian) method to find the true floor(sqrt()).
   44|  6.85k|  do {
   45|       |    // New |square_root| estimate is computed as the average between
   46|       |    // |square_root| and |number / square_root|.
   47|  6.85k|    square_root = (square_root + number / square_root) / 2;
   48|       |
   49|       |    // Note that after the first iteration, the estimate is always going to be
   50|       |    // larger or equal to the true square root value. Therefore to check
   51|       |    // convergence, we can simply detect condition when the square of the
   52|       |    // estimated square root is larger than the input.
   53|  6.85k|  } while (square_root * square_root > number);
  ------------------
  |  Branch (53:12): [True: 4.16k, False: 2.69k]
  ------------------
   54|  2.69k|  return square_root;
   55|  2.94k|}

_ZNK5draco7Options6GetIntERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEi:
   48|  3.00k|int Options::GetInt(const std::string& name, int default_val) const {
   49|  3.00k|  const auto it = options_.find(name);
   50|  3.00k|  if (it == options_.end()) {
  ------------------
  |  Branch (50:7): [True: 3.00k, False: 0]
  ------------------
   51|  3.00k|    return default_val;
   52|  3.00k|  }
   53|      0|  return std::atoi(it->second.c_str());
   54|  3.00k|}
_ZNK5draco7Options7GetBoolERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEb:
   72|  3.00k|bool Options::GetBool(const std::string& name, bool default_val) const {
   73|  3.00k|  const int ret = GetInt(name, -1);
   74|  3.00k|  if (ret == -1) {
  ------------------
  |  Branch (74:7): [True: 3.00k, False: 0]
  ------------------
   75|  3.00k|    return default_val;
   76|  3.00k|  }
   77|      0|  return static_cast<bool>(ret);
   78|  3.00k|}

_ZN5draco7OptionsC2Ev:
   32|  20.5k|  Options() = default;
_ZN5draco7OptionsD2Ev:
   33|  20.5k|  ~Options() = default;

_ZN5draco11DequantizerC2Ev:
   27|    142|Dequantizer::Dequantizer() : delta_(1.f) {}
_ZN5draco11Dequantizer4InitEfi:
   29|    142|bool Dequantizer::Init(float range, int32_t max_quantized_value) {
   30|    142|  if (max_quantized_value <= 0) {
  ------------------
  |  Branch (30:7): [True: 9, False: 133]
  ------------------
   31|      9|    return false;
   32|      9|  }
   33|    133|  delta_ = range / static_cast<float>(max_quantized_value);
   34|    133|  return true;
   35|    142|}

_ZNK5draco11Dequantizer15DequantizeFloatEi:
   71|  39.5M|  inline float DequantizeFloat(int32_t val) const {
   72|  39.5M|    return static_cast<float>(val) * delta_;
   73|  39.5M|  }
_ZNK5draco11DequantizerclEi:
   74|    177|  inline float operator()(int32_t val) const { return DequantizeFloat(val); }

_ZN5draco6StatusC2ENS0_4CodeE:
   41|   107k|  explicit Status(Code code) : code_(code) {}
_ZN5draco6StatusC2ENS0_4CodeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
   43|  18.9k|      : code_(code), error_msg_(error_msg) {}
_ZNK5draco6Status2okEv:
   52|   144k|  bool ok() const { return code_ == OK; }
_ZN5draco8OkStatusEv:
   66|   107k|inline Status OkStatus() { return Status(Status::OK); }
_ZN5draco6StatusC2ERKS0_:
   39|  19.0k|  Status(const Status& status) = default;

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  3.46k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      9|  StatusOr(const Status& status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  17.0k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|     10|  StatusOr(const Status& status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|     61|  StatusOr(const Status& status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  20.4k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  20.5k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|     61|  const Status& status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  18.9k|  StatusOr(const Status& status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  20.4k|  T&& value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.61k|  StatusOr(T&& value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  3.47k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      9|  const Status& status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  3.46k|  T&& value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  17.0k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|     10|  const Status& status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  17.0k|  T&& value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   627k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|   627k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 627k, Folded]
  ------------------
   65|   627k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 2.17k, False: 625k]
  ------------------
   66|  2.17k|      return false;
   67|  2.17k|    }
   68|   627k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|   625k|  return true;
   77|   627k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   229k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   229k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   229k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 119, False: 229k]
  ------------------
   33|    119|    return false;
   34|    119|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   229k|  uint8_t in;
   39|   229k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1.29k, False: 228k]
  ------------------
   40|  1.29k|    return false;
   41|  1.29k|  }
   42|   228k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 32.2k, False: 195k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  32.2k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 806, False: 31.4k]
  ------------------
   45|    806|      return false;
   46|    806|    }
   47|       |    // Append decoded info from this byte.
   48|  31.4k|    *out_val <<= 7;
   49|  31.4k|    *out_val |= in & ((1 << 7) - 1);
   50|   195k|  } else {
   51|       |    // Last byte reached
   52|   195k|    *out_val = in;
   53|   195k|  }
   54|   227k|  return true;
   55|   228k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  15.3k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  15.3k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  15.3k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 15.3k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  15.3k|  uint8_t in;
   39|  15.3k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 52, False: 15.2k]
  ------------------
   40|     52|    return false;
   41|     52|  }
   42|  15.2k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.53k, False: 12.7k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.53k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 42, False: 2.49k]
  ------------------
   45|     42|      return false;
   46|     42|    }
   47|       |    // Append decoded info from this byte.
   48|  2.49k|    *out_val <<= 7;
   49|  2.49k|    *out_val |= in & ((1 << 7) - 1);
   50|  12.7k|  } else {
   51|       |    // Last byte reached
   52|  12.7k|    *out_val = in;
   53|  12.7k|  }
   54|  15.2k|  return true;
   55|  15.2k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  10.1k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|  10.1k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 10.1k, Folded]
  ------------------
   65|  10.1k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 175, False: 10.0k]
  ------------------
   66|    175|      return false;
   67|    175|    }
   68|  10.1k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  10.0k|  return true;
   77|  10.1k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  6.08k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  6.08k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.08k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 6.07k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.07k|  uint8_t in;
   39|  6.07k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 51, False: 6.02k]
  ------------------
   40|     51|    return false;
   41|     51|  }
   42|  6.02k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 385, False: 5.64k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    385|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 39, False: 346]
  ------------------
   45|     39|      return false;
   46|     39|    }
   47|       |    // Append decoded info from this byte.
   48|    346|    *out_val <<= 7;
   49|    346|    *out_val |= in & ((1 << 7) - 1);
   50|  5.64k|  } else {
   51|       |    // Last byte reached
   52|  5.64k|    *out_val = in;
   53|  5.64k|  }
   54|  5.98k|  return true;
   55|  6.02k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   326k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|   326k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   326k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 18, False: 326k]
  ------------------
   33|     18|    return false;
   34|     18|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   326k|  uint8_t in;
   39|   326k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 218, False: 326k]
  ------------------
   40|    218|    return false;
   41|    218|  }
   42|   326k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.27k, False: 324k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.27k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 136, False: 2.14k]
  ------------------
   45|    136|      return false;
   46|    136|    }
   47|       |    // Append decoded info from this byte.
   48|  2.14k|    *out_val <<= 7;
   49|  2.14k|    *out_val |= in & ((1 << 7) - 1);
   50|   324k|  } else {
   51|       |    // Last byte reached
   52|   324k|    *out_val = in;
   53|   324k|  }
   54|   326k|  return true;
   55|   326k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  3.09k|bool DecodeVarint(IntTypeT* out_val, DecoderBuffer* buffer) {
   64|  3.09k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 3.09k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  3.09k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  3.09k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  3.09k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 50, False: 3.04k]
  ------------------
   72|     50|      return false;
   73|     50|    }
   74|  3.04k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  3.04k|  }
   76|  3.04k|  return true;
   77|  3.09k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.90k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  3.90k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.90k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 3.89k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.89k|  uint8_t in;
   39|  3.89k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 45, False: 3.85k]
  ------------------
   40|     45|    return false;
   41|     45|  }
   42|  3.85k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 805, False: 3.04k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    805|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 46, False: 759]
  ------------------
   45|     46|      return false;
   46|     46|    }
   47|       |    // Append decoded info from this byte.
   48|    759|    *out_val <<= 7;
   49|    759|    *out_val |= in & ((1 << 7) - 1);
   50|  3.04k|  } else {
   51|       |    // Last byte reached
   52|  3.04k|    *out_val = in;
   53|  3.04k|  }
   54|  3.80k|  return true;
   55|  3.85k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  5.24k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  5.24k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.24k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 5.24k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  5.24k|  uint8_t in;
   39|  5.24k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 35, False: 5.20k]
  ------------------
   40|     35|    return false;
   41|     35|  }
   42|  5.20k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 851, False: 4.35k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    851|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 42, False: 809]
  ------------------
   45|     42|      return false;
   46|     42|    }
   47|       |    // Append decoded info from this byte.
   48|    809|    *out_val <<= 7;
   49|    809|    *out_val |= in & ((1 << 7) - 1);
   50|  4.35k|  } else {
   51|       |    // Last byte reached
   52|  4.35k|    *out_val = in;
   53|  4.35k|  }
   54|  5.16k|  return true;
   55|  5.20k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  37.0k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  37.0k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  37.0k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 37.0k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  37.0k|  uint8_t in;
   39|  37.0k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 55, False: 37.0k]
  ------------------
   40|     55|    return false;
   41|     55|  }
   42|  37.0k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 717, False: 36.3k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    717|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 62, False: 655]
  ------------------
   45|     62|      return false;
   46|     62|    }
   47|       |    // Append decoded info from this byte.
   48|    655|    *out_val <<= 7;
   49|    655|    *out_val |= in & ((1 << 7) - 1);
   50|  36.3k|  } else {
   51|       |    // Last byte reached
   52|  36.3k|    *out_val = in;
   53|  36.3k|  }
   54|  36.9k|  return true;
   55|  37.0k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  12.2k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  12.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  12.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 120, False: 12.1k]
  ------------------
   33|    120|    return false;
   34|    120|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  12.1k|  uint8_t in;
   39|  12.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 148, False: 11.9k]
  ------------------
   40|    148|    return false;
   41|    148|  }
   42|  11.9k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.99k, False: 8.98k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.99k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 656, False: 2.34k]
  ------------------
   45|    656|      return false;
   46|    656|    }
   47|       |    // Append decoded info from this byte.
   48|  2.34k|    *out_val <<= 7;
   49|  2.34k|    *out_val |= in & ((1 << 7) - 1);
   50|  8.98k|  } else {
   51|       |    // Last byte reached
   52|  8.98k|    *out_val = in;
   53|  8.98k|  }
   54|  11.3k|  return true;
   55|  11.9k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  9.66k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  9.66k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  9.66k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 56, False: 9.61k]
  ------------------
   33|     56|    return false;
   34|     56|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  9.61k|  uint8_t in;
   39|  9.61k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 67, False: 9.54k]
  ------------------
   40|     67|    return false;
   41|     67|  }
   42|  9.54k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 5.18k, False: 4.36k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  5.18k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 718, False: 4.46k]
  ------------------
   45|    718|      return false;
   46|    718|    }
   47|       |    // Append decoded info from this byte.
   48|  4.46k|    *out_val <<= 7;
   49|  4.46k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.46k|  } else {
   51|       |    // Last byte reached
   52|  4.36k|    *out_val = in;
   53|  4.36k|  }
   54|  8.82k|  return true;
   55|  9.54k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  46.8k|bool DecodeVarintUnsigned(int depth, IntTypeT* out_val, DecoderBuffer* buffer) {
   31|  46.8k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  46.8k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 46.7k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  46.7k|  uint8_t in;
   39|  46.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 94, False: 46.6k]
  ------------------
   40|     94|    return false;
   41|     94|  }
   42|  46.6k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.73k, False: 42.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.73k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 73, False: 3.65k]
  ------------------
   45|     73|      return false;
   46|     73|    }
   47|       |    // Append decoded info from this byte.
   48|  3.65k|    *out_val <<= 7;
   49|  3.65k|    *out_val |= in & ((1 << 7) - 1);
   50|  42.9k|  } else {
   51|       |    // Last byte reached
   52|  42.9k|    *out_val = in;
   53|  42.9k|  }
   54|  46.6k|  return true;
   55|  46.6k|}

_ZN5draco7VectorDIfLi3EEC2Ev:
   42|   156k|  VectorD() {
   43|   627k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 470k, False: 156k]
  ------------------
   44|   470k|      (*this)[i] = Scalar(0);
   45|   470k|    }
   46|   156k|  }
_ZN5draco7VectorDIfLi3EEixEi:
  114|   755k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEixEi:
  115|   574k|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEixEi:
  114|  2.68G|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   61|     59|      : v_({{c0, c1, c2}}) {
   62|     59|    DRACO_DCHECK_EQ(dimension, 3);
   63|     59|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  115|   120M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  139|  13.3M|  Self operator-(const Self& o) const {
  140|  13.3M|    Self ret;
  141|  53.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 40.0M, False: 13.3M]
  ------------------
  142|  40.0M|      ret[i] = (*this)[i] - o[i];
  143|  40.0M|    }
  144|  13.3M|    return ret;
  145|  13.3M|  }
_ZN5draco12CrossProductIlTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEENS_7VectorDIS3_Li3EEERKS9_SB_:
  325|  6.64M|                                 const VectorD<ScalarT, 3>& v) {
  326|       |  // Preventing accidental use with uint32_t and the like.
  327|  6.64M|  static_assert(std::is_signed<ScalarT>::value,
  328|  6.64M|                "ScalarT must be a signed type. ");
  329|  6.64M|  VectorD<ScalarT, 3> r;
  330|  6.64M|  typedef typename std::make_unsigned<ScalarT>::type ScalarUT;
  331|  6.64M|  const ScalarUT u0 = static_cast<ScalarUT>(u[0]);
  332|  6.64M|  const ScalarUT u1 = static_cast<ScalarUT>(u[1]);
  333|  6.64M|  const ScalarUT u2 = static_cast<ScalarUT>(u[2]);
  334|  6.64M|  const ScalarUT v0 = static_cast<ScalarUT>(v[0]);
  335|  6.64M|  const ScalarUT v1 = static_cast<ScalarUT>(v[1]);
  336|  6.64M|  const ScalarUT v2 = static_cast<ScalarUT>(v[2]);
  337|  6.64M|  r[0] = static_cast<ScalarT>((u1 * v2) - (u2 * v1));
  338|  6.64M|  r[1] = static_cast<ScalarT>((u2 * v0) - (u0 * v2));
  339|  6.64M|  r[2] = static_cast<ScalarT>((u0 * v1) - (u1 * v0));
  340|  6.64M|  return r;
  341|  6.64M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  284|  6.64M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  285|  6.64M|  const Scalar* data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  239|  2.68M|  Scalar AbsSum() const {
  240|  2.68M|    Scalar result(0);
  241|  10.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (241:21): [True: 8.05M, False: 2.67M]
  ------------------
  242|  8.05M|      Scalar next_value = std::abs(v_[i]);
  243|  8.05M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (243:11): [True: 9.57k, False: 8.04M]
  ------------------
  244|       |        // Return the max if adding would have caused an overflow.
  245|  9.57k|        return std::numeric_limits<Scalar>::max();
  246|  9.57k|      }
  247|  8.04M|      result += next_value;
  248|  8.04M|    }
  249|  2.67M|    return result;
  250|  2.68M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  184|   216k|  Self operator/(const Scalar& o) const {
  185|   216k|    Self ret;
  186|   864k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (186:21): [True: 648k, False: 216k]
  ------------------
  187|   648k|      ret[i] = (*this)[i] / o;
  188|   648k|    }
  189|   216k|    return ret;
  190|   216k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  114|   201M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  114|  13.9M|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  284|  8.05M|  Scalar* data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  122|  2.33M|  Self operator-() const {
  123|  2.33M|    Self ret;
  124|  9.32M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (124:21): [True: 6.99M, False: 2.33M]
  ------------------
  125|  6.99M|      ret[i] = -(*this)[i];
  126|  6.99M|    }
  127|  2.33M|    return ret;
  128|  2.33M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  115|  6.99M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  139|  70.6M|  Self operator-(const Self& o) const {
  140|  70.6M|    Self ret;
  141|   212M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 141M, False: 70.6M]
  ------------------
  142|   141M|      ret[i] = (*this)[i] - o[i];
  143|   141M|    }
  144|  70.6M|    return ret;
  145|  70.6M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  114|   848M|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  115|  1.27G|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  114|  1.33G|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  131|   141M|  Self operator+(const Self& o) const {
  132|   141M|    Self ret;
  133|   424M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 282M, False: 141M]
  ------------------
  134|   282M|      ret[i] = (*this)[i] + o[i];
  135|   282M|    }
  136|   141M|    return ret;
  137|   141M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  115|  1.53G|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  139|  19.5M|  Self operator-(const Self& o) const {
  140|  19.5M|    Self ret;
  141|  58.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 39.1M, False: 19.5M]
  ------------------
  142|  39.1M|      ret[i] = (*this)[i] - o[i];
  143|  39.1M|    }
  144|  19.5M|    return ret;
  145|  19.5M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  131|  19.5M|  Self operator+(const Self& o) const {
  132|  19.5M|    Self ret;
  133|  58.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 39.1M, False: 19.5M]
  ------------------
  134|  39.1M|      ret[i] = (*this)[i] + o[i];
  135|  39.1M|    }
  136|  19.5M|    return ret;
  137|  19.5M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  208|   452k|  bool operator==(const Self& o) const {
  209|  1.29M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 875k, False: 421k]
  ------------------
  210|   875k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 31.1k, False: 844k]
  ------------------
  211|  31.1k|        return false;
  212|  31.1k|      }
  213|   875k|    }
  214|   421k|    return true;
  215|   452k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  115|  5.43M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  139|  62.9k|  Self operator-(const Self& o) const {
  140|  62.9k|    Self ret;
  141|   251k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 188k, False: 62.9k]
  ------------------
  142|   188k|      ret[i] = (*this)[i] - o[i];
  143|   188k|    }
  144|  62.9k|    return ret;
  145|  62.9k|  }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  236|  31.8k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  252|  32.5k|  Scalar Dot(const Self& o) const {
  253|  32.5k|    Scalar ret(0);
  254|   130k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 97.5k, False: 32.5k]
  ------------------
  255|  97.5k|      ret += (*this)[i] * o[i];
  256|  97.5k|    }
  257|  32.5k|    return ret;
  258|  32.5k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  176|    714|  Self operator*(const Scalar& o) const {
  177|    714|    Self ret;
  178|  2.85k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 2.14k, False: 714]
  ------------------
  179|  2.14k|      ret[i] = (*this)[i] * o;
  180|  2.14k|    }
  181|    714|    return ret;
  182|    714|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  139|  31.1k|  Self operator-(const Self& o) const {
  140|  31.1k|    Self ret;
  141|  93.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 62.2k, False: 31.1k]
  ------------------
  142|  62.2k|      ret[i] = (*this)[i] - o[i];
  143|  62.2k|    }
  144|  31.1k|    return ret;
  145|  31.1k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   42|  62.2k|  VectorD() {
   43|   186k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 124k, False: 62.2k]
  ------------------
   44|   124k|      (*this)[i] = Scalar(0);
   45|   124k|    }
   46|  62.2k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   54|   936k|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|   936k|    DRACO_DCHECK_EQ(dimension, 2);
   56|   936k|    v_[0] = c0;
   57|   936k|    v_[1] = c1;
   58|   936k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  114|   248k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  208|   328k|  bool operator==(const Self& o) const {
  209|   881k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (209:21): [True: 605k, False: 276k]
  ------------------
  210|   605k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (210:11): [True: 52.7k, False: 553k]
  ------------------
  211|  52.7k|        return false;
  212|  52.7k|      }
  213|   605k|    }
  214|   276k|    return true;
  215|   328k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  115|  1.82M|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   42|  39.0M|  VectorD() {
   43|   156M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 117M, False: 39.0M]
  ------------------
   44|   117M|      (*this)[i] = Scalar(0);
   45|   117M|    }
   46|  39.0M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  236|  55.7k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  252|  58.8k|  Scalar Dot(const Self& o) const {
  253|  58.8k|    Scalar ret(0);
  254|   235k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (254:21): [True: 176k, False: 58.8k]
  ------------------
  255|   176k|      ret += (*this)[i] * o[i];
  256|   176k|    }
  257|  58.8k|    return ret;
  258|  58.8k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  139|  3.14k|  Self operator-(const Self& o) const {
  140|  3.14k|    Self ret;
  141|  9.44k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 6.29k, False: 3.14k]
  ------------------
  142|  6.29k|      ret[i] = (*this)[i] - o[i];
  143|  6.29k|    }
  144|  3.14k|    return ret;
  145|  3.14k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  104|  11.6k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  34.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 23.2k, False: 11.6k]
  ------------------
  106|  23.2k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 23.2k, False: 0]
  ------------------
  107|  23.2k|        v_[i] = Scalar(src_vector[i]);
  108|  23.2k|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  23.2k|    }
  112|  11.6k|  }
_ZNK5draco7VectorDImLi2EEmlERKm:
  176|  5.94k|  Self operator*(const Scalar& o) const {
  177|  5.94k|    Self ret;
  178|  17.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 11.8k, False: 5.94k]
  ------------------
  179|  11.8k|      ret[i] = (*this)[i] * o;
  180|  11.8k|    }
  181|  5.94k|    return ret;
  182|  5.94k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   42|  11.7k|  VectorD() {
   43|  35.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 23.4k, False: 11.7k]
  ------------------
   44|  23.4k|      (*this)[i] = Scalar(0);
   45|  23.4k|    }
   46|  11.7k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  115|  46.7k|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  114|  46.9k|  Scalar& operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  131|  4.75k|  Self operator+(const Self& o) const {
  132|  4.75k|    Self ret;
  133|  14.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 9.50k, False: 4.75k]
  ------------------
  134|  9.50k|      ret[i] = (*this)[i] + o[i];
  135|  9.50k|    }
  136|  4.75k|    return ret;
  137|  4.75k|  }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  104|  5.80k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  17.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 11.6k, False: 5.80k]
  ------------------
  106|  11.6k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 11.6k, False: 0]
  ------------------
  107|  11.6k|        v_[i] = Scalar(src_vector[i]);
  108|  11.6k|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|  11.6k|    }
  112|  5.80k|  }
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  131|  2.94k|  Self operator+(const Self& o) const {
  132|  2.94k|    Self ret;
  133|  11.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (133:21): [True: 8.82k, False: 2.94k]
  ------------------
  134|  8.82k|      ret[i] = (*this)[i] + o[i];
  135|  8.82k|    }
  136|  2.94k|    return ret;
  137|  2.94k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  294|  2.94k|    const ScalarT& o, const VectorD<ScalarT, dimension_t>& v) {
  295|  2.94k|  return v * o;
  296|  2.94k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  176|  2.94k|  Self operator*(const Scalar& o) const {
  177|  2.94k|    Self ret;
  178|  11.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 8.82k, False: 2.94k]
  ------------------
  179|  8.82k|      ret[i] = (*this)[i] * o;
  180|  8.82k|    }
  181|  2.94k|    return ret;
  182|  2.94k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   54|   660k|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|   660k|    DRACO_DCHECK_EQ(dimension, 2);
   56|   660k|    v_[0] = c0;
   57|   660k|    v_[1] = c1;
   58|   660k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  176|  2.94k|  Self operator*(const Scalar& o) const {
  177|  2.94k|    Self ret;
  178|  8.82k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (178:21): [True: 5.88k, False: 2.94k]
  ------------------
  179|  5.88k|      ret[i] = (*this)[i] * o;
  180|  5.88k|    }
  181|  2.94k|    return ret;
  182|  2.94k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   42|  11.8k|  VectorD() {
   43|  35.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 23.7k, False: 11.8k]
  ------------------
   44|  23.7k|      (*this)[i] = Scalar(0);
   45|  23.7k|    }
   46|  11.8k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  184|  2.83k|  Self operator/(const Scalar& o) const {
  185|  2.83k|    Self ret;
  186|  8.51k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (186:21): [True: 5.67k, False: 2.83k]
  ------------------
  187|  5.67k|      ret[i] = (*this)[i] / o;
  188|  5.67k|    }
  189|  2.83k|    return ret;
  190|  2.83k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  139|  1.05k|  Self operator-(const Self& o) const {
  140|  1.05k|    Self ret;
  141|  3.17k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (141:21): [True: 2.11k, False: 1.05k]
  ------------------
  142|  2.11k|      ret[i] = (*this)[i] - o[i];
  143|  2.11k|    }
  144|  1.05k|    return ret;
  145|  1.05k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  114|  47.2k|  Scalar& operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   42|  2.33M|  VectorD() {
   43|  9.33M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 6.99M, False: 2.33M]
  ------------------
   44|  6.99M|      (*this)[i] = Scalar(0);
   45|  6.99M|    }
   46|  2.33M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   54|   314M|  VectorD(const Scalar& c0, const Scalar& c1) : v_({{c0, c1}}) {
   55|   314M|    DRACO_DCHECK_EQ(dimension, 2);
   56|   314M|    v_[0] = c0;
   57|   314M|    v_[1] = c1;
   58|   314M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  104|   424M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|  1.27G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 848M, False: 424M]
  ------------------
  106|   848M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 848M, False: 0]
  ------------------
  107|   848M|        v_[i] = Scalar(src_vector[i]);
  108|   848M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|   848M|    }
  112|   424M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   42|   212M|  VectorD() {
   43|   636M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 424M, False: 212M]
  ------------------
   44|   424M|      (*this)[i] = Scalar(0);
   45|   424M|    }
   46|   212M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  104|   212M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t>& src_vector) {
  105|   636M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (105:21): [True: 424M, False: 212M]
  ------------------
  106|   424M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (106:11): [True: 424M, False: 0]
  ------------------
  107|   424M|        v_[i] = Scalar(src_vector[i]);
  108|   424M|      } else {
  109|      0|        v_[i] = Scalar(0);
  110|      0|      }
  111|   424M|    }
  112|   212M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   90|   153M|  VectorD(const Self& o) {
   91|   459M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (91:21): [True: 306M, False: 153M]
  ------------------
   92|   306M|      (*this)[i] = o[i];
   93|   306M|    }
   94|   153M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   42|  39.1M|  VectorD() {
   43|   117M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (43:21): [True: 78.2M, False: 39.1M]
  ------------------
   44|  78.2M|      (*this)[i] = Scalar(0);
   45|  78.2M|    }
   46|  39.1M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   90|   893M|  VectorD(const Self& o) {
   91|  3.57G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (91:21): [True: 2.68G, False: 893M]
  ------------------
   92|  2.68G|      (*this)[i] = o[i];
   93|  2.68G|    }
   94|   893M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  115|  2.68G|  const Scalar& operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   61|   398M|      : v_({{c0, c1, c2}}) {
   62|   398M|    DRACO_DCHECK_EQ(dimension, 3);
   63|   398M|  }

_ZN5draco11CornerTableC2Ev:
   26|  9.93k|    : num_original_vertices_(0),
   27|  9.93k|      num_degenerated_faces_(0),
   28|  9.93k|      num_isolated_vertices_(0),
   29|  9.93k|      valence_cache_(*this) {}
_ZN5draco11CornerTable5ResetEii:
   66|  9.93k|bool CornerTable::Reset(int num_faces, int num_vertices) {
   67|  9.93k|  if (num_faces < 0 || num_vertices < 0) {
  ------------------
  |  Branch (67:7): [True: 0, False: 9.93k]
  |  Branch (67:24): [True: 3, False: 9.92k]
  ------------------
   68|      3|    return false;
   69|      3|  }
   70|  9.92k|  const unsigned int num_faces_unsigned = num_faces;
   71|  9.92k|  if (num_faces_unsigned >
  ------------------
  |  Branch (71:7): [True: 0, False: 9.92k]
  ------------------
   72|  9.92k|      std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
   73|      0|    return false;
   74|      0|  }
   75|  9.92k|  corner_to_vertex_map_.assign(num_faces_unsigned * 3, kInvalidVertexIndex);
   76|  9.92k|  opposite_corners_.assign(num_faces_unsigned * 3, kInvalidCornerIndex);
   77|  9.92k|  vertex_corners_.reserve(num_vertices);
   78|  9.92k|  valence_cache_.ClearValenceCache();
   79|  9.92k|  valence_cache_.ClearValenceCacheInaccurate();
   80|  9.92k|  return true;
   81|  9.92k|}

_ZNK5draco11CornerTable12num_verticesEv:
   73|   105M|  inline int num_vertices() const {
   74|   105M|    return static_cast<int>(vertex_corners_.size());
   75|   105M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  10.2M|  inline int num_corners() const {
   77|  10.2M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  10.2M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.59M|  inline int num_faces() const {
   80|  2.59M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.59M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   312M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   312M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 312M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   312M|    return opposite_corners_[corner];
   88|   312M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   519M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   519M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 11.8M, False: 507M]
  ------------------
   91|  11.8M|      return corner;
   92|  11.8M|    }
   93|   507M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 459M, False: 47.7M]
  ------------------
   94|   519M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   474M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   474M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 4.20M, False: 470M]
  ------------------
   97|  4.20M|      return corner;
   98|  4.20M|    }
   99|   470M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 135M, False: 335M]
  ------------------
  100|   474M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   879M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   879M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 879M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   879M|    return ConfidentVertex(corner);
  106|   879M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   879M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   879M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   879M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   879M|    return corner_to_vertex_map_[corner];
  111|   879M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  38.4M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  38.4M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 38.4M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  38.4M|    return FaceIndex(corner.value() / 3);
  117|  38.4M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   977M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  50.1M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  50.1M|    return vertex_corners_[v];
  152|  50.1M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.17M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.17M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.17M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 31.5k, False: 1.14M]
  ------------------
  188|  31.5k|      return true;
  189|  31.5k|    }
  190|  1.14M|    return false;
  191|  1.17M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  77.7M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  77.7M|    return Previous(Opposite(Previous(corner)));
  202|  77.7M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  10.9M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  10.9M|    return Next(Opposite(Next(corner)));
  207|  10.9M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  3.76M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  3.76M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 3.76M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  3.76M|    return Opposite(Previous(corner_id));
  222|  3.76M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  4.90M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  4.90M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 4.90M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  4.90M|    return Opposite(Next(corner_id));
  228|  4.90M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   312M|                                CornerIndex opp_corner_id) {
  249|   312M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   312M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   312M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   389M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   389M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   389M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   389M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   110M|  VertexIndex AddNewVertex() {
  271|   110M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   110M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   110M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   110M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   228M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   228M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   228M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 228M, False: 0]
  ------------------
  295|   228M|      vertex_corners_[vert] = corner;
  296|   228M|    }
  297|   228M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  1.01M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  1.01M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  1.01M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  1.01M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  7.03k|      : corner_table_(table),
  229|  7.03k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  7.03k|        corner_(start_corner_),
  231|  7.03k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.25M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  24.1k|  VertexCornersIterator& operator++() {
  268|  24.1k|    Next();
  269|  24.1k|    return *this;
  270|  24.1k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.63M|  void Next() {
  248|  3.63M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.60M, False: 31.1k]
  ------------------
  249|  3.60M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.60M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 24.1k, False: 3.57M]
  ------------------
  251|       |        // Open boundary reached.
  252|  24.1k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  24.1k|        left_traversal_ = false;
  254|  3.57M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 596k, False: 2.98M]
  ------------------
  255|       |        // End reached.
  256|   596k|        corner_ = kInvalidCornerIndex;
  257|   596k|      }
  258|  3.60M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  31.1k|      corner_ = corner_table_->SwingRight(corner_);
  262|  31.1k|    }
  263|  3.63M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.42M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  5.10M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  5.14M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  3.03M|  void Next() {
  248|  3.03M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.01M, False: 25.9k]
  ------------------
  249|  3.01M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.01M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.88M, False: 1.12M]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.88M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.88M|        left_traversal_ = false;
  254|  1.88M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 184k, False: 938k]
  ------------------
  255|       |        // End reached.
  256|   184k|        corner_ = kInvalidCornerIndex;
  257|   184k|      }
  258|  3.01M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  25.9k|      corner_ = corner_table_->SwingRight(corner_);
  262|  25.9k|    }
  263|  3.03M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  2.07M|      : corner_table_(table),
  236|  2.07M|        start_corner_(corner_id),
  237|  2.07M|        corner_(start_corner_),
  238|  2.07M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   613k|      : corner_table_(table),
  236|   613k|        start_corner_(corner_id),
  237|   613k|        corner_(start_corner_),
  238|   613k|        left_traversal_(true) {}

_ZN5draco4MeshC2Ev:
   33|  17.0k|Mesh::Mesh() {}

_ZN5draco4Mesh7AddFaceERKNSt3__15arrayINS_9IndexTypeIjNS_20PointIndex_tag_type_EEELm3EEE:
   74|  4.29k|  void AddFace(const Face& face) { faces_.push_back(face); }
_ZN5draco4Mesh7SetFaceENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEERKNSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEE:
   76|  11.7M|  void SetFace(FaceIndex face_id, const Face& face) {
   77|  11.7M|    if (face_id >= static_cast<uint32_t>(faces_.size())) {
  ------------------
  |  Branch (77:9): [True: 0, False: 11.7M]
  ------------------
   78|      0|      faces_.resize(face_id.value() + 1, Face());
   79|      0|    }
   80|  11.7M|    faces_[face_id] = face;
   81|  11.7M|  }
_ZN5draco4Mesh11SetNumFacesEm:
   85|  5.51k|  void SetNumFaces(size_t num_faces) { faces_.resize(num_faces, Face()); }
_ZNK5draco4Mesh9num_facesEv:
   87|  11.8M|  FaceIndex::ValueType num_faces() const {
   88|  11.8M|    return static_cast<uint32_t>(faces_.size());
   89|  11.8M|  }
_ZNK5draco4Mesh4faceENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   90|  26.3M|  const Face& face(FaceIndex face_id) const {
   91|  26.3M|    DRACO_DCHECK_LE(0, face_id.value());
   92|  26.3M|    DRACO_DCHECK_LT(face_id.value(), static_cast<int>(faces_.size()));
   93|  26.3M|    return faces_[face_id];
   94|  26.3M|  }
_ZN5draco4Mesh12SetAttributeEiNSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   96|  16.3k|  void SetAttribute(int att_id, std::unique_ptr<PointAttribute> pa) override {
   97|  16.3k|    PointCloud::SetAttribute(att_id, std::move(pa));
   98|  16.3k|    if (static_cast<int>(attribute_data_.size()) <= att_id) {
  ------------------
  |  Branch (98:9): [True: 16.3k, False: 0]
  ------------------
   99|  16.3k|      attribute_data_.resize(att_id + 1);
  100|  16.3k|    }
  101|  16.3k|  }
_ZN5draco4Mesh13AttributeDataC2Ev:
  170|  16.3k|    AttributeData() : element_type(MESH_CORNER_ATTRIBUTE) {}

_ZN5draco24MeshAttributeCornerTableC2Ev:
   23|  51.2k|    : no_interior_seams_(true), corner_table_(nullptr), valence_cache_(*this) {}
_ZN5draco24MeshAttributeCornerTable9InitEmptyEPKNS_11CornerTableE:
   25|  9.52k|bool MeshAttributeCornerTable::InitEmpty(const CornerTable* table) {
   26|  9.52k|  if (table == nullptr) {
  ------------------
  |  Branch (26:7): [True: 0, False: 9.52k]
  ------------------
   27|      0|    return false;
   28|      0|  }
   29|  9.52k|  valence_cache_.ClearValenceCache();
   30|  9.52k|  valence_cache_.ClearValenceCacheInaccurate();
   31|  9.52k|  is_edge_on_seam_.assign(table->num_corners(), false);
   32|  9.52k|  is_vertex_on_seam_.assign(table->num_vertices(), false);
   33|  9.52k|  corner_to_vertex_map_.assign(table->num_corners(), kInvalidVertexIndex);
   34|  9.52k|  vertex_to_attribute_entry_id_map_.reserve(table->num_vertices());
   35|  9.52k|  vertex_to_left_most_corner_map_.reserve(table->num_vertices());
   36|  9.52k|  corner_table_ = table;
   37|  9.52k|  no_interior_seams_ = true;
   38|  9.52k|  return true;
   39|  9.52k|}
_ZN5draco24MeshAttributeCornerTable11AddSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  108|  16.5M|void MeshAttributeCornerTable::AddSeamEdge(CornerIndex c) {
  109|  16.5M|  DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  110|  16.5M|  is_edge_on_seam_[c.value()] = true;
  111|       |  // Mark seam vertices.
  112|  16.5M|  is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Next(c)).value()] =
  113|  16.5M|      true;
  114|  16.5M|  is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Previous(c))
  115|  16.5M|                         .value()] = true;
  116|       |
  117|  16.5M|  const CornerIndex opp_corner = corner_table_->Opposite(c);
  118|  16.5M|  if (opp_corner != kInvalidCornerIndex) {
  ------------------
  |  Branch (118:7): [True: 15.9M, False: 568k]
  ------------------
  119|  15.9M|    no_interior_seams_ = false;
  120|  15.9M|    is_edge_on_seam_[opp_corner.value()] = true;
  121|  15.9M|    is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Next(opp_corner))
  122|  15.9M|                           .value()] = true;
  123|  15.9M|    is_vertex_on_seam_
  124|  15.9M|        [corner_table_->Vertex(corner_table_->Previous(opp_corner)).value()] =
  125|  15.9M|            true;
  126|  15.9M|  }
  127|  16.5M|}
_ZN5draco24MeshAttributeCornerTable17RecomputeVerticesEPKNS_4MeshEPKNS_14PointAttributeE:
  130|  9.52k|                                                 const PointAttribute* att) {
  131|  9.52k|  DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  132|  9.52k|  if (mesh != nullptr && att != nullptr) {
  ------------------
  |  Branch (132:7): [True: 0, False: 9.52k]
  |  Branch (132:26): [True: 0, False: 0]
  ------------------
  133|      0|    return RecomputeVerticesInternal<true>(mesh, att);
  134|  9.52k|  } else {
  135|  9.52k|    return RecomputeVerticesInternal<false>(nullptr, nullptr);
  136|  9.52k|  }
  137|  9.52k|}
_ZN5draco24MeshAttributeCornerTable25RecomputeVerticesInternalILb0EEEbPKNS_4MeshEPKNS_14PointAttributeE:
  141|  9.52k|    const Mesh* mesh, const PointAttribute* att) {
  142|  9.52k|  DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  143|  9.52k|  vertex_to_attribute_entry_id_map_.clear();
  144|  9.52k|  vertex_to_left_most_corner_map_.clear();
  145|  9.52k|  int num_new_vertices = 0;
  146|  6.66M|  for (VertexIndex v(0); v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (146:26): [True: 6.65M, False: 9.52k]
  ------------------
  147|  6.65M|    const CornerIndex c = corner_table_->LeftMostCorner(v);
  148|  6.65M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (148:9): [True: 47.4k, False: 6.60M]
  ------------------
  149|  47.4k|      continue;  // Isolated vertex?
  150|  47.4k|    }
  151|  6.60M|    AttributeValueIndex first_vert_id(num_new_vertices++);
  152|  6.60M|    if (init_vertex_to_attribute_entry_map) {
  ------------------
  |  Branch (152:9): [Folded, False: 6.60M]
  ------------------
  153|      0|      const PointIndex point_id = mesh->CornerToPointId(c.value());
  154|      0|      vertex_to_attribute_entry_id_map_.push_back(att->mapped_index(point_id));
  155|  6.60M|    } else {
  156|       |      // Identity mapping
  157|  6.60M|      vertex_to_attribute_entry_id_map_.push_back(first_vert_id);
  158|  6.60M|    }
  159|  6.60M|    CornerIndex first_c = c;
  160|  6.60M|    CornerIndex act_c;
  161|       |    // Check if the vertex is on a seam edge, if it is we need to find the first
  162|       |    // attribute entry on the seam edge when traversing in the CCW direction.
  163|  6.60M|    if (is_vertex_on_seam_[v.value()]) {
  ------------------
  |  Branch (163:9): [True: 5.78M, False: 819k]
  ------------------
  164|       |      // Try to swing left on the modified corner table. We need to get the
  165|       |      // first corner that defines an attribute seam.
  166|  5.78M|      act_c = SwingLeft(first_c);
  167|  5.89M|      while (act_c != kInvalidCornerIndex) {
  ------------------
  |  Branch (167:14): [True: 108k, False: 5.78M]
  ------------------
  168|   108k|        first_c = act_c;
  169|   108k|        act_c = SwingLeft(act_c);
  170|   108k|        if (act_c == c) {
  ------------------
  |  Branch (170:13): [True: 0, False: 108k]
  ------------------
  171|       |          // We reached the initial corner which shouldn't happen when we swing
  172|       |          // left from |c|.
  173|      0|          return false;
  174|      0|        }
  175|   108k|      }
  176|  5.78M|    }
  177|  6.60M|    corner_to_vertex_map_[first_c.value()] = VertexIndex(first_vert_id.value());
  178|  6.60M|    vertex_to_left_most_corner_map_.push_back(first_c);
  179|  6.60M|    act_c = corner_table_->SwingRight(first_c);
  180|  37.5M|    while (act_c != kInvalidCornerIndex && act_c != first_c) {
  ------------------
  |  Branch (180:12): [True: 36.9M, False: 573k]
  |  Branch (180:44): [True: 30.9M, False: 6.03M]
  ------------------
  181|  30.9M|      if (IsCornerOppositeToSeamEdge(corner_table_->Next(act_c))) {
  ------------------
  |  Branch (181:11): [True: 26.2M, False: 4.65M]
  ------------------
  182|  26.2M|        first_vert_id = AttributeValueIndex(num_new_vertices++);
  183|  26.2M|        if (init_vertex_to_attribute_entry_map) {
  ------------------
  |  Branch (183:13): [Folded, False: 26.2M]
  ------------------
  184|      0|          const PointIndex point_id = mesh->CornerToPointId(act_c.value());
  185|      0|          vertex_to_attribute_entry_id_map_.push_back(
  186|      0|              att->mapped_index(point_id));
  187|  26.2M|        } else {
  188|       |          // Identity mapping.
  189|  26.2M|          vertex_to_attribute_entry_id_map_.push_back(first_vert_id);
  190|  26.2M|        }
  191|  26.2M|        vertex_to_left_most_corner_map_.push_back(act_c);
  192|  26.2M|      }
  193|  30.9M|      corner_to_vertex_map_[act_c.value()] = VertexIndex(first_vert_id.value());
  194|  30.9M|      act_c = corner_table_->SwingRight(act_c);
  195|  30.9M|    }
  196|  6.60M|  }
  197|  9.52k|  return true;
  198|  9.52k|}

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  59.1M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  59.1M|    return is_edge_on_seam_[corner.value()];
   47|  59.1M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  28.2M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  28.2M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 28.2M]
  |  Branch (50:42): [True: 23.1M, False: 5.10M]
  ------------------
   51|  23.1M|      return kInvalidCornerIndex;
   52|  23.1M|    }
   53|  5.10M|    return corner_table_->Opposite(corner);
   54|  28.2M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  40.1M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  40.1M|    return corner_table_->Next(corner);
   58|  40.1M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  21.9M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  21.9M|    return corner_table_->Previous(corner);
   62|  21.9M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  5.04M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  5.04M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  5.04M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.36M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.36M|    return Opposite(Previous(corner));
   73|  3.36M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  3.90M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  3.90M|    return Opposite(Next(corner));
   76|  3.90M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  3.86M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  3.86M|    return Previous(Opposite(Previous(corner)));
   81|  3.86M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  12.7M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  12.7M|    return Next(Opposite(Next(corner)));
   86|  12.7M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  14.0k|  int num_vertices() const {
   89|  14.0k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  14.0k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  4.55k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.88k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   102M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   102M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   102M|    return ConfidentVertex(corner);
   97|   102M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   102M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   102M|    return corner_to_vertex_map_[corner.value()];
  100|   102M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.35M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.35M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.35M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.35M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.35M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.35M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.35M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.35M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.82M, False: 533k]
  ------------------
  128|  2.82M|      return true;
  129|  2.82M|    }
  130|   533k|    return false;
  131|  3.35M|  }

_ZN5draco12ValenceCacheINS_11CornerTableEEC2ERKS1_:
   35|  9.93k|  explicit ValenceCache(const CornerTableT& table) : table_(table) {}
_ZNK5draco12ValenceCacheINS_11CornerTableEE17ClearValenceCacheEv:
  123|  9.92k|  void ClearValenceCache() const {
  124|  9.92k|    vertex_valence_cache_32_bit_.clear();
  125|       |    // Force erasure.
  126|  9.92k|    IndexTypeVector<VertexIndex, int32_t>().swap(vertex_valence_cache_32_bit_);
  127|  9.92k|  }
_ZNK5draco12ValenceCacheINS_11CornerTableEE27ClearValenceCacheInaccurateEv:
  118|  9.92k|  void ClearValenceCacheInaccurate() const {
  119|  9.92k|    vertex_valence_cache_8_bit_.clear();
  120|       |    // Force erasure.
  121|  9.92k|    IndexTypeVector<VertexIndex, int8_t>().swap(vertex_valence_cache_8_bit_);
  122|  9.92k|  }
_ZN5draco12ValenceCacheINS_24MeshAttributeCornerTableEEC2ERKS1_:
   35|  51.2k|  explicit ValenceCache(const CornerTableT& table) : table_(table) {}
_ZNK5draco12ValenceCacheINS_24MeshAttributeCornerTableEE17ClearValenceCacheEv:
  123|  9.52k|  void ClearValenceCache() const {
  124|  9.52k|    vertex_valence_cache_32_bit_.clear();
  125|       |    // Force erasure.
  126|  9.52k|    IndexTypeVector<VertexIndex, int32_t>().swap(vertex_valence_cache_32_bit_);
  127|  9.52k|  }
_ZNK5draco12ValenceCacheINS_24MeshAttributeCornerTableEE27ClearValenceCacheInaccurateEv:
  118|  9.52k|  void ClearValenceCacheInaccurate() const {
  119|  9.52k|    vertex_valence_cache_8_bit_.clear();
  120|       |    // Force erasure.
  121|  9.52k|    IndexTypeVector<VertexIndex, int8_t>().swap(vertex_valence_cache_8_bit_);
  122|  9.52k|  }

_ZN5draco16GeometryMetadata20AddAttributeMetadataENSt3__110unique_ptrINS_17AttributeMetadataENS1_14default_deleteIS3_EEEE:
   50|  1.65k|    std::unique_ptr<AttributeMetadata> att_metadata) {
   51|  1.65k|  if (!att_metadata) {
  ------------------
  |  Branch (51:7): [True: 0, False: 1.65k]
  ------------------
   52|      0|    return false;
   53|      0|  }
   54|  1.65k|  att_metadatas_.push_back(std::move(att_metadata));
   55|  1.65k|  return true;
   56|  1.65k|}

_ZN5draco17AttributeMetadataC2Ev:
   27|  2.18k|  AttributeMetadata() : att_unique_id_(0) {}
_ZN5draco17AttributeMetadata17set_att_unique_idEj:
   32|  2.18k|  void set_att_unique_id(uint32_t att_unique_id) {
   33|  2.18k|    att_unique_id_ = att_unique_id;
   34|  2.18k|  }
_ZN5draco16GeometryMetadataC2Ev:
   60|  1.23k|  GeometryMetadata() {}

_ZN5draco10EntryValueC2ERKS0_:
   21|   313k|EntryValue::EntryValue(const EntryValue& value) {
   22|   313k|  data_.resize(value.data_.size());
   23|   313k|  memcpy(&data_[0], &value.data_[0], value.data_.size());
   24|   313k|}
_ZN5draco8Metadata14AddEntryBinaryERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_6vectorIhNS5_IhEEEE:
   97|   156k|                              const std::vector<uint8_t>& value) {
   98|   156k|  AddEntry(name, value);
   99|   156k|}
_ZN5draco8Metadata14AddSubMetadataERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_10unique_ptrIS0_NS1_14default_deleteIS0_EEEE:
  107|  79.7k|                              std::unique_ptr<Metadata> sub_metadata) {
  108|  79.7k|  auto sub_ptr = sub_metadatas_.find(name);
  109|       |  // Avoid accidentally writing over a sub-metadata with the same name.
  110|  79.7k|  if (sub_ptr != sub_metadatas_.end()) {
  ------------------
  |  Branch (110:7): [True: 37, False: 79.6k]
  ------------------
  111|     37|    return false;
  112|     37|  }
  113|  79.6k|  sub_metadatas_[name] = std::move(sub_metadata);
  114|  79.6k|  return true;
  115|  79.7k|}

_ZN5draco8MetadataC2Ev:
   98|  83.1k|  Metadata() {}
_ZN5draco8Metadata8AddEntryINSt3__16vectorIhNS2_9allocatorIhEEEEEEvRKNS2_12basic_stringIcNS2_11char_traitsIcEENS4_IcEEEERKT_:
  164|   156k|  void AddEntry(const std::string& entry_name, const DataTypeT& entry_value) {
  165|   156k|    const auto itr = entries_.find(entry_name);
  166|   156k|    if (itr != entries_.end()) {
  ------------------
  |  Branch (166:9): [True: 144k, False: 12.3k]
  ------------------
  167|   144k|      entries_.erase(itr);
  168|   144k|    }
  169|   156k|    entries_.insert(std::make_pair(entry_name, EntryValue(entry_value)));
  170|   156k|  }
_ZN5draco10EntryValueC2IhEERKNSt3__16vectorIT_NS2_9allocatorIS4_EEEE:
   41|   156k|  explicit EntryValue(const std::vector<DataTypeT>& data) {
   42|   156k|    const size_t total_size = sizeof(DataTypeT) * data.size();
   43|   156k|    data_.resize(total_size);
   44|   156k|    memcpy(&data_[0], &data[0], total_size);
   45|   156k|  }

_ZN5draco15MetadataDecoderC2Ev:
   23|  1.23k|MetadataDecoder::MetadataDecoder() : buffer_(nullptr) {}
_ZN5draco15MetadataDecoder22DecodeGeometryMetadataEPNS_13DecoderBufferEPNS_16GeometryMetadataE:
   35|  1.23k|                                             GeometryMetadata* metadata) {
   36|  1.23k|  if (!metadata) {
  ------------------
  |  Branch (36:7): [True: 0, False: 1.23k]
  ------------------
   37|      0|    return false;
   38|      0|  }
   39|  1.23k|  buffer_ = in_buffer;
   40|  1.23k|  uint32_t num_att_metadata = 0;
   41|  1.23k|  if (!DecodeVarint(&num_att_metadata, buffer_)) {
  ------------------
  |  Branch (41:7): [True: 24, False: 1.21k]
  ------------------
   42|     24|    return false;
   43|     24|  }
   44|       |  // Decode attribute metadata.
   45|  2.86k|  for (uint32_t i = 0; i < num_att_metadata; ++i) {
  ------------------
  |  Branch (45:24): [True: 2.23k, False: 634]
  ------------------
   46|  2.23k|    uint32_t att_unique_id;
   47|  2.23k|    if (!DecodeVarint(&att_unique_id, buffer_)) {
  ------------------
  |  Branch (47:9): [True: 43, False: 2.18k]
  ------------------
   48|     43|      return false;
   49|     43|    }
   50|  2.18k|    std::unique_ptr<AttributeMetadata> att_metadata =
   51|  2.18k|        std::unique_ptr<AttributeMetadata>(new AttributeMetadata());
   52|  2.18k|    att_metadata->set_att_unique_id(att_unique_id);
   53|  2.18k|    if (!DecodeMetadata(static_cast<Metadata*>(att_metadata.get()))) {
  ------------------
  |  Branch (53:9): [True: 533, False: 1.65k]
  ------------------
   54|    533|      return false;
   55|    533|    }
   56|  1.65k|    metadata->AddAttributeMetadata(std::move(att_metadata));
   57|  1.65k|  }
   58|    634|  return DecodeMetadata(static_cast<Metadata*>(metadata));
   59|  1.21k|}
_ZN5draco15MetadataDecoder14DecodeMetadataEPNS_8MetadataE:
   61|  2.82k|bool MetadataDecoder::DecodeMetadata(Metadata* metadata) {
   62|       |  // Limit metadata nesting depth to avoid stack overflow in destructor.
   63|  2.82k|  constexpr int kMaxSubmetadataLevel = 1000;
   64|       |
   65|  2.82k|  struct MetadataTuple {
   66|  2.82k|    Metadata* parent_metadata;
   67|  2.82k|    Metadata* decoded_metadata;
   68|  2.82k|    int level;
   69|  2.82k|  };
   70|  2.82k|  std::vector<MetadataTuple> metadata_stack;
   71|  2.82k|  metadata_stack.push_back({nullptr, metadata, 0});
   72|  84.3k|  while (!metadata_stack.empty()) {
  ------------------
  |  Branch (72:10): [True: 82.5k, False: 1.76k]
  ------------------
   73|  82.5k|    const MetadataTuple mp = metadata_stack.back();
   74|  82.5k|    metadata_stack.pop_back();
   75|  82.5k|    metadata = mp.decoded_metadata;
   76|       |
   77|  82.5k|    if (mp.parent_metadata != nullptr) {
  ------------------
  |  Branch (77:9): [True: 79.7k, False: 2.82k]
  ------------------
   78|  79.7k|      if (mp.level > kMaxSubmetadataLevel) {
  ------------------
  |  Branch (78:11): [True: 3, False: 79.7k]
  ------------------
   79|      3|        return false;
   80|      3|      }
   81|  79.7k|      std::string sub_metadata_name;
   82|  79.7k|      if (!DecodeName(&sub_metadata_name)) {
  ------------------
  |  Branch (82:11): [True: 51, False: 79.7k]
  ------------------
   83|     51|        return false;
   84|     51|      }
   85|  79.7k|      std::unique_ptr<Metadata> sub_metadata =
   86|  79.7k|          std::unique_ptr<Metadata>(new Metadata());
   87|  79.7k|      metadata = sub_metadata.get();
   88|  79.7k|      if (!mp.parent_metadata->AddSubMetadata(sub_metadata_name,
  ------------------
  |  Branch (88:11): [True: 37, False: 79.6k]
  ------------------
   89|  79.7k|                                              std::move(sub_metadata))) {
   90|     37|        return false;
   91|     37|      }
   92|  79.7k|    }
   93|  82.4k|    if (metadata == nullptr) {
  ------------------
  |  Branch (93:9): [True: 0, False: 82.4k]
  ------------------
   94|      0|      return false;
   95|      0|    }
   96|       |
   97|  82.4k|    uint32_t num_entries = 0;
   98|  82.4k|    if (!DecodeVarint(&num_entries, buffer_)) {
  ------------------
  |  Branch (98:9): [True: 45, False: 82.4k]
  ------------------
   99|     45|      return false;
  100|     45|    }
  101|   238k|    for (uint32_t i = 0; i < num_entries; ++i) {
  ------------------
  |  Branch (101:26): [True: 157k, False: 81.6k]
  ------------------
  102|   157k|      if (!DecodeEntry(metadata)) {
  ------------------
  |  Branch (102:11): [True: 775, False: 156k]
  ------------------
  103|    775|        return false;
  104|    775|      }
  105|   157k|    }
  106|  81.6k|    uint32_t num_sub_metadata = 0;
  107|  81.6k|    if (!DecodeVarint(&num_sub_metadata, buffer_)) {
  ------------------
  |  Branch (107:9): [True: 32, False: 81.6k]
  ------------------
  108|     32|      return false;
  109|     32|    }
  110|  81.6k|    if (num_sub_metadata > buffer_->remaining_size()) {
  ------------------
  |  Branch (110:9): [True: 110, False: 81.5k]
  ------------------
  111|       |      // The decoded number of metadata items is unreasonably high.
  112|    110|      return false;
  113|    110|    }
  114|   898k|    for (uint32_t i = 0; i < num_sub_metadata; ++i) {
  ------------------
  |  Branch (114:26): [True: 816k, False: 81.5k]
  ------------------
  115|   816k|      metadata_stack.push_back(
  116|   816k|          {metadata, nullptr, mp.parent_metadata ? mp.level + 1 : mp.level});
  ------------------
  |  Branch (116:31): [True: 809k, False: 7.87k]
  ------------------
  117|   816k|    }
  118|  81.5k|  }
  119|  1.76k|  return true;
  120|  2.82k|}
_ZN5draco15MetadataDecoder11DecodeEntryEPNS_8MetadataE:
  122|   157k|bool MetadataDecoder::DecodeEntry(Metadata* metadata) {
  123|   157k|  std::string entry_name;
  124|   157k|  if (!DecodeName(&entry_name)) {
  ------------------
  |  Branch (124:7): [True: 436, False: 156k]
  ------------------
  125|    436|    return false;
  126|    436|  }
  127|   156k|  uint32_t data_size = 0;
  128|   156k|  if (!DecodeVarint(&data_size, buffer_)) {
  ------------------
  |  Branch (128:7): [True: 92, False: 156k]
  ------------------
  129|     92|    return false;
  130|     92|  }
  131|   156k|  if (data_size == 0) {
  ------------------
  |  Branch (131:7): [True: 97, False: 156k]
  ------------------
  132|     97|    return false;
  133|     97|  }
  134|   156k|  if (data_size > buffer_->remaining_size()) {
  ------------------
  |  Branch (134:7): [True: 150, False: 156k]
  ------------------
  135|    150|    return false;
  136|    150|  }
  137|   156k|  std::vector<uint8_t> entry_value(data_size);
  138|   156k|  if (!buffer_->Decode(&entry_value[0], data_size)) {
  ------------------
  |  Branch (138:7): [True: 0, False: 156k]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|   156k|  metadata->AddEntryBinary(entry_name, entry_value);
  142|   156k|  return true;
  143|   156k|}
_ZN5draco15MetadataDecoder10DecodeNameEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  145|   237k|bool MetadataDecoder::DecodeName(std::string* name) {
  146|   237k|  uint8_t name_len = 0;
  147|   237k|  if (!buffer_->Decode(&name_len)) {
  ------------------
  |  Branch (147:7): [True: 193, False: 236k]
  ------------------
  148|    193|    return false;
  149|    193|  }
  150|   236k|  name->resize(name_len);
  151|   236k|  if (name_len == 0) {
  ------------------
  |  Branch (151:7): [True: 29.5k, False: 207k]
  ------------------
  152|  29.5k|    return true;
  153|  29.5k|  }
  154|   207k|  if (!buffer_->Decode(&name->at(0), name_len)) {
  ------------------
  |  Branch (154:7): [True: 294, False: 206k]
  ------------------
  155|    294|    return false;
  156|    294|  }
  157|   206k|  return true;
  158|   207k|}

_ZN5draco10PointCloudC2Ev:
   27|  20.4k|PointCloud::PointCloud() : num_points_(0) {}
_ZNK5draco10PointCloud18NumNamedAttributesENS_17GeometryAttribute4TypeE:
   62|  2.56k|int32_t PointCloud::NumNamedAttributes(GeometryAttribute::Type type) const {
   63|  2.56k|  if (type == GeometryAttribute::INVALID ||
  ------------------
  |  Branch (63:7): [True: 0, False: 2.56k]
  ------------------
   64|  2.56k|      type >= GeometryAttribute::NAMED_ATTRIBUTES_COUNT) {
  ------------------
  |  Branch (64:7): [True: 0, False: 2.56k]
  ------------------
   65|      0|    return 0;
   66|      0|  }
   67|  2.56k|  return static_cast<int32_t>(named_attribute_index_[type].size());
   68|  2.56k|}
_ZNK5draco10PointCloud19GetNamedAttributeIdENS_17GeometryAttribute4TypeE:
   70|  2.56k|int32_t PointCloud::GetNamedAttributeId(GeometryAttribute::Type type) const {
   71|  2.56k|  return GetNamedAttributeId(type, 0);
   72|  2.56k|}
_ZNK5draco10PointCloud19GetNamedAttributeIdENS_17GeometryAttribute4TypeEi:
   75|  2.56k|                                        int i) const {
   76|  2.56k|  if (NumNamedAttributes(type) <= i) {
  ------------------
  |  Branch (76:7): [True: 9, False: 2.55k]
  ------------------
   77|      9|    return -1;
   78|      9|  }
   79|  2.55k|  return named_attribute_index_[type][i];
   80|  2.56k|}
_ZN5draco10PointCloud12AddAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
  140|  30.4k|int PointCloud::AddAttribute(std::unique_ptr<PointAttribute> pa) {
  141|  30.4k|  SetAttribute(static_cast<int>(attributes_.size()), std::move(pa));
  142|  30.4k|  return static_cast<int>(attributes_.size() - 1);
  143|  30.4k|}
_ZN5draco10PointCloud12SetAttributeEiNSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
  178|  30.4k|void PointCloud::SetAttribute(int att_id, std::unique_ptr<PointAttribute> pa) {
  179|  30.4k|  DRACO_DCHECK(att_id >= 0);
  180|  30.4k|  if (static_cast<int>(attributes_.size()) <= att_id) {
  ------------------
  |  Branch (180:7): [True: 30.4k, False: 0]
  ------------------
  181|  30.4k|    attributes_.resize(att_id + 1);
  182|  30.4k|  }
  183|  30.4k|  if (pa->attribute_type() < GeometryAttribute::NAMED_ATTRIBUTES_COUNT) {
  ------------------
  |  Branch (183:7): [True: 30.4k, False: 0]
  ------------------
  184|  30.4k|    named_attribute_index_[pa->attribute_type()].push_back(att_id);
  185|  30.4k|  }
  186|  30.4k|  pa->set_unique_id(att_id);
  187|  30.4k|  attributes_[att_id] = std::move(pa);
  188|  30.4k|}

_ZNK5draco10PointCloud14num_attributesEv:
   78|  2.55k|  int32_t num_attributes() const {
   79|  2.55k|    return static_cast<int32_t>(attributes_.size());
   80|  2.55k|  }
_ZNK5draco10PointCloud9attributeEi:
   81|  13.9k|  const PointAttribute* attribute(int32_t att_id) const {
   82|  13.9k|    DRACO_DCHECK_LE(0, att_id);
   83|  13.9k|    DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
   84|  13.9k|    return attributes_[att_id].get();
   85|  13.9k|  }
_ZN5draco10PointCloud9attributeEi:
   89|  67.5k|  PointAttribute* attribute(int32_t att_id) {
   90|  67.5k|    DRACO_DCHECK_LE(0, att_id);
   91|  67.5k|    DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
   92|  67.5k|    return attributes_[att_id].get();
   93|  67.5k|  }
_ZN5draco10PointCloud11AddMetadataENSt3__110unique_ptrINS_16GeometryMetadataENS1_14default_deleteIS3_EEEE:
  144|    114|  void AddMetadata(std::unique_ptr<GeometryMetadata> metadata) {
  145|    114|    metadata_ = std::move(metadata);
  146|    114|  }
_ZNK5draco10PointCloud10num_pointsEv:
  198|  53.1k|  PointIndex::ValueType num_points() const { return num_points_; }
_ZN5draco10PointCloud14set_num_pointsEj:
  203|  9.44k|  void set_num_points(PointIndex::ValueType num) { num_points_ = num; }
_ZN5draco10PointCloudD2Ev:
   39|  20.4k|  virtual ~PointCloud() = default;

LLVMFuzzerTestOneInput:
   21|  20.5k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   22|  20.5k|  draco::DecoderBuffer buffer;
   23|  20.5k|  buffer.Init(reinterpret_cast<const char*>(data), size);
   24|       |
   25|  20.5k|  draco::Decoder decoder;
   26|  20.5k|  decoder.DecodePointCloudFromBuffer(&buffer);
   27|       |
   28|  20.5k|  return 0;
   29|  20.5k|}

