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

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

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

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

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

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

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

_ZN5draco17GeometryAttributeC2Ev:
   20|  29.6k|    : buffer_(nullptr),
   21|  29.6k|      num_components_(1),
   22|  29.6k|      data_type_(DT_FLOAT32),
   23|  29.6k|      byte_stride_(0),
   24|  29.6k|      byte_offset_(0),
   25|  29.6k|      attribute_type_(INVALID),
   26|  29.6k|      unique_id_(0) {}
_ZN5draco17GeometryAttribute4InitENS0_4TypeEPNS_10DataBufferEhNS_8DataTypeEbll:
   31|  29.6k|                             int64_t byte_stride, int64_t byte_offset) {
   32|  29.6k|  buffer_ = buffer;
   33|  29.6k|  if (buffer) {
  ------------------
  |  Branch (33:7): [True: 0, False: 29.6k]
  ------------------
   34|      0|    buffer_descriptor_.buffer_id = buffer->buffer_id();
   35|      0|    buffer_descriptor_.buffer_update_count = buffer->update_count();
   36|      0|  }
   37|  29.6k|  num_components_ = num_components;
   38|  29.6k|  data_type_ = data_type;
   39|  29.6k|  normalized_ = normalized;
   40|  29.6k|  byte_stride_ = byte_stride;
   41|  29.6k|  byte_offset_ = byte_offset;
   42|  29.6k|  attribute_type_ = attribute_type;
   43|  29.6k|}
_ZN5draco17GeometryAttribute8CopyFromERKS0_:
   45|    903|bool GeometryAttribute::CopyFrom(const GeometryAttribute &src_att) {
   46|    903|  num_components_ = src_att.num_components_;
   47|    903|  data_type_ = src_att.data_type_;
   48|    903|  normalized_ = src_att.normalized_;
   49|    903|  byte_stride_ = src_att.byte_stride_;
   50|    903|  byte_offset_ = src_att.byte_offset_;
   51|    903|  attribute_type_ = src_att.attribute_type_;
   52|    903|  buffer_descriptor_ = src_att.buffer_descriptor_;
   53|    903|  unique_id_ = src_att.unique_id_;
   54|    903|  if (src_att.buffer_ == nullptr) {
  ------------------
  |  Branch (54:7): [True: 0, False: 903]
  ------------------
   55|      0|    buffer_ = nullptr;
   56|    903|  } else {
   57|    903|    if (buffer_ == nullptr) {
  ------------------
  |  Branch (57:9): [True: 0, False: 903]
  ------------------
   58|      0|      return false;
   59|      0|    }
   60|    903|    buffer_->Update(src_att.buffer_->data(), src_att.buffer_->data_size());
   61|    903|  }
   62|       |#ifdef DRACO_TRANSCODER_SUPPORTED
   63|       |  name_ = src_att.name_;
   64|       |#endif
   65|    903|  return true;
   66|    903|}
_ZN5draco17GeometryAttribute11ResetBufferEPNS_10DataBufferEll:
  102|  19.0k|                                    int64_t byte_offset) {
  103|  19.0k|  buffer_ = buffer;
  104|  19.0k|  buffer_descriptor_.buffer_id = buffer->buffer_id();
  105|  19.0k|  buffer_descriptor_.buffer_update_count = buffer->update_count();
  106|  19.0k|  byte_stride_ = byte_stride;
  107|  19.0k|  byte_offset_ = byte_offset;
  108|  19.0k|}

_ZNK5draco17GeometryAttribute10GetBytePosENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  118|  12.3M|  inline int64_t GetBytePos(AttributeValueIndex att_index) const {
  119|  12.3M|    return byte_offset_ + byte_stride_ * att_index.value();
  120|  12.3M|  }
_ZNK5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  122|  12.3M|  inline const uint8_t *GetAddress(AttributeValueIndex att_index) const {
  123|  12.3M|    const int64_t byte_pos = GetBytePos(att_index);
  124|  12.3M|    return buffer_->data() + byte_pos;
  125|  12.3M|  }
_ZN5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  126|  9.17k|  inline uint8_t *GetAddress(AttributeValueIndex att_index) {
  127|  9.17k|    const int64_t byte_pos = GetBytePos(att_index);
  128|  9.17k|    return buffer_->data() + byte_pos;
  129|  9.17k|  }
_ZNK5draco17GeometryAttribute14IsAddressValidEPKh:
  130|  37.0M|  inline bool IsAddressValid(const uint8_t *address) const {
  131|  37.0M|    return ((buffer_->data() + buffer_->data_size()) > address);
  132|  37.0M|  }
_ZNK5draco17GeometryAttribute8GetValueENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPv:
  136|  10.1M|  void GetValue(AttributeValueIndex att_index, void *out_data) const {
  137|  10.1M|    const int64_t byte_pos = byte_offset_ + byte_stride_ * att_index.value();
  138|  10.1M|    buffer_->Read(byte_pos, out_data, byte_stride_);
  139|  10.1M|  }
_ZN5draco17GeometryAttribute17SetAttributeValueENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPKv:
  143|   236M|  void SetAttributeValue(AttributeValueIndex entry_index, const void *value) {
  144|   236M|    const int64_t byte_pos = entry_index.value() * byte_stride();
  145|   236M|    buffer_->Write(byte_pos, value, byte_stride());
  146|   236M|  }
_ZNK5draco17GeometryAttribute14attribute_typeEv:
  266|  56.3k|  Type attribute_type() const { return attribute_type_; }
_ZNK5draco17GeometryAttribute9data_typeEv:
  269|  33.5k|  DataType data_type() const { return data_type_; }
_ZNK5draco17GeometryAttribute14num_componentsEv:
  273|  20.4M|  uint8_t num_components() const { return num_components_; }
_ZNK5draco17GeometryAttribute11byte_strideEv:
  282|   473M|  int64_t byte_stride() const { return byte_stride_; }
_ZNK5draco17GeometryAttribute9unique_idEv:
  287|  7.38k|  uint32_t unique_id() const { return unique_id_; }
_ZN5draco17GeometryAttribute13set_unique_idEj:
  288|  73.6k|  void set_unique_id(uint32_t id) { unique_id_ = id; }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  12.3M|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|  12.3M|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  12.3M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  12.3M|                    OutT *out_val) const {
  180|  12.3M|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 12.3M]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  12.3M|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 12.3M]
  ------------------
  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: 12.3M]
  ------------------
  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: 12.3M]
  ------------------
  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: 12.3M]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  12.3M|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 12.3M, False: 0]
  ------------------
  197|  12.3M|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  12.3M|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 12.3M]
  ------------------
  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: 12.3M]
  ------------------
  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: 12.3M]
  ------------------
  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: 12.3M]
  ------------------
  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: 12.3M]
  ------------------
  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: 12.3M]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 12.3M]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  12.3M|    }
  221|  12.3M|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIilEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  12.3M|                         OutT *out_value) const {
  307|  12.3M|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  49.3M|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 36.9M, False: 12.3M]
  ------------------
  311|  36.9M|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 36.9M]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  36.9M|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|  36.9M|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 36.9M]
  ------------------
  316|  36.9M|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  36.9M|      src_address += sizeof(T);
  320|  36.9M|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  12.3M|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 12.3M]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  12.3M|    return true;
  326|  12.3M|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIilEEbRKT_bPT0_:
  364|  36.9M|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  36.9M|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [True: 36.9M, Folded]
  ------------------
  367|       |      // Make sure the |in_value| fits within the range of values that OutT
  368|       |      // is able to represent. Perform the check only for integral types.
  369|  36.9M|      if (!std::is_same<T, bool>::value && std::is_integral<T>::value) {
  ------------------
  |  Branch (369:11): [True: 0, Folded]
  |  Branch (369:44): [True: 0, Folded]
  ------------------
  370|  36.9M|        static constexpr OutT kOutMin =
  371|  36.9M|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (371:13): [True: 0, Folded]
  ------------------
  372|  36.9M|        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (372:13): [True: 0, False: 36.9M]
  |  Branch (372:35): [True: 0, False: 36.9M]
  ------------------
  373|      0|          return false;
  374|      0|        }
  375|  36.9M|      }
  376|       |
  377|       |      // Check conversion of floating point |in_value| to integral value OutT.
  378|  36.9M|      if (std::is_floating_point<T>::value) {
  ------------------
  |  Branch (378:11): [Folded, False: 36.9M]
  ------------------
  379|       |        // Make sure the floating point |in_value| is not NaN and not Inf as
  380|       |        // integral type OutT is unable to represent these values.
  381|      0|        if (sizeof(in_value) > sizeof(double)) {
  ------------------
  |  Branch (381:13): [Folded, False: 0]
  ------------------
  382|      0|          if (std::isnan(static_cast<long double>(in_value)) ||
  ------------------
  |  Branch (382:15): [True: 0, False: 0]
  ------------------
  383|      0|              std::isinf(static_cast<long double>(in_value))) {
  ------------------
  |  Branch (383:15): [True: 0, False: 0]
  ------------------
  384|      0|            return false;
  385|      0|          }
  386|      0|        } else if (sizeof(in_value) > sizeof(float)) {
  ------------------
  |  Branch (386:20): [Folded, False: 0]
  ------------------
  387|      0|          if (std::isnan(static_cast<double>(in_value)) ||
  ------------------
  |  Branch (387:15): [True: 0, False: 0]
  ------------------
  388|      0|              std::isinf(static_cast<double>(in_value))) {
  ------------------
  |  Branch (388:15): [True: 0, False: 0]
  ------------------
  389|      0|            return false;
  390|      0|          }
  391|      0|        } else {
  392|      0|          if (std::isnan(static_cast<float>(in_value)) ||
  ------------------
  |  Branch (392:15): [True: 0, False: 0]
  ------------------
  393|      0|              std::isinf(static_cast<float>(in_value))) {
  ------------------
  |  Branch (393:15): [True: 0, False: 0]
  ------------------
  394|      0|            return false;
  395|      0|          }
  396|      0|        }
  397|       |
  398|       |        // Make sure the floating point |in_value| fits within the range of
  399|       |        // values that integral type OutT is able to represent.
  400|      0|        if (in_value < std::numeric_limits<OutT>::min() ||
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|      0|            in_value >= std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (401:13): [True: 0, False: 0]
  ------------------
  402|      0|          return false;
  403|      0|        }
  404|      0|      }
  405|  36.9M|    }
  406|       |
  407|  36.9M|    if (std::is_integral<T>::value && std::is_floating_point<OutT>::value &&
  ------------------
  |  Branch (407:9): [True: 0, Folded]
  |  Branch (407:39): [Folded, False: 0]
  ------------------
  408|      0|        normalized) {
  ------------------
  |  Branch (408:9): [True: 0, False: 0]
  ------------------
  409|       |      // When converting integer to floating point, normalize the value if
  410|       |      // necessary.
  411|      0|      *out_value = static_cast<OutT>(in_value);
  412|      0|      *out_value /= static_cast<OutT>(std::numeric_limits<T>::max());
  413|  36.9M|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded, False: 36.9M]
  ------------------
  414|      0|               std::is_integral<OutT>::value && normalized) {
  ------------------
  |  Branch (414:16): [True: 0, Folded]
  |  Branch (414:49): [True: 0, False: 0]
  ------------------
  415|       |      // Converting from floating point to a normalized integer.
  416|      0|      if (in_value > 1 || in_value < 0) {
  ------------------
  |  Branch (416:11): [True: 0, False: 0]
  |  Branch (416:27): [True: 0, False: 0]
  ------------------
  417|       |        // Normalized float values need to be between 0 and 1.
  418|      0|        return false;
  419|      0|      }
  420|       |      // TODO(ostava): Consider allowing float to normalized integer conversion
  421|       |      // for 64-bit integer types. Currently it doesn't work because we don't
  422|       |      // have a floating point type that could store all 64 bit integers.
  423|      0|      if (sizeof(OutT) > 4) {
  ------------------
  |  Branch (423:11): [True: 0, Folded]
  ------------------
  424|      0|        return false;
  425|      0|      }
  426|       |      // Expand the float to the range of the output integer and round it to the
  427|       |      // nearest representable value. Use doubles for the math to ensure the
  428|       |      // integer values are represented properly during the conversion process.
  429|      0|      *out_value = static_cast<OutT>(std::floor(
  430|      0|          in_value * static_cast<double>(std::numeric_limits<OutT>::max()) +
  431|      0|          0.5));
  432|  36.9M|    } else {
  433|  36.9M|      *out_value = static_cast<OutT>(in_value);
  434|  36.9M|    }
  435|       |
  436|       |    // TODO(ostava): Add handling of normalized attributes when converting
  437|       |    // between different integer representations. If the attribute is
  438|       |    // normalized, integer values should be converted as if they represent 0-1
  439|       |    // range. E.g. when we convert uint16 to uint8, the range <0, 2^16 - 1>
  440|       |    // should be converted to range <0, 2^8 - 1>.
  441|  36.9M|    return true;
  442|  36.9M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  14.1k|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|  14.1k|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  14.1k|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  14.1k|                    OutT *out_val) const {
  180|  14.1k|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 14.1k]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  14.1k|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 14.1k]
  ------------------
  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: 14.1k]
  ------------------
  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: 14.1k]
  ------------------
  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: 14.1k]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  14.1k|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 14.1k, False: 0]
  ------------------
  197|  14.1k|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  14.1k|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 14.1k]
  ------------------
  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: 14.1k]
  ------------------
  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: 14.1k]
  ------------------
  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: 14.1k]
  ------------------
  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: 14.1k]
  ------------------
  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: 14.1k]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 14.1k]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  14.1k|    }
  221|  14.1k|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIifEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  14.1k|                         OutT *out_value) const {
  307|  14.1k|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  56.5k|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 42.4k, False: 14.1k]
  ------------------
  311|  42.4k|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 42.4k]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  42.4k|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|  42.4k|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 42.4k]
  ------------------
  316|  42.4k|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  42.4k|      src_address += sizeof(T);
  320|  42.4k|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  14.1k|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 14.1k]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  14.1k|    return true;
  326|  14.1k|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIifEEbRKT_bPT0_:
  364|  42.4k|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  42.4k|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [Folded, False: 42.4k]
  ------------------
  367|       |      // Make sure the |in_value| fits within the range of values that OutT
  368|       |      // is able to represent. Perform the check only for integral types.
  369|      0|      if (!std::is_same<T, bool>::value && std::is_integral<T>::value) {
  ------------------
  |  Branch (369:11): [True: 0, Folded]
  |  Branch (369:44): [True: 0, Folded]
  ------------------
  370|      0|        static constexpr OutT kOutMin =
  371|      0|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (371:13): [True: 0, Folded]
  ------------------
  372|      0|        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (372:13): [True: 0, False: 0]
  |  Branch (372:35): [True: 0, False: 0]
  ------------------
  373|      0|          return false;
  374|      0|        }
  375|      0|      }
  376|       |
  377|       |      // Check conversion of floating point |in_value| to integral value OutT.
  378|      0|      if (std::is_floating_point<T>::value) {
  ------------------
  |  Branch (378:11): [Folded, False: 0]
  ------------------
  379|       |        // Make sure the floating point |in_value| is not NaN and not Inf as
  380|       |        // integral type OutT is unable to represent these values.
  381|      0|        if (sizeof(in_value) > sizeof(double)) {
  ------------------
  |  Branch (381:13): [Folded, False: 0]
  ------------------
  382|      0|          if (std::isnan(static_cast<long double>(in_value)) ||
  ------------------
  |  Branch (382:15): [True: 0, False: 0]
  ------------------
  383|      0|              std::isinf(static_cast<long double>(in_value))) {
  ------------------
  |  Branch (383:15): [True: 0, False: 0]
  ------------------
  384|      0|            return false;
  385|      0|          }
  386|      0|        } else if (sizeof(in_value) > sizeof(float)) {
  ------------------
  |  Branch (386:20): [Folded, False: 0]
  ------------------
  387|      0|          if (std::isnan(static_cast<double>(in_value)) ||
  ------------------
  |  Branch (387:15): [True: 0, False: 0]
  ------------------
  388|      0|              std::isinf(static_cast<double>(in_value))) {
  ------------------
  |  Branch (388:15): [True: 0, False: 0]
  ------------------
  389|      0|            return false;
  390|      0|          }
  391|      0|        } else {
  392|      0|          if (std::isnan(static_cast<float>(in_value)) ||
  ------------------
  |  Branch (392:15): [True: 0, False: 0]
  ------------------
  393|      0|              std::isinf(static_cast<float>(in_value))) {
  ------------------
  |  Branch (393:15): [True: 0, False: 0]
  ------------------
  394|      0|            return false;
  395|      0|          }
  396|      0|        }
  397|       |
  398|       |        // Make sure the floating point |in_value| fits within the range of
  399|       |        // values that integral type OutT is able to represent.
  400|      0|        if (in_value < std::numeric_limits<OutT>::min() ||
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|      0|            in_value >= std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (401:13): [True: 0, False: 0]
  ------------------
  402|      0|          return false;
  403|      0|        }
  404|      0|      }
  405|      0|    }
  406|       |
  407|  42.4k|    if (std::is_integral<T>::value && std::is_floating_point<OutT>::value &&
  ------------------
  |  Branch (407:9): [True: 0, Folded]
  |  Branch (407:39): [True: 0, Folded]
  ------------------
  408|  42.4k|        normalized) {
  ------------------
  |  Branch (408:9): [True: 0, False: 42.4k]
  ------------------
  409|       |      // When converting integer to floating point, normalize the value if
  410|       |      // necessary.
  411|      0|      *out_value = static_cast<OutT>(in_value);
  412|      0|      *out_value /= static_cast<OutT>(std::numeric_limits<T>::max());
  413|  42.4k|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded, False: 42.4k]
  ------------------
  414|      0|               std::is_integral<OutT>::value && normalized) {
  ------------------
  |  Branch (414:16): [Folded, False: 0]
  |  Branch (414:49): [True: 0, False: 0]
  ------------------
  415|       |      // Converting from floating point to a normalized integer.
  416|      0|      if (in_value > 1 || in_value < 0) {
  ------------------
  |  Branch (416:11): [True: 0, False: 0]
  |  Branch (416:27): [True: 0, False: 0]
  ------------------
  417|       |        // Normalized float values need to be between 0 and 1.
  418|      0|        return false;
  419|      0|      }
  420|       |      // TODO(ostava): Consider allowing float to normalized integer conversion
  421|       |      // for 64-bit integer types. Currently it doesn't work because we don't
  422|       |      // have a floating point type that could store all 64 bit integers.
  423|      0|      if (sizeof(OutT) > 4) {
  ------------------
  |  Branch (423:11): [Folded, False: 0]
  ------------------
  424|      0|        return false;
  425|      0|      }
  426|       |      // Expand the float to the range of the output integer and round it to the
  427|       |      // nearest representable value. Use doubles for the math to ensure the
  428|       |      // integer values are represented properly during the conversion process.
  429|      0|      *out_value = static_cast<OutT>(std::floor(
  430|      0|          in_value * static_cast<double>(std::numeric_limits<OutT>::max()) +
  431|      0|          0.5));
  432|  42.4k|    } else {
  433|  42.4k|      *out_value = static_cast<OutT>(in_value);
  434|  42.4k|    }
  435|       |
  436|       |    // TODO(ostava): Add handling of normalized attributes when converting
  437|       |    // between different integer representations. If the attribute is
  438|       |    // normalized, integer values should be converted as if they represent 0-1
  439|       |    // range. E.g. when we convert uint16 to uint8, the range <0, 2^16 - 1>
  440|       |    // should be converted to range <0, 2^8 - 1>.
  441|  42.4k|    return true;
  442|  42.4k|  }

_ZN5draco14PointAttributeC2ERKNS_17GeometryAttributeE:
   31|  29.6k|    : GeometryAttribute(att),
   32|  29.6k|      num_unique_entries_(0),
   33|  29.6k|      identity_mapping_(false) {}
_ZN5draco14PointAttribute8CopyFromERKS0_:
   46|    903|void PointAttribute::CopyFrom(const PointAttribute &src_att) {
   47|    903|  if (buffer() == nullptr) {
  ------------------
  |  Branch (47:7): [True: 0, False: 903]
  ------------------
   48|       |    // If the destination attribute doesn't have a valid buffer, create it.
   49|      0|    attribute_buffer_ = std::unique_ptr<DataBuffer>(new DataBuffer());
   50|      0|    ResetBuffer(attribute_buffer_.get(), 0, 0);
   51|      0|  }
   52|    903|  if (!GeometryAttribute::CopyFrom(src_att)) {
  ------------------
  |  Branch (52:7): [True: 0, False: 903]
  ------------------
   53|      0|    return;
   54|      0|  }
   55|    903|  identity_mapping_ = src_att.identity_mapping_;
   56|    903|  num_unique_entries_ = src_att.num_unique_entries_;
   57|    903|  indices_map_ = src_att.indices_map_;
   58|    903|  if (src_att.attribute_transform_data_) {
  ------------------
  |  Branch (58:7): [True: 35, False: 868]
  ------------------
   59|     35|    attribute_transform_data_ = std::unique_ptr<AttributeTransformData>(
   60|     35|        new AttributeTransformData(*src_att.attribute_transform_data_));
   61|    868|  } else {
   62|    868|    attribute_transform_data_ = nullptr;
   63|    868|  }
   64|    903|}
_ZN5draco14PointAttribute5ResetEm:
   66|  19.0k|bool PointAttribute::Reset(size_t num_attribute_values) {
   67|  19.0k|  if (attribute_buffer_ == nullptr) {
  ------------------
  |  Branch (67:7): [True: 19.0k, False: 0]
  ------------------
   68|  19.0k|    attribute_buffer_ = std::unique_ptr<DataBuffer>(new DataBuffer());
   69|  19.0k|  }
   70|  19.0k|  const int64_t entry_size = DataTypeLength(data_type()) * num_components();
   71|  19.0k|  if (!attribute_buffer_->Update(nullptr, num_attribute_values * entry_size)) {
  ------------------
  |  Branch (71:7): [True: 0, False: 19.0k]
  ------------------
   72|      0|    return false;
   73|      0|  }
   74|       |  // Assign the new buffer to the parent attribute.
   75|  19.0k|  ResetBuffer(attribute_buffer_.get(), entry_size, 0);
   76|  19.0k|  num_unique_entries_ = static_cast<uint32_t>(num_attribute_values);
   77|  19.0k|  return true;
   78|  19.0k|}

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

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

_ZNK5draco17AttributesDecoder14GetAttributeIdEi:
   44|  65.4k|  int32_t GetAttributeId(int i) const override {
   45|  65.4k|    return point_attribute_ids_[i];
   46|  65.4k|  }
_ZNK5draco17AttributesDecoder16GetNumAttributesEv:
   47|  42.6k|  int32_t GetNumAttributes() const override {
   48|  42.6k|    return static_cast<int32_t>(point_attribute_ids_.size());
   49|  42.6k|  }
_ZNK5draco17AttributesDecoder10GetDecoderEv:
   50|  40.5k|  PointCloudDecoder *GetDecoder() const override {
   51|  40.5k|    return point_cloud_decoder_;
   52|  40.5k|  }
_ZN5draco17AttributesDecoder16DecodeAttributesEPNS_13DecoderBufferE:
   55|  5.89k|  bool DecodeAttributes(DecoderBuffer *in_buffer) override {
   56|  5.89k|    if (!DecodePortableAttributes(in_buffer)) {
  ------------------
  |  Branch (56:9): [True: 2.35k, False: 3.54k]
  ------------------
   57|  2.35k|      return false;
   58|  2.35k|    }
   59|  3.54k|    if (!DecodeDataNeededByPortableTransforms(in_buffer)) {
  ------------------
  |  Branch (59:9): [True: 1.48k, False: 2.05k]
  ------------------
   60|  1.48k|      return false;
   61|  1.48k|    }
   62|  2.05k|    if (!TransformAttributesToOriginalFormat()) {
  ------------------
  |  Branch (62:9): [True: 340, False: 1.71k]
  ------------------
   63|    340|      return false;
   64|    340|    }
   65|  1.71k|    return true;
   66|  2.05k|  }
_ZNK5draco17AttributesDecoder27GetLocalIdForPointAttributeEi:
   69|  1.76k|  int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const {
   70|  1.76k|    const int id_map_size =
   71|  1.76k|        static_cast<int>(point_attribute_to_local_id_map_.size());
   72|  1.76k|    if (point_attribute_id >= id_map_size) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.76k]
  ------------------
   73|      0|      return -1;
   74|      0|    }
   75|  1.76k|    return point_attribute_to_local_id_map_[point_attribute_id];
   76|  1.76k|  }
_ZN5draco17AttributesDecoderD2Ev:
   35|  37.6k|  virtual ~AttributesDecoder() = default;

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.26k|      : quantization_bits_(-1),
   54|  2.26k|        max_quantized_value_(-1),
   55|  2.26k|        max_value_(-1),
   56|  2.26k|        dequantization_scale_(1.f),
   57|  2.26k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.03k|  bool SetQuantizationBits(int32_t q) {
   60|  2.03k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 585, False: 1.44k]
  |  Branch (60:18): [True: 164, False: 1.28k]
  ------------------
   61|    749|      return false;
   62|    749|    }
   63|  1.28k|    quantization_bits_ = q;
   64|  1.28k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.28k|    max_value_ = max_quantized_value_ - 1;
   66|  1.28k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.28k|    center_value_ = max_value_ / 2;
   68|  1.28k|    return true;
   69|  2.03k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.02M|                                           int32_t *out_t) const {
   77|  2.02M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.80k, False: 2.02M]
  |  Branch (77:20): [True: 0, False: 3.80k]
  |  Branch (77:32): [True: 3.80k, False: 2.02M]
  |  Branch (77:42): [True: 0, False: 3.80k]
  ------------------
   78|  2.02M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.33M, False: 692k]
  |  Branch (78:29): [True: 4.86k, False: 1.32M]
  ------------------
   79|  4.86k|      s = max_value_;
   80|  4.86k|      t = max_value_;
   81|  2.02M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.80k, False: 2.01M]
  |  Branch (81:26): [True: 1.35k, False: 2.44k]
  ------------------
   82|  1.35k|      t = center_value_ - (t - center_value_);
   83|  2.02M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.32M, False: 691k]
  |  Branch (83:35): [True: 4.98k, False: 1.32M]
  ------------------
   84|  4.98k|      t = center_value_ + (center_value_ - t);
   85|  2.01M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.32M, False: 689k]
  |  Branch (85:35): [True: 533, False: 1.32M]
  ------------------
   86|    533|      s = center_value_ + (center_value_ - s);
   87|  2.01M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.35k, False: 2.01M]
  |  Branch (87:26): [True: 1.62k, False: 2.73k]
  ------------------
   88|  1.62k|      s = center_value_ - (s - center_value_);
   89|  1.62k|    }
   90|       |
   91|  2.02M|    *out_s = s;
   92|  2.02M|    *out_t = t;
   93|  2.02M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.02M|                                                       int32_t *out_t) const {
  100|  2.02M|    DRACO_DCHECK_EQ(
  101|  2.02M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.02M|        center_value_);
  103|  2.02M|    int32_t s, t;
  104|  2.02M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.31M, False: 707k]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.31M|      s = (int_vec[1] + center_value_);
  107|  1.31M|      t = (int_vec[2] + center_value_);
  108|  1.31M|    } else {
  109|       |      // Left hemisphere.
  110|   707k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 54.2k, False: 653k]
  ------------------
  111|  54.2k|        s = std::abs(int_vec[2]);
  112|   653k|      } else {
  113|   653k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   653k|      }
  115|   707k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 58.7k, False: 648k]
  ------------------
  116|  58.7k|        t = std::abs(int_vec[1]);
  117|   648k|      } else {
  118|   648k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   648k|      }
  120|   707k|    }
  121|  2.02M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.02M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   225k|                                                    float *out_vector) const {
  199|   225k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   225k|                                 in_t * dequantization_scale_ - 1.f,
  201|   225k|                                 out_vector);
  202|   225k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  18.3M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  18.3M|    DRACO_DCHECK_LE(s, center_value_);
  208|  18.3M|    DRACO_DCHECK_LE(t, center_value_);
  209|  18.3M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  18.3M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  18.3M|    const uint32_t st =
  212|  18.3M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  18.3M|    return st <= center_value_;
  214|  18.3M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  35.4M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  35.4M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  35.4M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  35.4M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  35.4M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  35.4M|    int32_t sign_s = 0;
  223|  35.4M|    int32_t sign_t = 0;
  224|  35.4M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 35.2M, False: 236k]
  |  Branch (224:20): [True: 35.0M, False: 139k]
  ------------------
  225|  35.0M|      sign_s = 1;
  226|  35.0M|      sign_t = 1;
  227|  35.0M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 261k, False: 114k]
  |  Branch (227:27): [True: 149k, False: 111k]
  ------------------
  228|   149k|      sign_s = -1;
  229|   149k|      sign_t = -1;
  230|   226k|    } else {
  231|   226k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 114k, False: 111k]
  ------------------
  232|   226k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 111k, False: 114k]
  ------------------
  233|   226k|    }
  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|  35.4M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  35.4M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  35.4M|    uint32_t us = *s;
  241|  35.4M|    uint32_t ut = *t;
  242|  35.4M|    us = us + us - corner_point_s;
  243|  35.4M|    ut = ut + ut - corner_point_t;
  244|  35.4M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 35.2M, False: 226k]
  ------------------
  245|  35.2M|      uint32_t temp = us;
  246|  35.2M|      us = -ut;
  247|  35.2M|      ut = -temp;
  248|  35.2M|    } else {
  249|   226k|      std::swap(us, ut);
  250|   226k|    }
  251|  35.4M|    us = us + corner_point_s;
  252|  35.4M|    ut = ut + corner_point_t;
  253|       |
  254|  35.4M|    *s = us;
  255|  35.4M|    *t = ut;
  256|  35.4M|    *s /= 2;
  257|  35.4M|    *t /= 2;
  258|  35.4M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  36.6M|  int32_t ModMax(int32_t x) const {
  273|  36.6M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 6.50k, False: 36.6M]
  ------------------
  274|  6.50k|      return x - this->max_quantized_value();
  275|  6.50k|    }
  276|  36.6M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 3.64k, False: 36.6M]
  ------------------
  277|  3.64k|      return x + this->max_quantized_value();
  278|  3.64k|    }
  279|  36.6M|    return x;
  280|  36.6M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.21k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  10.1k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|   109M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   225k|                                           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|   225k|    float y = in_s_scaled;
  329|   225k|    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|   225k|    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|   225k|    float x_offset = -x;
  342|   225k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 43.7k, False: 181k]
  ------------------
  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|   225k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 114k, False: 110k]
  ------------------
  348|   225k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 114k, False: 110k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   225k|    const float norm_squared = x * x + y * y + z * z;
  352|   225k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 225k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   225k|    } else {
  357|   225k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   225k|      out_vector[0] = x * d;
  359|   225k|      out_vector[1] = y * d;
  360|   225k|      out_vector[2] = z * d;
  361|   225k|    }
  362|   225k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.02M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.02M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.02M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.02M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.02M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.02M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.02M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.74M, False: 277k]
  ------------------
  181|  1.74M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.74M|    } else {
  183|   277k|      vec[0] =
  184|   277k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   277k|          abs_sum;
  186|   277k|      vec[1] =
  187|   277k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   277k|          abs_sum;
  189|   277k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 147k, False: 130k]
  ------------------
  190|   147k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   147k|      } else {
  192|   130k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   130k|      }
  194|   277k|    }
  195|  2.02M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    330|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    330|            attribute, transform, mesh_data),
   52|    330|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    313|                                                                *buffer) {
  194|    313|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    313|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    313|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 2, False: 311]
  ------------------
  196|       |    // Decode prediction mode.
  197|      2|    uint8_t mode;
  198|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 2]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 1, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      1|      return false;
  205|      1|    }
  206|      2|  }
  207|    312|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.45k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.18k, False: 267]
  ------------------
  211|  1.18k|    uint32_t num_flags;
  212|  1.18k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 10, False: 1.17k]
  ------------------
  213|     10|      return false;
  214|     10|    }
  215|  1.17k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 22, False: 1.15k]
  ------------------
  216|     22|      return false;
  217|     22|    }
  218|  1.15k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 391, False: 766]
  ------------------
  219|    391|      is_crease_edge_[i].resize(num_flags);
  220|    391|      RAnsBitDecoder decoder;
  221|    391|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 13, False: 378]
  ------------------
  222|     13|        return false;
  223|     13|      }
  224|  1.98M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.98M, False: 378]
  ------------------
  225|  1.98M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.98M|      }
  227|    378|      decoder.EndDecoding();
  228|    378|    }
  229|  1.15k|  }
  230|    267|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    267|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    312|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    235|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    235|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    235|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.17k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 940, False: 235]
  ------------------
   93|    940|    pred_vals[i].resize(num_components, 0);
   94|    940|  }
   95|    235|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    235|                                         out_data);
   97|       |
   98|    235|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    235|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    235|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    235|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    235|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    235|  const int corner_map_size =
  109|    235|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   896k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 896k, False: 151]
  ------------------
  111|   896k|    const CornerIndex start_corner_id =
  112|   896k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   896k|    CornerIndex corner_id(start_corner_id);
  115|   896k|    int num_parallelograms = 0;
  116|   896k|    bool first_pass = true;
  117|  1.95M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.09M, False: 859k]
  ------------------
  118|  1.09M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 77.4k, False: 1.01M]
  ------------------
  119|  1.09M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.09M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  77.4k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  77.4k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 618, False: 76.8k]
  ------------------
  127|    618|          break;
  128|    618|        }
  129|  77.4k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|  1.09M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.08M, False: 8.06k]
  ------------------
  134|  1.08M|        corner_id = table->SwingLeft(corner_id);
  135|  1.08M|      } else {
  136|  8.06k|        corner_id = table->SwingRight(corner_id);
  137|  8.06k|      }
  138|  1.09M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 36.6k, False: 1.05M]
  ------------------
  139|  36.6k|        break;
  140|  36.6k|      }
  141|  1.05M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 863k, False: 195k]
  |  Branch (141:47): [True: 859k, False: 3.57k]
  ------------------
  142|   859k|        first_pass = false;
  143|   859k|        corner_id = table->SwingRight(start_corner_id);
  144|   859k|      }
  145|  1.05M|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   896k|    int num_used_parallelograms = 0;
  150|   896k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 42.4k, False: 854k]
  ------------------
  151|  6.84M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 6.80M, False: 42.4k]
  ------------------
  152|  6.80M|        multi_pred_vals[i] = 0;
  153|  6.80M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   119k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 77.3k, False: 42.3k]
  ------------------
  156|  77.3k|        const int context = num_parallelograms - 1;
  157|  77.3k|        const int pos = is_crease_edge_pos[context]++;
  158|  77.3k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 84, False: 77.3k]
  ------------------
  159|     84|          return false;
  160|     84|        }
  161|  77.3k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  77.3k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 22.2k, False: 55.0k]
  ------------------
  163|  22.2k|          ++num_used_parallelograms;
  164|  3.22M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 3.20M, False: 22.2k]
  ------------------
  165|  3.20M|            multi_pred_vals[j] =
  166|  3.20M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  3.20M|          }
  168|  22.2k|        }
  169|  77.3k|      }
  170|  42.4k|    }
  171|   896k|    const int dst_offset = p * num_components;
  172|   896k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 887k, False: 8.84k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   887k|      const int src_offset = (p - 1) * num_components;
  176|   887k|      this->transform().ComputeOriginalValue(
  177|   887k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   887k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  1.22M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 1.22M, False: 8.84k]
  ------------------
  181|  1.22M|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  1.22M|      }
  183|  8.84k|      this->transform().ComputeOriginalValue(
  184|  8.84k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  8.84k|    }
  186|   896k|  }
  187|    151|  return true;
  188|    235|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    411|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    411|            attribute, transform, mesh_data),
   52|    411|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    384|                                                                *buffer) {
  194|    384|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    384|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    384|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 2, False: 382]
  ------------------
  196|       |    // Decode prediction mode.
  197|      2|    uint8_t mode;
  198|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 2]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 1, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      1|      return false;
  205|      1|    }
  206|      2|  }
  207|    383|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.68k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.39k, False: 289]
  ------------------
  211|  1.39k|    uint32_t num_flags;
  212|  1.39k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 12, False: 1.38k]
  ------------------
  213|     12|      return false;
  214|     12|    }
  215|  1.38k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 48, False: 1.33k]
  ------------------
  216|     48|      return false;
  217|     48|    }
  218|  1.33k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 579, False: 754]
  ------------------
  219|    579|      is_crease_edge_[i].resize(num_flags);
  220|    579|      RAnsBitDecoder decoder;
  221|    579|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 34, False: 545]
  ------------------
  222|     34|        return false;
  223|     34|      }
  224|  1.38M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.38M, False: 545]
  ------------------
  225|  1.38M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.38M|      }
  227|    545|      decoder.EndDecoding();
  228|    545|    }
  229|  1.33k|  }
  230|    289|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    289|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    383|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    247|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    247|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    247|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.23k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 988, False: 247]
  ------------------
   93|    988|    pred_vals[i].resize(num_components, 0);
   94|    988|  }
   95|    247|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    247|                                         out_data);
   97|       |
   98|    247|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    247|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    247|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    247|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    247|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    247|  const int corner_map_size =
  109|    247|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  95.8k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 95.7k, False: 90]
  ------------------
  111|  95.7k|    const CornerIndex start_corner_id =
  112|  95.7k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  95.7k|    CornerIndex corner_id(start_corner_id);
  115|  95.7k|    int num_parallelograms = 0;
  116|  95.7k|    bool first_pass = true;
  117|   562k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 557k, False: 4.38k]
  ------------------
  118|   557k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 180k, False: 377k]
  ------------------
  119|   557k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   557k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   180k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   180k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 324, False: 179k]
  ------------------
  127|    324|          break;
  128|    324|        }
  129|   180k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|   557k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 552k, False: 5.09k]
  ------------------
  134|   552k|        corner_id = table->SwingLeft(corner_id);
  135|   552k|      } else {
  136|  5.09k|        corner_id = table->SwingRight(corner_id);
  137|  5.09k|      }
  138|   557k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 91.0k, False: 466k]
  ------------------
  139|  91.0k|        break;
  140|  91.0k|      }
  141|   466k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 6.94k, False: 459k]
  |  Branch (141:47): [True: 4.38k, False: 2.56k]
  ------------------
  142|  4.38k|        first_pass = false;
  143|  4.38k|        corner_id = table->SwingRight(start_corner_id);
  144|  4.38k|      }
  145|   466k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  95.7k|    int num_used_parallelograms = 0;
  150|  95.7k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 93.7k, False: 1.97k]
  ------------------
  151|  4.74M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 4.64M, False: 93.7k]
  ------------------
  152|  4.64M|        multi_pred_vals[i] = 0;
  153|  4.64M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   273k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 180k, False: 93.6k]
  ------------------
  156|   180k|        const int context = num_parallelograms - 1;
  157|   180k|        const int pos = is_crease_edge_pos[context]++;
  158|   180k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 157, False: 179k]
  ------------------
  159|    157|          return false;
  160|    157|        }
  161|   179k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   179k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 24.7k, False: 155k]
  ------------------
  163|  24.7k|          ++num_used_parallelograms;
  164|  1.19M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.17M, False: 24.7k]
  ------------------
  165|  1.17M|            multi_pred_vals[j] =
  166|  1.17M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.17M|          }
  168|  24.7k|        }
  169|   179k|      }
  170|  93.7k|    }
  171|  95.5k|    const int dst_offset = p * num_components;
  172|  95.5k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 83.1k, False: 12.4k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  83.1k|      const int src_offset = (p - 1) * num_components;
  176|  83.1k|      this->transform().ComputeOriginalValue(
  177|  83.1k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  83.1k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   635k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 623k, False: 12.4k]
  ------------------
  181|   623k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   623k|      }
  183|  12.4k|      this->transform().ComputeOriginalValue(
  184|  12.4k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  12.4k|    }
  186|  95.5k|  }
  187|     90|  return true;
  188|    247|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.01k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.01k|    mesh_ = mesh;
   39|  2.01k|    corner_table_ = table;
   40|  2.01k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.01k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.01k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  11.4M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  7.73M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  7.73M|    return vertex_to_data_map_;
   48|  7.73M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  6.14M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  6.14M|    return data_to_corner_map_;
   51|  6.14M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.23k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.23k|    mesh_ = mesh;
   39|  2.23k|    corner_table_ = table;
   40|  2.23k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.23k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.23k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  9.17M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  7.67M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  7.67M|    return vertex_to_data_map_;
   48|  7.67M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.43M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.43M|    return data_to_corner_map_;
   51|  2.43M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  2.01k|      : mesh_(nullptr),
   31|  2.01k|        corner_table_(nullptr),
   32|  2.01k|        vertex_to_data_map_(nullptr),
   33|  2.01k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  2.23k|      : mesh_(nullptr),
   31|  2.23k|        corner_table_(nullptr),
   32|  2.23k|        vertex_to_data_map_(nullptr),
   33|  2.23k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   549k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   215k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   336k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   167k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.70k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.70k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  10.0M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.00k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.00k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  3.52M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    146|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    146|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    113|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    113|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    143|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    143|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    111|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    111|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    291|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    146|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    146|    DRACO_DCHECK_EQ(i, 0);
   70|    146|    (void)i;
   71|    146|    return GeometryAttribute::POSITION;
   72|    146|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    146|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    146|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 146]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    146|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 145]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    145|    predictor_.SetPositionAttribute(*att);
   82|    145|    return true;
   83|    146|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    145|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    145|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 9, False: 136]
  ------------------
  145|      9|    return false;
  146|      9|  }
  147|       |
  148|    136|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    136|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    136|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 40, False: 96]
  ------------------
  150|     40|    uint8_t prediction_mode;
  151|     40|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 40]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     40|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 39]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     39|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 39]
  ------------------
  160|     39|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     39|  }
  164|    135|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    135|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 130]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    130|  return true;
  172|    135|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    130|                                      const PointIndex *entry_to_point_id_map) {
  103|    130|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    130|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    130|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    130|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    130|  const int corner_map_size =
  111|    130|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    130|  VectorD<int32_t, 3> pred_normal_3d;
  114|    130|  int32_t pred_normal_oct[2];
  115|       |
  116|   549k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 549k, False: 130]
  ------------------
  117|   549k|    const CornerIndex corner_id =
  118|   549k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   549k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   549k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   549k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   549k|                    octahedron_tool_box_.center_value());
  125|   549k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 141k, False: 408k]
  ------------------
  126|   141k|      pred_normal_3d = -pred_normal_3d;
  127|   141k|    }
  128|   549k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   549k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   549k|    const int data_offset = data_id * 2;
  132|   549k|    this->transform().ComputeOriginalValue(
  133|   549k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   549k|  }
  135|    130|  flip_normal_bit_decoder_.EndDecoding();
  136|    130|  return true;
  137|    130|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    130|  void SetQuantizationBits(int q) {
   85|    130|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    130|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    225|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    113|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    113|    DRACO_DCHECK_EQ(i, 0);
   70|    113|    (void)i;
   71|    113|    return GeometryAttribute::POSITION;
   72|    113|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    113|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    113|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 113]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    113|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 112]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    112|    predictor_.SetPositionAttribute(*att);
   82|    112|    return true;
   83|    113|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    112|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    112|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 107]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    107|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    107|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    107|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 10, False: 97]
  ------------------
  150|     10|    uint8_t prediction_mode;
  151|     10|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 10]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     10|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 9]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|      9|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 9]
  ------------------
  160|      9|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|      9|  }
  164|    106|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    106|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 2, False: 104]
  ------------------
  168|      2|    return false;
  169|      2|  }
  170|       |
  171|    104|  return true;
  172|    106|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    104|                                      const PointIndex *entry_to_point_id_map) {
  103|    104|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    104|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    104|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    104|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    104|  const int corner_map_size =
  111|    104|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    104|  VectorD<int32_t, 3> pred_normal_3d;
  114|    104|  int32_t pred_normal_oct[2];
  115|       |
  116|   215k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 215k, False: 104]
  ------------------
  117|   215k|    const CornerIndex corner_id =
  118|   215k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   215k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   215k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   215k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   215k|                    octahedron_tool_box_.center_value());
  125|   215k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 207k, False: 7.50k]
  ------------------
  126|   207k|      pred_normal_3d = -pred_normal_3d;
  127|   207k|    }
  128|   215k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   215k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   215k|    const int data_offset = data_id * 2;
  132|   215k|    this->transform().ComputeOriginalValue(
  133|   215k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   215k|  }
  135|    104|  flip_normal_bit_decoder_.EndDecoding();
  136|    104|  return true;
  137|    104|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    104|  void SetQuantizationBits(int q) {
   85|    104|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    104|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    284|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    143|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    143|    DRACO_DCHECK_EQ(i, 0);
   70|    143|    (void)i;
   71|    143|    return GeometryAttribute::POSITION;
   72|    143|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    142|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    142|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 142]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    142|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 141]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    141|    predictor_.SetPositionAttribute(*att);
   82|    141|    return true;
   83|    142|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    140|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    140|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 7, False: 133]
  ------------------
  145|      7|    return false;
  146|      7|  }
  147|       |
  148|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    133|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 47, False: 86]
  ------------------
  150|     47|    uint8_t prediction_mode;
  151|     47|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 47]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     47|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 14, False: 33]
  ------------------
  155|       |      // Invalid prediction mode.
  156|     14|      return false;
  157|     14|    }
  158|       |
  159|     33|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 33]
  ------------------
  160|     33|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     33|  }
  164|    119|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    119|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 114]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    114|  return true;
  172|    119|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    114|                                      const PointIndex *entry_to_point_id_map) {
  103|    114|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    114|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    114|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    114|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    114|  const int corner_map_size =
  111|    114|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    114|  VectorD<int32_t, 3> pred_normal_3d;
  114|    114|  int32_t pred_normal_oct[2];
  115|       |
  116|   336k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 336k, False: 114]
  ------------------
  117|   336k|    const CornerIndex corner_id =
  118|   336k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   336k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   336k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   336k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   336k|                    octahedron_tool_box_.center_value());
  125|   336k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 314k, False: 22.4k]
  ------------------
  126|   314k|      pred_normal_3d = -pred_normal_3d;
  127|   314k|    }
  128|   336k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   336k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   336k|    const int data_offset = data_id * 2;
  132|   336k|    this->transform().ComputeOriginalValue(
  133|   336k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   336k|  }
  135|    114|  flip_normal_bit_decoder_.EndDecoding();
  136|    114|  return true;
  137|    114|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    114|  void SetQuantizationBits(int q) {
   85|    114|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    114|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    219|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    111|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    111|    DRACO_DCHECK_EQ(i, 0);
   70|    111|    (void)i;
   71|    111|    return GeometryAttribute::POSITION;
   72|    111|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    111|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    111|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 111]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    111|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 108]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    108|    predictor_.SetPositionAttribute(*att);
   82|    108|    return true;
   83|    111|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    107|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    107|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 6, False: 101]
  ------------------
  145|      6|    return false;
  146|      6|  }
  147|       |
  148|    101|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    101|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    101|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 21, False: 80]
  ------------------
  150|     21|    uint8_t prediction_mode;
  151|     21|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 21]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     21|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 20]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     20|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 20]
  ------------------
  160|     20|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     20|  }
  164|    100|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    100|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 96]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|     96|  return true;
  172|    100|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     96|                                      const PointIndex *entry_to_point_id_map) {
  103|     96|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     96|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     96|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     96|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     96|  const int corner_map_size =
  111|     96|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     96|  VectorD<int32_t, 3> pred_normal_3d;
  114|     96|  int32_t pred_normal_oct[2];
  115|       |
  116|   167k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 167k, False: 96]
  ------------------
  117|   167k|    const CornerIndex corner_id =
  118|   167k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   167k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   167k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   167k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   167k|                    octahedron_tool_box_.center_value());
  125|   167k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 166k, False: 1.17k]
  ------------------
  126|   166k|      pred_normal_3d = -pred_normal_3d;
  127|   166k|    }
  128|   167k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   167k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   167k|    const int data_offset = data_id * 2;
  132|   167k|    this->transform().ComputeOriginalValue(
  133|   167k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   167k|  }
  135|     96|  flip_normal_bit_decoder_.EndDecoding();
  136|     96|  return true;
  137|     96|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     96|  void SetQuantizationBits(int q) {
   85|     96|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     96|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    204|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    204|            attribute, transform, mesh_data),
   37|    204|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    406|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    204|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    204|    DRACO_DCHECK_EQ(i, 0);
   70|    204|    (void)i;
   71|    204|    return GeometryAttribute::POSITION;
   72|    204|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    203|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    203|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 203]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    203|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 202]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    202|    predictor_.SetPositionAttribute(*att);
   82|    202|    return true;
   83|    203|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    200|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    200|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 19, False: 181]
  ------------------
  145|     19|    return false;
  146|     19|  }
  147|       |
  148|    181|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    181|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    181|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 61, False: 120]
  ------------------
  150|     61|    uint8_t prediction_mode;
  151|     61|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 61]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     61|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 58]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|     58|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 58]
  ------------------
  160|     58|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     58|  }
  164|    178|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    178|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 7, False: 171]
  ------------------
  168|      7|    return false;
  169|      7|  }
  170|       |
  171|    171|  return true;
  172|    178|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    171|                                      const PointIndex *entry_to_point_id_map) {
  103|    171|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    171|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    171|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    171|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    171|  const int corner_map_size =
  111|    171|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    171|  VectorD<int32_t, 3> pred_normal_3d;
  114|    171|  int32_t pred_normal_oct[2];
  115|       |
  116|   616k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 616k, False: 171]
  ------------------
  117|   616k|    const CornerIndex corner_id =
  118|   616k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   616k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   616k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   616k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   616k|                    octahedron_tool_box_.center_value());
  125|   616k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 613k, False: 3.34k]
  ------------------
  126|   613k|      pred_normal_3d = -pred_normal_3d;
  127|   613k|    }
  128|   616k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   616k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   616k|    const int data_offset = data_id * 2;
  132|   616k|    this->transform().ComputeOriginalValue(
  133|   616k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   616k|  }
  135|    171|  flip_normal_bit_decoder_.EndDecoding();
  136|    171|  return true;
  137|    171|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    171|  void SetQuantizationBits(int q) {
   85|    171|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    171|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    355|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    355|            attribute, transform, mesh_data),
   37|    355|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    709|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    355|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    355|    DRACO_DCHECK_EQ(i, 0);
   70|    355|    (void)i;
   71|    355|    return GeometryAttribute::POSITION;
   72|    355|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    355|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    355|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 355]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    355|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 354]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    354|    predictor_.SetPositionAttribute(*att);
   82|    354|    return true;
   83|    355|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    352|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    352|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 23, False: 329]
  ------------------
  145|     23|    return false;
  146|     23|  }
  147|       |
  148|    329|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    329|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    329|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 83, False: 246]
  ------------------
  150|     83|    uint8_t prediction_mode;
  151|     83|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 8, False: 75]
  ------------------
  152|      8|      return false;
  153|      8|    }
  154|     75|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 74]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     74|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 74]
  ------------------
  160|     74|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     74|  }
  164|    320|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    320|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 15, False: 305]
  ------------------
  168|     15|    return false;
  169|     15|  }
  170|       |
  171|    305|  return true;
  172|    320|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    305|                                      const PointIndex *entry_to_point_id_map) {
  103|    305|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    305|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    305|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    305|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    305|  const int corner_map_size =
  111|    305|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    305|  VectorD<int32_t, 3> pred_normal_3d;
  114|    305|  int32_t pred_normal_oct[2];
  115|       |
  116|   141k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 141k, False: 305]
  ------------------
  117|   141k|    const CornerIndex corner_id =
  118|   141k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   141k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   141k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   141k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   141k|                    octahedron_tool_box_.center_value());
  125|   141k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 132k, False: 9.03k]
  ------------------
  126|   132k|      pred_normal_3d = -pred_normal_3d;
  127|   132k|    }
  128|   141k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   141k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   141k|    const int data_offset = data_id * 2;
  132|   141k|    this->transform().ComputeOriginalValue(
  133|   141k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   141k|  }
  135|    305|  flip_normal_bit_decoder_.EndDecoding();
  136|    305|  return true;
  137|    305|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    305|  void SetQuantizationBits(int q) {
   85|    305|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    305|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    146|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    146|            attribute, transform, mesh_data),
   37|    146|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    113|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    113|            attribute, transform, mesh_data),
   37|    113|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    143|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    143|            attribute, transform, mesh_data),
   37|    143|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    111|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    111|            attribute, transform, mesh_data),
   37|    111|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    185|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    185|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 38, False: 147]
  ------------------
  105|     38|      this->normal_prediction_mode_ = mode;
  106|     38|      return true;
  107|    147|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 147, False: 0]
  ------------------
  108|    147|      this->normal_prediction_mode_ = mode;
  109|    147|      return true;
  110|    147|    }
  111|      0|    return false;
  112|    185|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   549k|                             DataTypeT *prediction) override {
   42|   549k|    DRACO_DCHECK(this->IsInitialized());
   43|   549k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   549k|    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|   549k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   549k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   549k|    VectorD<int64_t, 3> normal;
   53|   549k|    CornerIndex c_next, c_prev;
   54|  1.22M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 673k, False: 549k]
  ------------------
   55|       |      // Getting corners.
   56|   673k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 216, False: 673k]
  ------------------
   57|    216|        c_next = corner_table->Next(corner_id);
   58|    216|        c_prev = corner_table->Previous(corner_id);
   59|   673k|      } else {
   60|   673k|        c_next = corner_table->Next(cit.Corner());
   61|   673k|        c_prev = corner_table->Previous(cit.Corner());
   62|   673k|      }
   63|   673k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   673k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   673k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   673k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   673k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   673k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   673k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   673k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   673k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   673k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   673k|      cit.Next();
   81|   673k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   549k|    constexpr int64_t upper_bound = 1 << 29;
   85|   549k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 144, False: 549k]
  ------------------
   86|    144|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    144|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 63, False: 81]
  ------------------
   88|     63|        const int64_t quotient = abs_sum / upper_bound;
   89|     63|        normal = normal / quotient;
   90|     63|      }
   91|   549k|    } else {
   92|   549k|      const int64_t abs_sum = normal.AbsSum();
   93|   549k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.75k, False: 547k]
  ------------------
   94|  1.75k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.75k|        normal = normal / quotient;
   96|  1.75k|      }
   97|   549k|    }
   98|   549k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   549k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   549k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   549k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   549k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    122|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    122|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 8, False: 114]
  ------------------
  105|      8|      this->normal_prediction_mode_ = mode;
  106|      8|      return true;
  107|    114|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 114, False: 0]
  ------------------
  108|    114|      this->normal_prediction_mode_ = mode;
  109|    114|      return true;
  110|    114|    }
  111|      0|    return false;
  112|    122|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   215k|                             DataTypeT *prediction) override {
   42|   215k|    DRACO_DCHECK(this->IsInitialized());
   43|   215k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   215k|    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|   215k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   215k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   215k|    VectorD<int64_t, 3> normal;
   53|   215k|    CornerIndex c_next, c_prev;
   54|  1.50M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.28M, False: 215k]
  ------------------
   55|       |      // Getting corners.
   56|  1.28M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 42, False: 1.28M]
  ------------------
   57|     42|        c_next = corner_table->Next(corner_id);
   58|     42|        c_prev = corner_table->Previous(corner_id);
   59|  1.28M|      } else {
   60|  1.28M|        c_next = corner_table->Next(cit.Corner());
   61|  1.28M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.28M|      }
   63|  1.28M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.28M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.28M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.28M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.28M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.28M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.28M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.28M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.28M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.28M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.28M|      cit.Next();
   81|  1.28M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   215k|    constexpr int64_t upper_bound = 1 << 29;
   85|   215k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 28, False: 215k]
  ------------------
   86|     28|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     28|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 14, False: 14]
  ------------------
   88|     14|        const int64_t quotient = abs_sum / upper_bound;
   89|     14|        normal = normal / quotient;
   90|     14|      }
   91|   215k|    } else {
   92|   215k|      const int64_t abs_sum = normal.AbsSum();
   93|   215k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 166k, False: 48.7k]
  ------------------
   94|   166k|        const int64_t quotient = abs_sum / upper_bound;
   95|   166k|        normal = normal / quotient;
   96|   166k|      }
   97|   215k|    }
   98|   215k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   215k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   215k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   215k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   215k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    176|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    176|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 31, False: 145]
  ------------------
  105|     31|      this->normal_prediction_mode_ = mode;
  106|     31|      return true;
  107|    145|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 145, False: 0]
  ------------------
  108|    145|      this->normal_prediction_mode_ = mode;
  109|    145|      return true;
  110|    145|    }
  111|      0|    return false;
  112|    176|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   336k|                             DataTypeT *prediction) override {
   42|   336k|    DRACO_DCHECK(this->IsInitialized());
   43|   336k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   336k|    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|   336k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   336k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   336k|    VectorD<int64_t, 3> normal;
   53|   336k|    CornerIndex c_next, c_prev;
   54|  1.04M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 709k, False: 336k]
  ------------------
   55|       |      // Getting corners.
   56|   709k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 174, False: 709k]
  ------------------
   57|    174|        c_next = corner_table->Next(corner_id);
   58|    174|        c_prev = corner_table->Previous(corner_id);
   59|   709k|      } else {
   60|   709k|        c_next = corner_table->Next(cit.Corner());
   61|   709k|        c_prev = corner_table->Previous(cit.Corner());
   62|   709k|      }
   63|   709k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   709k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   709k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   709k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   709k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   709k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   709k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   709k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   709k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   709k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   709k|      cit.Next();
   81|   709k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   336k|    constexpr int64_t upper_bound = 1 << 29;
   85|   336k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 116, False: 336k]
  ------------------
   86|    116|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    116|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 53, False: 63]
  ------------------
   88|     53|        const int64_t quotient = abs_sum / upper_bound;
   89|     53|        normal = normal / quotient;
   90|     53|      }
   91|   336k|    } else {
   92|   336k|      const int64_t abs_sum = normal.AbsSum();
   93|   336k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.49k, False: 334k]
  ------------------
   94|  1.49k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.49k|        normal = normal / quotient;
   96|  1.49k|      }
   97|   336k|    }
   98|   336k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   336k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   336k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   336k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   336k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    131|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    131|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 18, False: 113]
  ------------------
  105|     18|      this->normal_prediction_mode_ = mode;
  106|     18|      return true;
  107|    113|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 113, False: 0]
  ------------------
  108|    113|      this->normal_prediction_mode_ = mode;
  109|    113|      return true;
  110|    113|    }
  111|      0|    return false;
  112|    131|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   167k|                             DataTypeT *prediction) override {
   42|   167k|    DRACO_DCHECK(this->IsInitialized());
   43|   167k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   167k|    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|   167k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   167k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   167k|    VectorD<int64_t, 3> normal;
   53|   167k|    CornerIndex c_next, c_prev;
   54|  1.16M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 997k, False: 167k]
  ------------------
   55|       |      // Getting corners.
   56|   997k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 102, False: 997k]
  ------------------
   57|    102|        c_next = corner_table->Next(corner_id);
   58|    102|        c_prev = corner_table->Previous(corner_id);
   59|   997k|      } else {
   60|   997k|        c_next = corner_table->Next(cit.Corner());
   61|   997k|        c_prev = corner_table->Previous(cit.Corner());
   62|   997k|      }
   63|   997k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   997k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   997k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   997k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   997k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   997k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   997k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   997k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   997k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   997k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   997k|      cit.Next();
   81|   997k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   167k|    constexpr int64_t upper_bound = 1 << 29;
   85|   167k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 68, False: 167k]
  ------------------
   86|     68|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     68|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 24, False: 44]
  ------------------
   88|     24|        const int64_t quotient = abs_sum / upper_bound;
   89|     24|        normal = normal / quotient;
   90|     24|      }
   91|   167k|    } else {
   92|   167k|      const int64_t abs_sum = normal.AbsSum();
   93|   167k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 87.4k, False: 79.7k]
  ------------------
   94|  87.4k|        const int64_t quotient = abs_sum / upper_bound;
   95|  87.4k|        normal = normal / quotient;
   96|  87.4k|      }
   97|   167k|    }
   98|   167k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   167k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   167k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   167k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   167k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    204|      : Base(md) {
   35|    204|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    204|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    262|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    262|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 57, False: 205]
  ------------------
  105|     57|      this->normal_prediction_mode_ = mode;
  106|     57|      return true;
  107|    205|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 205, False: 0]
  ------------------
  108|    205|      this->normal_prediction_mode_ = mode;
  109|    205|      return true;
  110|    205|    }
  111|      0|    return false;
  112|    262|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   616k|                             DataTypeT *prediction) override {
   42|   616k|    DRACO_DCHECK(this->IsInitialized());
   43|   616k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   616k|    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|   616k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   616k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   616k|    VectorD<int64_t, 3> normal;
   53|   616k|    CornerIndex c_next, c_prev;
   54|  1.25M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 637k, False: 616k]
  ------------------
   55|       |      // Getting corners.
   56|   637k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 324, False: 637k]
  ------------------
   57|    324|        c_next = corner_table->Next(corner_id);
   58|    324|        c_prev = corner_table->Previous(corner_id);
   59|   637k|      } else {
   60|   637k|        c_next = corner_table->Next(cit.Corner());
   61|   637k|        c_prev = corner_table->Previous(cit.Corner());
   62|   637k|      }
   63|   637k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   637k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   637k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   637k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   637k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   637k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   637k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   637k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   637k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   637k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   637k|      cit.Next();
   81|   637k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   616k|    constexpr int64_t upper_bound = 1 << 29;
   85|   616k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 278, False: 616k]
  ------------------
   86|    278|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    278|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 109, False: 169]
  ------------------
   88|    109|        const int64_t quotient = abs_sum / upper_bound;
   89|    109|        normal = normal / quotient;
   90|    109|      }
   91|   616k|    } else {
   92|   616k|      const int64_t abs_sum = normal.AbsSum();
   93|   616k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.83k, False: 614k]
  ------------------
   94|  1.83k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.83k|        normal = normal / quotient;
   96|  1.83k|      }
   97|   616k|    }
   98|   616k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   616k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   616k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   616k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   616k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    355|      : Base(md) {
   35|    355|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    355|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    429|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    429|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 72, False: 357]
  ------------------
  105|     72|      this->normal_prediction_mode_ = mode;
  106|     72|      return true;
  107|    357|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 357, False: 0]
  ------------------
  108|    357|      this->normal_prediction_mode_ = mode;
  109|    357|      return true;
  110|    357|    }
  111|      0|    return false;
  112|    429|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   141k|                             DataTypeT *prediction) override {
   42|   141k|    DRACO_DCHECK(this->IsInitialized());
   43|   141k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   141k|    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|   141k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   141k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   141k|    VectorD<int64_t, 3> normal;
   53|   141k|    CornerIndex c_next, c_prev;
   54|   942k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 801k, False: 141k]
  ------------------
   55|       |      // Getting corners.
   56|   801k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 408, False: 800k]
  ------------------
   57|    408|        c_next = corner_table->Next(corner_id);
   58|    408|        c_prev = corner_table->Previous(corner_id);
   59|   800k|      } else {
   60|   800k|        c_next = corner_table->Next(cit.Corner());
   61|   800k|        c_prev = corner_table->Previous(cit.Corner());
   62|   800k|      }
   63|   801k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   801k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   801k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   801k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   801k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   801k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   801k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   801k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   801k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   801k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   801k|      cit.Next();
   81|   801k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   141k|    constexpr int64_t upper_bound = 1 << 29;
   85|   141k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 384, False: 140k]
  ------------------
   86|    384|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    384|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 103, False: 281]
  ------------------
   88|    103|        const int64_t quotient = abs_sum / upper_bound;
   89|    103|        normal = normal / quotient;
   90|    103|      }
   91|   140k|    } else {
   92|   140k|      const int64_t abs_sum = normal.AbsSum();
   93|   140k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.60k, False: 137k]
  ------------------
   94|  3.60k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.60k|        normal = normal / quotient;
   96|  3.60k|      }
   97|   140k|    }
   98|   141k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   141k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   141k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   141k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   141k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    146|      : Base(md) {
   35|    146|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    146|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    113|      : Base(md) {
   35|    113|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    113|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    143|      : Base(md) {
   35|    143|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    143|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    111|      : Base(md) {
   35|    111|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    111|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.89M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.89M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.89M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.89M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.89M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.89M|    return GetPositionForDataId(data_id);
   77|  1.89M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.89M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.89M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.89M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.89M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.89M|    VectorD<int64_t, 3> pos;
   68|  1.89M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.89M|    return pos;
   70|  1.89M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    145|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    145|    pos_attribute_ = &position_attribute;
   43|    145|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    130|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    130|    entry_to_point_id_map_ = map;
   46|    130|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.78M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.78M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.78M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.78M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.78M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.78M|    return GetPositionForDataId(data_id);
   77|  2.78M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.78M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.78M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.78M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.78M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.78M|    VectorD<int64_t, 3> pos;
   68|  2.78M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.78M|    return pos;
   70|  2.78M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    112|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    112|    pos_attribute_ = &position_attribute;
   43|    112|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    104|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    104|    entry_to_point_id_map_ = map;
   46|    104|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.75M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.75M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.75M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.75M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.75M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.75M|    return GetPositionForDataId(data_id);
   77|  1.75M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.75M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.75M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.75M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.75M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.75M|    VectorD<int64_t, 3> pos;
   68|  1.75M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.75M|    return pos;
   70|  1.75M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    141|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    141|    pos_attribute_ = &position_attribute;
   43|    141|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    114|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    114|    entry_to_point_id_map_ = map;
   46|    114|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.16M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.16M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.16M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.16M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.16M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.16M|    return GetPositionForDataId(data_id);
   77|  2.16M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.16M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.16M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.16M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.16M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.16M|    VectorD<int64_t, 3> pos;
   68|  2.16M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.16M|    return pos;
   70|  2.16M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    108|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    108|    pos_attribute_ = &position_attribute;
   43|    108|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     96|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     96|    entry_to_point_id_map_ = map;
   46|     96|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    204|      : pos_attribute_(nullptr),
   36|    204|        entry_to_point_id_map_(nullptr),
   37|    204|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    204|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.89M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.89M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.89M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.89M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.89M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.89M|    return GetPositionForDataId(data_id);
   77|  1.89M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.89M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.89M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.89M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.89M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.89M|    VectorD<int64_t, 3> pos;
   68|  1.89M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.89M|    return pos;
   70|  1.89M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    202|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    202|    pos_attribute_ = &position_attribute;
   43|    202|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    171|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    171|    entry_to_point_id_map_ = map;
   46|    171|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    355|      : pos_attribute_(nullptr),
   36|    355|        entry_to_point_id_map_(nullptr),
   37|    355|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    355|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.74M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.74M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.74M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.74M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.74M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.74M|    return GetPositionForDataId(data_id);
   77|  1.74M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.74M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.74M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.74M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.74M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.74M|    VectorD<int64_t, 3> pos;
   68|  1.74M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.74M|    return pos;
   70|  1.74M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    354|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    354|    pos_attribute_ = &position_attribute;
   43|    354|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    305|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    305|    entry_to_point_id_map_ = map;
   46|    305|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    146|      : pos_attribute_(nullptr),
   36|    146|        entry_to_point_id_map_(nullptr),
   37|    146|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    146|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    113|      : pos_attribute_(nullptr),
   36|    113|        entry_to_point_id_map_(nullptr),
   37|    113|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    113|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    143|      : pos_attribute_(nullptr),
   36|    143|        entry_to_point_id_map_(nullptr),
   37|    143|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    143|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    111|      : pos_attribute_(nullptr),
   36|    111|        entry_to_point_id_map_(nullptr),
   37|    111|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    111|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    299|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    299|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    285|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    285|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    285|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    285|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    285|      new DataTypeT[num_components]());
   70|       |
   71|    285|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    285|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    285|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    285|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    285|  const int corner_map_size =
   78|    285|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  1.36M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 1.36M, False: 285]
  ------------------
   80|  1.36M|    const CornerIndex start_corner_id =
   81|  1.36M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  1.36M|    CornerIndex corner_id(start_corner_id);
   84|  1.36M|    int num_parallelograms = 0;
   85|  72.5M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 71.1M, False: 1.36M]
  ------------------
   86|  71.1M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  71.1M|    }
   88|  3.10M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.73M, False: 1.36M]
  ------------------
   89|  1.73M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 151k, False: 1.58M]
  ------------------
   90|  1.73M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.73M|              num_components, parallelogram_pred_vals.get())) {
   92|  4.08M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 3.93M, False: 151k]
  ------------------
   93|  3.93M|          pred_vals[c] =
   94|  3.93M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  3.93M|        }
   96|   151k|        ++num_parallelograms;
   97|   151k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.73M|      corner_id = table->SwingRight(corner_id);
  101|  1.73M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 71.2k, False: 1.66M]
  ------------------
  102|  71.2k|        corner_id = kInvalidCornerIndex;
  103|  71.2k|      }
  104|  1.73M|    }
  105|       |
  106|  1.36M|    const int dst_offset = p * num_components;
  107|  1.36M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.28M, False: 81.6k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.28M|      const int src_offset = (p - 1) * num_components;
  111|  1.28M|      this->transform().ComputeOriginalValue(
  112|  1.28M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  1.28M|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  2.21M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 2.13M, False: 81.6k]
  ------------------
  116|  2.13M|        pred_vals[c] /= num_parallelograms;
  117|  2.13M|      }
  118|  81.6k|      this->transform().ComputeOriginalValue(
  119|  81.6k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  81.6k|    }
  121|  1.36M|  }
  122|    285|  return true;
  123|    285|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    362|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    362|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    341|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    341|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    341|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    341|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    341|      new DataTypeT[num_components]());
   70|       |
   71|    341|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    341|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    341|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    341|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    341|  const int corner_map_size =
   78|    341|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   703k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 703k, False: 341]
  ------------------
   80|   703k|    const CornerIndex start_corner_id =
   81|   703k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   703k|    CornerIndex corner_id(start_corner_id);
   84|   703k|    int num_parallelograms = 0;
   85|  21.7M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 21.0M, False: 703k]
  ------------------
   86|  21.0M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  21.0M|    }
   88|  4.87M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 4.17M, False: 703k]
  ------------------
   89|  4.17M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.36M, False: 2.80M]
  ------------------
   90|  4.17M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  4.17M|              num_components, parallelogram_pred_vals.get())) {
   92|  42.4M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 41.0M, False: 1.36M]
  ------------------
   93|  41.0M|          pred_vals[c] =
   94|  41.0M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  41.0M|        }
   96|  1.36M|        ++num_parallelograms;
   97|  1.36M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  4.17M|      corner_id = table->SwingRight(corner_id);
  101|  4.17M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 692k, False: 3.48M]
  ------------------
  102|   692k|        corner_id = kInvalidCornerIndex;
  103|   692k|      }
  104|  4.17M|    }
  105|       |
  106|   703k|    const int dst_offset = p * num_components;
  107|   703k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.06k, False: 702k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.06k|      const int src_offset = (p - 1) * num_components;
  111|  1.06k|      this->transform().ComputeOriginalValue(
  112|  1.06k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   702k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  21.7M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 21.0M, False: 702k]
  ------------------
  116|  21.0M|        pred_vals[c] /= num_parallelograms;
  117|  21.0M|      }
  118|   702k|      this->transform().ComputeOriginalValue(
  119|   702k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   702k|    }
  121|   703k|  }
  122|    341|  return true;
  123|    341|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  4.11M|    int num_components, DataTypeT *out_prediction) {
   49|  4.11M|  const CornerIndex oci = table->Opposite(ci);
   50|  4.11M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 3.38M, False: 737k]
  ------------------
   51|  3.38M|    return false;
   52|  3.38M|  }
   53|   737k|  int vert_opp, vert_next, vert_prev;
   54|   737k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   737k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   737k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 394k, False: 343k]
  |  Branch (56:35): [True: 304k, False: 89.9k]
  ------------------
   57|   304k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 283k, False: 21.0k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   283k|    const int v_opp_off = vert_opp * num_components;
   60|   283k|    const int v_next_off = vert_next * num_components;
   61|   283k|    const int v_prev_off = vert_prev * num_components;
   62|  20.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 20.4M, False: 283k]
  ------------------
   63|  20.4M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  20.4M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  20.4M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  20.4M|      const int64_t result =
   67|  20.4M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  20.4M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  20.4M|    }
   71|   283k|    return true;
   72|   283k|  }
   73|   454k|  return false;  // Not all data is available for prediction
   74|   737k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   737k|    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|   737k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   737k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   737k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   737k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.35M|    int num_components, DataTypeT *out_prediction) {
   49|  5.35M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.35M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 15.0k, False: 5.33M]
  ------------------
   51|  15.0k|    return false;
   52|  15.0k|  }
   53|  5.33M|  int vert_opp, vert_next, vert_prev;
   54|  5.33M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  5.33M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  5.33M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 2.96M, False: 2.37M]
  |  Branch (56:35): [True: 2.30M, False: 654k]
  ------------------
   57|  2.30M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.16M, False: 140k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.16M|    const int v_opp_off = vert_opp * num_components;
   60|  2.16M|    const int v_next_off = vert_next * num_components;
   61|  2.16M|    const int v_prev_off = vert_prev * num_components;
   62|  92.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 90.6M, False: 2.16M]
  ------------------
   63|  90.6M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  90.6M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  90.6M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  90.6M|      const int64_t result =
   67|  90.6M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  90.6M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  90.6M|    }
   71|  2.16M|    return true;
   72|  2.16M|  }
   73|  3.17M|  return false;  // Not all data is available for prediction
   74|  5.33M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  5.33M|    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|  5.33M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  5.33M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  5.33M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  5.33M|}

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

_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   36|    188|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   37|    188|            attribute, transform, mesh_data),
   38|    188|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   60|    373|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   62|    188|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   63|    188|    DRACO_DCHECK_EQ(i, 0);
   64|    188|    (void)i;
   65|    188|    return GeometryAttribute::POSITION;
   66|    188|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   68|    188|  bool SetParentAttribute(const PointAttribute *att) override {
   69|    188|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (69:9): [True: 0, False: 188]
  |  Branch (69:17): [True: 0, False: 188]
  ------------------
   70|      0|      return false;  // Invalid attribute type.
   71|      0|    }
   72|    188|    if (att->num_components() != 3) {
  ------------------
  |  Branch (72:9): [True: 3, False: 185]
  ------------------
   73|      3|      return false;  // Currently works only for 3 component positions.
   74|      3|    }
   75|    185|    predictor_.SetPositionAttribute(*att);
   76|    185|    return true;
   77|    188|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  118|    184|                                                                *buffer) {
  119|       |  // Decode the delta coded orientations.
  120|    184|  int32_t num_orientations = 0;
  121|    184|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (121:7): [True: 1, False: 183]
  |  Branch (121:45): [True: 6, False: 177]
  ------------------
  122|      7|    return false;
  123|      7|  }
  124|    177|  predictor_.ResizeOrientations(num_orientations);
  125|    177|  bool last_orientation = true;
  126|    177|  RAnsBitDecoder decoder;
  127|    177|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 165]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|  2.51G|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (130:19): [True: 2.51G, False: 165]
  ------------------
  131|  2.51G|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (131:9): [True: 372M, False: 2.13G]
  ------------------
  132|   372M|      last_orientation = !last_orientation;
  133|   372M|    }
  134|  2.51G|    predictor_.set_orientation(i, last_orientation);
  135|  2.51G|  }
  136|    165|  decoder.EndDecoding();
  137|    165|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  138|    165|                                     MeshDataT>::DecodePredictionData(buffer);
  139|    177|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   90|    151|                                      const PointIndex *entry_to_point_id_map) {
   91|    151|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (91:7): [True: 5, False: 146]
  ------------------
   92|    151|                            DataTypeT, MeshDataT>::kNumComponents) {
   93|      5|    return false;
   94|      5|  }
   95|    146|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
   96|    146|  this->transform().Init(num_components);
   97|       |
   98|    146|  const int corner_map_size =
   99|    146|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  100|   300k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (100:19): [True: 300k, False: 88]
  ------------------
  101|   300k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  102|   300k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (102:9): [True: 58, False: 299k]
  ------------------
  103|   300k|                                                          p)) {
  104|     58|      return false;
  105|     58|    }
  106|       |
  107|   299k|    const int dst_offset = p * num_components;
  108|   299k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  109|   299k|                                           in_corr + dst_offset,
  110|   299k|                                           out_data + dst_offset);
  111|   299k|  }
  112|     88|  return true;
  113|    146|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   36|    229|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   37|    229|            attribute, transform, mesh_data),
   38|    229|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   60|    455|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   62|    229|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   63|    229|    DRACO_DCHECK_EQ(i, 0);
   64|    229|    (void)i;
   65|    229|    return GeometryAttribute::POSITION;
   66|    229|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   68|    228|  bool SetParentAttribute(const PointAttribute *att) override {
   69|    228|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (69:9): [True: 0, False: 228]
  |  Branch (69:17): [True: 0, False: 228]
  ------------------
   70|      0|      return false;  // Invalid attribute type.
   71|      0|    }
   72|    228|    if (att->num_components() != 3) {
  ------------------
  |  Branch (72:9): [True: 2, False: 226]
  ------------------
   73|      2|      return false;  // Currently works only for 3 component positions.
   74|      2|    }
   75|    226|    predictor_.SetPositionAttribute(*att);
   76|    226|    return true;
   77|    228|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  118|    222|                                                                *buffer) {
  119|       |  // Decode the delta coded orientations.
  120|    222|  int32_t num_orientations = 0;
  121|    222|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (121:7): [True: 2, False: 220]
  |  Branch (121:45): [True: 2, False: 218]
  ------------------
  122|      4|    return false;
  123|      4|  }
  124|    218|  predictor_.ResizeOrientations(num_orientations);
  125|    218|  bool last_orientation = true;
  126|    218|  RAnsBitDecoder decoder;
  127|    218|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 206]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|  2.05G|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (130:19): [True: 2.05G, False: 206]
  ------------------
  131|  2.05G|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (131:9): [True: 295M, False: 1.75G]
  ------------------
  132|   295M|      last_orientation = !last_orientation;
  133|   295M|    }
  134|  2.05G|    predictor_.set_orientation(i, last_orientation);
  135|  2.05G|  }
  136|    206|  decoder.EndDecoding();
  137|    206|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  138|    206|                                     MeshDataT>::DecodePredictionData(buffer);
  139|    218|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   90|    170|                                      const PointIndex *entry_to_point_id_map) {
   91|    170|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (91:7): [True: 5, False: 165]
  ------------------
   92|    170|                            DataTypeT, MeshDataT>::kNumComponents) {
   93|      5|    return false;
   94|      5|  }
   95|    165|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
   96|    165|  this->transform().Init(num_components);
   97|       |
   98|    165|  const int corner_map_size =
   99|    165|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  100|   244k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (100:19): [True: 244k, False: 119]
  ------------------
  101|   244k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  102|   244k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (102:9): [True: 46, False: 244k]
  ------------------
  103|   244k|                                                          p)) {
  104|     46|      return false;
  105|     46|    }
  106|       |
  107|   244k|    const int dst_offset = p * num_components;
  108|   244k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  109|   244k|                                           in_corr + dst_offset,
  110|   244k|                                           out_data + dst_offset);
  111|   244k|  }
  112|    119|  return true;
  113|    165|}

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    188|      : pos_attribute_(nullptr),
   39|    188|        entry_to_point_id_map_(nullptr),
   40|    188|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    185|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    185|    pos_attribute_ = &position_attribute;
   43|    185|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    177|  void ResizeOrientations(int num_orientations) {
   74|    177|    orientations_.resize(num_orientations);
   75|    177|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  2.51G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    146|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    146|    entry_to_point_id_map_ = map;
   46|    146|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   300k|                                                 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|   300k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   300k|  const CornerIndex prev_corner_id =
   99|   300k|      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|   300k|  int next_data_id, prev_data_id;
  103|       |
  104|   300k|  int next_vert_id, prev_vert_id;
  105|   300k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   300k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   300k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   300k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   300k|  typedef VectorD<int64_t, 2> Vec2;
  112|   300k|  typedef VectorD<int64_t, 3> Vec3;
  113|   300k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   300k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 205k, False: 94.3k]
  |  Branch (115:33): [True: 111k, False: 94.3k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   111k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   111k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   111k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 100k, False: 11.2k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   100k|      predicted_value_[0] = p_uv[0];
  122|   100k|      predicted_value_[1] = p_uv[1];
  123|   100k|      return true;
  124|   100k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  11.2k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  11.2k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  11.2k|    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|  11.2k|    const Vec3 pn = prev_pos - next_pos;
  146|  11.2k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  11.2k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.72k, False: 9.53k]
  ------------------
  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.72k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.72k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.72k|      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.72k|      const int64_t n_uv_absmax_element =
  164|  1.72k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.72k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 26, False: 1.69k]
  ------------------
  166|  1.72k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     26|        return false;
  169|     26|      }
  170|  1.69k|      const int64_t pn_uv_absmax_element =
  171|  1.69k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.69k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 19, False: 1.68k]
  ------------------
  173|  1.69k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     19|        return false;
  176|     19|      }
  177|  1.68k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.68k|      const int64_t pn_absmax_element =
  179|  1.68k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.68k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 8, False: 1.67k]
  ------------------
  181|  1.68k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      8|        return false;
  184|      8|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.67k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.67k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  189|       |
  190|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  191|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  192|       |      //
  193|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  194|       |      //
  195|       |      // To preserve precision, we perform all operations in scaled space as
  196|       |      // explained above, so we want the final vector to be:
  197|       |      //
  198|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  199|       |      //
  200|       |      // We can then rewrite the formula as:
  201|       |      //
  202|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  203|       |      //
  204|  1.67k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.67k|      const uint64_t norm_squared =
  207|  1.67k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.67k|      cx_uv = cx_uv * norm_squared;
  210|       |
  211|       |      // Predicted uv coordinate is then computed by either adding or
  212|       |      // subtracting CX_UV to/from X_UV.
  213|  1.67k|      Vec2 predicted_uv;
  214|  1.67k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.67k]
  ------------------
  215|       |        // When encoding, compute both possible vectors and determine which one
  216|       |        // results in a better prediction.
  217|       |        // Both vectors need to be transformed back from the scaled space to
  218|       |        // the real UV coordinate space.
  219|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  220|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  221|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  222|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  224|      0|          predicted_uv = predicted_uv_0;
  225|      0|          orientations_.push_back(true);
  226|      0|        } else {
  227|      0|          predicted_uv = predicted_uv_1;
  228|      0|          orientations_.push_back(false);
  229|      0|        }
  230|  1.67k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.67k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 5, False: 1.66k]
  ------------------
  233|      5|          return false;
  234|      5|        }
  235|  1.66k|        const bool orientation = orientations_.back();
  236|  1.66k|        orientations_.pop_back();
  237|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  238|       |        // Note that the result will be the same (for non-overflowing values).
  239|  1.66k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 517, False: 1.15k]
  ------------------
  240|    517|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.15k|        } else {
  242|  1.15k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.15k|        }
  244|  1.66k|      }
  245|  1.66k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.66k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.66k|      return true;
  248|  1.67k|    }
  249|  11.2k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|   198k|  int data_offset = 0;
  254|   198k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 103k, False: 94.3k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|   103k|    data_offset = prev_data_id * kNumComponents;
  257|   103k|  }
  258|   198k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 9.53k, False: 188k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  9.53k|    data_offset = next_data_id * kNumComponents;
  261|   188k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   188k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 188k, False: 146]
  ------------------
  265|   188k|      data_offset = (data_id - 1) * kNumComponents;
  266|   188k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    438|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 292, False: 146]
  ------------------
  269|    292|        predicted_value_[i] = 0;
  270|    292|      }
  271|    146|      return true;
  272|    146|    }
  273|   188k|  }
  274|   594k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 396k, False: 198k]
  ------------------
  275|   396k|    predicted_value_[i] = data[data_offset + i];
  276|   396k|  }
  277|   198k|  return true;
  278|   198k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   222k|                                            const DataTypeT *data) const {
   59|   222k|    const int data_offset = entry_id * kNumComponents;
   60|   222k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   222k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  33.7k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  33.7k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  33.7k|    VectorD<int64_t, 3> pos;
   52|  33.7k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  33.7k|                                 &pos[0]);
   54|  33.7k|    return pos;
   55|  33.7k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   299k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    229|      : pos_attribute_(nullptr),
   39|    229|        entry_to_point_id_map_(nullptr),
   40|    229|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    226|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    226|    pos_attribute_ = &position_attribute;
   43|    226|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    218|  void ResizeOrientations(int num_orientations) {
   74|    218|    orientations_.resize(num_orientations);
   75|    218|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  2.05G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    165|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    165|    entry_to_point_id_map_ = map;
   46|    165|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   244k|                                                 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|   244k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   244k|  const CornerIndex prev_corner_id =
   99|   244k|      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|   244k|  int next_data_id, prev_data_id;
  103|       |
  104|   244k|  int next_vert_id, prev_vert_id;
  105|   244k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   244k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   244k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   244k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   244k|  typedef VectorD<int64_t, 2> Vec2;
  112|   244k|  typedef VectorD<int64_t, 3> Vec3;
  113|   244k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   244k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 244k, False: 289]
  |  Branch (115:33): [True: 244k, False: 272]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   244k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   244k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   244k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 225k, False: 19.0k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   225k|      predicted_value_[0] = p_uv[0];
  122|   225k|      predicted_value_[1] = p_uv[1];
  123|   225k|      return true;
  124|   225k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  19.0k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  19.0k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  19.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|  19.0k|    const Vec3 pn = prev_pos - next_pos;
  146|  19.0k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  19.0k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.43k, False: 17.6k]
  ------------------
  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.43k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.43k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.43k|      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.43k|      const int64_t n_uv_absmax_element =
  164|  1.43k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.43k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 27, False: 1.40k]
  ------------------
  166|  1.43k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     27|        return false;
  169|     27|      }
  170|  1.40k|      const int64_t pn_uv_absmax_element =
  171|  1.40k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.40k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 9, False: 1.39k]
  ------------------
  173|  1.40k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      9|        return false;
  176|      9|      }
  177|  1.39k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.39k|      const int64_t pn_absmax_element =
  179|  1.39k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.39k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 8, False: 1.39k]
  ------------------
  181|  1.39k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      8|        return false;
  184|      8|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.39k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.39k|      const uint64_t cx_norm2_squared = (tip_pos - x_pos).SquaredNorm();
  189|       |
  190|       |      // Compute vector CX_UV in the uv space by rotating vector PN_UV by 90
  191|       |      // degrees and scaling it with factor CX.Norm2() / PN.Norm2():
  192|       |      //
  193|       |      //     CX_UV = (CX.Norm2() / PN.Norm2()) * Rot(PN_UV)
  194|       |      //
  195|       |      // To preserve precision, we perform all operations in scaled space as
  196|       |      // explained above, so we want the final vector to be:
  197|       |      //
  198|       |      //     cx_uv = CX_UV * PN.Norm2Squared()
  199|       |      //
  200|       |      // We can then rewrite the formula as:
  201|       |      //
  202|       |      //     cx_uv = CX.Norm2() * PN.Norm2() * Rot(PN_UV)
  203|       |      //
  204|  1.39k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.39k|      const uint64_t norm_squared =
  207|  1.39k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.39k|      cx_uv = cx_uv * norm_squared;
  210|       |
  211|       |      // Predicted uv coordinate is then computed by either adding or
  212|       |      // subtracting CX_UV to/from X_UV.
  213|  1.39k|      Vec2 predicted_uv;
  214|  1.39k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.39k]
  ------------------
  215|       |        // When encoding, compute both possible vectors and determine which one
  216|       |        // results in a better prediction.
  217|       |        // Both vectors need to be transformed back from the scaled space to
  218|       |        // the real UV coordinate space.
  219|      0|        const Vec2 predicted_uv_0((x_uv + cx_uv) / pn_norm2_squared);
  220|      0|        const Vec2 predicted_uv_1((x_uv - cx_uv) / pn_norm2_squared);
  221|      0|        const Vec2 c_uv = GetTexCoordForEntryId(data_id, data);
  222|      0|        if ((c_uv - predicted_uv_0).SquaredNorm() <
  ------------------
  |  Branch (222:13): [True: 0, False: 0]
  ------------------
  223|      0|            (c_uv - predicted_uv_1).SquaredNorm()) {
  224|      0|          predicted_uv = predicted_uv_0;
  225|      0|          orientations_.push_back(true);
  226|      0|        } else {
  227|      0|          predicted_uv = predicted_uv_1;
  228|      0|          orientations_.push_back(false);
  229|      0|        }
  230|  1.39k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.39k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 2, False: 1.38k]
  ------------------
  233|      2|          return false;
  234|      2|        }
  235|  1.38k|        const bool orientation = orientations_.back();
  236|  1.38k|        orientations_.pop_back();
  237|       |        // Perform operations in unsigned type to avoid signed integer overflow.
  238|       |        // Note that the result will be the same (for non-overflowing values).
  239|  1.38k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 284, False: 1.10k]
  ------------------
  240|    284|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.10k|        } else {
  242|  1.10k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.10k|        }
  244|  1.38k|      }
  245|  1.38k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.38k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.38k|      return true;
  248|  1.39k|    }
  249|  19.0k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|  18.1k|  int data_offset = 0;
  254|  18.1k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 17.8k, False: 289]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  17.8k|    data_offset = prev_data_id * kNumComponents;
  257|  17.8k|  }
  258|  18.1k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 17.6k, False: 542]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  17.6k|    data_offset = next_data_id * kNumComponents;
  261|  17.6k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    542|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 377, False: 165]
  ------------------
  265|    377|      data_offset = (data_id - 1) * kNumComponents;
  266|    377|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    495|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 330, False: 165]
  ------------------
  269|    330|        predicted_value_[i] = 0;
  270|    330|      }
  271|    165|      return true;
  272|    165|    }
  273|    542|  }
  274|  54.0k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 36.0k, False: 18.0k]
  ------------------
  275|  36.0k|    predicted_value_[i] = data[data_offset + i];
  276|  36.0k|  }
  277|  18.0k|  return true;
  278|  18.1k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   488k|                                            const DataTypeT *data) const {
   59|   488k|    const int data_offset = entry_id * kNumComponents;
   60|   488k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   488k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  57.1k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  57.1k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  57.1k|    VectorD<int64_t, 3> pos;
   52|  57.1k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  57.1k|                                 &pos[0]);
   54|  57.1k|    return pos;
   55|  57.1k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   244k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    124|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    371|  bool AreCorrectionsPositive() override {
   71|    371|    return transform_.AreCorrectionsPositive();
   72|    371|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    114|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    114|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 27, False: 87]
  ------------------
   50|     27|      return false;
   51|     27|    }
   52|     87|    return true;
   53|    114|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  17.5M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    186|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    422|  bool AreCorrectionsPositive() override {
   71|    422|    return transform_.AreCorrectionsPositive();
   72|    422|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    175|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    175|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 24, False: 151]
  ------------------
   50|     24|      return false;
   51|     24|    }
   52|    151|    return true;
   53|    175|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   726k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  4.07k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  2.82k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  3.89k|  bool AreCorrectionsPositive() override {
   71|  3.89k|    return transform_.AreCorrectionsPositive();
   72|  3.89k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.12k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  3.12k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 259, False: 2.87k]
  ------------------
   50|    259|      return false;
   51|    259|    }
   52|  2.87k|    return true;
   53|  3.12k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  25.8M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    383|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    440|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    383|                                 const PointCloudDecoder *decoder) {
  188|    383|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    383|      method, att_id, decoder, TransformT());
  190|    383|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    383|                                 const TransformT &transform) {
  156|    383|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 383]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    383|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    383|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 364, False: 19]
  ------------------
  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|    364|    const MeshDecoder *const mesh_decoder =
  167|    364|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    364|    auto ret = CreateMeshPredictionScheme<
  170|    364|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    364|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    364|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    364|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 259, False: 105]
  ------------------
  174|    259|      return ret;
  175|    259|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    364|  }
  178|       |  // Create delta decoder.
  179|    124|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    124|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    383|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    148|      uint16_t bitstream_version) {
  143|    148|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    148|        method, attribute, transform, mesh_data, bitstream_version);
  145|    148|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    148|        uint16_t bitstream_version) {
  127|    148|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 146, False: 2]
  ------------------
  128|    146|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    146|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    146|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    146|                                                  mesh_data));
  132|    146|      }
  133|      2|      return nullptr;
  134|    148|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    115|      uint16_t bitstream_version) {
  143|    115|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    115|        method, attribute, transform, mesh_data, bitstream_version);
  145|    115|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    115|        uint16_t bitstream_version) {
  127|    115|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 113, False: 2]
  ------------------
  128|    113|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    113|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    113|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    113|                                                  mesh_data));
  132|    113|      }
  133|      2|      return nullptr;
  134|    115|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    440|                                 const PointCloudDecoder *decoder) {
  188|    440|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    440|      method, att_id, decoder, TransformT());
  190|    440|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    440|                                 const TransformT &transform) {
  156|    440|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 440]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    440|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    440|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 439, False: 1]
  ------------------
  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|    439|    const MeshDecoder *const mesh_decoder =
  167|    439|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    439|    auto ret = CreateMeshPredictionScheme<
  170|    439|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    439|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    439|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    439|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 254, False: 185]
  ------------------
  174|    254|      return ret;
  175|    254|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    439|  }
  178|       |  // Create delta decoder.
  179|    186|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    186|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    440|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    162|      uint16_t bitstream_version) {
  143|    162|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    162|        method, attribute, transform, mesh_data, bitstream_version);
  145|    162|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    162|        uint16_t bitstream_version) {
  111|    162|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 143, False: 19]
  ------------------
  112|    143|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    143|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    143|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    143|                                                  mesh_data));
  116|    143|      }
  117|     19|      return nullptr;
  118|    162|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    113|      uint16_t bitstream_version) {
  143|    113|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    113|        method, attribute, transform, mesh_data, bitstream_version);
  145|    113|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    113|        uint16_t bitstream_version) {
  111|    113|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 111, False: 2]
  ------------------
  112|    111|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    111|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    111|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    111|                                                  mesh_data));
  116|    111|      }
  117|      2|      return nullptr;
  118|    113|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  4.07k|                                 const PointCloudDecoder *decoder) {
  188|  4.07k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  4.07k|      method, att_id, decoder, TransformT());
  190|  4.07k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  4.07k|                                 const TransformT &transform) {
  156|  4.07k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 4.07k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  4.07k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  4.07k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 4.05k, False: 22]
  ------------------
  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|  4.05k|    const MeshDecoder *const mesh_decoder =
  167|  4.05k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  4.05k|    auto ret = CreateMeshPredictionScheme<
  170|  4.05k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  4.05k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  4.05k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  4.05k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 3.71k, False: 343]
  ------------------
  174|  3.71k|      return ret;
  175|  3.71k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  4.05k|  }
  178|       |  // Create delta decoder.
  179|    365|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    365|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  4.07k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.70k|      uint16_t bitstream_version) {
  143|  1.70k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.70k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.70k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.70k|        uint16_t bitstream_version) {
   53|  1.70k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 529, False: 1.17k]
  ------------------
   54|    529|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    529|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    529|                                                         MeshDataT>(
   57|    529|                attribute, transform, mesh_data));
   58|    529|      }
   59|  1.17k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.17k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 299, False: 877]
  ------------------
   61|    299|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    299|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    299|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    299|                                                  mesh_data));
   65|    299|      }
   66|    877|#endif
   67|    877|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 330, False: 547]
  ------------------
   68|    330|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    330|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    330|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    330|                                                  mesh_data));
   72|    330|      }
   73|    547|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    547|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 155, False: 392]
  ------------------
   75|    155|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    155|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    155|                                                     MeshDataT>(
   78|    155|                attribute, transform, mesh_data, bitstream_version));
   79|    155|      }
   80|    392|#endif
   81|    392|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 188, False: 204]
  ------------------
   82|    188|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    188|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    188|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    188|                                                  mesh_data));
   86|    188|      }
   87|    204|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    204|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 204, False: 0]
  ------------------
   89|    204|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    204|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    204|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    204|                                                  mesh_data));
   93|    204|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.70k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.00k|      uint16_t bitstream_version) {
  143|  2.00k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.00k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.00k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.00k|        uint16_t bitstream_version) {
   53|  2.00k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 532, False: 1.47k]
  ------------------
   54|    532|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    532|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    532|                                                         MeshDataT>(
   57|    532|                attribute, transform, mesh_data));
   58|    532|      }
   59|  1.47k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.47k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 362, False: 1.11k]
  ------------------
   61|    362|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    362|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    362|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    362|                                                  mesh_data));
   65|    362|      }
   66|  1.11k|#endif
   67|  1.11k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 411, False: 703]
  ------------------
   68|    411|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    411|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    411|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    411|                                                  mesh_data));
   72|    411|      }
   73|    703|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    703|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 119, False: 584]
  ------------------
   75|    119|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    119|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    119|                                                     MeshDataT>(
   78|    119|                attribute, transform, mesh_data, bitstream_version));
   79|    119|      }
   80|    584|#endif
   81|    584|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 229, False: 355]
  ------------------
   82|    229|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    229|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    229|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    229|                                                  mesh_data));
   86|    229|      }
   87|    355|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    355|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 355, False: 0]
  ------------------
   89|    355|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    355|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    355|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    355|                                                  mesh_data));
   93|    355|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.00k|    }

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     87|    const PointIndex *) {
   50|     87|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     87|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     87|  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|  16.8M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 16.8M, False: 87]
  ------------------
   57|  16.8M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  16.8M|                                           in_corr + i, out_data + i);
   59|  16.8M|  }
   60|     87|  return true;
   61|     87|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    151|    const PointIndex *) {
   50|    151|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    151|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    151|  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|   222k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 222k, False: 151]
  ------------------
   57|   222k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   222k|                                           in_corr + i, out_data + i);
   59|   222k|  }
   60|    151|  return true;
   61|    151|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    365|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    262|    const PointIndex *) {
   50|    262|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    262|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    262|  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.5M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 18.5M, False: 262]
  ------------------
   57|  18.5M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  18.5M|                                           in_corr + i, out_data + i);
   59|  18.5M|  }
   60|    262|  return true;
   61|    262|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    124|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    186|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    364|    uint16_t bitstream_version) {
   38|    364|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    364|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 364, False: 0]
  ------------------
   40|    364|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 3, False: 361]
  ------------------
   41|    361|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 23, False: 338]
  ------------------
   42|    338|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 338]
  ------------------
   43|    338|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 24, False: 314]
  ------------------
   44|    314|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 259, False: 55]
  ------------------
   45|    348|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 39, False: 16]
  ------------------
   46|    348|    const CornerTable *const ct = source->GetCornerTable();
   47|    348|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    348|        source->GetAttributeEncodingData(att_id);
   49|    348|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 85, False: 263]
  |  Branch (49:26): [True: 0, False: 263]
  ------------------
   50|       |      // No connectivity data found.
   51|     85|      return nullptr;
   52|     85|    }
   53|       |    // Connectivity data exists.
   54|    263|    const MeshAttributeCornerTable *const att_ct =
   55|    263|        source->GetAttributeCornerTable(att_id);
   56|    263|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 148, False: 115]
  ------------------
   57|    148|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    148|      MeshData md;
   59|    148|      md.Set(source->mesh(), att_ct,
   60|    148|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    148|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    148|      MeshPredictionSchemeFactoryT factory;
   63|    148|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    148|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 146, False: 2]
  ------------------
   65|    146|        return ret;
   66|    146|      }
   67|    148|    } else {
   68|    115|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    115|      MeshData md;
   70|    115|      md.Set(source->mesh(), ct,
   71|    115|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    115|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    115|      MeshPredictionSchemeFactoryT factory;
   74|    115|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    115|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 113, False: 2]
  ------------------
   76|    113|        return ret;
   77|    113|      }
   78|    115|    }
   79|    263|  }
   80|     20|  return nullptr;
   81|    364|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    439|    uint16_t bitstream_version) {
   38|    439|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    439|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 439, False: 0]
  ------------------
   40|    439|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 35, False: 404]
  ------------------
   41|    404|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 17, False: 387]
  ------------------
   42|    387|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 3, False: 384]
  ------------------
   43|    384|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 32, False: 352]
  ------------------
   44|    352|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 292, False: 60]
  ------------------
   45|    429|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 50, False: 10]
  ------------------
   46|    429|    const CornerTable *const ct = source->GetCornerTable();
   47|    429|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    429|        source->GetAttributeEncodingData(att_id);
   49|    429|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 154, False: 275]
  |  Branch (49:26): [True: 0, False: 275]
  ------------------
   50|       |      // No connectivity data found.
   51|    154|      return nullptr;
   52|    154|    }
   53|       |    // Connectivity data exists.
   54|    275|    const MeshAttributeCornerTable *const att_ct =
   55|    275|        source->GetAttributeCornerTable(att_id);
   56|    275|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 162, False: 113]
  ------------------
   57|    162|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    162|      MeshData md;
   59|    162|      md.Set(source->mesh(), att_ct,
   60|    162|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    162|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    162|      MeshPredictionSchemeFactoryT factory;
   63|    162|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    162|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 143, False: 19]
  ------------------
   65|    143|        return ret;
   66|    143|      }
   67|    162|    } else {
   68|    113|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    113|      MeshData md;
   70|    113|      md.Set(source->mesh(), ct,
   71|    113|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    113|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    113|      MeshPredictionSchemeFactoryT factory;
   74|    113|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    113|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 111, False: 2]
  ------------------
   76|    111|        return ret;
   77|    111|      }
   78|    113|    }
   79|    275|  }
   80|     31|  return nullptr;
   81|    439|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  4.05k|    uint16_t bitstream_version) {
   38|  4.05k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  4.05k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 4.05k, False: 0]
  ------------------
   40|  4.05k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.14k, False: 2.91k]
  ------------------
   41|  2.91k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 687, False: 2.22k]
  ------------------
   42|  2.22k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 769, False: 1.45k]
  ------------------
   43|  1.45k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 437, False: 1.01k]
  ------------------
   44|  1.01k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 566, False: 451]
  ------------------
   45|  3.91k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 311, False: 140]
  ------------------
   46|  3.91k|    const CornerTable *const ct = source->GetCornerTable();
   47|  3.91k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  3.91k|        source->GetAttributeEncodingData(att_id);
   49|  3.91k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 203, False: 3.71k]
  |  Branch (49:26): [True: 0, False: 3.71k]
  ------------------
   50|       |      // No connectivity data found.
   51|    203|      return nullptr;
   52|    203|    }
   53|       |    // Connectivity data exists.
   54|  3.71k|    const MeshAttributeCornerTable *const att_ct =
   55|  3.71k|        source->GetAttributeCornerTable(att_id);
   56|  3.71k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.70k, False: 2.00k]
  ------------------
   57|  1.70k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.70k|      MeshData md;
   59|  1.70k|      md.Set(source->mesh(), att_ct,
   60|  1.70k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.70k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.70k|      MeshPredictionSchemeFactoryT factory;
   63|  1.70k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.70k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.70k, False: 0]
  ------------------
   65|  1.70k|        return ret;
   66|  1.70k|      }
   67|  2.00k|    } else {
   68|  2.00k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.00k|      MeshData md;
   70|  2.00k|      md.Set(source->mesh(), ct,
   71|  2.00k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.00k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.00k|      MeshPredictionSchemeFactoryT factory;
   74|  2.00k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.00k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.00k, False: 0]
  ------------------
   76|  2.00k|        return ret;
   77|  2.00k|      }
   78|  2.00k|    }
   79|  3.71k|  }
   80|    140|  return nullptr;
   81|  4.05k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   726k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   726k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 465k, False: 260k]
  |  Branch (93:22): [True: 416k, False: 49.5k]
  ------------------
   94|   416k|      return true;
   95|   416k|    }
   96|   309k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 92.8k, False: 217k]
  |  Branch (96:25): [True: 45.4k, False: 47.4k]
  ------------------
   97|   726k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   726k|  int32_t GetRotationCount(Point2 pred) const {
   51|   726k|    const DataType sign_x = pred[0];
   52|   726k|    const DataType sign_y = pred[1];
   53|       |
   54|   726k|    int32_t rotation_count = 0;
   55|   726k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 465k, False: 260k]
  ------------------
   56|   465k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 416k, False: 49.5k]
  ------------------
   57|   416k|        rotation_count = 0;
   58|   416k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 24.9k, False: 24.5k]
  ------------------
   59|  24.9k|        rotation_count = 3;
   60|  24.9k|      } else {
   61|  24.5k|        rotation_count = 1;
   62|  24.5k|      }
   63|   465k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 167k, False: 92.8k]
  ------------------
   64|   167k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 121k, False: 46.4k]
  ------------------
   65|   121k|        rotation_count = 2;
   66|   121k|      } else {
   67|  46.4k|        rotation_count = 1;
   68|  46.4k|      }
   69|   167k|    } else {
   70|  92.8k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 45.4k, False: 47.4k]
  ------------------
   71|  45.4k|        rotation_count = 0;
   72|  47.4k|      } else {
   73|  47.4k|        rotation_count = 3;
   74|  47.4k|      }
   75|  92.8k|    }
   76|   726k|    return rotation_count;
   77|   726k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   529k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   529k|    switch (rotation_count) {
   81|   143k|      case 1:
  ------------------
  |  Branch (81:7): [True: 143k, False: 385k]
  ------------------
   82|   143k|        return Point2(p[1], -p[0]);
   83|   242k|      case 2:
  ------------------
  |  Branch (83:7): [True: 242k, False: 286k]
  ------------------
   84|   242k|        return Point2(-p[0], -p[1]);
   85|   143k|      case 3:
  ------------------
  |  Branch (85:7): [True: 143k, False: 385k]
  ------------------
   86|   143k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 529k]
  ------------------
   88|      0|        return p;
   89|   529k|    }
   90|   529k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    440|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE19DecodeTransformDataEPNS_13DecoderBufferE:
   45|    371|  bool DecodeTransformData(DecoderBuffer *buffer) {
   46|    371|    DataTypeT max_quantized_value, center_value;
   47|    371|    if (!buffer->Decode(&max_quantized_value)) {
  ------------------
  |  Branch (47:9): [True: 8, False: 363]
  ------------------
   48|      8|      return false;
   49|      8|    }
   50|    363|    if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    363|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (50:9): [True: 72, False: 291]
  ------------------
   51|     72|      if (!buffer->Decode(&center_value)) {
  ------------------
  |  Branch (51:11): [True: 3, False: 69]
  ------------------
   52|      3|        return false;
   53|      3|      }
   54|     72|    }
   55|    360|    (void)center_value;
   56|    360|    return this->set_max_quantized_value(max_quantized_value);
   57|    363|  }
_ZNK5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE20ComputeOriginalValueEPKiS3_Pi:
   61|  17.5M|                                   DataType *out_orig_vals) const {
   62|  17.5M|    DRACO_DCHECK_LE(pred_vals[0], 2 * this->center_value());
   63|  17.5M|    DRACO_DCHECK_LE(pred_vals[1], 2 * this->center_value());
   64|  17.5M|    DRACO_DCHECK_LE(corr_vals[0], 2 * this->center_value());
   65|  17.5M|    DRACO_DCHECK_LE(corr_vals[1], 2 * this->center_value());
   66|       |
   67|  17.5M|    DRACO_DCHECK_LE(0, pred_vals[0]);
   68|  17.5M|    DRACO_DCHECK_LE(0, pred_vals[1]);
   69|  17.5M|    DRACO_DCHECK_LE(0, corr_vals[0]);
   70|  17.5M|    DRACO_DCHECK_LE(0, corr_vals[1]);
   71|       |
   72|  17.5M|    const Point2 pred = Point2(pred_vals[0], pred_vals[1]);
   73|  17.5M|    const Point2 corr = Point2(corr_vals[0], corr_vals[1]);
   74|  17.5M|    const Point2 orig = ComputeOriginalValue(pred, corr);
   75|       |
   76|  17.5M|    out_orig_vals[0] = orig[0];
   77|  17.5M|    out_orig_vals[1] = orig[1];
   78|  17.5M|  }
_ZNK5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE20ComputeOriginalValueENS_7VectorDIiLi2EEERKS3_:
   81|  17.5M|  Point2 ComputeOriginalValue(Point2 pred, const Point2 &corr) const {
   82|  17.5M|    const Point2 t(this->center_value(), this->center_value());
   83|  17.5M|    typedef typename std::make_unsigned<DataTypeT>::type UnsignedDataTypeT;
   84|  17.5M|    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|  17.5M|    pred = Point2(Point2u(pred) - Point2u(t));
   89|       |
   90|  17.5M|    const bool pred_is_in_diamond = this->IsInDiamond(pred[0], pred[1]);
   91|  17.5M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (91:9): [True: 17.0M, False: 503k]
  ------------------
   92|  17.0M|      this->InvertDiamond(&pred[0], &pred[1]);
   93|  17.0M|    }
   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|  17.5M|    Point2 orig(Point2u(pred) + Point2u(corr));
   98|       |
   99|  17.5M|    orig[0] = this->ModMax(orig[0]);
  100|  17.5M|    orig[1] = this->ModMax(orig[1]);
  101|  17.5M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (101:9): [True: 17.0M, False: 503k]
  ------------------
  102|  17.0M|      this->InvertDiamond(&orig[0], &orig[1]);
  103|  17.0M|    }
  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|  17.5M|    orig = Point2(Point2u(orig) + Point2u(t));
  108|  17.5M|    return orig;
  109|  17.5M|  }
_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE4InitEi:
   44|     87|  void Init(int num_components) {}
_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiEC2Ev:
   41|    383|  PredictionSchemeNormalOctahedronDecodingTransform() {}

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

_ZN5draco37PredictionSchemeWrapDecodingTransformIiiE19DecodeTransformDataEPNS_13DecoderBufferE:
   66|  3.68k|  bool DecodeTransformData(DecoderBuffer *buffer) {
   67|  3.68k|    DataTypeT min_value, max_value;
   68|  3.68k|    if (!buffer->Decode(&min_value)) {
  ------------------
  |  Branch (68:9): [True: 60, False: 3.62k]
  ------------------
   69|     60|      return false;
   70|     60|    }
   71|  3.62k|    if (!buffer->Decode(&max_value)) {
  ------------------
  |  Branch (71:9): [True: 39, False: 3.58k]
  ------------------
   72|     39|      return false;
   73|     39|    }
   74|  3.58k|    if (min_value > max_value) {
  ------------------
  |  Branch (74:9): [True: 182, False: 3.40k]
  ------------------
   75|    182|      return false;
   76|    182|    }
   77|  3.40k|    this->set_min_value(min_value);
   78|  3.40k|    this->set_max_value(max_value);
   79|  3.40k|    if (!this->InitCorrectionBounds()) {
  ------------------
  |  Branch (79:9): [True: 20, False: 3.38k]
  ------------------
   80|     20|      return false;
   81|     20|    }
   82|  3.38k|    return true;
   83|  3.40k|  }
_ZNK5draco37PredictionSchemeWrapDecodingTransformIiiE20ComputeOriginalValueEPKiS3_Pi:
   38|  25.8M|                                   DataTypeT *out_original_vals) const {
   39|       |    // For now we assume both |DataTypeT| and |CorrTypeT| are equal.
   40|  25.8M|    static_assert(std::is_same<DataTypeT, CorrTypeT>::value,
   41|  25.8M|                  "Predictions and corrections must have the same type.");
   42|       |
   43|       |    // The only valid implementation right now is for int32_t.
   44|  25.8M|    static_assert(std::is_same<DataTypeT, int32_t>::value,
   45|  25.8M|                  "Only int32_t is supported for predicted values.");
   46|       |
   47|  25.8M|    predicted_vals = this->ClampPredictedValue(predicted_vals);
   48|       |
   49|       |    // Perform the wrapping using unsigned coordinates to avoid potential signed
   50|       |    // integer overflows caused by malformed input.
   51|  25.8M|    const uint32_t *const uint_predicted_vals =
   52|  25.8M|        reinterpret_cast<const uint32_t *>(predicted_vals);
   53|  25.8M|    const uint32_t *const uint_corr_vals =
   54|  25.8M|        reinterpret_cast<const uint32_t *>(corr_vals);
   55|   393M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (55:21): [True: 368M, False: 25.8M]
  ------------------
   56|   368M|      out_original_vals[i] =
   57|   368M|          static_cast<DataTypeT>(uint_predicted_vals[i] + uint_corr_vals[i]);
   58|   368M|      if (out_original_vals[i] > this->max_value()) {
  ------------------
  |  Branch (58:11): [True: 152k, False: 367M]
  ------------------
   59|   152k|        out_original_vals[i] -= this->max_dif();
   60|   367M|      } else if (out_original_vals[i] < this->min_value()) {
  ------------------
  |  Branch (60:18): [True: 923k, False: 367M]
  ------------------
   61|   923k|        out_original_vals[i] += this->max_dif();
   62|   923k|      }
   63|   368M|    }
   64|  25.8M|  }
_ZN5draco37PredictionSchemeWrapDecodingTransformIiiEC2Ev:
   32|  4.07k|  PredictionSchemeWrapDecodingTransform() {}

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  3.89k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  3.40k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  3.40k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  3.40k|  bool InitCorrectionBounds() {
   84|  3.40k|    const int64_t dif =
   85|  3.40k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  3.40k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 3.40k]
  |  Branch (86:20): [True: 20, False: 3.38k]
  ------------------
   87|     20|      return false;
   88|     20|    }
   89|  3.38k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  3.38k|    max_correction_ = max_dif_ / 2;
   91|  3.38k|    min_correction_ = -max_correction_;
   92|  3.38k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 1.55k, False: 1.82k]
  ------------------
   93|  1.55k|      max_correction_ -= 1;
   94|  1.55k|    }
   95|  3.38k|    return true;
   96|  3.40k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  2.84k|  void Init(int num_components) {
   56|  2.84k|    num_components_ = num_components;
   57|  2.84k|    clamped_value_.resize(num_components);
   58|  2.84k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  25.8M|      const DataTypeT *predicted_val) const {
   64|   393M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 368M, False: 25.8M]
  ------------------
   65|   368M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 289k, False: 367M]
  ------------------
   66|   289k|        clamped_value_[i] = max_value_;
   67|   367M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 5.89M, False: 361M]
  ------------------
   68|  5.89M|        clamped_value_[i] = min_value_;
   69|   361M|      } else {
   70|   361M|        clamped_value_[i] = predicted_val[i];
   71|   361M|      }
   72|   368M|    }
   73|  25.8M|    return clamped_value_.data();
   74|  25.8M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   787M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   368M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|  1.07M|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   367M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    476|  int quantization_bits() const {
   78|    476|    DRACO_DCHECK(false);
   79|    476|    return -1;
   80|    476|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  4.07k|      : num_components_(0),
   45|  4.07k|        min_value_(0),
   46|  4.07k|        max_value_(0),
   47|  4.07k|        max_dif_(0),
   48|  4.07k|        max_correction_(0),
   49|  4.07k|        min_correction_(0) {}

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  14.3k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  14.3k|                                      int attribute_id) {
   24|  14.3k|  decoder_ = decoder;
   25|  14.3k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  14.3k|  attribute_id_ = attribute_id;
   27|  14.3k|  return true;
   28|  14.3k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  8.71k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   39|  8.71k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 8.71k]
  ------------------
   40|  8.71k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 8.71k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  8.71k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 1.81k, False: 6.90k]
  ------------------
   44|  1.81k|    return false;
   45|  1.81k|  }
   46|  6.90k|  return true;
   47|  8.71k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  3.35k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  3.35k|  return true;
   53|  3.35k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    634|    const std::vector<PointIndex> &point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    634|  return true;
   59|    634|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  6.44k|const PointAttribute *SequentialAttributeDecoder::GetPortableAttribute() {
   62|       |  // If needed, copy point to attribute value index mapping from the final
   63|       |  // attribute to the portable attribute.
   64|  6.44k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 5.14k, False: 1.30k]
  |  Branch (64:45): [True: 4.57k, False: 567]
  ------------------
   65|  4.57k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 3.40k, False: 1.16k]
  ------------------
   66|  3.40k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  3.40k|    for (PointIndex i(0);
   68|  27.9M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 27.8M, False: 3.40k]
  ------------------
   69|  27.8M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  27.8M|    }
   71|  3.40k|  }
   72|  6.44k|  return portable_attribute_.get();
   73|  6.44k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  4.90k|    PredictionSchemeInterface *ps) {
   77|  6.64k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 1.76k, False: 4.88k]
  ------------------
   78|  1.76k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  1.76k|        ps->GetParentAttributeType(i));
   80|  1.76k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 2, False: 1.76k]
  ------------------
   81|      2|      return false;  // Requested attribute does not exist.
   82|      2|    }
   83|  1.76k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  1.76k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 1.76k]
  ------------------
   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|  1.76k|#endif
   90|  1.76k|    {
   91|  1.76k|      const PointAttribute *const pa = decoder_->GetPortableAttribute(att_id);
   92|  1.76k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 1, False: 1.76k]
  |  Branch (92:28): [True: 15, False: 1.74k]
  ------------------
   93|     16|        return false;
   94|     16|      }
   95|  1.76k|    }
   96|  1.76k|  }
   97|  4.88k|  return true;
   98|  4.90k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    977|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  102|    977|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    977|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    977|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    977|  uint8_t *const value_data = value_data_ptr.get();
  106|    977|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  8.43k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 7.51k, False: 916]
  ------------------
  109|  7.51k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 61, False: 7.45k]
  ------------------
  110|     61|      return false;
  111|     61|    }
  112|  7.45k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  7.45k|    out_byte_pos += entry_size;
  114|  7.45k|  }
  115|    916|  return true;
  116|    977|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  6.53k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   138M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  4.90k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  22.7k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  7.38k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  7.38k|    portable_attribute_ = std::move(att);
   71|  7.38k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  24.7k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  14.3k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  25.8k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  4.67k|    DecoderBuffer *buffer) {
   30|  4.67k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 250, False: 4.42k]
  ------------------
   31|    250|    return false;
   32|    250|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  4.42k|  const int32_t num_attributes = GetNumAttributes();
   35|  4.42k|  sequential_decoders_.resize(num_attributes);
   36|  18.7k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 14.3k, False: 4.38k]
  ------------------
   37|  14.3k|    uint8_t decoder_type;
   38|  14.3k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 9, False: 14.3k]
  ------------------
   39|      9|      return false;
   40|      9|    }
   41|       |    // Create the decoder from the id.
   42|  14.3k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  14.3k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 13, False: 14.3k]
  ------------------
   44|     13|      return false;
   45|     13|    }
   46|  14.3k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 12, False: 14.3k]
  ------------------
   47|     12|      return false;
   48|     12|    }
   49|  14.3k|  }
   50|  4.38k|  return true;
   51|  4.42k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  4.06k|    DecoderBuffer *buffer) {
   55|  4.06k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 4.06k]
  |  Branch (55:22): [True: 9, False: 4.05k]
  ------------------
   56|      9|    return false;
   57|      9|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  4.05k|  const int32_t num_attributes = GetNumAttributes();
   60|  17.9k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 13.8k, False: 4.05k]
  ------------------
   61|  13.8k|    PointAttribute *const pa =
   62|  13.8k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  13.8k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 13.8k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  13.8k|  }
   67|  4.05k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  4.05k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  4.05k|    DecoderBuffer *in_buffer) {
   72|  4.05k|  const int32_t num_attributes = GetNumAttributes();
   73|  10.9k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 8.71k, False: 2.24k]
  ------------------
   74|  8.71k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.81k, False: 6.90k]
  ------------------
   75|  8.71k|                                                          in_buffer)) {
   76|  1.81k|      return false;
   77|  1.81k|    }
   78|  8.71k|  }
   79|  2.24k|  return true;
   80|  4.05k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.24k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  2.24k|  const int32_t num_attributes = GetNumAttributes();
   85|  6.02k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 4.18k, False: 1.84k]
  ------------------
   86|  4.18k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 399, False: 3.78k]
  ------------------
   87|  4.18k|            point_ids_, in_buffer)) {
   88|    399|      return false;
   89|    399|    }
   90|  4.18k|  }
   91|  1.84k|  return true;
   92|  2.24k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.84k|    TransformAttributesToOriginalFormat() {
   96|  1.84k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.95k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.44k, False: 1.50k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  3.44k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 3.44k, False: 0]
  ------------------
  100|  3.44k|      const PointAttribute *const attribute =
  101|  3.44k|          sequential_decoders_[i]->attribute();
  102|  3.44k|      const PointAttribute *const portable_attribute =
  103|  3.44k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  3.44k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 2.81k, False: 634]
  |  Branch (104:11): [True: 883, False: 2.56k]
  ------------------
  105|  2.81k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 883, False: 1.93k]
  ------------------
  106|  2.81k|              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|    883|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    883|        continue;
  114|    883|      }
  115|  3.44k|    }
  116|  2.56k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 340, False: 2.22k]
  ------------------
  117|  2.56k|            point_ids_)) {
  118|    340|      return false;
  119|    340|    }
  120|  2.56k|  }
  121|  1.50k|  return true;
  122|  1.84k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  14.3k|    uint8_t decoder_type) {
  127|  14.3k|  switch (decoder_type) {
  128|  1.86k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.86k, False: 12.4k]
  ------------------
  129|  1.86k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.86k|          new SequentialAttributeDecoder());
  131|  11.2k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 11.2k, False: 3.05k]
  ------------------
  132|  11.2k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  11.2k|          new SequentialIntegerAttributeDecoder());
  134|    213|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 213, False: 14.1k]
  ------------------
  135|    213|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    213|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    962|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 962, False: 13.3k]
  ------------------
  139|    962|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    962|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     13|    default:
  ------------------
  |  Branch (142:5): [True: 13, False: 14.3k]
  ------------------
  143|     13|      break;
  144|  14.3k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     13|  return nullptr;
  147|  14.3k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  12.4k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  12.4k|                                             int attribute_id) {
   27|  12.4k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 12.4k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  12.4k|  return true;
   31|  12.4k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  1.93k|    const std::vector<PointIndex> &point_ids) {
   35|  1.93k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  1.93k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 1.93k, False: 0]
  ------------------
   37|  1.93k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.93k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 1.93k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  1.93k|#endif
   41|  1.93k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  1.93k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  7.74k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  7.74k|  int8_t prediction_scheme_method;
   48|  7.74k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 36, False: 7.70k]
  ------------------
   49|     36|    return false;
   50|     36|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  7.70k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 49, False: 7.65k]
  ------------------
   53|  7.65k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 130, False: 7.52k]
  ------------------
   54|    179|    return false;
   55|    179|  }
   56|  7.52k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 7.52k, False: 5]
  ------------------
   57|  7.52k|    int8_t prediction_transform_type;
   58|  7.52k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 20, False: 7.50k]
  ------------------
   59|     20|      return false;
   60|     20|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  7.50k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 18, False: 7.48k]
  ------------------
   63|  7.48k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 82, False: 7.40k]
  ------------------
   64|    100|      return false;
   65|    100|    }
   66|  7.40k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  7.40k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  7.40k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  7.40k|  }
   70|       |
   71|  7.40k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 4.90k, False: 2.50k]
  ------------------
   72|  4.90k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 18, False: 4.88k]
  ------------------
   73|     18|      return false;
   74|     18|    }
   75|  4.90k|  }
   76|       |
   77|  7.38k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.39k, False: 5.99k]
  ------------------
   78|  1.39k|    return false;
   79|  1.39k|  }
   80|       |
   81|  5.99k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  5.99k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  5.99k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 5.99k, False: 0]
  ------------------
   84|  5.99k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  5.99k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 5.99k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|      0|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 0]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|      0|  }
   90|  5.99k|#endif
   91|  5.99k|  return true;
   92|  5.99k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  6.53k|    PredictionSchemeTransformType transform_type) {
   98|  6.53k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 2.45k, False: 4.07k]
  ------------------
   99|  2.45k|    return nullptr;  // For now we support only wrap transform.
  100|  2.45k|  }
  101|  4.07k|  return CreatePredictionSchemeForDecoder<
  102|  4.07k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  4.07k|      method, attribute_id(), decoder());
  104|  6.53k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  7.38k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  7.38k|  const int num_components = GetNumValueComponents();
  109|  7.38k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 7.38k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  7.38k|  const size_t num_entries = point_ids.size();
  113|  7.38k|  const size_t num_values = num_entries * num_components;
  114|  7.38k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  7.38k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  7.38k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 7, False: 7.38k]
  ------------------
  117|      7|    return false;
  118|      7|  }
  119|  7.38k|  uint8_t compressed;
  120|  7.38k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 20, False: 7.36k]
  ------------------
  121|     20|    return false;
  122|     20|  }
  123|  7.36k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 627, False: 6.73k]
  ------------------
  124|       |    // Decode compressed values.
  125|    627|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 221, False: 406]
  ------------------
  126|    627|                       in_buffer,
  127|    627|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    221|      return false;
  129|    221|    }
  130|  6.73k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  6.73k|    uint8_t num_bytes;
  134|  6.73k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 9, False: 6.72k]
  ------------------
  135|      9|      return false;
  136|      9|    }
  137|  6.72k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 371, False: 6.35k]
  ------------------
  138|    371|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 371]
  ------------------
  139|    371|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    371|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 10, False: 361]
  ------------------
  143|    371|                             sizeof(int32_t) * num_values)) {
  144|     10|        return false;
  145|     10|      }
  146|  6.35k|    } else {
  147|  6.35k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 28, False: 6.32k]
  ------------------
  148|  6.35k|          num_bytes * num_values) {
  149|     28|        return false;
  150|     28|      }
  151|  6.32k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 35, False: 6.29k]
  ------------------
  152|  6.32k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     35|        return false;
  154|     35|      }
  155|   950M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 950M, False: 6.29k]
  ------------------
  156|   950M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 950M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   950M|      }
  160|  6.29k|    }
  161|  6.72k|  }
  162|       |
  163|  7.05k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 7.05k, False: 0]
  |  Branch (163:26): [True: 2.37k, False: 4.68k]
  ------------------
  164|  6.26k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 3.89k, False: 793]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  6.26k|    ConvertSymbolsToSignedInts(
  167|  6.26k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  6.26k|        static_cast<int>(num_values), portable_attribute_data);
  169|  6.26k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  7.05k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 4.68k, False: 2.37k]
  ------------------
  173|  4.68k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 655, False: 4.02k]
  ------------------
  174|    655|      return false;
  175|    655|    }
  176|       |
  177|  4.02k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 4.02k, False: 0]
  ------------------
  178|  4.02k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 412, False: 3.61k]
  ------------------
  179|  4.02k|              portable_attribute_data, portable_attribute_data,
  180|  4.02k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    412|        return false;
  182|    412|      }
  183|  4.02k|    }
  184|  4.02k|  }
  185|  5.99k|  return true;
  186|  7.05k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.52k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.52k|  switch (attribute()->data_type()) {
  190|    128|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 128, False: 1.39k]
  ------------------
  191|    128|      StoreTypedValues<uint8_t>(num_values);
  192|    128|      break;
  193|    730|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 730, False: 794]
  ------------------
  194|    730|      StoreTypedValues<int8_t>(num_values);
  195|    730|      break;
  196|     99|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 99, False: 1.42k]
  ------------------
  197|     99|      StoreTypedValues<uint16_t>(num_values);
  198|     99|      break;
  199|    223|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 223, False: 1.30k]
  ------------------
  200|    223|      StoreTypedValues<int16_t>(num_values);
  201|    223|      break;
  202|    150|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 150, False: 1.37k]
  ------------------
  203|    150|      StoreTypedValues<uint32_t>(num_values);
  204|    150|      break;
  205|     95|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 95, False: 1.42k]
  ------------------
  206|     95|      StoreTypedValues<int32_t>(num_values);
  207|     95|      break;
  208|     99|    default:
  ------------------
  |  Branch (208:5): [True: 99, False: 1.42k]
  ------------------
  209|     99|      return false;
  210|  1.52k|  }
  211|  1.42k|  return true;
  212|  1.52k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  7.38k|    int num_entries, int num_components) {
  237|  7.38k|  GeometryAttribute ga;
  238|  7.38k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  7.38k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  7.38k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  7.38k|  port_att->SetIdentityMapping();
  242|  7.38k|  port_att->Reset(num_entries);
  243|  7.38k|  port_att->set_unique_id(attribute()->unique_id());
  244|  7.38k|  SetPortableAttribute(std::move(port_att));
  245|  7.38k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    128|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    128|  const int num_components = attribute()->num_components();
  217|    128|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    128|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    128|      new AttributeTypeT[num_components]);
  220|    128|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    128|  int val_id = 0;
  222|    128|  int out_byte_pos = 0;
  223|   432k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 432k, False: 128]
  ------------------
  224|  29.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 29.3M, False: 432k]
  ------------------
  225|  29.3M|      const AttributeTypeT value =
  226|  29.3M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  29.3M|      att_val[c] = value;
  228|  29.3M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   432k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   432k|    out_byte_pos += entry_size;
  232|   432k|  }
  233|    128|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    730|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    730|  const int num_components = attribute()->num_components();
  217|    730|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    730|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    730|      new AttributeTypeT[num_components]);
  220|    730|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    730|  int val_id = 0;
  222|    730|  int out_byte_pos = 0;
  223|   123M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 123M, False: 730]
  ------------------
  224|   291M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 168M, False: 123M]
  ------------------
  225|   168M|      const AttributeTypeT value =
  226|   168M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   168M|      att_val[c] = value;
  228|   168M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   123M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   123M|    out_byte_pos += entry_size;
  232|   123M|  }
  233|    730|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     99|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     99|  const int num_components = attribute()->num_components();
  217|     99|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     99|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     99|      new AttributeTypeT[num_components]);
  220|     99|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     99|  int val_id = 0;
  222|     99|  int out_byte_pos = 0;
  223|   901k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 901k, False: 99]
  ------------------
  224|  49.0M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 48.1M, False: 901k]
  ------------------
  225|  48.1M|      const AttributeTypeT value =
  226|  48.1M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  48.1M|      att_val[c] = value;
  228|  48.1M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   901k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   901k|    out_byte_pos += entry_size;
  232|   901k|  }
  233|     99|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    223|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    223|  const int num_components = attribute()->num_components();
  217|    223|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    223|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    223|      new AttributeTypeT[num_components]);
  220|    223|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    223|  int val_id = 0;
  222|    223|  int out_byte_pos = 0;
  223|  1.07M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.07M, False: 223]
  ------------------
  224|  48.0M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 46.9M, False: 1.07M]
  ------------------
  225|  46.9M|      const AttributeTypeT value =
  226|  46.9M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  46.9M|      att_val[c] = value;
  228|  46.9M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.07M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.07M|    out_byte_pos += entry_size;
  232|  1.07M|  }
  233|    223|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    150|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    150|  const int num_components = attribute()->num_components();
  217|    150|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    150|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    150|      new AttributeTypeT[num_components]);
  220|    150|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    150|  int val_id = 0;
  222|    150|  int out_byte_pos = 0;
  223|  1.20M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.20M, False: 150]
  ------------------
  224|   121M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 120M, False: 1.20M]
  ------------------
  225|   120M|      const AttributeTypeT value =
  226|   120M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   120M|      att_val[c] = value;
  228|   120M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.20M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.20M|    out_byte_pos += entry_size;
  232|  1.20M|  }
  233|    150|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|     95|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     95|  const int num_components = attribute()->num_components();
  217|     95|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     95|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     95|      new AttributeTypeT[num_components]);
  220|     95|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     95|  int val_id = 0;
  222|     95|  int out_byte_pos = 0;
  223|  11.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 11.0M, False: 95]
  ------------------
  224|  65.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 54.6M, False: 11.0M]
  ------------------
  225|  54.6M|      const AttributeTypeT value =
  226|  54.6M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  54.6M|      att_val[c] = value;
  228|  54.6M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  11.0M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  11.0M|    out_byte_pos += entry_size;
  232|  11.0M|  }
  233|     95|}

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

_ZN5draco32SequentialNormalAttributeDecoderC2Ev:
   21|    962|SequentialNormalAttributeDecoder::SequentialNormalAttributeDecoder() {}
_ZN5draco32SequentialNormalAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   24|    962|                                            int attribute_id) {
   25|    962|  if (!SequentialIntegerAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (25:7): [True: 0, False: 962]
  ------------------
   26|      0|    return false;
   27|      0|  }
   28|       |  // Currently, this encoder works only for 3-component normal vectors.
   29|    962|  if (attribute()->num_components() != 3) {
  ------------------
  |  Branch (29:7): [True: 1, False: 961]
  ------------------
   30|      1|    return false;
   31|      1|  }
   32|       |  // Also the data type must be DT_FLOAT32.
   33|    961|  if (attribute()->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (33:7): [True: 2, False: 959]
  ------------------
   34|      2|    return false;
   35|      2|  }
   36|    959|  return true;
   37|    961|}
_ZN5draco32SequentialNormalAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   40|    858|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   41|    858|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   42|    858|  if (decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    858|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (42:7): [True: 0, False: 858]
  ------------------
   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|    858|#endif
   52|    858|  return SequentialIntegerAttributeDecoder::DecodeIntegerValues(point_ids,
   53|    858|                                                                in_buffer);
   54|    858|}
_ZN5draco32SequentialNormalAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   57|    702|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   58|    702|  if (decoder()->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    702|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (58:7): [True: 702, False: 0]
  ------------------
   59|       |    // For newer file version, decode attribute transform data here.
   60|    702|    if (!octahedral_transform_.DecodeParameters(*GetPortableAttribute(),
  ------------------
  |  Branch (60:9): [True: 325, False: 377]
  ------------------
   61|    702|                                                in_buffer)) {
   62|    325|      return false;
   63|    325|    }
   64|    702|  }
   65|       |
   66|       |  // Store the decoded transform data in portable attribute.
   67|    377|  return octahedral_transform_.TransferToAttribute(portable_attribute());
   68|    702|}
_ZN5draco32SequentialNormalAttributeDecoder11StoreValuesEj:
   70|    365|bool SequentialNormalAttributeDecoder::StoreValues(uint32_t num_points) {
   71|       |  // Convert all quantized values back to floats.
   72|    365|  return octahedral_transform_.InverseTransformAttribute(
   73|    365|      *GetPortableAttribute(), attribute());
   74|    365|}

_ZNK5draco32SequentialNormalAttributeDecoder21GetNumValueComponentsEv:
   35|    858|  int32_t GetNumValueComponents() const override {
   36|    858|    return 2;  // We quantize everything into two components.
   37|    858|  }
_ZN5draco32SequentialNormalAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   51|    864|      PredictionSchemeTransformType transform_type) override {
   52|    864|    switch (transform_type) {
   53|      0|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   54|    383|      case PREDICTION_TRANSFORM_NORMAL_OCTAHEDRON: {
  ------------------
  |  Branch (54:7): [True: 383, False: 481]
  ------------------
   55|    383|        typedef PredictionSchemeNormalOctahedronDecodingTransform<int32_t>
   56|    383|            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|    383|        return CreatePredictionSchemeForDecoder<int32_t, Transform>(
   61|    383|            method, attribute_id(), decoder());
   62|      0|      }
   63|      0|#endif
   64|    440|      case PREDICTION_TRANSFORM_NORMAL_OCTAHEDRON_CANONICALIZED: {
  ------------------
  |  Branch (64:7): [True: 440, False: 424]
  ------------------
   65|    440|        typedef PredictionSchemeNormalOctahedronCanonicalizedDecodingTransform<
   66|    440|            int32_t>
   67|    440|            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|    440|        return CreatePredictionSchemeForDecoder<int32_t, Transform>(
   72|    440|            method, attribute_id(), decoder());
   73|      0|      }
   74|     41|      default:
  ------------------
  |  Branch (74:7): [True: 41, False: 823]
  ------------------
   75|     41|        return nullptr;  // Currently, we support only octahedron transform and
   76|       |                         // octahedron transform canonicalized.
   77|    864|    }
   78|    864|  }

_ZN5draco38SequentialQuantizationAttributeDecoderC2Ev:
   22|    213|    SequentialQuantizationAttributeDecoder() {}
_ZN5draco38SequentialQuantizationAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   25|    213|                                                  int attribute_id) {
   26|    213|  if (!SequentialIntegerAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (26:7): [True: 0, False: 213]
  ------------------
   27|      0|    return false;
   28|      0|  }
   29|    213|  const PointAttribute *const attribute =
   30|    213|      decoder->point_cloud()->attribute(attribute_id);
   31|       |  // Currently we can quantize only floating point arguments.
   32|    213|  if (attribute->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (32:7): [True: 9, False: 204]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|    204|  return true;
   36|    213|}
_ZN5draco38SequentialQuantizationAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   39|    181|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   40|    181|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   41|    181|  if (decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0) &&
  ------------------
  |  |  115|    362|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (41:7): [True: 0, False: 181]
  ------------------
   42|      0|      !DecodeQuantizedDataInfo()) {
  ------------------
  |  Branch (42:7): [True: 0, False: 0]
  ------------------
   43|      0|    return false;
   44|      0|  }
   45|    181|#endif
   46|    181|  return SequentialIntegerAttributeDecoder::DecodeIntegerValues(point_ids,
   47|    181|                                                                in_buffer);
   48|    181|}
_ZN5draco38SequentialQuantizationAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   52|    125|        const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   53|    125|  if (decoder()->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    125|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (53:7): [True: 125, False: 0]
  ------------------
   54|       |    // Decode quantization data here only for files with bitstream version 2.0+
   55|    125|    if (!DecodeQuantizedDataInfo()) {
  ------------------
  |  Branch (55:9): [True: 74, False: 51]
  ------------------
   56|     74|      return false;
   57|     74|    }
   58|    125|  }
   59|       |
   60|       |  // Store the decoded transform data in portable attribute;
   61|     51|  return quantization_transform_.TransferToAttribute(portable_attribute());
   62|    125|}
_ZN5draco38SequentialQuantizationAttributeDecoder11StoreValuesEj:
   64|     41|bool SequentialQuantizationAttributeDecoder::StoreValues(uint32_t num_points) {
   65|     41|  return DequantizeValues(num_points);
   66|     41|}
_ZN5draco38SequentialQuantizationAttributeDecoder23DecodeQuantizedDataInfoEv:
   68|    125|bool SequentialQuantizationAttributeDecoder::DecodeQuantizedDataInfo() {
   69|       |  // Get attribute used as source for decoding.
   70|    125|  auto att = GetPortableAttribute();
   71|    125|  if (att == nullptr) {
  ------------------
  |  Branch (71:7): [True: 0, False: 125]
  ------------------
   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|      0|    att = attribute();
   77|      0|  }
   78|    125|  return quantization_transform_.DecodeParameters(*att, decoder()->buffer());
   79|    125|}
_ZN5draco38SequentialQuantizationAttributeDecoder16DequantizeValuesEj:
   82|     41|    uint32_t num_values) {
   83|       |  // Convert all quantized values back to floats.
   84|     41|  return quantization_transform_.InverseTransformAttribute(
   85|     41|      *GetPortableAttribute(), attribute());
   86|     41|}

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  4.14M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  4.14M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  4.14M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  4.14M|    const int remaining = 32 - num_used_bits_;
   54|  4.14M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 2.32M, False: 1.82M]
  ------------------
   55|  2.32M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 1.99M, False: 323k]
  ------------------
   56|  1.99M|        return false;
   57|  1.99M|      }
   58|   323k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   323k|      num_used_bits_ += nbits;
   60|   323k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 10.6k, False: 313k]
  ------------------
   61|  10.6k|        ++pos_;
   62|  10.6k|        num_used_bits_ = 0;
   63|  10.6k|      }
   64|  1.82M|    } else {
   65|  1.82M|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 1.81M, False: 11.4k]
  ------------------
   66|  1.81M|        return false;
   67|  1.81M|      }
   68|  11.4k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  11.4k|      num_used_bits_ = nbits - remaining;
   70|  11.4k|      ++pos_;
   71|  11.4k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  11.4k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  11.4k|    }
   74|   335k|    return true;
   75|  4.14M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  6.03M|  bool DecodeNextBit() {
   35|  6.03M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  6.03M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 5.66M, False: 368k]
  ------------------
   37|  5.66M|      return false;
   38|  5.66M|    }
   39|   368k|    const bool bit = *pos_ & selector;
   40|   368k|    ++num_used_bits_;
   41|   368k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 11.3k, False: 356k]
  ------------------
   42|  11.3k|      ++pos_;
   43|  11.3k|      num_used_bits_ = 0;
   44|  11.3k|    }
   45|   368k|    return bit;
   46|  6.03M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    648|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    571|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    381|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  8.78k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 8.54k, False: 239]
  ------------------
   35|  8.54k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 142, False: 8.40k]
  ------------------
   36|    142|        return false;
   37|    142|      }
   38|  8.54k|    }
   39|    239|    return bit_decoder_.StartDecoding(source_buffer);
   40|    381|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.53M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.53M|    uint32_t result = 0;
   49|  16.0M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 13.5M, False: 2.53M]
  ------------------
   50|  13.5M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  13.5M|      result = (result << 1) + bit;
   52|  13.5M|    }
   53|  2.53M|    *value = result;
   54|  2.53M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|    101|  void EndDecoding() {
   57|  3.33k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 3.23k, False: 101]
  ------------------
   58|  3.23k|      folded_number_decoders_[i].EndDecoding();
   59|  3.23k|    }
   60|    101|    bit_decoder_.EndDecoding();
   61|    101|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    571|  FoldedBit32Decoder() {}

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

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

_ZN5draco12DracoOptionsINS_17GeometryAttribute4TypeEE16SetAttributeBoolERKS2_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEb:
  206|  14.6k|                                                   bool val) {
  207|  14.6k|  GetAttributeOptions(att_key)->SetBool(name, val);
  208|  14.6k|}
_ZN5draco12DracoOptionsINS_17GeometryAttribute4TypeEE19GetAttributeOptionsERKS2_:
  147|  14.6k|    const AttributeKeyT &att_key) {
  148|  14.6k|  auto it = attribute_options_.find(att_key);
  149|  14.6k|  if (it != attribute_options_.end()) {
  ------------------
  |  Branch (149:7): [True: 0, False: 14.6k]
  ------------------
  150|      0|    return &it->second;
  151|      0|  }
  152|  14.6k|  Options new_options;
  153|  14.6k|  it = attribute_options_.insert(std::make_pair(att_key, new_options)).first;
  154|  14.6k|  return &it->second;
  155|  14.6k|}
_ZNK5draco12DracoOptionsINS_17GeometryAttribute4TypeEE16GetAttributeBoolERKS2_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEb:
  195|  2.88k|                                                   bool default_val) const {
  196|  2.88k|  const Options *const att_options = FindAttributeOptions(att_key);
  197|  2.88k|  if (att_options && att_options->IsOptionSet(name)) {
  ------------------
  |  Branch (197:7): [True: 903, False: 1.98k]
  |  Branch (197:22): [True: 903, False: 0]
  ------------------
  198|    903|    return att_options->GetBool(name, default_val);
  199|    903|  }
  200|  1.98k|  return global_options_.GetBool(name, default_val);
  201|  2.88k|}
_ZNK5draco12DracoOptionsINS_17GeometryAttribute4TypeEE20FindAttributeOptionsERKS2_:
  137|  2.88k|    const AttributeKeyT &att_key) const {
  138|  2.88k|  auto it = attribute_options_.find(att_key);
  139|  2.88k|  if (it == attribute_options_.end()) {
  ------------------
  |  Branch (139:7): [True: 1.98k, False: 903]
  ------------------
  140|  1.98k|    return nullptr;
  141|  1.98k|  }
  142|    903|  return &it->second;
  143|  2.88k|}

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

_ZN5draco10AnsDecoderC2Ev:
   56|  49.0k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  25.3k|                                const uint8_t *const buf, int offset) {
  301|  25.3k|  unsigned x;
  302|  25.3k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 64, False: 25.2k]
  ------------------
  303|     64|    return 1;
  304|     64|  }
  305|  25.2k|  ans->buf = buf;
  306|  25.2k|  x = buf[offset - 1] >> 6;
  307|  25.2k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 22.0k, False: 3.19k]
  ------------------
  308|  22.0k|    ans->buf_offset = offset - 1;
  309|  22.0k|    ans->state = buf[offset - 1] & 0x3F;
  310|  22.0k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.94k, False: 251]
  ------------------
  311|  2.94k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 5, False: 2.93k]
  ------------------
  312|      5|      return 1;
  313|      5|    }
  314|  2.93k|    ans->buf_offset = offset - 2;
  315|  2.93k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.93k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 240, False: 11]
  ------------------
  317|    240|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 7, False: 233]
  ------------------
  318|      7|      return 1;
  319|      7|    }
  320|    233|    ans->buf_offset = offset - 3;
  321|    233|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    233|  } else {
  323|     11|    return 1;
  324|     11|  }
  325|  25.2k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  25.2k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  25.2k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  25.2k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  25.2k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 6, False: 25.2k]
  ------------------
  327|      6|    return 1;
  328|      6|  }
  329|  25.2k|  return 0;
  330|  25.2k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.93k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.93k|  uint32_t val;
   69|  2.93k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.93k|  val = mem[1] << 8;
   72|  2.93k|  val |= mem[0];
   73|  2.93k|  return val;
   74|  2.93k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    233|static uint32_t mem_get_le24(const void *vmem) {
   77|    233|  uint32_t val;
   78|    233|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    233|  val = mem[2] << 16;
   81|    233|  val |= mem[1] << 8;
   82|    233|  val |= mem[0];
   83|    233|  return val;
   84|    233|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  4.68G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  4.68G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  4.68G|  unsigned quot, rem, x, xn;
  172|  4.68G|#endif
  173|  4.68G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  4.68G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  4.68G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  9.36G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 3.97G, False: 708M]
  |  Branch (174:40): [True: 97.2k, False: 3.97G]
  ------------------
  175|  97.2k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  97.2k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  97.2k|  }
  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|  4.68G|  x = ans->state;
  184|  4.68G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  4.68G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  4.68G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  4.68G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  4.68G|  xn = quot * p;
  187|  4.68G|  val = rem < p;
  188|  4.68G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  9.36G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 3.97G, False: 703M]
  |  |  ------------------
  ------------------
  189|  3.97G|    ans->state = xn + rem;
  190|  3.97G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   703M|    ans->state = x - xn - p;
  193|   703M|  }
  194|  4.68G|#endif
  195|  4.68G|  return val;
  196|  4.68G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  66.5k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  66.5k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  66.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  66.5k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  4.59k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  2.39k|                                       uint32_t num_symbols) {
  482|  2.39k|    lut_table_.resize(rans_precision);
  483|  2.39k|    probability_table_.resize(num_symbols);
  484|  2.39k|    uint32_t cum_prob = 0;
  485|  2.39k|    uint32_t act_prob = 0;
  486|  18.2k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 16.0k, False: 2.17k]
  ------------------
  487|  16.0k|      probability_table_[i].prob = token_probs[i];
  488|  16.0k|      probability_table_[i].cum_prob = cum_prob;
  489|  16.0k|      cum_prob += token_probs[i];
  490|  16.0k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 227, False: 15.8k]
  ------------------
  491|    227|        return false;
  492|    227|      }
  493|  8.01M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 8.00M, False: 15.8k]
  ------------------
  494|  8.00M|        lut_table_[j] = i;
  495|  8.00M|      }
  496|  15.8k|      act_prob = cum_prob;
  497|  15.8k|    }
  498|  2.17k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 260, False: 1.91k]
  ------------------
  499|    260|      return false;
  500|    260|    }
  501|  1.91k|    return true;
  502|  2.17k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.53k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.53k|    unsigned x;
  423|  1.53k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 112, False: 1.41k]
  ------------------
  424|    112|      return 1;
  425|    112|    }
  426|  1.41k|    ans_.buf = buf;
  427|  1.41k|    x = buf[offset - 1] >> 6;
  428|  1.41k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 906, False: 513]
  ------------------
  429|    906|      ans_.buf_offset = offset - 1;
  430|    906|      ans_.state = buf[offset - 1] & 0x3F;
  431|    906|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 170, False: 343]
  ------------------
  432|    170|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 25, False: 145]
  ------------------
  433|     25|        return 1;
  434|     25|      }
  435|    145|      ans_.buf_offset = offset - 2;
  436|    145|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    343|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 217, False: 126]
  ------------------
  438|    217|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 36, False: 181]
  ------------------
  439|     36|        return 1;
  440|     36|      }
  441|    181|      ans_.buf_offset = offset - 3;
  442|    181|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    181|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 126, False: 0]
  ------------------
  444|    126|      ans_.buf_offset = offset - 4;
  445|    126|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    126|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.35k|    ans_.state += l_rans_base;
  450|  1.35k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.35k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 119, False: 1.23k]
  ------------------
  451|    119|      return 1;
  452|    119|    }
  453|  1.23k|    return 0;
  454|  1.35k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    245|static uint32_t mem_get_le16(const void *vmem) {
   68|    245|  uint32_t val;
   69|    245|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    245|  val = mem[1] << 8;
   72|    245|  val |= mem[0];
   73|    245|  return val;
   74|    245|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    279|static uint32_t mem_get_le24(const void *vmem) {
   77|    279|  uint32_t val;
   78|    279|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    279|  val = mem[2] << 16;
   81|    279|  val |= mem[1] << 8;
   82|    279|  val |= mem[0];
   83|    279|  return val;
   84|    279|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    354|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    354|  uint32_t val;
   88|    354|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    354|  val = mem[3] << 24;
   91|    354|  val |= mem[2] << 16;
   92|    354|  val |= mem[1] << 8;
   93|    354|  val |= mem[0];
   94|    354|  return val;
   95|    354|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  77.5M|  inline int rans_read() {
  463|  77.5M|    unsigned rem;
  464|  77.5M|    unsigned quo;
  465|  77.5M|    struct rans_dec_sym sym;
  466|  77.5M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 65.5M, False: 12.0M]
  |  Branch (466:40): [True: 23.0k, False: 65.5M]
  ------------------
  467|  23.0k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  23.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  23.0k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  77.5M|    quo = ans_.state / rans_precision;
  472|  77.5M|    rem = ans_.state % rans_precision;
  473|  77.5M|    fetch_sym(&sym, rem);
  474|  77.5M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  77.5M|    return sym.val;
  476|  77.5M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  77.5M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  77.5M|    uint32_t symbol = lut_table_[rem];
  507|  77.5M|    out->val = symbol;
  508|  77.5M|    out->prob = probability_table_[symbol].prob;
  509|  77.5M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  77.5M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.16k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    330|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    199|                                       uint32_t num_symbols) {
  482|    199|    lut_table_.resize(rans_precision);
  483|    199|    probability_table_.resize(num_symbols);
  484|    199|    uint32_t cum_prob = 0;
  485|    199|    uint32_t act_prob = 0;
  486|  2.61k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.44k, False: 174]
  ------------------
  487|  2.44k|      probability_table_[i].prob = token_probs[i];
  488|  2.44k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.44k|      cum_prob += token_probs[i];
  490|  2.44k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 25, False: 2.41k]
  ------------------
  491|     25|        return false;
  492|     25|      }
  493|  1.21M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.20M, False: 2.41k]
  ------------------
  494|  1.20M|        lut_table_[j] = i;
  495|  1.20M|      }
  496|  2.41k|      act_prob = cum_prob;
  497|  2.41k|    }
  498|    174|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 38, False: 136]
  ------------------
  499|     38|      return false;
  500|     38|    }
  501|    136|    return true;
  502|    174|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     67|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     67|    unsigned x;
  423|     67|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 64]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     64|    ans_.buf = buf;
  427|     64|    x = buf[offset - 1] >> 6;
  428|     64|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 27, False: 37]
  ------------------
  429|     27|      ans_.buf_offset = offset - 1;
  430|     27|      ans_.state = buf[offset - 1] & 0x3F;
  431|     37|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 6, False: 31]
  ------------------
  432|      6|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 5]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      5|      ans_.buf_offset = offset - 2;
  436|      5|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     31|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 17, False: 14]
  ------------------
  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|     14|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 14, False: 0]
  ------------------
  444|     14|      ans_.buf_offset = offset - 4;
  445|     14|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     14|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     55|    ans_.state += l_rans_base;
  450|     55|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     55|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 12, False: 43]
  ------------------
  451|     12|      return 1;
  452|     12|    }
  453|     43|    return 0;
  454|     55|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  98.8k|  inline int rans_read() {
  463|  98.8k|    unsigned rem;
  464|  98.8k|    unsigned quo;
  465|  98.8k|    struct rans_dec_sym sym;
  466|  99.6k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 34.8k, False: 64.7k]
  |  Branch (466:40): [True: 844, False: 34.0k]
  ------------------
  467|    844|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    844|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    844|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  98.8k|    quo = ans_.state / rans_precision;
  472|  98.8k|    rem = ans_.state % rans_precision;
  473|  98.8k|    fetch_sym(&sym, rem);
  474|  98.8k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  98.8k|    return sym.val;
  476|  98.8k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  98.8k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  98.8k|    uint32_t symbol = lut_table_[rem];
  507|  98.8k|    out->val = symbol;
  508|  98.8k|    out->prob = probability_table_[symbol].prob;
  509|  98.8k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  98.8k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     43|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    336|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    180|                                       uint32_t num_symbols) {
  482|    180|    lut_table_.resize(rans_precision);
  483|    180|    probability_table_.resize(num_symbols);
  484|    180|    uint32_t cum_prob = 0;
  485|    180|    uint32_t act_prob = 0;
  486|  3.50k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.34k, False: 160]
  ------------------
  487|  3.34k|      probability_table_[i].prob = token_probs[i];
  488|  3.34k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.34k|      cum_prob += token_probs[i];
  490|  3.34k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 20, False: 3.32k]
  ------------------
  491|     20|        return false;
  492|     20|      }
  493|  4.20M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 4.20M, False: 3.32k]
  ------------------
  494|  4.20M|        lut_table_[j] = i;
  495|  4.20M|      }
  496|  3.32k|      act_prob = cum_prob;
  497|  3.32k|    }
  498|    160|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 41, False: 119]
  ------------------
  499|     41|      return false;
  500|     41|    }
  501|    119|    return true;
  502|    160|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     74|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     74|    unsigned x;
  423|     74|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 73]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     73|    ans_.buf = buf;
  427|     73|    x = buf[offset - 1] >> 6;
  428|     73|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 23, False: 50]
  ------------------
  429|     23|      ans_.buf_offset = offset - 1;
  430|     23|      ans_.state = buf[offset - 1] & 0x3F;
  431|     50|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 16, False: 34]
  ------------------
  432|     16|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 6, False: 10]
  ------------------
  433|      6|        return 1;
  434|      6|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     34|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 18, False: 16]
  ------------------
  438|     18|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 15]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     15|      ans_.buf_offset = offset - 3;
  442|     15|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     16|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 16, False: 0]
  ------------------
  444|     16|      ans_.buf_offset = offset - 4;
  445|     16|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     16|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     64|    ans_.state += l_rans_base;
  450|     64|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     64|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 12, False: 52]
  ------------------
  451|     12|      return 1;
  452|     12|    }
  453|     52|    return 0;
  454|     64|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   416k|  inline int rans_read() {
  463|   416k|    unsigned rem;
  464|   416k|    unsigned quo;
  465|   416k|    struct rans_dec_sym sym;
  466|   418k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 405k, False: 13.3k]
  |  Branch (466:40): [True: 2.00k, False: 403k]
  ------------------
  467|  2.00k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.00k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.00k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   416k|    quo = ans_.state / rans_precision;
  472|   416k|    rem = ans_.state % rans_precision;
  473|   416k|    fetch_sym(&sym, rem);
  474|   416k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   416k|    return sym.val;
  476|   416k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   416k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   416k|    uint32_t symbol = lut_table_[rem];
  507|   416k|    out->val = symbol;
  508|   416k|    out->prob = probability_table_[symbol].prob;
  509|   416k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   416k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     52|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    415|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    260|                                       uint32_t num_symbols) {
  482|    260|    lut_table_.resize(rans_precision);
  483|    260|    probability_table_.resize(num_symbols);
  484|    260|    uint32_t cum_prob = 0;
  485|    260|    uint32_t act_prob = 0;
  486|  21.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 21.6k, False: 224]
  ------------------
  487|  21.6k|      probability_table_[i].prob = token_probs[i];
  488|  21.6k|      probability_table_[i].cum_prob = cum_prob;
  489|  21.6k|      cum_prob += token_probs[i];
  490|  21.6k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 36, False: 21.5k]
  ------------------
  491|     36|        return false;
  492|     36|      }
  493|  12.9M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 12.8M, False: 21.5k]
  ------------------
  494|  12.8M|        lut_table_[j] = i;
  495|  12.8M|      }
  496|  21.5k|      act_prob = cum_prob;
  497|  21.5k|    }
  498|    224|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 59, False: 165]
  ------------------
  499|     59|      return false;
  500|     59|    }
  501|    165|    return true;
  502|    224|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     89|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     89|    unsigned x;
  423|     89|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 79]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|     79|    ans_.buf = buf;
  427|     79|    x = buf[offset - 1] >> 6;
  428|     79|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 30, False: 49]
  ------------------
  429|     30|      ans_.buf_offset = offset - 1;
  430|     30|      ans_.state = buf[offset - 1] & 0x3F;
  431|     49|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 17, False: 32]
  ------------------
  432|     17|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 7]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     32|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 22, False: 10]
  ------------------
  438|     22|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 18, False: 4]
  ------------------
  439|     18|        return 1;
  440|     18|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     10|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 10, False: 0]
  ------------------
  444|     10|      ans_.buf_offset = offset - 4;
  445|     10|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     10|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     51|    ans_.state += l_rans_base;
  450|     51|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     51|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 9, False: 42]
  ------------------
  451|      9|      return 1;
  452|      9|    }
  453|     42|    return 0;
  454|     51|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  42.0k|  inline int rans_read() {
  463|  42.0k|    unsigned rem;
  464|  42.0k|    unsigned quo;
  465|  42.0k|    struct rans_dec_sym sym;
  466|  42.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 40.9k, False: 1.51k]
  |  Branch (466:40): [True: 420, False: 40.5k]
  ------------------
  467|    420|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    420|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    420|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  42.0k|    quo = ans_.state / rans_precision;
  472|  42.0k|    rem = ans_.state % rans_precision;
  473|  42.0k|    fetch_sym(&sym, rem);
  474|  42.0k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  42.0k|    return sym.val;
  476|  42.0k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  42.0k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  42.0k|    uint32_t symbol = lut_table_[rem];
  507|  42.0k|    out->val = symbol;
  508|  42.0k|    out->prob = probability_table_[symbol].prob;
  509|  42.0k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  42.0k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     42|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    435|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    265|                                       uint32_t num_symbols) {
  482|    265|    lut_table_.resize(rans_precision);
  483|    265|    probability_table_.resize(num_symbols);
  484|    265|    uint32_t cum_prob = 0;
  485|    265|    uint32_t act_prob = 0;
  486|  26.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 25.8k, False: 233]
  ------------------
  487|  25.8k|      probability_table_[i].prob = token_probs[i];
  488|  25.8k|      probability_table_[i].cum_prob = cum_prob;
  489|  25.8k|      cum_prob += token_probs[i];
  490|  25.8k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 32, False: 25.8k]
  ------------------
  491|     32|        return false;
  492|     32|      }
  493|  49.7M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 49.7M, False: 25.8k]
  ------------------
  494|  49.7M|        lut_table_[j] = i;
  495|  49.7M|      }
  496|  25.8k|      act_prob = cum_prob;
  497|  25.8k|    }
  498|    233|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 60, False: 173]
  ------------------
  499|     60|      return false;
  500|     60|    }
  501|    173|    return true;
  502|    233|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     77|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     77|    unsigned x;
  423|     77|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 71]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     71|    ans_.buf = buf;
  427|     71|    x = buf[offset - 1] >> 6;
  428|     71|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 20, False: 51]
  ------------------
  429|     20|      ans_.buf_offset = offset - 1;
  430|     20|      ans_.state = buf[offset - 1] & 0x3F;
  431|     51|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 5, False: 46]
  ------------------
  432|      5|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 4]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      4|      ans_.buf_offset = offset - 2;
  436|      4|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     46|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 27, False: 19]
  ------------------
  438|     27|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 11, False: 16]
  ------------------
  439|     11|        return 1;
  440|     11|      }
  441|     16|      ans_.buf_offset = offset - 3;
  442|     16|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     19|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 19, False: 0]
  ------------------
  444|     19|      ans_.buf_offset = offset - 4;
  445|     19|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     19|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     59|    ans_.state += l_rans_base;
  450|     59|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     59|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 7, False: 52]
  ------------------
  451|      7|      return 1;
  452|      7|    }
  453|     52|    return 0;
  454|     59|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|   172k|  inline int rans_read() {
  463|   172k|    unsigned rem;
  464|   172k|    unsigned quo;
  465|   172k|    struct rans_dec_sym sym;
  466|   174k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 84.7k, False: 89.8k]
  |  Branch (466:40): [True: 1.84k, False: 82.8k]
  ------------------
  467|  1.84k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.84k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.84k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   172k|    quo = ans_.state / rans_precision;
  472|   172k|    rem = ans_.state % rans_precision;
  473|   172k|    fetch_sym(&sym, rem);
  474|   172k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   172k|    return sym.val;
  476|   172k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|   172k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   172k|    uint32_t symbol = lut_table_[rem];
  507|   172k|    out->val = symbol;
  508|   172k|    out->prob = probability_table_[symbol].prob;
  509|   172k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   172k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     52|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    327|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    197|                                       uint32_t num_symbols) {
  482|    197|    lut_table_.resize(rans_precision);
  483|    197|    probability_table_.resize(num_symbols);
  484|    197|    uint32_t cum_prob = 0;
  485|    197|    uint32_t act_prob = 0;
  486|  8.13k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 7.97k, False: 164]
  ------------------
  487|  7.97k|      probability_table_[i].prob = token_probs[i];
  488|  7.97k|      probability_table_[i].cum_prob = cum_prob;
  489|  7.97k|      cum_prob += token_probs[i];
  490|  7.97k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 33, False: 7.94k]
  ------------------
  491|     33|        return false;
  492|     33|      }
  493|  67.5M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 67.5M, False: 7.94k]
  ------------------
  494|  67.5M|        lut_table_[j] = i;
  495|  67.5M|      }
  496|  7.94k|      act_prob = cum_prob;
  497|  7.94k|    }
  498|    164|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 49, False: 115]
  ------------------
  499|     49|      return false;
  500|     49|    }
  501|    115|    return true;
  502|    164|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     77|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     77|    unsigned x;
  423|     77|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 71]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     71|    ans_.buf = buf;
  427|     71|    x = buf[offset - 1] >> 6;
  428|     71|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 27, False: 44]
  ------------------
  429|     27|      ans_.buf_offset = offset - 1;
  430|     27|      ans_.state = buf[offset - 1] & 0x3F;
  431|     44|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 36]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 7]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     36|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 13, False: 23]
  ------------------
  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|     23|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 23, False: 0]
  ------------------
  444|     23|      ans_.buf_offset = offset - 4;
  445|     23|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     23|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     69|    ans_.state += l_rans_base;
  450|     69|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     69|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 13, False: 56]
  ------------------
  451|     13|      return 1;
  452|     13|    }
  453|     56|    return 0;
  454|     69|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   425k|  inline int rans_read() {
  463|   425k|    unsigned rem;
  464|   425k|    unsigned quo;
  465|   425k|    struct rans_dec_sym sym;
  466|   426k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 279k, False: 147k]
  |  Branch (466:40): [True: 1.14k, False: 278k]
  ------------------
  467|  1.14k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.14k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.14k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   425k|    quo = ans_.state / rans_precision;
  472|   425k|    rem = ans_.state % rans_precision;
  473|   425k|    fetch_sym(&sym, rem);
  474|   425k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   425k|    return sym.val;
  476|   425k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   425k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   425k|    uint32_t symbol = lut_table_[rem];
  507|   425k|    out->val = symbol;
  508|   425k|    out->prob = probability_table_[symbol].prob;
  509|   425k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   425k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     56|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.76k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    960|                                       uint32_t num_symbols) {
  482|    960|    lut_table_.resize(rans_precision);
  483|    960|    probability_table_.resize(num_symbols);
  484|    960|    uint32_t cum_prob = 0;
  485|    960|    uint32_t act_prob = 0;
  486|  14.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 13.0k, False: 913]
  ------------------
  487|  13.0k|      probability_table_[i].prob = token_probs[i];
  488|  13.0k|      probability_table_[i].cum_prob = cum_prob;
  489|  13.0k|      cum_prob += token_probs[i];
  490|  13.0k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 47, False: 13.0k]
  ------------------
  491|     47|        return false;
  492|     47|      }
  493|   862M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 862M, False: 13.0k]
  ------------------
  494|   862M|        lut_table_[j] = i;
  495|   862M|      }
  496|  13.0k|      act_prob = cum_prob;
  497|  13.0k|    }
  498|    913|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 115, False: 798]
  ------------------
  499|    115|      return false;
  500|    115|    }
  501|    798|    return true;
  502|    913|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    439|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    439|    unsigned x;
  423|    439|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 25, False: 414]
  ------------------
  424|     25|      return 1;
  425|     25|    }
  426|    414|    ans_.buf = buf;
  427|    414|    x = buf[offset - 1] >> 6;
  428|    414|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 107, False: 307]
  ------------------
  429|    107|      ans_.buf_offset = offset - 1;
  430|    107|      ans_.state = buf[offset - 1] & 0x3F;
  431|    307|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 100, False: 207]
  ------------------
  432|    100|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 33, False: 67]
  ------------------
  433|     33|        return 1;
  434|     33|      }
  435|     67|      ans_.buf_offset = offset - 2;
  436|     67|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    207|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 61, False: 146]
  ------------------
  438|     61|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 19, False: 42]
  ------------------
  439|     19|        return 1;
  440|     19|      }
  441|     42|      ans_.buf_offset = offset - 3;
  442|     42|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    146|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 146, False: 0]
  ------------------
  444|    146|      ans_.buf_offset = offset - 4;
  445|    146|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    146|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    362|    ans_.state += l_rans_base;
  450|    362|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    362|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 39, False: 323]
  ------------------
  451|     39|      return 1;
  452|     39|    }
  453|    323|    return 0;
  454|    362|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  83.7M|  inline int rans_read() {
  463|  83.7M|    unsigned rem;
  464|  83.7M|    unsigned quo;
  465|  83.7M|    struct rans_dec_sym sym;
  466|  83.7M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 74.3M, False: 9.36M]
  |  Branch (466:40): [True: 4.40k, False: 74.3M]
  ------------------
  467|  4.40k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.40k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.40k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  83.7M|    quo = ans_.state / rans_precision;
  472|  83.7M|    rem = ans_.state % rans_precision;
  473|  83.7M|    fetch_sym(&sym, rem);
  474|  83.7M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  83.7M|    return sym.val;
  476|  83.7M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  83.7M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  83.7M|    uint32_t symbol = lut_table_[rem];
  507|  83.7M|    out->val = symbol;
  508|  83.7M|    out->prob = probability_table_[symbol].prob;
  509|  83.7M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  83.7M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    323|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.30k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.30k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.30k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.30k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.30k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.30k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 76, False: 1.22k]
  ------------------
   67|     76|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 8, False: 68]
  ------------------
   68|      8|      return false;
   69|      8|    }
   70|       |
   71|     76|  } else
   72|  1.22k|#endif
   73|  1.22k|  {
   74|  1.22k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 33, False: 1.19k]
  ------------------
   75|     33|      return false;
   76|     33|    }
   77|  1.22k|  }
   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.26k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 83, False: 1.17k]
  ------------------
   83|     83|    return false;
   84|     83|  }
   85|  1.17k|  probability_table_.resize(num_symbols_);
   86|  1.17k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 451, False: 728]
  ------------------
   87|    451|    return true;
   88|    451|  }
   89|       |  // Decode the table.
   90|  58.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 58.2k, False: 517]
  ------------------
   91|  58.2k|    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|  58.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 86, False: 58.1k]
  ------------------
   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|  58.1k|    const int token = prob_data & 3;
  102|  58.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 28.0k, False: 30.1k]
  ------------------
  103|  28.0k|      const uint32_t offset = prob_data >> 2;
  104|  28.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 93, False: 27.9k]
  ------------------
  105|     93|        return false;
  106|     93|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   875k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 847k, False: 27.9k]
  ------------------
  109|   847k|        probability_table_[i + j] = 0;
  110|   847k|      }
  111|  27.9k|      i += offset;
  112|  30.1k|    } else {
  113|  30.1k|      const int extra_bytes = token;
  114|  30.1k|      uint32_t prob = prob_data >> 2;
  115|  57.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 27.2k, False: 30.1k]
  ------------------
  116|  27.2k|        uint8_t eb;
  117|  27.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 32, False: 27.1k]
  ------------------
  118|     32|          return false;
  119|     32|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  27.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  27.1k|      }
  124|  30.1k|      probability_table_[i] = prob;
  125|  30.1k|    }
  126|  58.1k|  }
  127|    517|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 178, False: 339]
  ------------------
  128|    178|    return false;
  129|    178|  }
  130|    339|  return true;
  131|    517|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    684|    DecoderBuffer *buffer) {
  136|    684|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    684|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    684|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    684|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 648]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 6, False: 30]
  ------------------
  141|      6|      return false;
  142|      6|    }
  143|       |
  144|     36|  } else
  145|    648|#endif
  146|    648|  {
  147|    648|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 42, False: 606]
  ------------------
  148|     42|      return false;
  149|     42|    }
  150|    648|  }
  151|    636|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 136, False: 500]
  ------------------
  152|    136|    return false;
  153|    136|  }
  154|    500|  const uint8_t *const data_head =
  155|    500|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    500|  buffer->Advance(bytes_encoded);
  158|    500|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 120, False: 380]
  ------------------
  159|    120|    return false;
  160|    120|  }
  161|    380|  return true;
  162|    500|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    508|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  1.33M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    306|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    306|  ans_.read_end();
  167|    306|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    604|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    604|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    604|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 604]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    604|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    604|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    604|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 97, False: 507]
  ------------------
   67|     97|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 93]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     97|  } else
   72|    507|#endif
   73|    507|  {
   74|    507|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 496]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    507|  }
   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|    589|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 68, False: 521]
  ------------------
   83|     68|    return false;
   84|     68|  }
   85|    521|  probability_table_.resize(num_symbols_);
   86|    521|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 18, False: 503]
  ------------------
   87|     18|    return true;
   88|     18|  }
   89|       |  // Decode the table.
   90|  2.08M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.08M, False: 330]
  ------------------
   91|  2.08M|    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|  2.08M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 64, False: 2.08M]
  ------------------
   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|  2.08M|    const int token = prob_data & 3;
  102|  2.08M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 593k, False: 1.48M]
  ------------------
  103|   593k|      const uint32_t offset = prob_data >> 2;
  104|   593k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 72, False: 593k]
  ------------------
  105|     72|        return false;
  106|     72|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  18.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 17.9M, False: 593k]
  ------------------
  109|  17.9M|        probability_table_[i + j] = 0;
  110|  17.9M|      }
  111|   593k|      i += offset;
  112|  1.48M|    } else {
  113|  1.48M|      const int extra_bytes = token;
  114|  1.48M|      uint32_t prob = prob_data >> 2;
  115|  1.54M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 57.3k, False: 1.48M]
  ------------------
  116|  57.3k|        uint8_t eb;
  117|  57.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 37, False: 57.3k]
  ------------------
  118|     37|          return false;
  119|     37|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  57.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  57.3k|      }
  124|  1.48M|      probability_table_[i] = prob;
  125|  1.48M|    }
  126|  2.08M|  }
  127|    330|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 124, False: 206]
  ------------------
  128|    124|    return false;
  129|    124|  }
  130|    206|  return true;
  131|    330|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    224|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    206|    DecoderBuffer *buffer) {
  136|    206|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    206|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    206|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    206|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 12, False: 194]
  ------------------
  140|     12|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 11]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     12|  } else
  145|    194|#endif
  146|    194|  {
  147|    194|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 192]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    194|  }
  151|    203|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 44, False: 159]
  ------------------
  152|     44|    return false;
  153|     44|  }
  154|    159|  const uint8_t *const data_head =
  155|    159|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    159|  buffer->Advance(bytes_encoded);
  158|    159|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 141]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|    141|  return true;
  162|    159|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  42.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    141|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    141|  ans_.read_end();
  167|    141|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    617|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    617|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    617|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 617]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    617|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    617|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    617|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 61, False: 556]
  ------------------
   67|     61|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 59]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     61|  } else
   72|    556|#endif
   73|    556|  {
   74|    556|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 548]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    556|  }
   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|    607|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 52, False: 555]
  ------------------
   83|     52|    return false;
   84|     52|  }
   85|    555|  probability_table_.resize(num_symbols_);
   86|    555|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 16, False: 539]
  ------------------
   87|     16|    return true;
   88|     16|  }
   89|       |  // Decode the table.
   90|   297k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 297k, False: 392]
  ------------------
   91|   297k|    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|   297k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 65, False: 297k]
  ------------------
   95|     65|      return false;
   96|     65|    }
   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|   297k|    const int token = prob_data & 3;
  102|   297k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 177k, False: 120k]
  ------------------
  103|   177k|      const uint32_t offset = prob_data >> 2;
  104|   177k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 47, False: 177k]
  ------------------
  105|     47|        return false;
  106|     47|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.02M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.85M, False: 177k]
  ------------------
  109|  5.85M|        probability_table_[i + j] = 0;
  110|  5.85M|      }
  111|   177k|      i += offset;
  112|   177k|    } else {
  113|   120k|      const int extra_bytes = token;
  114|   120k|      uint32_t prob = prob_data >> 2;
  115|   170k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 50.3k, False: 120k]
  ------------------
  116|  50.3k|        uint8_t eb;
  117|  50.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 35, False: 50.3k]
  ------------------
  118|     35|          return false;
  119|     35|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  50.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  50.3k|      }
  124|   120k|      probability_table_[i] = prob;
  125|   120k|    }
  126|   297k|  }
  127|    392|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 45, False: 347]
  ------------------
  128|     45|    return false;
  129|     45|  }
  130|    347|  return true;
  131|    392|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    363|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    347|    DecoderBuffer *buffer) {
  136|    347|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    347|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    347|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    347|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 20, False: 327]
  ------------------
  140|     20|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 18]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     20|  } else
  145|    327|#endif
  146|    327|  {
  147|    327|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 318]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    327|  }
  151|    336|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 94, False: 242]
  ------------------
  152|     94|    return false;
  153|     94|  }
  154|    242|  const uint8_t *const data_head =
  155|    242|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    242|  buffer->Advance(bytes_encoded);
  158|    242|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 224]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|    224|  return true;
  162|    242|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  4.33M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    224|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    224|  ans_.read_end();
  167|    224|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    482|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    482|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    482|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 482]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    482|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    482|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    482|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 56, False: 426]
  ------------------
   67|     56|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 55]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     56|  } else
   72|    426|#endif
   73|    426|  {
   74|    426|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 424]
  ------------------
   75|      2|      return false;
   76|      2|    }
   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|    479|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 464]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    464|  probability_table_.resize(num_symbols_);
   86|    464|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 460]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  12.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 12.2k, False: 266]
  ------------------
   91|  12.2k|    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|  12.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 78, False: 12.1k]
  ------------------
   95|     78|      return false;
   96|     78|    }
   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|  12.1k|    const int token = prob_data & 3;
  102|  12.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.10k, False: 7.04k]
  ------------------
  103|  5.10k|      const uint32_t offset = prob_data >> 2;
  104|  5.10k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 95, False: 5.00k]
  ------------------
  105|     95|        return false;
  106|     95|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   192k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 187k, False: 5.00k]
  ------------------
  109|   187k|        probability_table_[i + j] = 0;
  110|   187k|      }
  111|  5.00k|      i += offset;
  112|  7.04k|    } else {
  113|  7.04k|      const int extra_bytes = token;
  114|  7.04k|      uint32_t prob = prob_data >> 2;
  115|  12.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.33k, False: 7.02k]
  ------------------
  116|  5.33k|        uint8_t eb;
  117|  5.33k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 5.31k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.31k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.31k|      }
  124|  7.02k|      probability_table_[i] = prob;
  125|  7.02k|    }
  126|  12.1k|  }
  127|    266|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 36, False: 230]
  ------------------
  128|     36|    return false;
  129|     36|  }
  130|    230|  return true;
  131|    266|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    234|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    230|    DecoderBuffer *buffer) {
  136|    230|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    230|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    230|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    230|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 49, False: 181]
  ------------------
  140|     49|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 44]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     49|  } else
  145|    181|#endif
  146|    181|  {
  147|    181|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 179]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    181|  }
  151|    223|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 105, False: 118]
  ------------------
  152|    105|    return false;
  153|    105|  }
  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: 20, False: 98]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|     98|  return true;
  162|    118|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  10.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|     98|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     98|  ans_.read_end();
  167|     98|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    314|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    314|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    314|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 314]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    314|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    314|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    314|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 288]
  ------------------
   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|    288|#endif
   73|    288|  {
   74|    288|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 277]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    288|  }
   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|    301|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 290]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    290|  probability_table_.resize(num_symbols_);
   86|    290|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 283]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  11.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.2k, False: 170]
  ------------------
   91|  11.2k|    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.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 48, False: 11.2k]
  ------------------
   95|     48|      return false;
   96|     48|    }
   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.2k|    const int token = prob_data & 3;
  102|  11.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.43k, False: 5.77k]
  ------------------
  103|  5.43k|      const uint32_t offset = prob_data >> 2;
  104|  5.43k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 5.39k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   199k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 194k, False: 5.39k]
  ------------------
  109|   194k|        probability_table_[i + j] = 0;
  110|   194k|      }
  111|  5.39k|      i += offset;
  112|  5.77k|    } else {
  113|  5.77k|      const int extra_bytes = token;
  114|  5.77k|      uint32_t prob = prob_data >> 2;
  115|  8.92k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.18k, False: 5.74k]
  ------------------
  116|  3.18k|        uint8_t eb;
  117|  3.18k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 3.15k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.15k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.15k|      }
  124|  5.74k|      probability_table_[i] = prob;
  125|  5.74k|    }
  126|  11.2k|  }
  127|    170|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 151]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    151|  return true;
  131|    170|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    158|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    151|    DecoderBuffer *buffer) {
  136|    151|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    151|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    151|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    151|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 135]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 13]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     16|  } else
  145|    135|#endif
  146|    135|  {
  147|    135|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 132]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    135|  }
  151|    145|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 125]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|    125|  const uint8_t *const data_head =
  155|    125|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    125|  buffer->Advance(bytes_encoded);
  158|    125|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 112]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|    112|  return true;
  162|    125|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  1.20M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    112|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    112|  ans_.read_end();
  167|    112|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    404|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    404|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    404|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 404]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    404|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    404|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    404|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 68, False: 336]
  ------------------
   67|     68|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 67]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     68|  } else
   72|    336|#endif
   73|    336|  {
   74|    336|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 330]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    336|  }
   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|    397|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 376]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    376|  probability_table_.resize(num_symbols_);
   86|    376|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 372]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  11.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.7k, False: 256]
  ------------------
   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: 62, False: 11.6k]
  ------------------
   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|  11.6k|    const int token = prob_data & 3;
  102|  11.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.68k, False: 6.97k]
  ------------------
  103|  4.68k|      const uint32_t offset = prob_data >> 2;
  104|  4.68k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 4.65k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  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: 156k, False: 4.65k]
  ------------------
  109|   156k|        probability_table_[i + j] = 0;
  110|   156k|      }
  111|  4.65k|      i += offset;
  112|  6.97k|    } else {
  113|  6.97k|      const int extra_bytes = token;
  114|  6.97k|      uint32_t prob = prob_data >> 2;
  115|  11.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.83k, False: 6.94k]
  ------------------
  116|  4.83k|        uint8_t eb;
  117|  4.83k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 4.81k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.81k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.81k|      }
  124|  6.94k|      probability_table_[i] = prob;
  125|  6.94k|    }
  126|  11.6k|  }
  127|    256|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 233]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    233|  return true;
  131|    256|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    237|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    233|    DecoderBuffer *buffer) {
  136|    233|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    233|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    233|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    233|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 45, False: 188]
  ------------------
  140|     45|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 42]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     45|  } else
  145|    188|#endif
  146|    188|  {
  147|    188|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 187]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    188|  }
  151|    229|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 80, False: 149]
  ------------------
  152|     80|    return false;
  153|     80|  }
  154|    149|  const uint8_t *const data_head =
  155|    149|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    149|  buffer->Advance(bytes_encoded);
  158|    149|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 122]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|    122|  return true;
  162|    149|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  6.98M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    122|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    122|  ans_.read_end();
  167|    122|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    424|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    424|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    424|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 424]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    424|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    424|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    424|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 52, False: 372]
  ------------------
   67|     52|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 49]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     52|  } else
   72|    372|#endif
   73|    372|  {
   74|    372|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 367]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    372|  }
   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|    416|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 392]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    392|  probability_table_.resize(num_symbols_);
   86|    392|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 379]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|  1.13M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.13M, False: 211]
  ------------------
   91|  1.13M|    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.13M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 87, False: 1.13M]
  ------------------
   95|     87|      return false;
   96|     87|    }
   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.13M|    const int token = prob_data & 3;
  102|  1.13M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 486k, False: 650k]
  ------------------
  103|   486k|      const uint32_t offset = prob_data >> 2;
  104|   486k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 44, False: 486k]
  ------------------
  105|     44|        return false;
  106|     44|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  18.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 18.3M, False: 486k]
  ------------------
  109|  18.3M|        probability_table_[i + j] = 0;
  110|  18.3M|      }
  111|   486k|      i += offset;
  112|   650k|    } else {
  113|   650k|      const int extra_bytes = token;
  114|   650k|      uint32_t prob = prob_data >> 2;
  115|  1.08M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 432k, False: 650k]
  ------------------
  116|   432k|        uint8_t eb;
  117|   432k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 37, False: 432k]
  ------------------
  118|     37|          return false;
  119|     37|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   432k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   432k|      }
  124|   650k|      probability_table_[i] = prob;
  125|   650k|    }
  126|  1.13M|  }
  127|    211|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 192]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    192|  return true;
  131|    211|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    205|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    192|    DecoderBuffer *buffer) {
  136|    192|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    192|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    192|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    192|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 169]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 18]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     23|  } else
  145|    169|#endif
  146|    169|  {
  147|    169|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 167]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    169|  }
  151|    185|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 55, False: 130]
  ------------------
  152|     55|    return false;
  153|     55|  }
  154|    130|  const uint8_t *const data_head =
  155|    130|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    130|  buffer->Advance(bytes_encoded);
  158|    130|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 37, False: 93]
  ------------------
  159|     37|    return false;
  160|     37|  }
  161|     93|  return true;
  162|    130|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  8.70M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     93|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     93|  ans_.read_end();
  167|     93|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    451|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    451|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    451|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 451]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    451|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    451|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    451|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 65, False: 386]
  ------------------
   67|     65|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 61]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     65|  } else
   72|    386|#endif
   73|    386|  {
   74|    386|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 22, False: 364]
  ------------------
   75|     22|      return false;
   76|     22|    }
   77|    386|  }
   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|    425|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 39, False: 386]
  ------------------
   83|     39|    return false;
   84|     39|  }
   85|    386|  probability_table_.resize(num_symbols_);
   86|    386|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 383]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   209k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 209k, False: 257]
  ------------------
   91|   209k|    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|   209k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 51, False: 209k]
  ------------------
   95|     51|      return false;
   96|     51|    }
   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|   209k|    const int token = prob_data & 3;
  102|   209k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 28.6k, False: 180k]
  ------------------
  103|  28.6k|      const uint32_t offset = prob_data >> 2;
  104|  28.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 46, False: 28.5k]
  ------------------
  105|     46|        return false;
  106|     46|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.19M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.16M, False: 28.5k]
  ------------------
  109|  1.16M|        probability_table_[i + j] = 0;
  110|  1.16M|      }
  111|  28.5k|      i += offset;
  112|   180k|    } else {
  113|   180k|      const int extra_bytes = token;
  114|   180k|      uint32_t prob = prob_data >> 2;
  115|   239k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 59.0k, False: 180k]
  ------------------
  116|  59.0k|        uint8_t eb;
  117|  59.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 59.0k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  59.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  59.0k|      }
  124|   180k|      probability_table_[i] = prob;
  125|   180k|    }
  126|   209k|  }
  127|    257|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 43, False: 214]
  ------------------
  128|     43|    return false;
  129|     43|  }
  130|    214|  return true;
  131|    257|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    217|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    214|    DecoderBuffer *buffer) {
  136|    214|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    214|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    214|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    214|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 42, False: 172]
  ------------------
  140|     42|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 41]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     42|  } else
  145|    172|#endif
  146|    172|  {
  147|    172|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 170]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    172|  }
  151|    211|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 103, False: 108]
  ------------------
  152|    103|    return false;
  153|    103|  }
  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: 39, False: 69]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|     69|  return true;
  162|    108|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  2.05M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     69|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     69|  ans_.read_end();
  167|     69|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    330|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    330|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    330|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 330]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    330|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    330|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    330|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 309]
  ------------------
   67|     21|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 20]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     21|  } else
   72|    309|#endif
   73|    309|  {
   74|    309|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 303]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    309|  }
   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|    323|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 303]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    303|  probability_table_.resize(num_symbols_);
   86|    303|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 292]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  14.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 14.3k, False: 199]
  ------------------
   91|  14.3k|    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.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 42, False: 14.3k]
  ------------------
   95|     42|      return false;
   96|     42|    }
   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.3k|    const int token = prob_data & 3;
  102|  14.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.57k, False: 7.73k]
  ------------------
  103|  6.57k|      const uint32_t offset = prob_data >> 2;
  104|  6.57k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 6.54k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   263k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 257k, False: 6.54k]
  ------------------
  109|   257k|        probability_table_[i + j] = 0;
  110|   257k|      }
  111|  6.54k|      i += offset;
  112|  7.73k|    } else {
  113|  7.73k|      const int extra_bytes = token;
  114|  7.73k|      uint32_t prob = prob_data >> 2;
  115|  12.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.29k, False: 7.72k]
  ------------------
  116|  4.29k|        uint8_t eb;
  117|  4.29k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 4.27k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.27k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.27k|      }
  124|  7.72k|      probability_table_[i] = prob;
  125|  7.72k|    }
  126|  14.3k|  }
  127|    199|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 63, False: 136]
  ------------------
  128|     63|    return false;
  129|     63|  }
  130|    136|  return true;
  131|    199|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    147|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    136|    DecoderBuffer *buffer) {
  136|    136|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    136|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    136|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    136|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 136]
  ------------------
  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|    136|#endif
  146|    136|  {
  147|    136|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 134]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    136|  }
  151|    134|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 67, False: 67]
  ------------------
  152|     67|    return false;
  153|     67|  }
  154|     67|  const uint8_t *const data_head =
  155|     67|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     67|  buffer->Advance(bytes_encoded);
  158|     67|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 24, False: 43]
  ------------------
  159|     24|    return false;
  160|     24|  }
  161|     43|  return true;
  162|     67|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  98.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     43|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     43|  ans_.read_end();
  167|     43|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    336|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    336|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    336|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 336]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    336|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    336|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    336|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 12, False: 324]
  ------------------
   67|     12|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 11]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     12|  } else
   72|    324|#endif
   73|    324|  {
   74|    324|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 319]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    324|  }
   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|    330|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 309]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    309|  probability_table_.resize(num_symbols_);
   86|    309|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 304]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   345k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 345k, False: 180]
  ------------------
   91|   345k|    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|   345k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 53, False: 345k]
  ------------------
   95|     53|      return false;
   96|     53|    }
   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|   345k|    const int token = prob_data & 3;
  102|   345k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 105k, False: 240k]
  ------------------
  103|   105k|      const uint32_t offset = prob_data >> 2;
  104|   105k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 105k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.66M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.56M, False: 105k]
  ------------------
  109|  3.56M|        probability_table_[i + j] = 0;
  110|  3.56M|      }
  111|   105k|      i += offset;
  112|   240k|    } else {
  113|   240k|      const int extra_bytes = token;
  114|   240k|      uint32_t prob = prob_data >> 2;
  115|   408k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 168k, False: 239k]
  ------------------
  116|   168k|        uint8_t eb;
  117|   168k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 168k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   168k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   168k|      }
  124|   239k|      probability_table_[i] = prob;
  125|   239k|    }
  126|   345k|  }
  127|    180|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 61, False: 119]
  ------------------
  128|     61|    return false;
  129|     61|  }
  130|    119|  return true;
  131|    180|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    124|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    119|    DecoderBuffer *buffer) {
  136|    119|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    119|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    119|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    119|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 119]
  ------------------
  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|    119|#endif
  146|    119|  {
  147|    119|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 118]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    119|  }
  151|    118|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 44, False: 74]
  ------------------
  152|     44|    return false;
  153|     44|  }
  154|     74|  const uint8_t *const data_head =
  155|     74|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     74|  buffer->Advance(bytes_encoded);
  158|     74|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 52]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     52|  return true;
  162|     74|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   416k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     52|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     52|  ans_.read_end();
  167|     52|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    415|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    415|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    415|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 415]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    415|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    415|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    415|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 385]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 29]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     30|  } else
   72|    385|#endif
   73|    385|  {
   74|    385|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 383]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    385|  }
   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|    412|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 388]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    388|  probability_table_.resize(num_symbols_);
   86|    388|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 382]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  66.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 65.8k, False: 260]
  ------------------
   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: 66, False: 65.7k]
  ------------------
   95|     66|      return false;
   96|     66|    }
   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: 21.4k, False: 44.2k]
  ------------------
  103|  21.4k|      const uint32_t offset = prob_data >> 2;
  104|  21.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 39, False: 21.4k]
  ------------------
  105|     39|        return false;
  106|     39|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   783k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 761k, False: 21.4k]
  ------------------
  109|   761k|        probability_table_[i + j] = 0;
  110|   761k|      }
  111|  21.4k|      i += offset;
  112|  44.2k|    } else {
  113|  44.2k|      const int extra_bytes = token;
  114|  44.2k|      uint32_t prob = prob_data >> 2;
  115|  66.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 22.4k, False: 44.2k]
  ------------------
  116|  22.4k|        uint8_t eb;
  117|  22.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 22.4k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  22.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  22.4k|      }
  124|  44.2k|      probability_table_[i] = prob;
  125|  44.2k|    }
  126|  65.7k|  }
  127|    260|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 95, False: 165]
  ------------------
  128|     95|    return false;
  129|     95|  }
  130|    165|  return true;
  131|    260|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    171|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    165|    DecoderBuffer *buffer) {
  136|    165|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    165|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    165|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    165|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 165]
  ------------------
  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|    165|#endif
  146|    165|  {
  147|    165|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 161]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    165|  }
  151|    161|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 72, False: 89]
  ------------------
  152|     72|    return false;
  153|     72|  }
  154|     89|  const uint8_t *const data_head =
  155|     89|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     89|  buffer->Advance(bytes_encoded);
  158|     89|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 47, False: 42]
  ------------------
  159|     47|    return false;
  160|     47|  }
  161|     42|  return true;
  162|     89|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  42.0k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     42|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     42|  ans_.read_end();
  167|     42|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    435|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    435|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    435|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 435]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    435|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    435|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    435|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 12, False: 423]
  ------------------
   67|     12|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 11]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     12|  } else
   72|    423|#endif
   73|    423|  {
   74|    423|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 412]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    423|  }
   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|    423|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 413]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    413|  probability_table_.resize(num_symbols_);
   86|    413|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 401]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|  45.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 45.5k, False: 265]
  ------------------
   91|  45.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|  45.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 75, False: 45.4k]
  ------------------
   95|     75|      return false;
   96|     75|    }
   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|  45.4k|    const int token = prob_data & 3;
  102|  45.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.2k, False: 35.1k]
  ------------------
  103|  10.2k|      const uint32_t offset = prob_data >> 2;
  104|  10.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 40, False: 10.2k]
  ------------------
  105|     40|        return false;
  106|     40|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   319k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 309k, False: 10.2k]
  ------------------
  109|   309k|        probability_table_[i + j] = 0;
  110|   309k|      }
  111|  10.2k|      i += offset;
  112|  35.1k|    } else {
  113|  35.1k|      const int extra_bytes = token;
  114|  35.1k|      uint32_t prob = prob_data >> 2;
  115|  43.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.03k, False: 35.1k]
  ------------------
  116|  8.03k|        uint8_t eb;
  117|  8.03k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 8.01k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.01k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.01k|      }
  124|  35.1k|      probability_table_[i] = prob;
  125|  35.1k|    }
  126|  45.4k|  }
  127|    265|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 92, False: 173]
  ------------------
  128|     92|    return false;
  129|     92|  }
  130|    173|  return true;
  131|    265|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    185|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    173|    DecoderBuffer *buffer) {
  136|    173|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    173|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    173|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    173|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 173]
  ------------------
  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|    173|#endif
  146|    173|  {
  147|    173|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 170]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    173|  }
  151|    170|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 93, False: 77]
  ------------------
  152|     93|    return false;
  153|     93|  }
  154|     77|  const uint8_t *const data_head =
  155|     77|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     77|  buffer->Advance(bytes_encoded);
  158|     77|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 52]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     52|  return true;
  162|     77|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   172k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     52|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     52|  ans_.read_end();
  167|     52|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    327|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    327|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    327|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 327]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    327|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    327|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    327|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 308]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 17]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     19|  } else
   72|    308|#endif
   73|    308|  {
   74|    308|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 306]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    308|  }
   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|    323|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 313]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    313|  probability_table_.resize(num_symbols_);
   86|    313|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 302]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   229k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 229k, False: 197]
  ------------------
   91|   229k|    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|   229k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 57, False: 229k]
  ------------------
   95|     57|      return false;
   96|     57|    }
   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|   229k|    const int token = prob_data & 3;
  102|   229k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 64.2k, False: 165k]
  ------------------
  103|  64.2k|      const uint32_t offset = prob_data >> 2;
  104|  64.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 64.2k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.31M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.24M, False: 64.2k]
  ------------------
  109|  2.24M|        probability_table_[i + j] = 0;
  110|  2.24M|      }
  111|  64.2k|      i += offset;
  112|   165k|    } else {
  113|   165k|      const int extra_bytes = token;
  114|   165k|      uint32_t prob = prob_data >> 2;
  115|   289k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 124k, False: 165k]
  ------------------
  116|   124k|        uint8_t eb;
  117|   124k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 124k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   124k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   124k|      }
  124|   165k|      probability_table_[i] = prob;
  125|   165k|    }
  126|   229k|  }
  127|    197|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 82, False: 115]
  ------------------
  128|     82|    return false;
  129|     82|  }
  130|    115|  return true;
  131|    197|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    126|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    115|    DecoderBuffer *buffer) {
  136|    115|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    115|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    115|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    115|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 115]
  ------------------
  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|    115|#endif
  146|    115|  {
  147|    115|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 110]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    115|  }
  151|    110|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 33, False: 77]
  ------------------
  152|     33|    return false;
  153|     33|  }
  154|     77|  const uint8_t *const data_head =
  155|     77|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     77|  buffer->Advance(bytes_encoded);
  158|     77|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 56]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|     56|  return true;
  162|     77|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   425k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     56|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     56|  ans_.read_end();
  167|     56|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    358|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    358|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    358|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 358]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    358|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    358|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    358|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 31, False: 327]
  ------------------
   67|     31|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 30]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     31|  } else
   72|    327|#endif
   73|    327|  {
   74|    327|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 12, False: 315]
  ------------------
   75|     12|      return false;
   76|     12|    }
   77|    327|  }
   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|    345|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 25, False: 320]
  ------------------
   83|     25|    return false;
   84|     25|  }
   85|    320|  probability_table_.resize(num_symbols_);
   86|    320|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 314]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   108k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 108k, False: 185]
  ------------------
   91|   108k|    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|   108k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 57, False: 108k]
  ------------------
   95|     57|      return false;
   96|     57|    }
   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|   108k|    const int token = prob_data & 3;
  102|   108k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 55.5k, False: 52.5k]
  ------------------
  103|  55.5k|      const uint32_t offset = prob_data >> 2;
  104|  55.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 55.4k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.87M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.81M, False: 55.4k]
  ------------------
  109|  2.81M|        probability_table_[i + j] = 0;
  110|  2.81M|      }
  111|  55.4k|      i += offset;
  112|  55.4k|    } else {
  113|  52.5k|      const int extra_bytes = token;
  114|  52.5k|      uint32_t prob = prob_data >> 2;
  115|  79.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 27.0k, False: 52.5k]
  ------------------
  116|  27.0k|        uint8_t eb;
  117|  27.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 30, False: 27.0k]
  ------------------
  118|     30|          return false;
  119|     30|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  27.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  27.0k|      }
  124|  52.5k|      probability_table_[i] = prob;
  125|  52.5k|    }
  126|   108k|  }
  127|    185|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 30, False: 155]
  ------------------
  128|     30|    return false;
  129|     30|  }
  130|    155|  return true;
  131|    185|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    161|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    155|    DecoderBuffer *buffer) {
  136|    155|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    155|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    155|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    155|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 152]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 1]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|      3|  } else
  145|    152|#endif
  146|    152|  {
  147|    152|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 142]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    152|  }
  151|    143|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 46, False: 97]
  ------------------
  152|     46|    return false;
  153|     46|  }
  154|     97|  const uint8_t *const data_head =
  155|     97|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     97|  buffer->Advance(bytes_encoded);
  158|     97|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 72]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     72|  return true;
  162|     97|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  6.68M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     72|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     72|  ans_.read_end();
  167|     72|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    375|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    375|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    375|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 375]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    375|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    375|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    375|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 49, False: 326]
  ------------------
   67|     49|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 48]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     49|  } else
   72|    326|#endif
   73|    326|  {
   74|    326|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 324]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    326|  }
   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|    372|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 364]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    364|  probability_table_.resize(num_symbols_);
   86|    364|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 16, False: 348]
  ------------------
   87|     16|    return true;
   88|     16|  }
   89|       |  // Decode the table.
   90|   225k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 225k, False: 227]
  ------------------
   91|   225k|    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|   225k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 64, False: 225k]
  ------------------
   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|   225k|    const int token = prob_data & 3;
  102|   225k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 26.4k, False: 199k]
  ------------------
  103|  26.4k|      const uint32_t offset = prob_data >> 2;
  104|  26.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 26.3k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.03M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.00M, False: 26.3k]
  ------------------
  109|  1.00M|        probability_table_[i + j] = 0;
  110|  1.00M|      }
  111|  26.3k|      i += offset;
  112|   199k|    } else {
  113|   199k|      const int extra_bytes = token;
  114|   199k|      uint32_t prob = prob_data >> 2;
  115|   262k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 63.8k, False: 198k]
  ------------------
  116|  63.8k|        uint8_t eb;
  117|  63.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 63.8k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  63.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  63.8k|      }
  124|   198k|      probability_table_[i] = prob;
  125|   198k|    }
  126|   225k|  }
  127|    227|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 44, False: 183]
  ------------------
  128|     44|    return false;
  129|     44|  }
  130|    183|  return true;
  131|    227|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    199|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    183|    DecoderBuffer *buffer) {
  136|    183|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    183|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    183|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    183|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 38, False: 145]
  ------------------
  140|     38|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 37]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     38|  } else
  145|    145|#endif
  146|    145|  {
  147|    145|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 136]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    145|  }
  151|    173|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 61, False: 112]
  ------------------
  152|     61|    return false;
  153|     61|  }
  154|    112|  const uint8_t *const data_head =
  155|    112|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    112|  buffer->Advance(bytes_encoded);
  158|    112|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 37, False: 75]
  ------------------
  159|     37|    return false;
  160|     37|  }
  161|     75|  return true;
  162|    112|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  3.47M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     75|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     75|  ans_.read_end();
  167|     75|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    347|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    347|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    347|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 347]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    347|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    347|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    347|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 314]
  ------------------
   67|     33|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 32]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     33|  } else
   72|    314|#endif
   73|    314|  {
   74|    314|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 305]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    314|  }
   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|    337|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 29, False: 308]
  ------------------
   83|     29|    return false;
   84|     29|  }
   85|    308|  probability_table_.resize(num_symbols_);
   86|    308|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 304]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  11.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.6k, False: 186]
  ------------------
   91|  11.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|  11.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 57, False: 11.5k]
  ------------------
   95|     57|      return false;
   96|     57|    }
   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.5k|    const int token = prob_data & 3;
  102|  11.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.59k, False: 4.99k]
  ------------------
  103|  6.59k|      const uint32_t offset = prob_data >> 2;
  104|  6.59k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 35, False: 6.56k]
  ------------------
  105|     35|        return false;
  106|     35|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   240k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 233k, False: 6.56k]
  ------------------
  109|   233k|        probability_table_[i + j] = 0;
  110|   233k|      }
  111|  6.56k|      i += offset;
  112|  6.56k|    } else {
  113|  4.99k|      const int extra_bytes = token;
  114|  4.99k|      uint32_t prob = prob_data >> 2;
  115|  8.65k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.68k, False: 4.96k]
  ------------------
  116|  3.68k|        uint8_t eb;
  117|  3.68k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 3.66k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.66k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.66k|      }
  124|  4.96k|      probability_table_[i] = prob;
  125|  4.96k|    }
  126|  11.5k|  }
  127|    186|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 160]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    160|  return true;
  131|    186|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    164|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    160|    DecoderBuffer *buffer) {
  136|    160|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    160|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    160|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    160|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 17, False: 143]
  ------------------
  140|     17|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 15]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     17|  } else
  145|    143|#endif
  146|    143|  {
  147|    143|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 15, False: 128]
  ------------------
  148|     15|      return false;
  149|     15|    }
  150|    143|  }
  151|    143|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 54, False: 89]
  ------------------
  152|     54|    return false;
  153|     54|  }
  154|     89|  const uint8_t *const data_head =
  155|     89|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     89|  buffer->Advance(bytes_encoded);
  158|     89|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 64]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     64|  return true;
  162|     89|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  25.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    349|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    349|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    349|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 349]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    349|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    349|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    349|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 38, False: 311]
  ------------------
   67|     38|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 37]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     38|  } else
   72|    311|#endif
   73|    311|  {
   74|    311|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 307]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    311|  }
   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|    344|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 25, False: 319]
  ------------------
   83|     25|    return false;
   84|     25|  }
   85|    319|  probability_table_.resize(num_symbols_);
   86|    319|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 308]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  7.71k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.52k, False: 186]
  ------------------
   91|  7.52k|    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|  7.52k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 72, False: 7.45k]
  ------------------
   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|  7.45k|    const int token = prob_data & 3;
  102|  7.45k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.56k, False: 3.88k]
  ------------------
  103|  3.56k|      const uint32_t offset = prob_data >> 2;
  104|  3.56k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 3.54k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   126k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 123k, False: 3.54k]
  ------------------
  109|   123k|        probability_table_[i + j] = 0;
  110|   123k|      }
  111|  3.54k|      i += offset;
  112|  3.88k|    } else {
  113|  3.88k|      const int extra_bytes = token;
  114|  3.88k|      uint32_t prob = prob_data >> 2;
  115|  6.63k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.76k, False: 3.86k]
  ------------------
  116|  2.76k|        uint8_t eb;
  117|  2.76k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 2.74k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.74k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.74k|      }
  124|  3.86k|      probability_table_[i] = prob;
  125|  3.86k|    }
  126|  7.45k|  }
  127|    186|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 160]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    160|  return true;
  131|    186|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    171|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    160|    DecoderBuffer *buffer) {
  136|    160|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    160|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    160|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    160|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 133]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 25]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     27|  } else
  145|    133|#endif
  146|    133|  {
  147|    133|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 130]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    133|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 74, False: 81]
  ------------------
  152|     74|    return false;
  153|     74|  }
  154|     81|  const uint8_t *const data_head =
  155|     81|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     81|  buffer->Advance(bytes_encoded);
  158|     81|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 23, False: 58]
  ------------------
  159|     23|    return false;
  160|     23|  }
  161|     58|  return true;
  162|     81|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  18.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    337|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    337|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    337|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 337]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    337|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    337|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    337|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 74, False: 263]
  ------------------
   67|     74|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 72]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     74|  } else
   72|    263|#endif
   73|    263|  {
   74|    263|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 252]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    263|  }
   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|    324|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 302]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    302|  probability_table_.resize(num_symbols_);
   86|    302|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 297]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  60.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 60.2k, False: 176]
  ------------------
   91|  60.2k|    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|  60.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 68, False: 60.2k]
  ------------------
   95|     68|      return false;
   96|     68|    }
   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|  60.2k|    const int token = prob_data & 3;
  102|  60.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 45.8k, False: 14.3k]
  ------------------
  103|  45.8k|      const uint32_t offset = prob_data >> 2;
  104|  45.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 45.8k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   467k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 421k, False: 45.8k]
  ------------------
  109|   421k|        probability_table_[i + j] = 0;
  110|   421k|      }
  111|  45.8k|      i += offset;
  112|  45.8k|    } else {
  113|  14.3k|      const int extra_bytes = token;
  114|  14.3k|      uint32_t prob = prob_data >> 2;
  115|  31.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 17.5k, False: 14.3k]
  ------------------
  116|  17.5k|        uint8_t eb;
  117|  17.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 17.5k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  17.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  17.5k|      }
  124|  14.3k|      probability_table_[i] = prob;
  125|  14.3k|    }
  126|  60.2k|  }
  127|    176|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 36, False: 140]
  ------------------
  128|     36|    return false;
  129|     36|  }
  130|    140|  return true;
  131|    176|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    145|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    140|    DecoderBuffer *buffer) {
  136|    140|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    140|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    140|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    140|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 56, False: 84]
  ------------------
  140|     56|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 55]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     56|  } else
  145|     84|#endif
  146|     84|  {
  147|     84|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 81]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     84|  }
  151|    136|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 76, False: 60]
  ------------------
  152|     76|    return false;
  153|     76|  }
  154|     60|  const uint8_t *const data_head =
  155|     60|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     60|  buffer->Advance(bytes_encoded);
  158|     60|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 6, False: 54]
  ------------------
  159|      6|    return false;
  160|      6|  }
  161|     54|  return true;
  162|     60|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  28.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     54|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     54|  ans_.read_end();
  167|     54|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  11.0k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  11.0k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 23, False: 10.9k]
  ------------------
   35|     23|    return true;
   36|     23|  }
   37|       |  // Decode which scheme to use.
   38|  10.9k|  uint8_t scheme;
   39|  10.9k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 145, False: 10.8k]
  ------------------
   40|    145|    return false;
   41|    145|  }
   42|  10.8k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.07k, False: 9.78k]
  ------------------
   43|  1.07k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.07k|                                                  src_buffer, out_values);
   45|  9.78k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 7.48k, False: 2.29k]
  ------------------
   46|  7.48k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  7.48k|                                               out_values);
   48|  7.48k|  }
   49|  2.29k|  return false;
   50|  10.8k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.07k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.07k|  SymbolDecoderT<5> tag_decoder;
   57|  1.07k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 481, False: 590]
  ------------------
   58|    481|    return false;
   59|    481|  }
   60|       |
   61|    590|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 282, False: 308]
  ------------------
   62|    282|    return false;
   63|    282|  }
   64|       |
   65|    308|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 308, False: 0]
  |  Branch (65:25): [True: 74, False: 234]
  ------------------
   66|     74|    return false;  // Wrong number of symbols.
   67|     74|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    234|  src_buffer->StartBitDecoding(false, nullptr);
   72|    234|  int value_id = 0;
   73|   748k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 747k, False: 234]
  ------------------
   74|       |    // Decode the tag.
   75|   747k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  1.82M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 1.08M, False: 747k]
  ------------------
   78|  1.08M|      uint32_t val;
   79|  1.08M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 1.08M]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|  1.08M|      out_values[value_id++] = val;
   83|  1.08M|    }
   84|   747k|  }
   85|    234|  tag_decoder.EndDecoding();
   86|    234|  src_buffer->EndBitDecoding();
   87|    234|  return true;
   88|    234|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  7.48k|                      uint32_t *out_values) {
  117|  7.48k|  uint8_t max_bit_length;
  118|  7.48k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 37, False: 7.44k]
  ------------------
  119|     37|    return false;
  120|     37|  }
  121|  7.44k|  switch (max_bit_length) {
  122|    604|    case 1:
  ------------------
  |  Branch (122:5): [True: 604, False: 6.84k]
  ------------------
  123|    604|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    604|                                                         out_values);
  125|    617|    case 2:
  ------------------
  |  Branch (125:5): [True: 617, False: 6.82k]
  ------------------
  126|    617|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    617|                                                         out_values);
  128|    482|    case 3:
  ------------------
  |  Branch (128:5): [True: 482, False: 6.96k]
  ------------------
  129|    482|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    482|                                                         out_values);
  131|    314|    case 4:
  ------------------
  |  Branch (131:5): [True: 314, False: 7.13k]
  ------------------
  132|    314|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    314|                                                         out_values);
  134|    232|    case 5:
  ------------------
  |  Branch (134:5): [True: 232, False: 7.21k]
  ------------------
  135|    232|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    232|                                                         out_values);
  137|    404|    case 6:
  ------------------
  |  Branch (137:5): [True: 404, False: 7.04k]
  ------------------
  138|    404|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    404|                                                         out_values);
  140|    424|    case 7:
  ------------------
  |  Branch (140:5): [True: 424, False: 7.02k]
  ------------------
  141|    424|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    424|                                                         out_values);
  143|    451|    case 8:
  ------------------
  |  Branch (143:5): [True: 451, False: 6.99k]
  ------------------
  144|    451|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    451|                                                         out_values);
  146|    330|    case 9:
  ------------------
  |  Branch (146:5): [True: 330, False: 7.11k]
  ------------------
  147|    330|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    330|                                                         out_values);
  149|    336|    case 10:
  ------------------
  |  Branch (149:5): [True: 336, False: 7.11k]
  ------------------
  150|    336|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    336|          num_values, src_buffer, out_values);
  152|    415|    case 11:
  ------------------
  |  Branch (152:5): [True: 415, False: 7.03k]
  ------------------
  153|    415|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    415|          num_values, src_buffer, out_values);
  155|    435|    case 12:
  ------------------
  |  Branch (155:5): [True: 435, False: 7.01k]
  ------------------
  156|    435|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    435|          num_values, src_buffer, out_values);
  158|    327|    case 13:
  ------------------
  |  Branch (158:5): [True: 327, False: 7.11k]
  ------------------
  159|    327|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    327|          num_values, src_buffer, out_values);
  161|    358|    case 14:
  ------------------
  |  Branch (161:5): [True: 358, False: 7.08k]
  ------------------
  162|    358|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    358|          num_values, src_buffer, out_values);
  164|    375|    case 15:
  ------------------
  |  Branch (164:5): [True: 375, False: 7.07k]
  ------------------
  165|    375|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    375|          num_values, src_buffer, out_values);
  167|    347|    case 16:
  ------------------
  |  Branch (167:5): [True: 347, False: 7.09k]
  ------------------
  168|    347|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    347|          num_values, src_buffer, out_values);
  170|    349|    case 17:
  ------------------
  |  Branch (170:5): [True: 349, False: 7.09k]
  ------------------
  171|    349|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    349|          num_values, src_buffer, out_values);
  173|    337|    case 18:
  ------------------
  |  Branch (173:5): [True: 337, False: 7.10k]
  ------------------
  174|    337|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    337|          num_values, src_buffer, out_values);
  176|    309|    default:
  ------------------
  |  Branch (176:5): [True: 309, False: 7.13k]
  ------------------
  177|    309|      return false;
  178|  7.44k|  }
  179|  7.44k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    604|                              uint32_t *out_values) {
   93|    604|  SymbolDecoderT decoder;
   94|    604|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 380, False: 224]
  ------------------
   95|    380|    return false;
   96|    380|  }
   97|       |
   98|    224|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 224, False: 0]
  |  Branch (98:25): [True: 18, False: 206]
  ------------------
   99|     18|    return false;  // Wrong number of symbols.
  100|     18|  }
  101|       |
  102|    206|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 65, False: 141]
  ------------------
  103|     65|    return false;
  104|     65|  }
  105|  42.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 42.3M, False: 141]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  42.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  42.3M|    out_values[i] = value;
  109|  42.3M|  }
  110|    141|  decoder.EndDecoding();
  111|    141|  return true;
  112|    206|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    617|                              uint32_t *out_values) {
   93|    617|  SymbolDecoderT decoder;
   94|    617|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 254, False: 363]
  ------------------
   95|    254|    return false;
   96|    254|  }
   97|       |
   98|    363|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 363, False: 0]
  |  Branch (98:25): [True: 16, False: 347]
  ------------------
   99|     16|    return false;  // Wrong number of symbols.
  100|     16|  }
  101|       |
  102|    347|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 123, False: 224]
  ------------------
  103|    123|    return false;
  104|    123|  }
  105|  4.33M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.33M, False: 224]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.33M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.33M|    out_values[i] = value;
  109|  4.33M|  }
  110|    224|  decoder.EndDecoding();
  111|    224|  return true;
  112|    347|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    482|                              uint32_t *out_values) {
   93|    482|  SymbolDecoderT decoder;
   94|    482|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 248, False: 234]
  ------------------
   95|    248|    return false;
   96|    248|  }
   97|       |
   98|    234|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 234, False: 0]
  |  Branch (98:25): [True: 4, False: 230]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    230|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 132, False: 98]
  ------------------
  103|    132|    return false;
  104|    132|  }
  105|  10.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.5M, False: 98]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.5M|    out_values[i] = value;
  109|  10.5M|  }
  110|     98|  decoder.EndDecoding();
  111|     98|  return true;
  112|    230|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    314|                              uint32_t *out_values) {
   93|    314|  SymbolDecoderT decoder;
   94|    314|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 156, False: 158]
  ------------------
   95|    156|    return false;
   96|    156|  }
   97|       |
   98|    158|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 158, False: 0]
  |  Branch (98:25): [True: 7, False: 151]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    151|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 39, False: 112]
  ------------------
  103|     39|    return false;
  104|     39|  }
  105|  1.20M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.20M, False: 112]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.20M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.20M|    out_values[i] = value;
  109|  1.20M|  }
  110|    112|  decoder.EndDecoding();
  111|    112|  return true;
  112|    151|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    232|                              uint32_t *out_values) {
   93|    232|  SymbolDecoderT decoder;
   94|    232|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 32, False: 200]
  ------------------
   95|     32|    return false;
   96|     32|  }
   97|       |
   98|    200|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 200, False: 0]
  |  Branch (98:25): [True: 106, False: 94]
  ------------------
   99|    106|    return false;  // Wrong number of symbols.
  100|    106|  }
  101|       |
  102|     94|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 22, False: 72]
  ------------------
  103|     22|    return false;
  104|     22|  }
  105|   589k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 589k, False: 72]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   589k|    const uint32_t value = decoder.DecodeSymbol();
  108|   589k|    out_values[i] = value;
  109|   589k|  }
  110|     72|  decoder.EndDecoding();
  111|     72|  return true;
  112|     94|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    404|                              uint32_t *out_values) {
   93|    404|  SymbolDecoderT decoder;
   94|    404|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 167, False: 237]
  ------------------
   95|    167|    return false;
   96|    167|  }
   97|       |
   98|    237|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 237, False: 0]
  |  Branch (98:25): [True: 4, False: 233]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    233|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 111, False: 122]
  ------------------
  103|    111|    return false;
  104|    111|  }
  105|  6.98M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.98M, False: 122]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.98M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.98M|    out_values[i] = value;
  109|  6.98M|  }
  110|    122|  decoder.EndDecoding();
  111|    122|  return true;
  112|    233|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    424|                              uint32_t *out_values) {
   93|    424|  SymbolDecoderT decoder;
   94|    424|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 219, False: 205]
  ------------------
   95|    219|    return false;
   96|    219|  }
   97|       |
   98|    205|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 205, False: 0]
  |  Branch (98:25): [True: 13, False: 192]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    192|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 99, False: 93]
  ------------------
  103|     99|    return false;
  104|     99|  }
  105|  8.70M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.70M, False: 93]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.70M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.70M|    out_values[i] = value;
  109|  8.70M|  }
  110|     93|  decoder.EndDecoding();
  111|     93|  return true;
  112|    192|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    451|                              uint32_t *out_values) {
   93|    451|  SymbolDecoderT decoder;
   94|    451|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 234, False: 217]
  ------------------
   95|    234|    return false;
   96|    234|  }
   97|       |
   98|    217|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 217, False: 0]
  |  Branch (98:25): [True: 3, False: 214]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    214|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 145, False: 69]
  ------------------
  103|    145|    return false;
  104|    145|  }
  105|  2.05M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.05M, False: 69]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.05M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.05M|    out_values[i] = value;
  109|  2.05M|  }
  110|     69|  decoder.EndDecoding();
  111|     69|  return true;
  112|    214|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    330|                              uint32_t *out_values) {
   93|    330|  SymbolDecoderT decoder;
   94|    330|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 183, False: 147]
  ------------------
   95|    183|    return false;
   96|    183|  }
   97|       |
   98|    147|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 147, False: 0]
  |  Branch (98:25): [True: 11, False: 136]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    136|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 93, False: 43]
  ------------------
  103|     93|    return false;
  104|     93|  }
  105|  98.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 98.8k, False: 43]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  98.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  98.8k|    out_values[i] = value;
  109|  98.8k|  }
  110|     43|  decoder.EndDecoding();
  111|     43|  return true;
  112|    136|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    336|                              uint32_t *out_values) {
   93|    336|  SymbolDecoderT decoder;
   94|    336|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 212, False: 124]
  ------------------
   95|    212|    return false;
   96|    212|  }
   97|       |
   98|    124|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 124, False: 0]
  |  Branch (98:25): [True: 5, False: 119]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    119|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 67, False: 52]
  ------------------
  103|     67|    return false;
  104|     67|  }
  105|   416k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 416k, False: 52]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   416k|    const uint32_t value = decoder.DecodeSymbol();
  108|   416k|    out_values[i] = value;
  109|   416k|  }
  110|     52|  decoder.EndDecoding();
  111|     52|  return true;
  112|    119|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    415|                              uint32_t *out_values) {
   93|    415|  SymbolDecoderT decoder;
   94|    415|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 244, False: 171]
  ------------------
   95|    244|    return false;
   96|    244|  }
   97|       |
   98|    171|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 171, False: 0]
  |  Branch (98:25): [True: 6, False: 165]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    165|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 123, False: 42]
  ------------------
  103|    123|    return false;
  104|    123|  }
  105|  42.1k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 42.0k, False: 42]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  42.0k|    const uint32_t value = decoder.DecodeSymbol();
  108|  42.0k|    out_values[i] = value;
  109|  42.0k|  }
  110|     42|  decoder.EndDecoding();
  111|     42|  return true;
  112|    165|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    435|                              uint32_t *out_values) {
   93|    435|  SymbolDecoderT decoder;
   94|    435|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 250, False: 185]
  ------------------
   95|    250|    return false;
   96|    250|  }
   97|       |
   98|    185|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 185, False: 0]
  |  Branch (98:25): [True: 12, False: 173]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    173|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 121, False: 52]
  ------------------
  103|    121|    return false;
  104|    121|  }
  105|   172k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 172k, False: 52]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   172k|    const uint32_t value = decoder.DecodeSymbol();
  108|   172k|    out_values[i] = value;
  109|   172k|  }
  110|     52|  decoder.EndDecoding();
  111|     52|  return true;
  112|    173|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    327|                              uint32_t *out_values) {
   93|    327|  SymbolDecoderT decoder;
   94|    327|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 201, False: 126]
  ------------------
   95|    201|    return false;
   96|    201|  }
   97|       |
   98|    126|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 126, False: 0]
  |  Branch (98:25): [True: 11, False: 115]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    115|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 59, False: 56]
  ------------------
  103|     59|    return false;
  104|     59|  }
  105|   425k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 425k, False: 56]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   425k|    const uint32_t value = decoder.DecodeSymbol();
  108|   425k|    out_values[i] = value;
  109|   425k|  }
  110|     56|  decoder.EndDecoding();
  111|     56|  return true;
  112|    115|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    358|                              uint32_t *out_values) {
   93|    358|  SymbolDecoderT decoder;
   94|    358|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 197, False: 161]
  ------------------
   95|    197|    return false;
   96|    197|  }
   97|       |
   98|    161|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 161, False: 0]
  |  Branch (98:25): [True: 6, False: 155]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    155|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 83, False: 72]
  ------------------
  103|     83|    return false;
  104|     83|  }
  105|  6.68M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.68M, False: 72]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.68M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.68M|    out_values[i] = value;
  109|  6.68M|  }
  110|     72|  decoder.EndDecoding();
  111|     72|  return true;
  112|    155|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    375|                              uint32_t *out_values) {
   93|    375|  SymbolDecoderT decoder;
   94|    375|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 176, False: 199]
  ------------------
   95|    176|    return false;
   96|    176|  }
   97|       |
   98|    199|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 199, False: 0]
  |  Branch (98:25): [True: 16, False: 183]
  ------------------
   99|     16|    return false;  // Wrong number of symbols.
  100|     16|  }
  101|       |
  102|    183|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 108, False: 75]
  ------------------
  103|    108|    return false;
  104|    108|  }
  105|  3.47M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.47M, False: 75]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.47M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.47M|    out_values[i] = value;
  109|  3.47M|  }
  110|     75|  decoder.EndDecoding();
  111|     75|  return true;
  112|    183|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    347|                              uint32_t *out_values) {
   93|    347|  SymbolDecoderT decoder;
   94|    347|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 183, False: 164]
  ------------------
   95|    183|    return false;
   96|    183|  }
   97|       |
   98|    164|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 164, False: 0]
  |  Branch (98:25): [True: 4, False: 160]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    160|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 64]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|  25.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 25.9M, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  25.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  25.9M|    out_values[i] = value;
  109|  25.9M|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    160|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    349|                              uint32_t *out_values) {
   93|    349|  SymbolDecoderT decoder;
   94|    349|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 178, False: 171]
  ------------------
   95|    178|    return false;
   96|    178|  }
   97|       |
   98|    171|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 171, False: 0]
  |  Branch (98:25): [True: 11, False: 160]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    160|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 102, False: 58]
  ------------------
  103|    102|    return false;
  104|    102|  }
  105|  18.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 18.9M, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  18.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  18.9M|    out_values[i] = value;
  109|  18.9M|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    160|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    337|                              uint32_t *out_values) {
   93|    337|  SymbolDecoderT decoder;
   94|    337|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 192, False: 145]
  ------------------
   95|    192|    return false;
   96|    192|  }
   97|       |
   98|    145|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 145, False: 0]
  |  Branch (98:25): [True: 5, False: 140]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    140|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 86, False: 54]
  ------------------
  103|     86|    return false;
  104|     86|  }
  105|  28.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 28.6M, False: 54]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  28.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  28.6M|    out_values[i] = value;
  109|  28.6M|  }
  110|     54|  decoder.EndDecoding();
  111|     54|  return true;
  112|    140|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  2.59k|    : decoder_(nullptr),
   49|  2.59k|      last_symbol_id_(-1),
   50|  2.59k|      last_vert_id_(-1),
   51|  2.59k|      last_face_id_(-1),
   52|  2.59k|      num_new_vertices_(0),
   53|  2.59k|      num_encoded_vertices_(0),
   54|  2.59k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.59k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.59k|  decoder_ = decoder;
   60|  2.59k|  return true;
   61|  2.59k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  2.19k|    int att_id) const {
   67|  3.62k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 3.13k, False: 492]
  ------------------
   68|  3.13k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  3.13k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.43k, False: 1.70k]
  |  Branch (69:27): [True: 0, False: 1.70k]
  ------------------
   70|  1.43k|      continue;
   71|  1.43k|    }
   72|  1.70k|    const AttributesDecoderInterface *const dec =
   73|  1.70k|        decoder_->attributes_decoder(decoder_id);
   74|  3.50k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 3.50k, False: 0]
  ------------------
   75|  3.50k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.70k, False: 1.80k]
  ------------------
   76|  1.70k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.16k, False: 531]
  ------------------
   77|  1.16k|          return &attribute_data_[i].connectivity_data;
   78|  1.16k|        }
   79|    531|        return nullptr;
   80|  1.70k|      }
   81|  3.50k|    }
   82|  1.70k|  }
   83|    492|  return nullptr;
   84|  2.19k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  2.19k|    int att_id) const {
   90|  3.62k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 3.13k, False: 492]
  ------------------
   91|  3.13k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  3.13k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.43k, False: 1.70k]
  |  Branch (92:27): [True: 0, False: 1.70k]
  ------------------
   93|  1.43k|      continue;
   94|  1.43k|    }
   95|  1.70k|    const AttributesDecoderInterface *const dec =
   96|  1.70k|        decoder_->attributes_decoder(decoder_id);
   97|  3.50k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 3.50k, False: 0]
  ------------------
   98|  3.50k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.70k, False: 1.80k]
  ------------------
   99|  1.70k|        return &attribute_data_[i].encoding_data;
  100|  1.70k|      }
  101|  3.50k|    }
  102|  1.70k|  }
  103|    492|  return &pos_encoding_data_;
  104|  2.19k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  1.74k|    int32_t att_decoder_id) {
  131|  1.74k|  int8_t att_data_id;
  132|  1.74k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 11, False: 1.73k]
  ------------------
  133|     11|    return false;
  134|     11|  }
  135|  1.73k|  uint8_t decoder_type;
  136|  1.73k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 6, False: 1.73k]
  ------------------
  137|      6|    return false;
  138|      6|  }
  139|       |
  140|  1.73k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.28k, False: 443]
  ------------------
  141|  1.28k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 58, False: 1.23k]
  ------------------
  142|     58|      return false;  // Unexpected attribute data.
  143|     58|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.23k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 8, False: 1.22k]
  ------------------
  148|      8|      return false;
  149|      8|    }
  150|       |
  151|  1.22k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.22k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    443|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 441]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|    441|    pos_data_decoder_id_ = att_decoder_id;
  158|    441|  }
  159|       |
  160|  1.66k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.66k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.66k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.66k, False: 1]
  ------------------
  162|  1.66k|    uint8_t traversal_method_encoded;
  163|  1.66k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 13, False: 1.64k]
  ------------------
  164|     13|      return false;
  165|     13|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.64k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 48, False: 1.60k]
  ------------------
  168|     48|      return false;
  169|     48|    }
  170|  1.60k|    traversal_method =
  171|  1.60k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.60k|  }
  173|       |
  174|  1.60k|  const Mesh *mesh = decoder_->mesh();
  175|  1.60k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.60k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 752, False: 850]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    752|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    752|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 393, False: 359]
  ------------------
  182|    393|      encoding_data = &pos_encoding_data_;
  183|    393|    } else {
  184|    359|      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|    359|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    359|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    752|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 128, False: 624]
  ------------------
  191|    128|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    128|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    128|          AttTraverser;
  194|    128|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    624|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 624, False: 0]
  ------------------
  196|    624|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    624|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    624|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    624|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    850|  } else {
  203|    850|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 6, False: 844]
  ------------------
  204|      6|      return false;  // Unsupported method.
  205|      6|    }
  206|    844|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 842]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    842|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    842|        AttObserver;
  214|    842|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    842|        AttTraverser;
  216|       |
  217|    842|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    842|        &attribute_data_[att_data_id].encoding_data;
  219|    842|    const MeshAttributeCornerTable *const corner_table =
  220|    842|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    842|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    842|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    842|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    842|                             encoding_data);
  227|       |
  228|    842|    AttTraverser att_traverser;
  229|    842|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    842|    traversal_sequencer->SetTraverser(att_traverser);
  232|    842|    sequencer = std::move(traversal_sequencer);
  233|    842|  }
  234|       |
  235|  1.59k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.59k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.59k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.59k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.59k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.59k|                                        std::move(att_controller));
  244|  1.59k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  2.59k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.59k|  num_new_vertices_ = 0;
  249|  2.59k|  new_to_parent_vertex_map_.clear();
  250|  2.59k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.59k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.59k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 596, False: 1.99k]
  ------------------
  252|    596|    uint32_t num_new_verts;
  253|    596|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    596|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 182, False: 414]
  ------------------
  254|    182|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 8, False: 174]
  ------------------
  255|      8|        return false;
  256|      8|      }
  257|    414|    } else {
  258|    414|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 1, False: 413]
  ------------------
  259|      1|        return false;
  260|      1|      }
  261|    414|    }
  262|    587|    num_new_vertices_ = num_new_verts;
  263|    587|  }
  264|  2.58k|#endif
  265|       |
  266|  2.58k|  uint32_t num_encoded_vertices;
  267|  2.58k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.58k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.58k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 174, False: 2.40k]
  ------------------
  269|    174|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 3, False: 171]
  ------------------
  270|      3|      return false;
  271|      3|    }
  272|       |
  273|    174|  } else
  274|  2.40k|#endif
  275|  2.40k|  {
  276|  2.40k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 5, False: 2.40k]
  ------------------
  277|      5|      return false;
  278|      5|    }
  279|  2.40k|  }
  280|  2.57k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.57k|  uint32_t num_faces;
  283|  2.57k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.57k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.57k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 171, False: 2.40k]
  ------------------
  285|    171|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 5, False: 166]
  ------------------
  286|      5|      return false;
  287|      5|    }
  288|       |
  289|    171|  } else
  290|  2.40k|#endif
  291|  2.40k|  {
  292|  2.40k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 2, False: 2.40k]
  ------------------
  293|      2|      return false;
  294|      2|    }
  295|  2.40k|  }
  296|  2.56k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 7, False: 2.56k]
  ------------------
  297|      7|    return false;  // Draco cannot handle this many faces.
  298|      7|  }
  299|       |
  300|  2.56k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 29, False: 2.53k]
  ------------------
  301|     29|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     29|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.53k|  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.53k|  const uint64_t num_encoded_vertices_64 =
  311|  2.53k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.53k|  const uint64_t max_num_vertex_edges =
  313|  2.53k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.53k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 9, False: 2.52k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      9|    return false;
  317|      9|  }
  318|       |
  319|  2.52k|  uint8_t num_attribute_data;
  320|  2.52k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 26, False: 2.49k]
  ------------------
  321|     26|    return false;
  322|     26|  }
  323|       |
  324|  2.49k|  uint32_t num_encoded_symbols;
  325|  2.49k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.49k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.49k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 141, False: 2.35k]
  ------------------
  327|    141|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 12, False: 129]
  ------------------
  328|     12|      return false;
  329|     12|    }
  330|       |
  331|    141|  } else
  332|  2.35k|#endif
  333|  2.35k|  {
  334|  2.35k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 3, False: 2.35k]
  ------------------
  335|      3|      return false;
  336|      3|    }
  337|  2.35k|  }
  338|       |
  339|  2.48k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 22, False: 2.45k]
  ------------------
  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|     22|    return false;
  344|     22|  }
  345|  2.45k|  const uint32_t max_encoded_faces =
  346|  2.45k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.45k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 33, False: 2.42k]
  ------------------
  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|     33|    return false;
  352|     33|  }
  353|       |
  354|  2.42k|  uint32_t num_encoded_split_symbols;
  355|  2.42k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.42k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.42k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 108, False: 2.31k]
  ------------------
  357|    108|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 2, False: 106]
  ------------------
  358|      2|      return false;
  359|      2|    }
  360|       |
  361|    108|  } else
  362|  2.31k|#endif
  363|  2.31k|  {
  364|  2.31k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 7, False: 2.31k]
  ------------------
  365|      7|      return false;
  366|      7|    }
  367|  2.31k|  }
  368|       |
  369|  2.41k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 36, False: 2.38k]
  ------------------
  370|     36|    return false;  // Split symbols are a sub-set of all symbols.
  371|     36|  }
  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: 0, False: 2.38k]
  ------------------
  397|  2.38k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      0|    return false;
  399|      0|  }
  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: 497, False: 1.88k]
  ------------------
  411|    497|    uint32_t encoded_connectivity_size;
  412|    497|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    497|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 98, False: 399]
  ------------------
  413|     98|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 5, False: 93]
  ------------------
  414|      5|        return false;
  415|      5|      }
  416|    399|    } else {
  417|    399|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 2, False: 397]
  ------------------
  418|      2|        return false;
  419|      2|      }
  420|    399|    }
  421|    490|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 4, False: 486]
  ------------------
  422|    486|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 29, False: 457]
  ------------------
  423|     33|      return false;
  424|     33|    }
  425|    457|    DecoderBuffer event_buffer;
  426|    457|    event_buffer.Init(
  427|    457|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    457|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    457|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    457|    topology_split_decoded_bytes =
  432|    457|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    457|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 112, False: 345]
  ------------------
  434|    112|      return false;
  435|    112|    }
  436|       |
  437|    457|  } else
  438|  1.88k|#endif
  439|  1.88k|  {
  440|  1.88k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 71, False: 1.81k]
  ------------------
  441|     71|      return false;
  442|     71|    }
  443|  1.88k|  }
  444|       |
  445|  2.15k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.15k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.15k|                                           num_encoded_split_symbols);
  449|  2.15k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.15k|  DecoderBuffer traversal_end_buffer;
  452|  2.15k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 198, False: 1.96k]
  ------------------
  453|    198|    return false;
  454|    198|  }
  455|       |
  456|  1.96k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.96k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 219, False: 1.74k]
  ------------------
  458|    219|    return false;
  459|    219|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.74k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.74k|                           traversal_end_buffer.remaining_size(),
  464|  1.74k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.74k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.74k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.74k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 232, False: 1.50k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    232|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    232|  }
  471|  1.74k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.74k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.68k, False: 53]
  ------------------
  475|  1.68k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.68k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.68k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 227, False: 1.46k]
  ------------------
  477|  1.41k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.18k, False: 227]
  ------------------
  478|  1.18k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.18k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.18k|      }
  482|       |
  483|    227|    } else
  484|  1.46k|#endif
  485|  1.46k|    {
  486|   303k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 302k, False: 1.46k]
  ------------------
  487|   302k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 302k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   302k|      }
  491|  1.46k|    }
  492|  1.68k|  }
  493|  1.74k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  5.61k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 3.87k, False: 1.74k]
  ------------------
  498|  3.87k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  2.81M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 2.81M, False: 3.87k]
  ------------------
  501|  2.81M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  2.81M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  3.87k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 3.87k]
  ------------------
  505|  3.87k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  3.87k|  }
  509|       |
  510|  1.74k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  5.61k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 3.87k, False: 1.74k]
  ------------------
  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|  3.87k|    int32_t att_connectivity_verts =
  517|  3.87k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  3.87k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 206, False: 3.67k]
  ------------------
  519|    206|      att_connectivity_verts = corner_table_->num_vertices();
  520|    206|    }
  521|  3.87k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  3.87k|  }
  523|  1.74k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 6, False: 1.73k]
  ------------------
  524|      6|    return false;
  525|      6|  }
  526|  1.73k|  return true;
  527|  1.74k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    400|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    400|  return true;
  532|    400|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  1.96k|    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.96k|  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.96k|  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.96k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.96k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.96k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.96k|  int num_faces = 0;
  562|  9.76M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 9.75M, False: 1.78k]
  ------------------
  563|  9.75M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  9.75M|    bool check_topology_split = false;
  566|  9.75M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  9.75M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 4.52M, False: 5.23M]
  ------------------
  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|  4.52M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 4.52M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  4.52M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  4.52M|      const VertexIndex vertex_x =
  593|  4.52M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  4.52M|      const CornerIndex corner_b =
  595|  4.52M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  4.52M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 131, False: 4.52M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    131|        return -1;
  600|    131|      }
  601|  4.52M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 4.52M]
  |  Branch (601:11): [True: 0, False: 4.52M]
  ------------------
  602|  4.52M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 4.52M]
  ------------------
  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|  4.52M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  4.52M|      SetOppositeCorners(corner_a, corner + 1);
  612|  4.52M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  4.52M|      const VertexIndex vert_a_prev =
  616|  4.52M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  4.52M|      const VertexIndex vert_b_next =
  618|  4.52M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  4.52M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 4.52M]
  |  Branch (619:38): [True: 0, False: 4.52M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  4.52M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  4.52M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  4.52M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  4.52M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  4.52M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  4.52M|      active_corner_stack.back() = corner;
  631|  5.23M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.09M, False: 4.14M]
  |  Branch (631:40): [True: 476k, False: 3.66M]
  ------------------
  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|  1.57M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 1.57M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  1.57M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  1.57M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 1.57M]
  ------------------
  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|  1.57M|      const CornerIndex corner(3 * face.value());
  658|  1.57M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  1.57M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.09M, False: 476k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.09M|        opp_corner = corner + 2;
  662|  1.09M|        corner_l = corner + 1;
  663|  1.09M|        corner_r = corner;
  664|  1.09M|      } else {
  665|       |        // "l" is the new first corner.
  666|   476k|        opp_corner = corner + 1;
  667|   476k|        corner_l = corner;
  668|   476k|        corner_r = corner + 2;
  669|   476k|      }
  670|  1.57M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  1.57M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  1.57M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 1, False: 1.57M]
  ------------------
  675|      1|        return -1;  // Unexpected number of decoded vertices.
  676|      1|      }
  677|       |
  678|  1.57M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  1.57M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  1.57M|      const VertexIndex vertex_r =
  682|  1.57M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  1.57M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  1.57M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  1.57M|      corner_table_->MapCornerToVertex(
  688|  1.57M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  1.57M|      active_corner_stack.back() = corner;
  690|  1.57M|      check_topology_split = true;
  691|  3.66M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 1.41M, False: 2.25M]
  ------------------
  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|  1.41M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 2, False: 1.41M]
  ------------------
  703|      2|        return -1;
  704|      2|      }
  705|  1.41M|      const CornerIndex corner_b = active_corner_stack.back();
  706|  1.41M|      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|  1.41M|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  1.41M|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 35, False: 1.41M]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     35|        active_corner_stack.push_back(it->second);
  714|     35|      }
  715|  1.41M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 10, False: 1.41M]
  ------------------
  716|     10|        return -1;
  717|     10|      }
  718|  1.41M|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  1.41M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 1.41M]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  1.41M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 6, False: 1.41M]
  |  Branch (724:11): [True: 6, False: 1.41M]
  ------------------
  725|  1.41M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 1.41M]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      6|        return -1;
  729|      6|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  1.41M|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  1.41M|      SetOppositeCorners(corner_a, corner + 2);
  735|  1.41M|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  1.41M|      const VertexIndex vertex_p =
  739|  1.41M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  1.41M|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  1.41M|      corner_table_->MapCornerToVertex(
  742|  1.41M|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  1.41M|      const VertexIndex vert_b_prev =
  744|  1.41M|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  1.41M|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  1.41M|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  1.41M|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  1.41M|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  1.41M|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  1.41M|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  1.41M|                                       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|  1.41M|      const CornerIndex first_corner = corner_n;
  757|  9.02M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 7.61M, False: 1.41M]
  ------------------
  758|  7.61M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  7.61M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  7.61M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 2, False: 7.61M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      2|          return -1;
  764|      2|        }
  765|  7.61M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  1.41M|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  1.41M|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 18.5k, False: 1.39M]
  ------------------
  770|  18.5k|        invalid_vertices.push_back(vertex_n);
  771|  18.5k|      }
  772|  1.41M|      active_corner_stack.back() = corner;
  773|  2.25M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 2.25M, False: 0]
  ------------------
  774|  2.25M|      const CornerIndex corner(3 * face.value());
  775|  2.25M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  2.25M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  2.25M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  2.25M|                                       corner_table_->AddNewVertex());
  780|  2.25M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  2.25M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  2.25M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 2.25M]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  2.25M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  2.25M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  2.25M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  2.25M|      active_corner_stack.push_back(corner);
  792|  2.25M|      check_topology_split = true;
  793|  2.25M|    } 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|  9.75M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  9.75M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 3.82M, False: 5.93M]
  ------------------
  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|  3.82M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  3.82M|      EdgeFaceName split_edge;
  812|  3.82M|      int encoder_split_symbol_id;
  813|  3.82M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.15k, False: 3.82M]
  ------------------
  814|  3.82M|                             &encoder_split_symbol_id)) {
  815|  1.15k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 16, False: 1.13k]
  ------------------
  816|     16|          return -1;  // Wrong split symbol id.
  817|     16|        }
  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: 402, False: 737]
  ------------------
  832|    402|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    737|        } else {
  834|    737|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    737|        }
  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|  3.82M|    }
  844|  9.75M|  }
  845|  1.78k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.78k]
  ------------------
  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|  28.0k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 26.3k, False: 1.76k]
  ------------------
  850|  26.3k|    const CornerIndex corner = active_corner_stack.back();
  851|  26.3k|    active_corner_stack.pop_back();
  852|  26.3k|    const bool interior_face =
  853|  26.3k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  26.3k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 19.2k, False: 7.06k]
  ------------------
  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|  19.2k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 6, False: 19.2k]
  ------------------
  877|      6|        return -1;  // More faces than expected added to the mesh.
  878|      6|      }
  879|       |
  880|  19.2k|      const CornerIndex corner_a = corner;
  881|  19.2k|      const VertexIndex vert_n =
  882|  19.2k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  19.2k|      const CornerIndex corner_b =
  884|  19.2k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  19.2k|      const VertexIndex vert_x =
  887|  19.2k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  19.2k|      const CornerIndex corner_c =
  889|  19.2k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  19.2k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 13, False: 19.2k]
  |  Branch (891:33): [True: 7, False: 19.2k]
  |  Branch (891:55): [True: 0, False: 19.2k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     20|        return -1;
  894|     20|      }
  895|  19.2k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 19.2k]
  |  Branch (895:11): [True: 1, False: 19.2k]
  ------------------
  896|  19.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 19.2k]
  ------------------
  897|  19.2k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 19.2k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      1|        return -1;
  901|      1|      }
  902|       |
  903|  19.2k|      const VertexIndex vert_p =
  904|  19.2k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  19.2k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  19.2k|      const CornerIndex new_corner(3 * face.value());
  909|  19.2k|      SetOppositeCorners(new_corner, corner);
  910|  19.2k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  19.2k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  19.2k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  19.2k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  19.2k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  76.9k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 57.7k, False: 19.2k]
  ------------------
  920|  57.7k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  57.7k|      }
  922|       |
  923|  19.2k|      init_face_configurations_.push_back(true);
  924|  19.2k|      init_corners_.push_back(new_corner);
  925|  19.2k|    } 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|  7.06k|      init_face_configurations_.push_back(false);
  930|  7.06k|      init_corners_.push_back(corner);
  931|  7.06k|    }
  932|  26.3k|  }
  933|  1.76k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 18, False: 1.74k]
  ------------------
  934|     18|    return -1;  // Unexpected number of decoded faces.
  935|     18|  }
  936|       |
  937|  1.74k|  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.74k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 485, False: 1.74k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    485|    VertexIndex src_vert(num_vertices - 1);
  943|    600|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 115, False: 485]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    115|      src_vert = VertexIndex(--num_vertices - 1);
  946|    115|    }
  947|    485|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 115, False: 370]
  ------------------
  948|    115|      continue;  // No need to swap anything.
  949|    115|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    370|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  2.51k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 2.14k, False: 369]
  ------------------
  954|  2.14k|      const CornerIndex cid = vcit.Corner();
  955|  2.14k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 1, False: 2.14k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      1|        return -1;
  959|      1|      }
  960|  2.14k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  2.14k|    }
  962|    369|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    369|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    369|    corner_table_->MakeVertexIsolated(src_vert);
  967|    369|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    369|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    369|    num_vertices--;
  972|    369|  }
  973|  1.74k|  return num_vertices;
  974|  1.74k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.34k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.34k|  uint32_t num_topology_splits;
  982|  2.34k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.34k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.34k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 81, False: 2.26k]
  ------------------
  984|     81|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 80]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|     81|  } else
  989|  2.26k|#endif
  990|  2.26k|  {
  991|  2.26k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 5, False: 2.25k]
  ------------------
  992|      5|      return -1;
  993|      5|    }
  994|  2.26k|  }
  995|  2.33k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.30k, False: 1.03k]
  ------------------
  996|  1.30k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 32, False: 1.27k]
  ------------------
  997|  1.30k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     32|      return -1;
  999|     32|    }
 1000|  1.27k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.27k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.27k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 34, False: 1.23k]
  ------------------
 1002|    795|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 782, False: 13]
  ------------------
 1003|    782|        TopologySplitEventData event_data;
 1004|    782|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 11, False: 771]
  ------------------
 1005|     11|          return -1;
 1006|     11|        }
 1007|    771|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 9, False: 762]
  ------------------
 1008|      9|          return -1;
 1009|      9|        }
 1010|    762|        uint8_t edge_data;
 1011|    762|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 1, False: 761]
  ------------------
 1012|      1|          return -1;
 1013|      1|        }
 1014|    761|        event_data.source_edge = edge_data & 1;
 1015|    761|        topology_split_data_.push_back(event_data);
 1016|    761|      }
 1017|       |
 1018|     34|    } else
 1019|  1.23k|#endif
 1020|  1.23k|    {
 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.23k|      int last_source_symbol_id = 0;
 1024|  5.26k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.06k, False: 1.19k]
  ------------------
 1025|  4.06k|        TopologySplitEventData event_data;
 1026|  4.06k|        uint32_t delta;
 1027|  4.06k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 10, False: 4.05k]
  ------------------
 1028|     10|          return -1;
 1029|     10|        }
 1030|  4.05k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.05k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 9, False: 4.05k]
  ------------------
 1032|      9|          return -1;
 1033|      9|        }
 1034|  4.05k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 23, False: 4.02k]
  ------------------
 1035|     23|          return -1;
 1036|     23|        }
 1037|  4.02k|        event_data.split_symbol_id =
 1038|  4.02k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.02k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.02k|        topology_split_data_.push_back(event_data);
 1041|  4.02k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.19k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  4.69k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 3.50k, False: 1.19k]
  ------------------
 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: 599, False: 2.90k]
  ------------------
 1047|    599|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.90k|        } else {
 1049|  2.90k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.90k|        }
 1051|  3.50k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  3.50k|        event_data.source_edge = edge_data & 1;
 1053|  3.50k|      }
 1054|  1.19k|      decoder_buffer->EndBitDecoding();
 1055|  1.19k|    }
 1056|  1.27k|  }
 1057|  2.24k|  uint32_t num_hole_events = 0;
 1058|  2.24k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.24k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.24k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 58, False: 2.18k]
  ------------------
 1060|     58|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 7, False: 51]
  ------------------
 1061|      7|      return -1;
 1062|      7|    }
 1063|  2.18k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.18k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 360, False: 1.82k]
  ------------------
 1064|    360|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 7, False: 353]
  ------------------
 1065|      7|      return -1;
 1066|      7|    }
 1067|    360|  }
 1068|  2.22k|#endif
 1069|  2.22k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 78, False: 2.14k]
  ------------------
 1070|     78|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     78|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     78|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 32, False: 46]
  ------------------
 1072|  15.4k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 15.4k, False: 1]
  ------------------
 1073|  15.4k|        HoleEventData event_data;
 1074|  15.4k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 31, False: 15.3k]
  ------------------
 1075|     31|          return -1;
 1076|     31|        }
 1077|  15.3k|        hole_event_data_.push_back(event_data);
 1078|  15.3k|      }
 1079|       |
 1080|     32|    } else
 1081|     46|#endif
 1082|     46|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     46|      int last_symbol_id = 0;
 1085|  37.3k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 37.3k, False: 9]
  ------------------
 1086|  37.3k|        HoleEventData event_data;
 1087|  37.3k|        uint32_t delta;
 1088|  37.3k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 37, False: 37.3k]
  ------------------
 1089|     37|          return -1;
 1090|     37|        }
 1091|  37.3k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  37.3k|        last_symbol_id = event_data.symbol_id;
 1093|  37.3k|        hole_event_data_.push_back(event_data);
 1094|  37.3k|      }
 1095|     46|    }
 1096|     78|  }
 1097|  2.15k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.22k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.18k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.18k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.18k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  4.75k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 3.56k, False: 1.18k]
  ------------------
 1109|  3.56k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  3.56k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.14k, False: 2.42k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  2.29k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.14k, False: 1.14k]
  ------------------
 1114|  1.14k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.14k|      }
 1116|  1.14k|      continue;
 1117|  1.14k|    }
 1118|       |
 1119|  4.84k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 2.42k, False: 2.42k]
  ------------------
 1120|  2.42k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  2.42k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 1.80k, False: 615]
  ------------------
 1122|  1.80k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  1.80k|      }
 1124|  2.42k|    }
 1125|  2.42k|  }
 1126|  1.18k|  return true;
 1127|  1.18k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   302k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   302k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   302k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   302k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.20M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 906k, False: 302k]
  ------------------
 1139|   906k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   906k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 34.3k, False: 871k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   219k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 185k, False: 34.3k]
  ------------------
 1144|   185k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   185k|      }
 1146|  34.3k|      continue;
 1147|  34.3k|    }
 1148|   871k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   871k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 435k, False: 435k]
  ------------------
 1151|   435k|      continue;
 1152|   435k|    }
 1153|       |
 1154|  3.39M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 2.96M, False: 435k]
  ------------------
 1155|  2.96M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  2.96M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 2.62M, False: 337k]
  ------------------
 1157|  2.62M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  2.62M|      }
 1159|  2.96M|    }
 1160|   435k|  }
 1161|   302k|  return true;
 1162|   302k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  1.74k|    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.74k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.74k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 53, False: 1.68k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  3.79k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 3.74k, False: 53]
  ------------------
 1176|  3.74k|      Mesh::Face face;
 1177|  3.74k|      const CornerIndex start_corner(3 * f.value());
 1178|  14.9k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 11.2k, False: 3.74k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  11.2k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  11.2k|        face[c] = vert_id;
 1182|  11.2k|      }
 1183|  3.74k|      decoder_->mesh()->SetFace(f, face);
 1184|  3.74k|    }
 1185|     53|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     53|    return true;
 1187|     53|  }
 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.68k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.68k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   192k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 191k, False: 1.68k]
  ------------------
 1197|   191k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   191k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 11.7k, False: 179k]
  ------------------
 1199|  11.7k|      continue;  // Isolated vertex.
 1200|  11.7k|    }
 1201|   179k|    CornerIndex deduplication_first_corner = c;
 1202|   179k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 35.4k, False: 143k]
  ------------------
 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|  35.4k|      deduplication_first_corner = c;
 1206|   143k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   154k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 151k, False: 2.39k]
  ------------------
 1210|   151k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 5.92k, False: 146k]
  ------------------
 1211|  5.92k|          continue;  // No seam for this attribute, ignore it.
 1212|  5.92k|        }
 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|   146k|        const VertexIndex vert_id =
 1217|   146k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   146k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   146k|        bool seam_found = false;
 1220|   154k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 149k, False: 4.52k]
  ------------------
 1221|   149k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 6, False: 149k]
  ------------------
 1222|      6|            return false;
 1223|      6|          }
 1224|   149k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 141k, False: 7.99k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   141k|            deduplication_first_corner = act_c;
 1227|   141k|            seam_found = true;
 1228|   141k|            break;
 1229|   141k|          }
 1230|  7.99k|          act_c = corner_table_->SwingRight(act_c);
 1231|  7.99k|        }
 1232|   146k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 141k, False: 4.52k]
  ------------------
 1233|   141k|          break;  // No reason to process other attributes if we found a seam.
 1234|   141k|        }
 1235|   146k|      }
 1236|   143k|    }
 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|   179k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   179k|    corner_to_point_map[c.value()] =
 1246|   179k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   179k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   179k|    CornerIndex prev_c = c;
 1250|   179k|    c = corner_table_->SwingRight(c);
 1251|   974k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 938k, False: 35.6k]
  |  Branch (1251:40): [True: 794k, False: 143k]
  ------------------
 1252|   794k|      bool attribute_seam = false;
 1253|   838k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 826k, False: 12.8k]
  ------------------
 1254|   826k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 782k, False: 43.9k]
  ------------------
 1255|   826k|            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|   782k|          attribute_seam = true;
 1259|   782k|          break;
 1260|   782k|        }
 1261|   826k|      }
 1262|   794k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 782k, False: 12.8k]
  ------------------
 1263|   782k|        corner_to_point_map[c.value()] =
 1264|   782k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   782k|        point_to_corner_map.push_back(c.value());
 1266|   782k|      } else {
 1267|  12.8k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  12.8k|      }
 1269|   794k|      prev_c = c;
 1270|   794k|      c = corner_table_->SwingRight(c);
 1271|   794k|    }
 1272|   179k|  }
 1273|       |  // Add faces.
 1274|   304k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 302k, False: 1.68k]
  ------------------
 1275|   302k|    Mesh::Face face;
 1276|  1.21M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 908k, False: 302k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   908k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   908k|    }
 1280|   302k|    decoder_->mesh()->SetFace(f, face);
 1281|   302k|  }
 1282|  1.68k|  decoder_->point_cloud()->set_num_points(
 1283|  1.68k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.68k|  return true;
 1285|  1.68k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.42k|    : decoder_(nullptr),
   49|  2.42k|      last_symbol_id_(-1),
   50|  2.42k|      last_vert_id_(-1),
   51|  2.42k|      last_face_id_(-1),
   52|  2.42k|      num_new_vertices_(0),
   53|  2.42k|      num_encoded_vertices_(0),
   54|  2.42k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.42k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.42k|  decoder_ = decoder;
   60|  2.42k|  return true;
   61|  2.42k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  1.91k|    int att_id) const {
   67|  3.08k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.45k, False: 622]
  ------------------
   68|  2.45k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.45k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.16k, False: 1.29k]
  |  Branch (69:27): [True: 0, False: 1.29k]
  ------------------
   70|  1.16k|      continue;
   71|  1.16k|    }
   72|  1.29k|    const AttributesDecoderInterface *const dec =
   73|  1.29k|        decoder_->attributes_decoder(decoder_id);
   74|  2.68k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 2.68k, False: 0]
  ------------------
   75|  2.68k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.29k, False: 1.39k]
  ------------------
   76|  1.29k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 781, False: 512]
  ------------------
   77|    781|          return &attribute_data_[i].connectivity_data;
   78|    781|        }
   79|    512|        return nullptr;
   80|  1.29k|      }
   81|  2.68k|    }
   82|  1.29k|  }
   83|    622|  return nullptr;
   84|  1.91k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  1.91k|    int att_id) const {
   90|  3.08k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.45k, False: 622]
  ------------------
   91|  2.45k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.45k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.16k, False: 1.29k]
  |  Branch (92:27): [True: 0, False: 1.29k]
  ------------------
   93|  1.16k|      continue;
   94|  1.16k|    }
   95|  1.29k|    const AttributesDecoderInterface *const dec =
   96|  1.29k|        decoder_->attributes_decoder(decoder_id);
   97|  2.68k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 2.68k, False: 0]
  ------------------
   98|  2.68k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.29k, False: 1.39k]
  ------------------
   99|  1.29k|        return &attribute_data_[i].encoding_data;
  100|  1.29k|      }
  101|  2.68k|    }
  102|  1.29k|  }
  103|    622|  return &pos_encoding_data_;
  104|  1.91k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.62k|    int32_t att_decoder_id) {
  131|  1.62k|  int8_t att_data_id;
  132|  1.62k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 42, False: 1.58k]
  ------------------
  133|     42|    return false;
  134|     42|  }
  135|  1.58k|  uint8_t decoder_type;
  136|  1.58k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 19, False: 1.56k]
  ------------------
  137|     19|    return false;
  138|     19|  }
  139|       |
  140|  1.56k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.10k, False: 461]
  ------------------
  141|  1.10k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 32, False: 1.06k]
  ------------------
  142|     32|      return false;  // Unexpected attribute data.
  143|     32|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.06k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 5, False: 1.06k]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|       |
  151|  1.06k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.06k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    461|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 460]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    460|    pos_data_decoder_id_ = att_decoder_id;
  158|    460|  }
  159|       |
  160|  1.52k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.52k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.52k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.52k, False: 0]
  ------------------
  162|  1.52k|    uint8_t traversal_method_encoded;
  163|  1.52k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 8, False: 1.51k]
  ------------------
  164|      8|      return false;
  165|      8|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.51k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 18, False: 1.49k]
  ------------------
  168|     18|      return false;
  169|     18|    }
  170|  1.49k|    traversal_method =
  171|  1.49k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.49k|  }
  173|       |
  174|  1.49k|  const Mesh *mesh = decoder_->mesh();
  175|  1.49k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.49k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 825, False: 673]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    825|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    825|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 438, False: 387]
  ------------------
  182|    438|      encoding_data = &pos_encoding_data_;
  183|    438|    } else {
  184|    387|      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|    387|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    387|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    825|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 209, False: 616]
  ------------------
  191|    209|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    209|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    209|          AttTraverser;
  194|    209|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    616|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 616, False: 0]
  ------------------
  196|    616|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    616|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    616|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    616|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    825|  } else {
  203|    673|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 3, False: 670]
  ------------------
  204|      3|      return false;  // Unsupported method.
  205|      3|    }
  206|    670|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 5, False: 665]
  ------------------
  207|      5|      return false;  // Attribute data must be specified.
  208|      5|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    665|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    665|        AttObserver;
  214|    665|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    665|        AttTraverser;
  216|       |
  217|    665|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    665|        &attribute_data_[att_data_id].encoding_data;
  219|    665|    const MeshAttributeCornerTable *const corner_table =
  220|    665|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    665|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    665|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    665|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    665|                             encoding_data);
  227|       |
  228|    665|    AttTraverser att_traverser;
  229|    665|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    665|    traversal_sequencer->SetTraverser(att_traverser);
  232|    665|    sequencer = std::move(traversal_sequencer);
  233|    665|  }
  234|       |
  235|  1.49k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.49k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.49k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.49k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.49k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.49k|                                        std::move(att_controller));
  244|  1.49k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.42k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.42k|  num_new_vertices_ = 0;
  249|  2.42k|  new_to_parent_vertex_map_.clear();
  250|  2.42k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.42k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.42k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 308, False: 2.11k]
  ------------------
  252|    308|    uint32_t num_new_verts;
  253|    308|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    308|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 210, False: 98]
  ------------------
  254|    210|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 8, False: 202]
  ------------------
  255|      8|        return false;
  256|      8|      }
  257|    210|    } else {
  258|     98|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 3, False: 95]
  ------------------
  259|      3|        return false;
  260|      3|      }
  261|     98|    }
  262|    297|    num_new_vertices_ = num_new_verts;
  263|    297|  }
  264|  2.41k|#endif
  265|       |
  266|  2.41k|  uint32_t num_encoded_vertices;
  267|  2.41k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.41k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.41k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 202, False: 2.21k]
  ------------------
  269|    202|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 5, False: 197]
  ------------------
  270|      5|      return false;
  271|      5|    }
  272|       |
  273|    202|  } else
  274|  2.21k|#endif
  275|  2.21k|  {
  276|  2.21k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 3, False: 2.21k]
  ------------------
  277|      3|      return false;
  278|      3|    }
  279|  2.21k|  }
  280|  2.40k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.40k|  uint32_t num_faces;
  283|  2.40k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.40k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.40k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 197, False: 2.21k]
  ------------------
  285|    197|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 4, False: 193]
  ------------------
  286|      4|      return false;
  287|      4|    }
  288|       |
  289|    197|  } else
  290|  2.21k|#endif
  291|  2.21k|  {
  292|  2.21k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 3, False: 2.20k]
  ------------------
  293|      3|      return false;
  294|      3|    }
  295|  2.21k|  }
  296|  2.40k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 5, False: 2.39k]
  ------------------
  297|      5|    return false;  // Draco cannot handle this many faces.
  298|      5|  }
  299|       |
  300|  2.39k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 21, False: 2.37k]
  ------------------
  301|     21|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     21|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.37k|  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.37k|  const uint64_t num_encoded_vertices_64 =
  311|  2.37k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.37k|  const uint64_t max_num_vertex_edges =
  313|  2.37k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.37k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 14, False: 2.36k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     14|    return false;
  317|     14|  }
  318|       |
  319|  2.36k|  uint8_t num_attribute_data;
  320|  2.36k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 27, False: 2.33k]
  ------------------
  321|     27|    return false;
  322|     27|  }
  323|       |
  324|  2.33k|  uint32_t num_encoded_symbols;
  325|  2.33k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.33k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.33k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 171, False: 2.16k]
  ------------------
  327|    171|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 14, False: 157]
  ------------------
  328|     14|      return false;
  329|     14|    }
  330|       |
  331|    171|  } else
  332|  2.16k|#endif
  333|  2.16k|  {
  334|  2.16k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 3, False: 2.15k]
  ------------------
  335|      3|      return false;
  336|      3|    }
  337|  2.16k|  }
  338|       |
  339|  2.31k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 20, False: 2.29k]
  ------------------
  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|     20|    return false;
  344|     20|  }
  345|  2.29k|  const uint32_t max_encoded_faces =
  346|  2.29k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.29k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 42, False: 2.25k]
  ------------------
  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|     42|    return false;
  352|     42|  }
  353|       |
  354|  2.25k|  uint32_t num_encoded_split_symbols;
  355|  2.25k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.25k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.25k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 135, False: 2.11k]
  ------------------
  357|    135|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 4, False: 131]
  ------------------
  358|      4|      return false;
  359|      4|    }
  360|       |
  361|    135|  } else
  362|  2.11k|#endif
  363|  2.11k|  {
  364|  2.11k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 3, False: 2.11k]
  ------------------
  365|      3|      return false;
  366|      3|    }
  367|  2.11k|  }
  368|       |
  369|  2.24k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 31, False: 2.21k]
  ------------------
  370|     31|    return false;  // Split symbols are a sub-set of all symbols.
  371|     31|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.21k|  vertex_traversal_length_.clear();
  375|  2.21k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.21k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.21k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.21k|  processed_corner_ids_.clear();
  380|  2.21k|  processed_corner_ids_.reserve(num_faces);
  381|  2.21k|  processed_connectivity_corners_.clear();
  382|  2.21k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.21k|  topology_split_data_.clear();
  384|  2.21k|  hole_event_data_.clear();
  385|  2.21k|  init_face_configurations_.clear();
  386|  2.21k|  init_corners_.clear();
  387|       |
  388|  2.21k|  last_symbol_id_ = -1;
  389|  2.21k|  last_face_id_ = -1;
  390|  2.21k|  last_vert_id_ = -1;
  391|       |
  392|  2.21k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.21k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.21k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.21k]
  ------------------
  397|  2.21k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      0|    return false;
  399|      0|  }
  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.21k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.21k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.21k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.21k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.21k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 213, False: 2.00k]
  ------------------
  411|    213|    uint32_t encoded_connectivity_size;
  412|    213|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    213|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 126, False: 87]
  ------------------
  413|    126|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 3, False: 123]
  ------------------
  414|      3|        return false;
  415|      3|      }
  416|    126|    } else {
  417|     87|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 2, False: 85]
  ------------------
  418|      2|        return false;
  419|      2|      }
  420|     87|    }
  421|    208|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 206]
  ------------------
  422|    206|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 20, False: 186]
  ------------------
  423|     22|      return false;
  424|     22|    }
  425|    186|    DecoderBuffer event_buffer;
  426|    186|    event_buffer.Init(
  427|    186|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    186|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    186|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    186|    topology_split_decoded_bytes =
  432|    186|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    186|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 133, False: 53]
  ------------------
  434|    133|      return false;
  435|    133|    }
  436|       |
  437|    186|  } else
  438|  2.00k|#endif
  439|  2.00k|  {
  440|  2.00k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 73, False: 1.93k]
  ------------------
  441|     73|      return false;
  442|     73|    }
  443|  2.00k|  }
  444|       |
  445|  1.98k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.98k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.98k|                                           num_encoded_split_symbols);
  449|  1.98k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.98k|  DecoderBuffer traversal_end_buffer;
  452|  1.98k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 171, False: 1.81k]
  ------------------
  453|    171|    return false;
  454|    171|  }
  455|       |
  456|  1.81k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.81k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 148, False: 1.66k]
  ------------------
  458|    148|    return false;
  459|    148|  }
  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: 13, False: 1.65k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     13|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     13|  }
  471|  1.66k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.66k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.64k, False: 19]
  ------------------
  475|  1.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.64k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 13, False: 1.63k]
  ------------------
  477|  1.40k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.39k, False: 13]
  ------------------
  478|  1.39k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.39k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.39k|      }
  482|       |
  483|     13|    } else
  484|  1.63k|#endif
  485|  1.63k|    {
  486|  10.3M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 10.3M, False: 1.63k]
  ------------------
  487|  10.3M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 10.3M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  10.3M|      }
  491|  1.63k|    }
  492|  1.64k|  }
  493|  1.66k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  3.77k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 2.10k, False: 1.66k]
  ------------------
  498|  2.10k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  14.1M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 14.1M, False: 2.10k]
  ------------------
  501|  14.1M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  14.1M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  2.10k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 2.10k]
  ------------------
  505|  2.10k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  2.10k|  }
  509|       |
  510|  1.66k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  3.77k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 2.10k, 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|  2.10k|    int32_t att_connectivity_verts =
  517|  2.10k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  2.10k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 153, False: 1.95k]
  ------------------
  519|    153|      att_connectivity_verts = corner_table_->num_vertices();
  520|    153|    }
  521|  2.10k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  2.10k|  }
  523|  1.66k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 10, False: 1.65k]
  ------------------
  524|     10|    return false;
  525|     10|  }
  526|  1.65k|  return true;
  527|  1.66k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    550|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    550|  return true;
  532|    550|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  1.81k|    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.81k|  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.81k|  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.81k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.81k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.81k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.81k|  int num_faces = 0;
  562|  49.2M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 49.2M, False: 1.72k]
  ------------------
  563|  49.2M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  49.2M|    bool check_topology_split = false;
  566|  49.2M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  49.2M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 24.5M, False: 24.7M]
  ------------------
  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|  24.5M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 24.5M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  24.5M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  24.5M|      const VertexIndex vertex_x =
  593|  24.5M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  24.5M|      const CornerIndex corner_b =
  595|  24.5M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  24.5M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 30, False: 24.5M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     30|        return -1;
  600|     30|      }
  601|  24.5M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 24.5M]
  |  Branch (601:11): [True: 0, False: 24.5M]
  ------------------
  602|  24.5M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 24.5M]
  ------------------
  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|  24.5M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  24.5M|      SetOppositeCorners(corner_a, corner + 1);
  612|  24.5M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  24.5M|      const VertexIndex vert_a_prev =
  616|  24.5M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  24.5M|      const VertexIndex vert_b_next =
  618|  24.5M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  24.5M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 24.5M]
  |  Branch (619:38): [True: 0, False: 24.5M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  24.5M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  24.5M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  24.5M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  24.5M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  24.5M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  24.5M|      active_corner_stack.back() = corner;
  631|  24.7M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 24.7M, False: 29.3k]
  |  Branch (631:40): [True: 5.80k, False: 23.4k]
  ------------------
  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|  24.7M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 24.7M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  24.7M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  24.7M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 24.7M]
  ------------------
  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|  24.7M|      const CornerIndex corner(3 * face.value());
  658|  24.7M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  24.7M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 24.7M, False: 5.80k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  24.7M|        opp_corner = corner + 2;
  662|  24.7M|        corner_l = corner + 1;
  663|  24.7M|        corner_r = corner;
  664|  24.7M|      } else {
  665|       |        // "l" is the new first corner.
  666|  5.80k|        opp_corner = corner + 1;
  667|  5.80k|        corner_l = corner;
  668|  5.80k|        corner_r = corner + 2;
  669|  5.80k|      }
  670|  24.7M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  24.7M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  24.7M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 13, False: 24.7M]
  ------------------
  675|     13|        return -1;  // Unexpected number of decoded vertices.
  676|     13|      }
  677|       |
  678|  24.7M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  24.7M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  24.7M|      const VertexIndex vertex_r =
  682|  24.7M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  24.7M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  24.7M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  24.7M|      corner_table_->MapCornerToVertex(
  688|  24.7M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  24.7M|      active_corner_stack.back() = corner;
  690|  24.7M|      check_topology_split = true;
  691|  24.7M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 7.69k, False: 15.7k]
  ------------------
  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.69k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 7.69k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  7.69k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  7.69k|      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.69k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  7.69k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 26, False: 7.66k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     26|        active_corner_stack.push_back(it->second);
  714|     26|      }
  715|  7.69k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 9, False: 7.68k]
  ------------------
  716|      9|        return -1;
  717|      9|      }
  718|  7.68k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  7.68k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 7.68k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  7.68k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 8, False: 7.67k]
  |  Branch (724:11): [True: 8, False: 7.67k]
  ------------------
  725|  7.67k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 7.67k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      8|        return -1;
  729|      8|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  7.67k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  7.67k|      SetOppositeCorners(corner_a, corner + 2);
  735|  7.67k|      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.67k|      const VertexIndex vertex_p =
  739|  7.67k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  7.67k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  7.67k|      corner_table_->MapCornerToVertex(
  742|  7.67k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  7.67k|      const VertexIndex vert_b_prev =
  744|  7.67k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  7.67k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  7.67k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  7.67k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  7.67k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  7.67k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  7.67k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  7.67k|                                       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.67k|      const CornerIndex first_corner = corner_n;
  757|  33.6k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 25.9k, False: 7.67k]
  ------------------
  758|  25.9k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  25.9k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  25.9k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 25.9k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  25.9k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  7.67k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  7.67k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 3.67k, False: 3.99k]
  ------------------
  770|  3.67k|        invalid_vertices.push_back(vertex_n);
  771|  3.67k|      }
  772|  7.67k|      active_corner_stack.back() = corner;
  773|  15.7k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 15.7k, False: 0]
  ------------------
  774|  15.7k|      const CornerIndex corner(3 * face.value());
  775|  15.7k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  15.7k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  15.7k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  15.7k|                                       corner_table_->AddNewVertex());
  780|  15.7k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  15.7k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  15.7k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 15.7k]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  15.7k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  15.7k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  15.7k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  15.7k|      active_corner_stack.push_back(corner);
  792|  15.7k|      check_topology_split = true;
  793|  15.7k|    } 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|  49.2M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  49.2M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 24.7M, False: 24.5M]
  ------------------
  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|  24.7M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  24.7M|      EdgeFaceName split_edge;
  812|  24.7M|      int encoder_split_symbol_id;
  813|  24.7M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.36k, False: 24.7M]
  ------------------
  814|  24.7M|                             &encoder_split_symbol_id)) {
  815|  1.36k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 22, False: 1.34k]
  ------------------
  816|     22|          return -1;  // Wrong split symbol id.
  817|     22|        }
  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.34k|        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.34k|        CornerIndex new_active_corner;
  831|  1.34k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 435, False: 909]
  ------------------
  832|    435|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    909|        } else {
  834|    909|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    909|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.34k|        const int decoder_split_symbol_id =
  839|  1.34k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.34k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.34k|            new_active_corner;
  842|  1.34k|      }
  843|  24.7M|    }
  844|  49.2M|  }
  845|  1.72k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.72k]
  ------------------
  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|  8.17k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 6.46k, False: 1.70k]
  ------------------
  850|  6.46k|    const CornerIndex corner = active_corner_stack.back();
  851|  6.46k|    active_corner_stack.pop_back();
  852|  6.46k|    const bool interior_face =
  853|  6.46k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  6.46k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 2.90k, False: 3.55k]
  ------------------
  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.90k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 4, False: 2.89k]
  ------------------
  877|      4|        return -1;  // More faces than expected added to the mesh.
  878|      4|      }
  879|       |
  880|  2.89k|      const CornerIndex corner_a = corner;
  881|  2.89k|      const VertexIndex vert_n =
  882|  2.89k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  2.89k|      const CornerIndex corner_b =
  884|  2.89k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  2.89k|      const VertexIndex vert_x =
  887|  2.89k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  2.89k|      const CornerIndex corner_c =
  889|  2.89k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  2.89k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 2.89k]
  |  Branch (891:33): [True: 7, False: 2.89k]
  |  Branch (891:55): [True: 0, False: 2.89k]
  ------------------
  892|       |        // All matched corners must be different.
  893|      9|        return -1;
  894|      9|      }
  895|  2.89k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 2.88k]
  |  Branch (895:11): [True: 1, False: 2.88k]
  ------------------
  896|  2.88k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 2.88k]
  ------------------
  897|  2.88k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 2.88k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      1|        return -1;
  901|      1|      }
  902|       |
  903|  2.88k|      const VertexIndex vert_p =
  904|  2.88k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  2.88k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  2.88k|      const CornerIndex new_corner(3 * face.value());
  909|  2.88k|      SetOppositeCorners(new_corner, corner);
  910|  2.88k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  2.88k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  2.88k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  2.88k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  2.88k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  11.5k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 8.66k, False: 2.88k]
  ------------------
  920|  8.66k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  8.66k|      }
  922|       |
  923|  2.88k|      init_face_configurations_.push_back(true);
  924|  2.88k|      init_corners_.push_back(new_corner);
  925|  3.55k|    } 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|  3.55k|      init_face_configurations_.push_back(false);
  930|  3.55k|      init_corners_.push_back(corner);
  931|  3.55k|    }
  932|  6.46k|  }
  933|  1.70k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 41, False: 1.66k]
  ------------------
  934|     41|    return -1;  // Unexpected number of decoded faces.
  935|     41|  }
  936|       |
  937|  1.66k|  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.66k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 184, False: 1.66k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    184|    VertexIndex src_vert(num_vertices - 1);
  943|    223|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 39, False: 184]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     39|      src_vert = VertexIndex(--num_vertices - 1);
  946|     39|    }
  947|    184|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 39, False: 145]
  ------------------
  948|     39|      continue;  // No need to swap anything.
  949|     39|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    145|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|    791|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 650, False: 141]
  ------------------
  954|    650|      const CornerIndex cid = vcit.Corner();
  955|    650|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 4, False: 646]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      4|        return -1;
  959|      4|      }
  960|    646|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|    646|    }
  962|    141|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    141|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    141|    corner_table_->MakeVertexIsolated(src_vert);
  967|    141|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    141|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    141|    num_vertices--;
  972|    141|  }
  973|  1.66k|  return num_vertices;
  974|  1.66k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.18k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.18k|  uint32_t num_topology_splits;
  982|  2.18k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.18k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.18k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 106, False: 2.08k]
  ------------------
  984|    106|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 105]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    106|  } else
  989|  2.08k|#endif
  990|  2.08k|  {
  991|  2.08k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 16, False: 2.06k]
  ------------------
  992|     16|      return -1;
  993|     16|    }
  994|  2.08k|  }
  995|  2.17k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 744, False: 1.42k]
  ------------------
  996|    744|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 55, False: 689]
  ------------------
  997|    744|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     55|      return -1;
  999|     55|    }
 1000|    689|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    689|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    689|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 58, False: 631]
  ------------------
 1002|  31.6k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 31.6k, False: 30]
  ------------------
 1003|  31.6k|        TopologySplitEventData event_data;
 1004|  31.6k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 16, False: 31.6k]
  ------------------
 1005|     16|          return -1;
 1006|     16|        }
 1007|  31.6k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 8, False: 31.6k]
  ------------------
 1008|      8|          return -1;
 1009|      8|        }
 1010|  31.6k|        uint8_t edge_data;
 1011|  31.6k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 31.6k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|  31.6k|        event_data.source_edge = edge_data & 1;
 1015|  31.6k|        topology_split_data_.push_back(event_data);
 1016|  31.6k|      }
 1017|       |
 1018|     58|    } 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.18k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.58k, False: 604]
  ------------------
 1025|  3.58k|        TopologySplitEventData event_data;
 1026|  3.58k|        uint32_t delta;
 1027|  3.58k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 4, False: 3.57k]
  ------------------
 1028|      4|          return -1;
 1029|      4|        }
 1030|  3.57k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.57k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 10, False: 3.56k]
  ------------------
 1032|     10|          return -1;
 1033|     10|        }
 1034|  3.56k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 13, False: 3.55k]
  ------------------
 1035|     13|          return -1;
 1036|     13|        }
 1037|  3.55k|        event_data.split_symbol_id =
 1038|  3.55k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.55k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.55k|        topology_split_data_.push_back(event_data);
 1041|  3.55k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    604|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.85k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 3.24k, False: 604]
  ------------------
 1045|  3.24k|        uint32_t edge_data;
 1046|  3.24k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.24k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 776, False: 2.47k]
  ------------------
 1047|    776|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.47k|        } else {
 1049|  2.47k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.47k|        }
 1051|  3.24k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  3.24k|        event_data.source_edge = edge_data & 1;
 1053|  3.24k|      }
 1054|    604|      decoder_buffer->EndBitDecoding();
 1055|    604|    }
 1056|    689|  }
 1057|  2.06k|  uint32_t num_hole_events = 0;
 1058|  2.06k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.06k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.06k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 64, False: 1.99k]
  ------------------
 1060|     64|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 62]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  1.99k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.99k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 59, False: 1.93k]
  ------------------
 1064|     59|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 5, False: 54]
  ------------------
 1065|      5|      return -1;
 1066|      5|    }
 1067|     59|  }
 1068|  2.05k|#endif
 1069|  2.05k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 78, False: 1.97k]
  ------------------
 1070|     78|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     78|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     78|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 52, False: 26]
  ------------------
 1072|   258k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 258k, False: 1]
  ------------------
 1073|   258k|        HoleEventData event_data;
 1074|   258k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 51, False: 258k]
  ------------------
 1075|     51|          return -1;
 1076|     51|        }
 1077|   258k|        hole_event_data_.push_back(event_data);
 1078|   258k|      }
 1079|       |
 1080|     52|    } else
 1081|     26|#endif
 1082|     26|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     26|      int last_symbol_id = 0;
 1085|  2.58k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 2.57k, False: 5]
  ------------------
 1086|  2.57k|        HoleEventData event_data;
 1087|  2.57k|        uint32_t delta;
 1088|  2.57k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 21, False: 2.55k]
  ------------------
 1089|     21|          return -1;
 1090|     21|        }
 1091|  2.55k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  2.55k|        last_symbol_id = event_data.symbol_id;
 1093|  2.55k|        hole_event_data_.push_back(event_data);
 1094|  2.55k|      }
 1095|     26|    }
 1096|     78|  }
 1097|  1.98k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.05k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.39k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.39k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.39k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  5.56k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 4.17k, False: 1.39k]
  ------------------
 1109|  4.17k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  4.17k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 569, False: 3.60k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  1.13k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 569, False: 569]
  ------------------
 1114|    569|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    569|      }
 1116|    569|      continue;
 1117|    569|    }
 1118|       |
 1119|  7.20k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 3.60k, False: 3.60k]
  ------------------
 1120|  3.60k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  3.60k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 3.53k, False: 70]
  ------------------
 1122|  3.53k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  3.53k|      }
 1124|  3.60k|    }
 1125|  3.60k|  }
 1126|  1.39k|  return true;
 1127|  1.39k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  10.3M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  10.3M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  10.3M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  10.3M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  41.4M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 31.0M, False: 10.3M]
  ------------------
 1139|  31.0M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  31.0M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 135k, False: 30.9M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   276k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 140k, False: 135k]
  ------------------
 1144|   140k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   140k|      }
 1146|   135k|      continue;
 1147|   135k|    }
 1148|  30.9M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  30.9M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 15.4M, False: 15.4M]
  ------------------
 1151|  15.4M|      continue;
 1152|  15.4M|    }
 1153|       |
 1154|  31.2M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 15.8M, False: 15.4M]
  ------------------
 1155|  15.8M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  15.8M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 14.0M, False: 1.79M]
  ------------------
 1157|  14.0M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  14.0M|      }
 1159|  15.8M|    }
 1160|  15.4M|  }
 1161|  10.3M|  return true;
 1162|  10.3M|}
_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: 19, False: 1.64k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  15.4k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 15.3k, False: 19]
  ------------------
 1176|  15.3k|      Mesh::Face face;
 1177|  15.3k|      const CornerIndex start_corner(3 * f.value());
 1178|  61.5k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 46.1k, False: 15.3k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  46.1k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  46.1k|        face[c] = vert_id;
 1182|  46.1k|      }
 1183|  15.3k|      decoder_->mesh()->SetFace(f, face);
 1184|  15.3k|    }
 1185|     19|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     19|    return true;
 1187|     19|  }
 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.64k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.64k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  5.24M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 5.23M, False: 1.63k]
  ------------------
 1197|  5.23M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  5.23M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 2.80k, False: 5.23M]
  ------------------
 1199|  2.80k|      continue;  // Isolated vertex.
 1200|  2.80k|    }
 1201|  5.23M|    CornerIndex deduplication_first_corner = c;
 1202|  5.23M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 135k, False: 5.10M]
  ------------------
 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|   135k|      deduplication_first_corner = c;
 1206|  5.10M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  5.64M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 5.10M, False: 538k]
  ------------------
 1210|  5.10M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 525k, False: 4.57M]
  ------------------
 1211|   525k|          continue;  // No seam for this attribute, ignore it.
 1212|   525k|        }
 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.57M|        const VertexIndex vert_id =
 1217|  4.57M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  4.57M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  4.57M|        bool seam_found = false;
 1220|  4.72M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 4.71M, False: 14.8k]
  ------------------
 1221|  4.71M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 10, False: 4.71M]
  ------------------
 1222|     10|            return false;
 1223|     10|          }
 1224|  4.71M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 4.56M, False: 150k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  4.56M|            deduplication_first_corner = act_c;
 1227|  4.56M|            seam_found = true;
 1228|  4.56M|            break;
 1229|  4.56M|          }
 1230|   150k|          act_c = corner_table_->SwingRight(act_c);
 1231|   150k|        }
 1232|  4.57M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 4.56M, False: 14.8k]
  ------------------
 1233|  4.56M|          break;  // No reason to process other attributes if we found a seam.
 1234|  4.56M|        }
 1235|  4.57M|      }
 1236|  5.10M|    }
 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|  5.23M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  5.23M|    corner_to_point_map[c.value()] =
 1246|  5.23M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  5.23M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  5.23M|    CornerIndex prev_c = c;
 1250|  5.23M|    c = corner_table_->SwingRight(c);
 1251|  30.9M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 30.8M, False: 137k]
  |  Branch (1251:40): [True: 25.7M, False: 5.09M]
  ------------------
 1252|  25.7M|      bool attribute_seam = false;
 1253|  28.5M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 25.7M, False: 2.81M]
  ------------------
 1254|  25.7M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 22.9M, False: 2.83M]
  ------------------
 1255|  25.7M|            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|  22.9M|          attribute_seam = true;
 1259|  22.9M|          break;
 1260|  22.9M|        }
 1261|  25.7M|      }
 1262|  25.7M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 22.9M, False: 2.81M]
  ------------------
 1263|  22.9M|        corner_to_point_map[c.value()] =
 1264|  22.9M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  22.9M|        point_to_corner_map.push_back(c.value());
 1266|  22.9M|      } else {
 1267|  2.81M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  2.81M|      }
 1269|  25.7M|      prev_c = c;
 1270|  25.7M|      c = corner_table_->SwingRight(c);
 1271|  25.7M|    }
 1272|  5.23M|  }
 1273|       |  // Add faces.
 1274|  10.2M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 10.2M, False: 1.63k]
  ------------------
 1275|  10.2M|    Mesh::Face face;
 1276|  41.1M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 30.8M, False: 10.2M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  30.8M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  30.8M|    }
 1280|  10.2M|    decoder_->mesh()->SetFace(f, face);
 1281|  10.2M|  }
 1282|  1.63k|  decoder_->point_cloud()->set_num_points(
 1283|  1.63k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.63k|  return true;
 1285|  1.64k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  2.44k|    : decoder_(nullptr),
   49|  2.44k|      last_symbol_id_(-1),
   50|  2.44k|      last_vert_id_(-1),
   51|  2.44k|      last_face_id_(-1),
   52|  2.44k|      num_new_vertices_(0),
   53|  2.44k|      num_encoded_vertices_(0),
   54|  2.44k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.44k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.44k|  decoder_ = decoder;
   60|  2.44k|  return true;
   61|  2.44k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    144|    int att_id) const {
   67|    233|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 172, False: 61]
  ------------------
   68|    172|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    172|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 89, False: 83]
  |  Branch (69:27): [True: 0, False: 83]
  ------------------
   70|     89|      continue;
   71|     89|    }
   72|     83|    const AttributesDecoderInterface *const dec =
   73|     83|        decoder_->attributes_decoder(decoder_id);
   74|    934|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 934, False: 0]
  ------------------
   75|    934|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 83, False: 851]
  ------------------
   76|     83|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 65, False: 18]
  ------------------
   77|     65|          return &attribute_data_[i].connectivity_data;
   78|     65|        }
   79|     18|        return nullptr;
   80|     83|      }
   81|    934|    }
   82|     83|  }
   83|     61|  return nullptr;
   84|    144|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    144|    int att_id) const {
   90|    233|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 172, False: 61]
  ------------------
   91|    172|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    172|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 89, False: 83]
  |  Branch (92:27): [True: 0, False: 83]
  ------------------
   93|     89|      continue;
   94|     89|    }
   95|     83|    const AttributesDecoderInterface *const dec =
   96|     83|        decoder_->attributes_decoder(decoder_id);
   97|    934|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 934, False: 0]
  ------------------
   98|    934|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 83, False: 851]
  ------------------
   99|     83|        return &attribute_data_[i].encoding_data;
  100|     83|      }
  101|    934|    }
  102|     83|  }
  103|     61|  return &pos_encoding_data_;
  104|    144|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    138|    int32_t att_decoder_id) {
  131|    138|  int8_t att_data_id;
  132|    138|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 4, False: 134]
  ------------------
  133|      4|    return false;
  134|      4|  }
  135|    134|  uint8_t decoder_type;
  136|    134|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 7, False: 127]
  ------------------
  137|      7|    return false;
  138|      7|  }
  139|       |
  140|    127|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 78, False: 49]
  ------------------
  141|     78|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 17, False: 61]
  ------------------
  142|     17|      return false;  // Unexpected attribute data.
  143|     17|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     61|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 3, False: 58]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|       |
  151|     58|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|     58|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|     49|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 47]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|     47|    pos_data_decoder_id_ = att_decoder_id;
  158|     47|  }
  159|       |
  160|    105|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    105|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    105|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 105, False: 0]
  ------------------
  162|    105|    uint8_t traversal_method_encoded;
  163|    105|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 3, False: 102]
  ------------------
  164|      3|      return false;
  165|      3|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    102|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 15, False: 87]
  ------------------
  168|     15|      return false;
  169|     15|    }
  170|     87|    traversal_method =
  171|     87|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|     87|  }
  173|       |
  174|     87|  const Mesh *mesh = decoder_->mesh();
  175|     87|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|     87|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 45, False: 42]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|     45|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|     45|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 31, False: 14]
  ------------------
  182|     31|      encoding_data = &pos_encoding_data_;
  183|     31|    } else {
  184|     14|      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|     14|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     14|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|     45|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 25, False: 20]
  ------------------
  191|     25|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     25|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     25|          AttTraverser;
  194|     25|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     25|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 20, False: 0]
  ------------------
  196|     20|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     20|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     20|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     20|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|     45|  } else {
  203|     42|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 3, False: 39]
  ------------------
  204|      3|      return false;  // Unsupported method.
  205|      3|    }
  206|     39|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 37]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     37|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     37|        AttObserver;
  214|     37|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     37|        AttTraverser;
  216|       |
  217|     37|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     37|        &attribute_data_[att_data_id].encoding_data;
  219|     37|    const MeshAttributeCornerTable *const corner_table =
  220|     37|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     37|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     37|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     37|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     37|                             encoding_data);
  227|       |
  228|     37|    AttTraverser att_traverser;
  229|     37|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     37|    traversal_sequencer->SetTraverser(att_traverser);
  232|     37|    sequencer = std::move(traversal_sequencer);
  233|     37|  }
  234|       |
  235|     82|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 82]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|     82|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|     82|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|     82|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|     82|                                        std::move(att_controller));
  244|     82|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  2.44k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.44k|  num_new_vertices_ = 0;
  249|  2.44k|  new_to_parent_vertex_map_.clear();
  250|  2.44k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.44k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.44k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 428, False: 2.01k]
  ------------------
  252|    428|    uint32_t num_new_verts;
  253|    428|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    428|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 227, False: 201]
  ------------------
  254|    227|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 8, False: 219]
  ------------------
  255|      8|        return false;
  256|      8|      }
  257|    227|    } else {
  258|    201|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 1, False: 200]
  ------------------
  259|      1|        return false;
  260|      1|      }
  261|    201|    }
  262|    419|    num_new_vertices_ = num_new_verts;
  263|    419|  }
  264|  2.43k|#endif
  265|       |
  266|  2.43k|  uint32_t num_encoded_vertices;
  267|  2.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.43k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 219, False: 2.21k]
  ------------------
  269|    219|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 4, False: 215]
  ------------------
  270|      4|      return false;
  271|      4|    }
  272|       |
  273|    219|  } else
  274|  2.21k|#endif
  275|  2.21k|  {
  276|  2.21k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 4, False: 2.20k]
  ------------------
  277|      4|      return false;
  278|      4|    }
  279|  2.21k|  }
  280|  2.42k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.42k|  uint32_t num_faces;
  283|  2.42k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.42k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.42k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 215, False: 2.20k]
  ------------------
  285|    215|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 2, False: 213]
  ------------------
  286|      2|      return false;
  287|      2|    }
  288|       |
  289|    215|  } else
  290|  2.20k|#endif
  291|  2.20k|  {
  292|  2.20k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 3, False: 2.20k]
  ------------------
  293|      3|      return false;
  294|      3|    }
  295|  2.20k|  }
  296|  2.41k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 3, False: 2.41k]
  ------------------
  297|      3|    return false;  // Draco cannot handle this many faces.
  298|      3|  }
  299|       |
  300|  2.41k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 24, False: 2.39k]
  ------------------
  301|     24|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     24|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.39k|  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.39k|  const uint64_t num_encoded_vertices_64 =
  311|  2.39k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.39k|  const uint64_t max_num_vertex_edges =
  313|  2.39k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.39k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 12, False: 2.37k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     12|    return false;
  317|     12|  }
  318|       |
  319|  2.37k|  uint8_t num_attribute_data;
  320|  2.37k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 20, False: 2.35k]
  ------------------
  321|     20|    return false;
  322|     20|  }
  323|       |
  324|  2.35k|  uint32_t num_encoded_symbols;
  325|  2.35k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.35k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.35k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 200, False: 2.15k]
  ------------------
  327|    200|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 12, False: 188]
  ------------------
  328|     12|      return false;
  329|     12|    }
  330|       |
  331|    200|  } else
  332|  2.15k|#endif
  333|  2.15k|  {
  334|  2.15k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 6, False: 2.15k]
  ------------------
  335|      6|      return false;
  336|      6|    }
  337|  2.15k|  }
  338|       |
  339|  2.34k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 14, False: 2.32k]
  ------------------
  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|     14|    return false;
  344|     14|  }
  345|  2.32k|  const uint32_t max_encoded_faces =
  346|  2.32k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.32k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 43, False: 2.28k]
  ------------------
  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|     43|    return false;
  352|     43|  }
  353|       |
  354|  2.28k|  uint32_t num_encoded_split_symbols;
  355|  2.28k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.28k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.28k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 173, False: 2.11k]
  ------------------
  357|    173|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 3, False: 170]
  ------------------
  358|      3|      return false;
  359|      3|    }
  360|       |
  361|    173|  } else
  362|  2.11k|#endif
  363|  2.11k|  {
  364|  2.11k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 4, False: 2.10k]
  ------------------
  365|      4|      return false;
  366|      4|    }
  367|  2.11k|  }
  368|       |
  369|  2.27k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 27, False: 2.25k]
  ------------------
  370|     27|    return false;  // Split symbols are a sub-set of all symbols.
  371|     27|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.25k|  vertex_traversal_length_.clear();
  375|  2.25k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.25k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.25k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.25k|  processed_corner_ids_.clear();
  380|  2.25k|  processed_corner_ids_.reserve(num_faces);
  381|  2.25k|  processed_connectivity_corners_.clear();
  382|  2.25k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.25k|  topology_split_data_.clear();
  384|  2.25k|  hole_event_data_.clear();
  385|  2.25k|  init_face_configurations_.clear();
  386|  2.25k|  init_corners_.clear();
  387|       |
  388|  2.25k|  last_symbol_id_ = -1;
  389|  2.25k|  last_face_id_ = -1;
  390|  2.25k|  last_vert_id_ = -1;
  391|       |
  392|  2.25k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.25k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.25k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.25k]
  ------------------
  397|  2.25k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      0|    return false;
  399|      0|  }
  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.25k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.25k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.25k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.25k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.25k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 353, False: 1.89k]
  ------------------
  411|    353|    uint32_t encoded_connectivity_size;
  412|    353|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    353|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 164, False: 189]
  ------------------
  413|    164|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 4, False: 160]
  ------------------
  414|      4|        return false;
  415|      4|      }
  416|    189|    } else {
  417|    189|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 2, False: 187]
  ------------------
  418|      2|        return false;
  419|      2|      }
  420|    189|    }
  421|    347|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 346]
  ------------------
  422|    346|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 21, False: 325]
  ------------------
  423|     22|      return false;
  424|     22|    }
  425|    325|    DecoderBuffer event_buffer;
  426|    325|    event_buffer.Init(
  427|    325|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    325|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    325|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    325|    topology_split_decoded_bytes =
  432|    325|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    325|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 91, False: 234]
  ------------------
  434|     91|      return false;
  435|     91|    }
  436|       |
  437|    325|  } else
  438|  1.89k|#endif
  439|  1.89k|  {
  440|  1.89k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 92, False: 1.80k]
  ------------------
  441|     92|      return false;
  442|     92|    }
  443|  1.89k|  }
  444|       |
  445|  2.03k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.03k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.03k|                                           num_encoded_split_symbols);
  449|  2.03k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.03k|  DecoderBuffer traversal_end_buffer;
  452|  2.03k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 1.08k, False: 957]
  ------------------
  453|  1.08k|    return false;
  454|  1.08k|  }
  455|       |
  456|    957|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|    957|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 809, False: 148]
  ------------------
  458|    809|    return false;
  459|    809|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    148|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    148|                           traversal_end_buffer.remaining_size(),
  464|    148|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    148|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 5, False: 143]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      5|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      5|  }
  471|    148|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    148|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 129, False: 19]
  ------------------
  475|    129|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    129|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    129|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 4, False: 125]
  ------------------
  477|     12|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 8, False: 4]
  ------------------
  478|      8|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 8]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|      8|      }
  482|       |
  483|      4|    } else
  484|    125|#endif
  485|    125|    {
  486|   310k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 309k, False: 125]
  ------------------
  487|   309k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 309k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   309k|      }
  491|    125|    }
  492|    129|  }
  493|    148|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    347|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 199, False: 148]
  ------------------
  498|    199|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   350k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 350k, False: 199]
  ------------------
  501|   350k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   350k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    199|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 199]
  ------------------
  505|    199|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    199|  }
  509|       |
  510|    148|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    347|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 199, False: 148]
  ------------------
  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|    199|    int32_t att_connectivity_verts =
  517|    199|        attribute_data_[i].connectivity_data.num_vertices();
  518|    199|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 1, False: 198]
  ------------------
  519|      1|      att_connectivity_verts = corner_table_->num_vertices();
  520|      1|    }
  521|    199|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    199|  }
  523|    148|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 16, False: 132]
  ------------------
  524|     16|    return false;
  525|     16|  }
  526|    132|  return true;
  527|    148|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     13|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     13|  return true;
  532|     13|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|    957|    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|    957|  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|    957|  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|    957|  std::vector<VertexIndex> invalid_vertices;
  558|    957|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|    957|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|    957|  int num_faces = 0;
  562|  47.7M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 47.7M, False: 245]
  ------------------
  563|  47.7M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  47.7M|    bool check_topology_split = false;
  566|  47.7M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  47.7M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 3.73M, False: 44.0M]
  ------------------
  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|  3.73M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 49, False: 3.73M]
  ------------------
  588|     49|        return -1;
  589|     49|      }
  590|       |
  591|  3.73M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  3.73M|      const VertexIndex vertex_x =
  593|  3.73M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  3.73M|      const CornerIndex corner_b =
  595|  3.73M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  3.73M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 342, False: 3.73M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    342|        return -1;
  600|    342|      }
  601|  3.73M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 3.73M]
  |  Branch (601:11): [True: 0, False: 3.73M]
  ------------------
  602|  3.73M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 3.73M]
  ------------------
  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|  3.73M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  3.73M|      SetOppositeCorners(corner_a, corner + 1);
  612|  3.73M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  3.73M|      const VertexIndex vert_a_prev =
  616|  3.73M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  3.73M|      const VertexIndex vert_b_next =
  618|  3.73M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  3.73M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 3.73M]
  |  Branch (619:38): [True: 0, False: 3.73M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  3.73M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  3.73M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  3.73M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  3.73M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  3.73M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  3.73M|      active_corner_stack.back() = corner;
  631|  44.0M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.69k, False: 44.0M]
  |  Branch (631:40): [True: 37.6M, False: 6.37M]
  ------------------
  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|  37.6M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 37.6M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  37.6M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  37.6M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 37.6M]
  ------------------
  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|  37.6M|      const CornerIndex corner(3 * face.value());
  658|  37.6M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  37.6M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.69k, False: 37.6M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.69k|        opp_corner = corner + 2;
  662|  1.69k|        corner_l = corner + 1;
  663|  1.69k|        corner_r = corner;
  664|  37.6M|      } else {
  665|       |        // "l" is the new first corner.
  666|  37.6M|        opp_corner = corner + 1;
  667|  37.6M|        corner_l = corner;
  668|  37.6M|        corner_r = corner + 2;
  669|  37.6M|      }
  670|  37.6M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  37.6M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  37.6M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 9, False: 37.6M]
  ------------------
  675|      9|        return -1;  // Unexpected number of decoded vertices.
  676|      9|      }
  677|       |
  678|  37.6M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  37.6M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  37.6M|      const VertexIndex vertex_r =
  682|  37.6M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  37.6M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  37.6M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  37.6M|      corner_table_->MapCornerToVertex(
  688|  37.6M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  37.6M|      active_corner_stack.back() = corner;
  690|  37.6M|      check_topology_split = true;
  691|  37.6M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 35.2k, False: 6.33M]
  ------------------
  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|  35.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 35.2k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  35.2k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  35.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|  35.2k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  35.2k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 21, False: 35.2k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     21|        active_corner_stack.push_back(it->second);
  714|     21|      }
  715|  35.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 56, False: 35.2k]
  ------------------
  716|     56|        return -1;
  717|     56|      }
  718|  35.2k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  35.2k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 35.2k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  35.2k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 3, False: 35.2k]
  |  Branch (724:11): [True: 3, False: 35.2k]
  ------------------
  725|  35.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 35.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|      3|        return -1;
  729|      3|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  35.2k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  35.2k|      SetOppositeCorners(corner_a, corner + 2);
  735|  35.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|  35.2k|      const VertexIndex vertex_p =
  739|  35.2k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  35.2k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  35.2k|      corner_table_->MapCornerToVertex(
  742|  35.2k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  35.2k|      const VertexIndex vert_b_prev =
  744|  35.2k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  35.2k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  35.2k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  35.2k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  35.2k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  35.2k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  35.2k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  35.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|  35.2k|      const CornerIndex first_corner = corner_n;
  757|  10.3M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 10.2M, False: 35.2k]
  ------------------
  758|  10.2M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  10.2M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  10.2M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 10.2M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  10.2M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  35.2k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  35.2k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 35.1k, False: 57]
  ------------------
  770|  35.1k|        invalid_vertices.push_back(vertex_n);
  771|  35.1k|      }
  772|  35.2k|      active_corner_stack.back() = corner;
  773|  6.33M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 6.33M, False: 199]
  ------------------
  774|  6.33M|      const CornerIndex corner(3 * face.value());
  775|  6.33M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  6.33M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  6.33M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  6.33M|                                       corner_table_->AddNewVertex());
  780|  6.33M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  6.33M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  6.33M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 17, False: 6.33M]
  ------------------
  784|     17|        return -1;  // Unexpected number of decoded vertices.
  785|     17|      }
  786|       |
  787|  6.33M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  6.33M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  6.33M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  6.33M|      active_corner_stack.push_back(corner);
  792|  6.33M|      check_topology_split = true;
  793|  6.33M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    199|      return -1;
  796|    199|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  47.7M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  47.7M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 44.0M, False: 3.76M]
  ------------------
  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|  44.0M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  44.0M|      EdgeFaceName split_edge;
  812|  44.0M|      int encoder_split_symbol_id;
  813|  44.0M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.05k, False: 44.0M]
  ------------------
  814|  44.0M|                             &encoder_split_symbol_id)) {
  815|  1.05k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 36, False: 1.01k]
  ------------------
  816|     36|          return -1;  // Wrong split symbol id.
  817|     36|        }
  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.01k|        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.01k|        CornerIndex new_active_corner;
  831|  1.01k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 370, False: 646]
  ------------------
  832|    370|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    646|        } else {
  834|    646|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    646|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.01k|        const int decoder_split_symbol_id =
  839|  1.01k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.01k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.01k|            new_active_corner;
  842|  1.01k|      }
  843|  44.0M|    }
  844|  47.7M|  }
  845|    245|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 245]
  ------------------
  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|  4.35M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 4.35M, False: 217]
  ------------------
  850|  4.35M|    const CornerIndex corner = active_corner_stack.back();
  851|  4.35M|    active_corner_stack.pop_back();
  852|  4.35M|    const bool interior_face =
  853|  4.35M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  4.35M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 4.33M, False: 15.9k]
  ------------------
  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|  4.33M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 25, False: 4.33M]
  ------------------
  877|     25|        return -1;  // More faces than expected added to the mesh.
  878|     25|      }
  879|       |
  880|  4.33M|      const CornerIndex corner_a = corner;
  881|  4.33M|      const VertexIndex vert_n =
  882|  4.33M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  4.33M|      const CornerIndex corner_b =
  884|  4.33M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  4.33M|      const VertexIndex vert_x =
  887|  4.33M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  4.33M|      const CornerIndex corner_c =
  889|  4.33M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  4.33M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 4.33M]
  |  Branch (891:33): [True: 1, False: 4.33M]
  |  Branch (891:55): [True: 0, False: 4.33M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      3|        return -1;
  894|      3|      }
  895|  4.33M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 4.33M]
  |  Branch (895:11): [True: 0, False: 4.33M]
  ------------------
  896|  4.33M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 4.33M]
  ------------------
  897|  4.33M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 4.33M]
  ------------------
  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|  4.33M|      const VertexIndex vert_p =
  904|  4.33M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  4.33M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  4.33M|      const CornerIndex new_corner(3 * face.value());
  909|  4.33M|      SetOppositeCorners(new_corner, corner);
  910|  4.33M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  4.33M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  4.33M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  4.33M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  4.33M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  17.3M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 13.0M, False: 4.33M]
  ------------------
  920|  13.0M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  13.0M|      }
  922|       |
  923|  4.33M|      init_face_configurations_.push_back(true);
  924|  4.33M|      init_corners_.push_back(new_corner);
  925|  4.33M|    } 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|  15.9k|      init_face_configurations_.push_back(false);
  930|  15.9k|      init_corners_.push_back(corner);
  931|  15.9k|    }
  932|  4.35M|  }
  933|    217|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 66, False: 151]
  ------------------
  934|     66|    return -1;  // Unexpected number of decoded faces.
  935|     66|  }
  936|       |
  937|    151|  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.47k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 2.47k, False: 148]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  2.47k|    VertexIndex src_vert(num_vertices - 1);
  943|  3.05k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 574, False: 2.47k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    574|      src_vert = VertexIndex(--num_vertices - 1);
  946|    574|    }
  947|  2.47k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 441, False: 2.03k]
  ------------------
  948|    441|      continue;  // No need to swap anything.
  949|    441|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.03k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  8.10k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 6.07k, False: 2.03k]
  ------------------
  954|  6.07k|      const CornerIndex cid = vcit.Corner();
  955|  6.07k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 6.07k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      3|        return -1;
  959|      3|      }
  960|  6.07k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  6.07k|    }
  962|  2.03k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.03k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.03k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.03k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.03k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.03k|    num_vertices--;
  972|  2.03k|  }
  973|    148|  return num_vertices;
  974|    151|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.22k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.22k|  uint32_t num_topology_splits;
  982|  2.22k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.22k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.22k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 143, False: 2.07k]
  ------------------
  984|    143|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 142]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    143|  } else
  989|  2.07k|#endif
  990|  2.07k|  {
  991|  2.07k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 13, False: 2.06k]
  ------------------
  992|     13|      return -1;
  993|     13|    }
  994|  2.07k|  }
  995|  2.20k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 437, False: 1.77k]
  ------------------
  996|    437|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 52, False: 385]
  ------------------
  997|    437|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     52|      return -1;
  999|     52|    }
 1000|    385|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    385|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    385|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 36, False: 349]
  ------------------
 1002|  54.0k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 54.0k, False: 12]
  ------------------
 1003|  54.0k|        TopologySplitEventData event_data;
 1004|  54.0k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 12, False: 54.0k]
  ------------------
 1005|     12|          return -1;
 1006|     12|        }
 1007|  54.0k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 7, False: 54.0k]
  ------------------
 1008|      7|          return -1;
 1009|      7|        }
 1010|  54.0k|        uint8_t edge_data;
 1011|  54.0k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 5, False: 54.0k]
  ------------------
 1012|      5|          return -1;
 1013|      5|        }
 1014|  54.0k|        event_data.source_edge = edge_data & 1;
 1015|  54.0k|        topology_split_data_.push_back(event_data);
 1016|  54.0k|      }
 1017|       |
 1018|     36|    } else
 1019|    349|#endif
 1020|    349|    {
 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|    349|      int last_source_symbol_id = 0;
 1024|  3.85k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.55k, False: 301]
  ------------------
 1025|  3.55k|        TopologySplitEventData event_data;
 1026|  3.55k|        uint32_t delta;
 1027|  3.55k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 17, False: 3.53k]
  ------------------
 1028|     17|          return -1;
 1029|     17|        }
 1030|  3.53k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.53k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 10, False: 3.52k]
  ------------------
 1032|     10|          return -1;
 1033|     10|        }
 1034|  3.52k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 21, False: 3.50k]
  ------------------
 1035|     21|          return -1;
 1036|     21|        }
 1037|  3.50k|        event_data.split_symbol_id =
 1038|  3.50k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.50k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.50k|        topology_split_data_.push_back(event_data);
 1041|  3.50k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    301|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.25k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.95k, False: 301]
  ------------------
 1045|  2.95k|        uint32_t edge_data;
 1046|  2.95k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 480, False: 2.47k]
  ------------------
 1047|    480|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.47k|        } else {
 1049|  2.47k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.47k|        }
 1051|  2.95k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  2.95k|        event_data.source_edge = edge_data & 1;
 1053|  2.95k|      }
 1054|    301|      decoder_buffer->EndBitDecoding();
 1055|    301|    }
 1056|    385|  }
 1057|  2.08k|  uint32_t num_hole_events = 0;
 1058|  2.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.08k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 105, False: 1.97k]
  ------------------
 1060|    105|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 102]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  1.97k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.97k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 172, False: 1.80k]
  ------------------
 1064|    172|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 11, False: 161]
  ------------------
 1065|     11|      return -1;
 1066|     11|    }
 1067|    172|  }
 1068|  2.07k|#endif
 1069|  2.07k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 56, False: 2.01k]
  ------------------
 1070|     56|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     56|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     56|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 24, False: 32]
  ------------------
 1072|   320k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 320k, False: 3]
  ------------------
 1073|   320k|        HoleEventData event_data;
 1074|   320k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 21, False: 320k]
  ------------------
 1075|     21|          return -1;
 1076|     21|        }
 1077|   320k|        hole_event_data_.push_back(event_data);
 1078|   320k|      }
 1079|       |
 1080|     24|    } else
 1081|     32|#endif
 1082|     32|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     32|      int last_symbol_id = 0;
 1085|    819|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 797, False: 22]
  ------------------
 1086|    797|        HoleEventData event_data;
 1087|    797|        uint32_t delta;
 1088|    797|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 10, False: 787]
  ------------------
 1089|     10|          return -1;
 1090|     10|        }
 1091|    787|        event_data.symbol_id = delta + last_symbol_id;
 1092|    787|        last_symbol_id = event_data.symbol_id;
 1093|    787|        hole_event_data_.push_back(event_data);
 1094|    787|      }
 1095|     32|    }
 1096|     56|  }
 1097|  2.03k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.07k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|      8|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|      8|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|      8|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     32|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 24, False: 8]
  ------------------
 1109|     24|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     24|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 8, False: 16]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     16|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 8, False: 8]
  ------------------
 1114|      8|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|      8|      }
 1116|      8|      continue;
 1117|      8|    }
 1118|       |
 1119|     32|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 16, False: 16]
  ------------------
 1120|     16|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     16|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 6, False: 10]
  ------------------
 1122|      6|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|      6|      }
 1124|     16|    }
 1125|     16|  }
 1126|      8|  return true;
 1127|      8|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   309k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   309k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   309k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   309k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.23M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 929k, False: 309k]
  ------------------
 1139|   929k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   929k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 181k, False: 748k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   362k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 181k, False: 181k]
  ------------------
 1144|   181k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   181k|      }
 1146|   181k|      continue;
 1147|   181k|    }
 1148|   748k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   748k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 374k, False: 374k]
  ------------------
 1151|   374k|      continue;
 1152|   374k|    }
 1153|       |
 1154|   748k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 374k, False: 374k]
  ------------------
 1155|   374k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   374k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 168k, False: 205k]
  ------------------
 1157|   168k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   168k|      }
 1159|   374k|    }
 1160|   374k|  }
 1161|   309k|  return true;
 1162|   309k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    148|    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|    148|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    148|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 19, False: 129]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  80.5k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 80.5k, False: 19]
  ------------------
 1176|  80.5k|      Mesh::Face face;
 1177|  80.5k|      const CornerIndex start_corner(3 * f.value());
 1178|   322k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 241k, False: 80.5k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   241k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   241k|        face[c] = vert_id;
 1182|   241k|      }
 1183|  80.5k|      decoder_->mesh()->SetFace(f, face);
 1184|  80.5k|    }
 1185|     19|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     19|    return true;
 1187|     19|  }
 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|    129|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    129|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   237k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 236k, False: 113]
  ------------------
 1197|   236k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   236k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 49, False: 236k]
  ------------------
 1199|     49|      continue;  // Isolated vertex.
 1200|     49|    }
 1201|   236k|    CornerIndex deduplication_first_corner = c;
 1202|   236k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 179k, False: 56.9k]
  ------------------
 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|   179k|      deduplication_first_corner = c;
 1206|   179k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  66.0k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 56.9k, False: 9.02k]
  ------------------
 1210|  56.9k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 8.85k, False: 48.1k]
  ------------------
 1211|  8.85k|          continue;  // No seam for this attribute, ignore it.
 1212|  8.85k|        }
 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|  48.1k|        const VertexIndex vert_id =
 1217|  48.1k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  48.1k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  48.1k|        bool seam_found = false;
 1220|  52.4k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 52.2k, False: 217]
  ------------------
 1221|  52.2k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 16, False: 52.2k]
  ------------------
 1222|     16|            return false;
 1223|     16|          }
 1224|  52.2k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 47.9k, False: 4.32k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  47.9k|            deduplication_first_corner = act_c;
 1227|  47.9k|            seam_found = true;
 1228|  47.9k|            break;
 1229|  47.9k|          }
 1230|  4.32k|          act_c = corner_table_->SwingRight(act_c);
 1231|  4.32k|        }
 1232|  48.1k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 47.9k, False: 217]
  ------------------
 1233|  47.9k|          break;  // No reason to process other attributes if we found a seam.
 1234|  47.9k|        }
 1235|  48.1k|      }
 1236|  56.9k|    }
 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|   236k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   236k|    corner_to_point_map[c.value()] =
 1246|   236k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   236k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   236k|    CornerIndex prev_c = c;
 1250|   236k|    c = corner_table_->SwingRight(c);
 1251|   830k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 650k, False: 180k]
  |  Branch (1251:40): [True: 593k, False: 56.5k]
  ------------------
 1252|   593k|      bool attribute_seam = false;
 1253|  1.09M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 593k, False: 502k]
  ------------------
 1254|   593k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 91.0k, False: 502k]
  ------------------
 1255|   593k|            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|  91.0k|          attribute_seam = true;
 1259|  91.0k|          break;
 1260|  91.0k|        }
 1261|   593k|      }
 1262|   593k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 91.0k, False: 502k]
  ------------------
 1263|  91.0k|        corner_to_point_map[c.value()] =
 1264|  91.0k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  91.0k|        point_to_corner_map.push_back(c.value());
 1266|   502k|      } else {
 1267|   502k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   502k|      }
 1269|   593k|      prev_c = c;
 1270|   593k|      c = corner_table_->SwingRight(c);
 1271|   593k|    }
 1272|   236k|  }
 1273|       |  // Add faces.
 1274|  78.3k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 78.2k, False: 113]
  ------------------
 1275|  78.2k|    Mesh::Face face;
 1276|   312k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 234k, False: 78.2k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   234k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   234k|    }
 1280|  78.2k|    decoder_->mesh()->SetFace(f, face);
 1281|  78.2k|  }
 1282|    113|  decoder_->point_cloud()->set_num_points(
 1283|    113|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    113|  return true;
 1285|    129|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    128|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    128|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    128|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    128|  const Mesh *mesh = decoder_->mesh();
  115|    128|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    128|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    128|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    128|                           encoding_data);
  120|       |
  121|    128|  TraverserT att_traverser;
  122|    128|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    128|  traversal_sequencer->SetTraverser(att_traverser);
  125|    128|  return std::move(traversal_sequencer);
  126|    128|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    624|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    624|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    624|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    624|  const Mesh *mesh = decoder_->mesh();
  115|    624|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    624|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    624|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    624|                           encoding_data);
  120|       |
  121|    624|  TraverserT att_traverser;
  122|    624|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    624|  traversal_sequencer->SetTraverser(att_traverser);
  125|    624|  return std::move(traversal_sequencer);
  126|    624|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    209|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    209|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    209|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    209|  const Mesh *mesh = decoder_->mesh();
  115|    209|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    209|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    209|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    209|                           encoding_data);
  120|       |
  121|    209|  TraverserT att_traverser;
  122|    209|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    209|  traversal_sequencer->SetTraverser(att_traverser);
  125|    209|  return std::move(traversal_sequencer);
  126|    209|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    616|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    616|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    616|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    616|  const Mesh *mesh = decoder_->mesh();
  115|    616|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    616|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    616|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    616|                           encoding_data);
  120|       |
  121|    616|  TraverserT att_traverser;
  122|    616|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    616|  traversal_sequencer->SetTraverser(att_traverser);
  125|    616|  return std::move(traversal_sequencer);
  126|    616|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     25|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     25|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     25|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     25|  const Mesh *mesh = decoder_->mesh();
  115|     25|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     25|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     25|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     25|                           encoding_data);
  120|       |
  121|     25|  TraverserT att_traverser;
  122|     25|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     25|  traversal_sequencer->SetTraverser(att_traverser);
  125|     25|  return std::move(traversal_sequencer);
  126|     25|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     20|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     20|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     20|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     20|  const Mesh *mesh = decoder_->mesh();
  115|     20|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     20|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     20|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     20|                           encoding_data);
  120|       |
  121|     20|  TraverserT att_traverser;
  122|     20|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     20|  traversal_sequencer->SetTraverser(att_traverser);
  125|     20|  return std::move(traversal_sequencer);
  126|     20|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  6.47k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.19k|  const CornerTable *GetCornerTable() const override {
   67|  2.19k|    return corner_table_.get();
   68|  2.19k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  3.82M|                       int *out_encoder_split_symbol_id) {
   87|  3.82M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 21.5k, False: 3.80M]
  ------------------
   88|  21.5k|      return false;
   89|  21.5k|    }
   90|  3.80M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 16, False: 3.80M]
  ------------------
   91|  3.80M|        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|     16|      *out_encoder_split_symbol_id = -1;
   98|     16|      return true;
   99|     16|    }
  100|  3.80M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 3.80M, False: 1.13k]
  ------------------
  101|  3.80M|      return false;
  102|  3.80M|    }
  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|  3.80M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  13.5M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  13.5M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  13.5M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  13.5M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  13.7k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  5.94k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  3.89k|  const CornerTable *GetCornerTable() const override {
   67|  3.89k|    return corner_table_.get();
   68|  3.89k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  24.7M|                       int *out_encoder_split_symbol_id) {
   87|  24.7M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 24.6M, False: 54.2k]
  ------------------
   88|  24.6M|      return false;
   89|  24.6M|    }
   90|  54.2k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 22, False: 54.2k]
  ------------------
   91|  54.2k|        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|     22|      *out_encoder_split_symbol_id = -1;
   98|     22|      return true;
   99|     22|    }
  100|  54.2k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 52.8k, False: 1.34k]
  ------------------
  101|  52.8k|      return false;
  102|  52.8k|    }
  103|  1.34k|    *out_face_edge =
  104|  1.34k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.34k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.34k|    topology_split_data_.pop_back();
  108|  1.34k|    return true;
  109|  54.2k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  73.7M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  73.7M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  73.7M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  73.7M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  9.29k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  11.0k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.18k|  const CornerTable *GetCornerTable() const override {
   67|  2.18k|    return corner_table_.get();
   68|  2.18k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  44.0M|                       int *out_encoder_split_symbol_id) {
   87|  44.0M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 43.6M, False: 429k]
  ------------------
   88|  43.6M|      return false;
   89|  43.6M|    }
   90|   429k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 36, False: 429k]
  ------------------
   91|   429k|        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|     36|      *out_encoder_split_symbol_id = -1;
   98|     36|      return true;
   99|     36|    }
  100|   429k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 428k, False: 1.01k]
  ------------------
  101|   428k|      return false;
  102|   428k|    }
  103|  1.01k|    *out_face_edge =
  104|  1.01k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.01k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.01k|    topology_split_data_.pop_back();
  108|  1.01k|    return true;
  109|   429k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  58.2M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  58.2M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  58.2M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  58.2M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  12.9k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  7.45k|      : attribute_connectivity_decoders_(nullptr),
   34|  7.45k|        num_attribute_data_(0),
   35|  7.45k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  6.18k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  6.18k|    decoder_impl_ = decoder;
   38|  6.18k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  6.18k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  6.18k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  6.18k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  4.90k|  uint16_t BitstreamVersion() const {
   45|  4.90k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  4.90k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.15k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  6.18k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  4.14k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  4.14k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 154, False: 3.98k]
  ------------------
   63|    154|      return false;
   64|    154|    }
   65|       |
   66|  3.98k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 118, False: 3.86k]
  ------------------
   67|    118|      return false;
   68|    118|    }
   69|       |
   70|  3.86k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 26, False: 3.84k]
  ------------------
   71|     26|      return false;
   72|     26|    }
   73|  3.84k|    *out_buffer = buffer_;
   74|  3.84k|    return true;
   75|  3.86k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  4.38M|  inline bool DecodeStartFaceConfiguration() {
   79|  4.38M|    uint32_t face_configuration;
   80|  4.38M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  4.38M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.38M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 481, False: 4.38M]
  ------------------
   82|    481|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    481|    } else
   85|  4.38M|#endif
   86|  4.38M|    {
   87|  4.38M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  4.38M|    }
   89|  4.38M|    return face_configuration;
   90|  4.38M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  9.83M|  inline uint32_t DecodeSymbol() {
   94|  9.83M|    uint32_t symbol;
   95|  9.83M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  9.83M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 4.56M, False: 5.27M]
  ------------------
   97|  4.56M|      return symbol;
   98|  4.56M|    }
   99|       |    // Else decode two additional bits.
  100|  5.27M|    uint32_t symbol_suffix;
  101|  5.27M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  5.27M|    symbol |= (symbol_suffix << 1);
  103|  5.27M|    return symbol;
  104|  9.83M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  9.75M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  1.41M|  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|  3.55k|  void Done() {
  123|  3.55k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 3.41k, False: 143]
  ------------------
  124|  3.41k|      symbol_buffer_.EndBitDecoding();
  125|  3.41k|    }
  126|  3.55k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  3.55k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.55k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 250, False: 3.30k]
  ------------------
  128|    250|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    250|    } else
  131|  3.30k|#endif
  132|  3.30k|    {
  133|  3.30k|      start_face_decoder_.EndDecoding();
  134|  3.30k|    }
  135|  3.55k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  1.83k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  4.37k|  bool DecodeTraversalSymbols() {
  141|  4.37k|    uint64_t traversal_size;
  142|  4.37k|    symbol_buffer_ = buffer_;
  143|  4.37k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 50, False: 4.32k]
  ------------------
  144|     50|      return false;
  145|     50|    }
  146|  4.32k|    buffer_ = symbol_buffer_;
  147|  4.32k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 175, False: 4.15k]
  ------------------
  148|    175|      return false;
  149|    175|    }
  150|  4.15k|    buffer_.Advance(traversal_size);
  151|  4.15k|    return true;
  152|  4.32k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  5.95k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  5.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  5.95k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 522, False: 5.43k]
  ------------------
  158|    522|      start_face_buffer_ = buffer_;
  159|    522|      uint64_t traversal_size;
  160|    522|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 4, False: 518]
  ------------------
  161|      4|        return false;
  162|      4|      }
  163|    518|      buffer_ = start_face_buffer_;
  164|    518|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 181, False: 337]
  ------------------
  165|    181|        return false;
  166|    181|      }
  167|    337|      buffer_.Advance(traversal_size);
  168|    337|      return true;
  169|    518|    }
  170|  5.43k|#endif
  171|  5.43k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  5.95k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  5.72k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  5.72k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 3.73k, False: 1.98k]
  ------------------
  177|  3.73k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  3.73k|          new BinaryDecoder[num_attribute_data_]);
  179|  10.3k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 6.68k, False: 3.69k]
  ------------------
  180|  6.68k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 44, False: 6.63k]
  ------------------
  181|     44|          return false;
  182|     44|        }
  183|  6.68k|      }
  184|  3.73k|    }
  185|  5.67k|    return true;
  186|  5.72k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  4.48k|MeshSequentialDecoder::MeshSequentialDecoder() {}
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  4.32k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  4.32k|  uint32_t num_faces;
   31|  4.32k|  uint32_t num_points;
   32|  4.32k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  4.32k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.32k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 718, False: 3.60k]
  ------------------
   34|    718|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 9, False: 709]
  ------------------
   35|      9|      return false;
   36|      9|    }
   37|    709|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 6, False: 703]
  ------------------
   38|      6|      return false;
   39|      6|    }
   40|       |
   41|    709|  } else
   42|  3.60k|#endif
   43|  3.60k|  {
   44|  3.60k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 6, False: 3.60k]
  ------------------
   45|      6|      return false;
   46|      6|    }
   47|  3.60k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 12, False: 3.59k]
  ------------------
   48|     12|      return false;
   49|     12|    }
   50|  3.60k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  4.29k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  4.29k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 1, False: 4.29k]
  ------------------
   56|      1|    return false;
   57|      1|  }
   58|  4.29k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 29, False: 4.26k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|     29|    return false;
   62|     29|  }
   63|  4.26k|  uint8_t connectivity_method;
   64|  4.26k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 2, False: 4.26k]
  ------------------
   65|      2|    return false;
   66|      2|  }
   67|  4.26k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 3.44k, False: 821]
  ------------------
   68|  3.44k|    if (!DecodeAndDecompressIndices(num_faces)) {
  ------------------
  |  Branch (68:9): [True: 3.28k, False: 153]
  ------------------
   69|  3.28k|      return false;
   70|  3.28k|    }
   71|  3.44k|  } else {
   72|    821|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 630, False: 191]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  2.06k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 1.44k, False: 622]
  ------------------
   75|  1.44k|        Mesh::Face face;
   76|  5.77k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 4.33k, False: 1.43k]
  ------------------
   77|  4.33k|          uint8_t val;
   78|  4.33k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 8, False: 4.32k]
  ------------------
   79|      8|            return false;
   80|      8|          }
   81|  4.32k|          face[j] = val;
   82|  4.32k|        }
   83|  1.43k|        mesh()->AddFace(face);
   84|  1.43k|      }
   85|    630|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (85:16): [True: 81, False: 110]
  ------------------
   86|       |      // Decode indices as uint16_t.
   87|  38.9k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (87:28): [True: 38.9k, False: 52]
  ------------------
   88|  38.9k|        Mesh::Face face;
   89|   155k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (89:25): [True: 116k, False: 38.9k]
  ------------------
   90|   116k|          uint16_t val;
   91|   116k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (91:15): [True: 29, False: 116k]
  ------------------
   92|     29|            return false;
   93|     29|          }
   94|   116k|          face[j] = val;
   95|   116k|        }
   96|  38.9k|        mesh()->AddFace(face);
   97|  38.9k|      }
   98|    110|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (98:16): [True: 44, False: 66]
  ------------------
   99|     44|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     44|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (99:16): [True: 37, False: 7]
  ------------------
  100|       |      // Decode indices as uint32_t.
  101|    320|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (101:28): [True: 302, False: 18]
  ------------------
  102|    302|        Mesh::Face face;
  103|  1.17k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (103:25): [True: 890, False: 283]
  ------------------
  104|    890|          uint32_t val;
  105|    890|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (105:15): [True: 19, False: 871]
  ------------------
  106|     19|            return false;
  107|     19|          }
  108|    871|          face[j] = val;
  109|    871|        }
  110|    283|        mesh()->AddFace(face);
  111|    283|      }
  112|     73|    } else {
  113|       |      // Decode faces as uint32_t (default).
  114|    850|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (114:28): [True: 811, False: 39]
  ------------------
  115|    811|        Mesh::Face face;
  116|  3.16k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (116:25): [True: 2.38k, False: 777]
  ------------------
  117|  2.38k|          uint32_t val;
  118|  2.38k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (118:15): [True: 34, False: 2.35k]
  ------------------
  119|     34|            return false;
  120|     34|          }
  121|  2.35k|          face[j] = val;
  122|  2.35k|        }
  123|    777|        mesh()->AddFace(face);
  124|    777|      }
  125|     73|    }
  126|    821|  }
  127|    884|  point_cloud()->set_num_points(num_points);
  128|    884|  return true;
  129|  4.26k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  131|  17.9k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  132|       |  // Always create the basic attribute decoder.
  133|  17.9k|  return SetAttributesDecoder(
  134|  17.9k|      att_decoder_id,
  135|  17.9k|      std::unique_ptr<AttributesDecoder>(
  136|  17.9k|          new SequentialAttributeDecodersController(
  137|  17.9k|              std::unique_ptr<PointsSequencer>(
  138|  17.9k|                  new LinearSequencer(point_cloud()->num_points())))));
  139|  17.9k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEj:
  141|  3.44k|bool MeshSequentialDecoder::DecodeAndDecompressIndices(uint32_t num_faces) {
  142|       |  // Get decoded indices differences that were encoded with an entropy code.
  143|  3.44k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  144|  3.44k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (144:7): [True: 3.20k, False: 231]
  ------------------
  145|  3.20k|    return false;
  146|  3.20k|  }
  147|       |  // Reconstruct the indices from the differences.
  148|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  149|    231|  int32_t last_index_value = 0;  // This will always be >= 0.
  150|    231|  int vertex_index = 0;
  151|    832|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (151:24): [True: 679, False: 153]
  ------------------
  152|    679|    Mesh::Face face;
  153|  2.51k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (153:21): [True: 1.91k, False: 601]
  ------------------
  154|  1.91k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  155|  1.91k|      int32_t index_diff = (encoded_val >> 1);
  156|  1.91k|      if (encoded_val & 1) {
  ------------------
  |  Branch (156:11): [True: 395, False: 1.52k]
  ------------------
  157|    395|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (157:13): [True: 58, False: 337]
  ------------------
  158|       |          // Subtracting index_diff would result in a negative index.
  159|     58|          return false;
  160|     58|        }
  161|    337|        index_diff = -index_diff;
  162|  1.52k|      } else {
  163|  1.52k|        if (index_diff >
  ------------------
  |  Branch (163:13): [True: 20, False: 1.50k]
  ------------------
  164|  1.52k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  165|       |          // Adding index_diff to last_index_value would overflow.
  166|     20|          return false;
  167|     20|        }
  168|  1.52k|      }
  169|  1.83k|      const int32_t index_value = index_diff + last_index_value;
  170|  1.83k|      face[j] = index_value;
  171|  1.83k|      last_index_value = index_value;
  172|  1.83k|    }
  173|    601|    mesh()->AddFace(face);
  174|    601|  }
  175|    153|  return true;
  176|    231|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.21k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.73M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.73M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.73M, False: 2.87k]
  ------------------
   61|  2.73M|      return true;  // Already traversed.
   62|  2.73M|    }
   63|       |
   64|  2.87k|    corner_traversal_stack_.clear();
   65|  2.87k|    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.87k|    const VertexIndex next_vert =
   69|  2.87k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.87k|    const VertexIndex prev_vert =
   71|  2.87k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.87k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.87k]
  |  Branch (72:45): [True: 0, False: 2.87k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.87k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.30k, False: 564]
  ------------------
   76|  2.30k|      this->MarkVertexVisited(next_vert);
   77|  2.30k|      this->traversal_observer().OnNewVertexVisited(
   78|  2.30k|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.30k|    }
   80|  2.87k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.50k, False: 370]
  ------------------
   81|  2.50k|      this->MarkVertexVisited(prev_vert);
   82|  2.50k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.50k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.50k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  20.3k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 17.4k, False: 2.87k]
  ------------------
   88|       |      // Currently processed corner.
   89|  17.4k|      corner_id = corner_traversal_stack_.back();
   90|  17.4k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  17.4k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 17.4k]
  |  Branch (92:47): [True: 829, False: 16.6k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    829|        corner_traversal_stack_.pop_back();
   95|    829|        continue;
   96|    829|      }
   97|  2.73M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.73M, Folded]
  ------------------
   98|  2.73M|        this->MarkFaceVisited(face_id);
   99|  2.73M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.73M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.73M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.73M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.73M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.38M, False: 1.35M]
  ------------------
  105|  1.38M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.38M|          this->MarkVertexVisited(vert_id);
  107|  1.38M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.38M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.34M, False: 32.1k]
  ------------------
  109|  1.34M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.34M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.34M|            continue;
  112|  1.34M|          }
  113|  1.38M|        }
  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.38M|        const CornerIndex right_corner_id =
  118|  1.38M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.38M|        const CornerIndex left_corner_id =
  120|  1.38M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.38M|        const FaceIndex right_face_id(
  122|  1.38M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 21.3k, False: 1.36M]
  ------------------
  123|  1.38M|                 ? kInvalidFaceIndex
  124|  1.38M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.38M|        const FaceIndex left_face_id(
  126|  1.38M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 12.4k, False: 1.37M]
  ------------------
  127|  1.38M|                 ? kInvalidFaceIndex
  128|  1.38M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.38M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.35M, False: 32.0k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.35M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 9.32k, False: 1.34M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  9.32k|            corner_traversal_stack_.pop_back();
  134|  9.32k|            break;  // Break from the while (true) loop.
  135|  1.34M|          } else {
  136|       |            // Go to the left face.
  137|  1.34M|            corner_id = left_corner_id;
  138|  1.34M|            face_id = left_face_id;
  139|  1.34M|          }
  140|  1.35M|        } else {
  141|       |          // Right face was not visited.
  142|  32.0k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 24.7k, False: 7.28k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  24.7k|            corner_id = right_corner_id;
  145|  24.7k|            face_id = right_face_id;
  146|  24.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|  7.28k|            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|  7.28k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  7.28k|            break;
  159|  7.28k|          }
  160|  32.0k|        }
  161|  1.38M|      }
  162|  16.6k|    }
  163|  2.87k|    return true;
  164|  2.87k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.21k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.52k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.48k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.53M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.53M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 886k, False: 2.64M]
  ------------------
   61|   886k|      return true;  // Already traversed.
   62|   886k|    }
   63|       |
   64|  2.64M|    corner_traversal_stack_.clear();
   65|  2.64M|    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.64M|    const VertexIndex next_vert =
   69|  2.64M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.64M|    const VertexIndex prev_vert =
   71|  2.64M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.64M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.64M]
  |  Branch (72:45): [True: 0, False: 2.64M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.64M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.64M, False: 1.46k]
  ------------------
   76|  2.64M|      this->MarkVertexVisited(next_vert);
   77|  2.64M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.64M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.64M|    }
   80|  2.64M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.64M, False: 1.24k]
  ------------------
   81|  2.64M|      this->MarkVertexVisited(prev_vert);
   82|  2.64M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.64M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.64M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  5.35M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.71M, False: 2.64M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.71M|      corner_id = corner_traversal_stack_.back();
   90|  2.71M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.71M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.71M]
  |  Branch (92:47): [True: 5.20k, False: 2.70M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  5.20k|        corner_traversal_stack_.pop_back();
   95|  5.20k|        continue;
   96|  5.20k|      }
   97|  3.53M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.53M, Folded]
  ------------------
   98|  3.53M|        this->MarkFaceVisited(face_id);
   99|  3.53M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.53M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.53M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.53M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.53M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.10M, False: 422k]
  ------------------
  105|  3.10M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.10M|          this->MarkVertexVisited(vert_id);
  107|  3.10M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.10M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 408k, False: 2.69M]
  ------------------
  109|   408k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   408k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   408k|            continue;
  112|   408k|          }
  113|  3.10M|        }
  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.12M|        const CornerIndex right_corner_id =
  118|  3.12M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.12M|        const CornerIndex left_corner_id =
  120|  3.12M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.12M|        const FaceIndex right_face_id(
  122|  3.12M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.67M, False: 447k]
  ------------------
  123|  3.12M|                 ? kInvalidFaceIndex
  124|  3.12M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.12M|        const FaceIndex left_face_id(
  126|  3.12M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.66M, False: 452k]
  ------------------
  127|  3.12M|                 ? kInvalidFaceIndex
  128|  3.12M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.12M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.06M, False: 52.6k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.06M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.67M, False: 396k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.67M|            corner_traversal_stack_.pop_back();
  134|  2.67M|            break;  // Break from the while (true) loop.
  135|  2.67M|          } else {
  136|       |            // Go to the left face.
  137|   396k|            corner_id = left_corner_id;
  138|   396k|            face_id = left_face_id;
  139|   396k|          }
  140|  3.06M|        } else {
  141|       |          // Right face was not visited.
  142|  52.6k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 19.2k, False: 33.4k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  19.2k|            corner_id = right_corner_id;
  145|  19.2k|            face_id = right_face_id;
  146|  33.4k|          } 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|  33.4k|            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|  33.4k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  33.4k|            break;
  159|  33.4k|          }
  160|  52.6k|        }
  161|  3.12M|      }
  162|  2.70M|    }
  163|  2.64M|    return true;
  164|  2.64M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.48k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.08k|  DepthFirstTraverser() {}

_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   58|    337|  void OnTraversalStart() {
   59|    337|    prediction_degree_.resize(this->corner_table()->num_vertices(), 0);
   60|    337|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.61M|  bool TraverseFromCorner(CornerIndex corner_id) {
   66|  2.61M|    if (prediction_degree_.size() == 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2.61M]
  ------------------
   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.61M|    traversal_stacks_[0].push_back(corner_id);
   74|  2.61M|    best_priority_ = 0;
   75|       |    // For the first face, check the remaining corners as they may not be
   76|       |    // processed yet.
   77|  2.61M|    const VertexIndex next_vert =
   78|  2.61M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   79|  2.61M|    const VertexIndex prev_vert =
   80|  2.61M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   81|  2.61M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (81:9): [True: 1.24k, False: 2.60M]
  ------------------
   82|  1.24k|      this->MarkVertexVisited(next_vert);
   83|  1.24k|      this->traversal_observer().OnNewVertexVisited(
   84|  1.24k|          next_vert, this->corner_table()->Next(corner_id));
   85|  1.24k|    }
   86|  2.61M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (86:9): [True: 1.38k, False: 2.60M]
  ------------------
   87|  1.38k|      this->MarkVertexVisited(prev_vert);
   88|  1.38k|      this->traversal_observer().OnNewVertexVisited(
   89|  1.38k|          prev_vert, this->corner_table()->Previous(corner_id));
   90|  1.38k|    }
   91|  2.61M|    const VertexIndex tip_vertex = this->corner_table()->Vertex(corner_id);
   92|  2.61M|    if (!this->IsVertexVisited(tip_vertex)) {
  ------------------
  |  Branch (92:9): [True: 1.10k, False: 2.60M]
  ------------------
   93|  1.10k|      this->MarkVertexVisited(tip_vertex);
   94|  1.10k|      this->traversal_observer().OnNewVertexVisited(tip_vertex, corner_id);
   95|  1.10k|    }
   96|       |    // Start the actual traversal.
   97|  7.59M|    while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
  ------------------
  |  Branch (97:12): [True: 4.98M, False: 2.61M]
  ------------------
   98|  4.98M|      FaceIndex face_id(corner_id.value() / 3);
   99|       |      // Make sure the face hasn't been visited yet.
  100|  4.98M|      if (this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (100:11): [True: 3.89M, False: 1.08M]
  ------------------
  101|       |        // This face has been already traversed.
  102|  3.89M|        continue;
  103|  3.89M|      }
  104|       |
  105|  2.61M|      while (true) {
  ------------------
  |  Branch (105:14): [True: 2.61M, Folded]
  ------------------
  106|  2.61M|        face_id = FaceIndex(corner_id.value() / 3);
  107|  2.61M|        this->MarkFaceVisited(face_id);
  108|  2.61M|        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.61M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  113|  2.61M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (113:13): [True: 1.32M, False: 1.28M]
  ------------------
  114|  1.32M|          this->MarkVertexVisited(vert_id);
  115|  1.32M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  116|  1.32M|        }
  117|       |
  118|       |        // Check whether we can traverse to the right and left neighboring
  119|       |        // faces.
  120|  2.61M|        const CornerIndex right_corner_id =
  121|  2.61M|            this->corner_table()->GetRightCorner(corner_id);
  122|  2.61M|        const CornerIndex left_corner_id =
  123|  2.61M|            this->corner_table()->GetLeftCorner(corner_id);
  124|  2.61M|        const FaceIndex right_face_id(
  125|  2.61M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (125:14): [True: 16.5k, False: 2.59M]
  ------------------
  126|  2.61M|                 ? kInvalidFaceIndex
  127|  2.61M|                 : FaceIndex(right_corner_id.value() / 3)));
  128|  2.61M|        const FaceIndex left_face_id(
  129|  2.61M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (129:14): [True: 18.9k, False: 2.59M]
  ------------------
  130|  2.61M|                 ? kInvalidFaceIndex
  131|  2.61M|                 : FaceIndex(left_corner_id.value() / 3)));
  132|  2.61M|        const bool is_right_face_visited = this->IsFaceVisited(right_face_id);
  133|  2.61M|        const bool is_left_face_visited = this->IsFaceVisited(left_face_id);
  134|       |
  135|  2.61M|        if (!is_left_face_visited) {
  ------------------
  |  Branch (135:13): [True: 2.05M, False: 558k]
  ------------------
  136|       |          // We can go to the left face.
  137|  2.05M|          const int priority = ComputePriority(left_corner_id);
  138|  2.05M|          if (is_right_face_visited && priority <= best_priority_) {
  ------------------
  |  Branch (138:15): [True: 759k, False: 1.29M]
  |  Branch (138:40): [True: 737k, False: 21.9k]
  ------------------
  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|   737k|            corner_id = left_corner_id;
  144|   737k|            continue;
  145|  1.31M|          } else {
  146|  1.31M|            AddCornerToTraversalStack(left_corner_id, priority);
  147|  1.31M|          }
  148|  2.05M|        }
  149|  1.87M|        if (!is_right_face_visited) {
  ------------------
  |  Branch (149:13): [True: 1.84M, False: 28.5k]
  ------------------
  150|       |          // Go to the right face.
  151|  1.84M|          const int priority = ComputePriority(right_corner_id);
  152|  1.84M|          if (priority <= best_priority_) {
  ------------------
  |  Branch (152:15): [True: 790k, False: 1.05M]
  ------------------
  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|   790k|            corner_id = right_corner_id;
  156|   790k|            continue;
  157|  1.05M|          } else {
  158|  1.05M|            AddCornerToTraversalStack(right_corner_id, priority);
  159|  1.05M|          }
  160|  1.84M|        }
  161|       |
  162|       |        // Couldn't proceed directly to the next corner
  163|  1.08M|        break;
  164|  1.87M|      }
  165|  1.08M|    }
  166|  2.61M|    return true;
  167|  2.61M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE23PopNextCornerToTraverseEv:
  173|  7.59M|  CornerIndex PopNextCornerToTraverse() {
  174|  15.9M|    for (int i = best_priority_; i < kMaxPriority; ++i) {
  ------------------
  |  Branch (174:34): [True: 13.3M, False: 2.61M]
  ------------------
  175|  13.3M|      if (!traversal_stacks_[i].empty()) {
  ------------------
  |  Branch (175:11): [True: 4.98M, False: 8.37M]
  ------------------
  176|  4.98M|        const CornerIndex ret = traversal_stacks_[i].back();
  177|  4.98M|        traversal_stacks_[i].pop_back();
  178|  4.98M|        best_priority_ = i;
  179|  4.98M|        return ret;
  180|  4.98M|      }
  181|  13.3M|    }
  182|  2.61M|    return kInvalidCornerIndex;
  183|  7.59M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15ComputePriorityENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  194|  3.89M|  inline int ComputePriority(CornerIndex corner_id) {
  195|  3.89M|    const VertexIndex v_tip = this->corner_table()->Vertex(corner_id);
  196|       |    // Priority 0 when traversing to already visited vertices.
  197|  3.89M|    int priority = 0;
  198|  3.89M|    if (!this->IsVertexVisited(v_tip)) {
  ------------------
  |  Branch (198:9): [True: 2.60M, False: 1.29M]
  ------------------
  199|  2.60M|      const int degree = ++prediction_degree_[v_tip];
  200|       |      // Priority 1 when prediction degree > 1, otherwise 2.
  201|  2.60M|      priority = (degree > 1 ? 1 : 2);
  ------------------
  |  Branch (201:19): [True: 1.28M, False: 1.32M]
  ------------------
  202|  2.60M|    }
  203|       |    // Clamp the priority to the maximum number of buckets.
  204|  3.89M|    if (priority >= kMaxPriority) {
  ------------------
  |  Branch (204:9): [True: 0, False: 3.89M]
  ------------------
  205|      0|      priority = kMaxPriority - 1;
  206|      0|    }
  207|  3.89M|    return priority;
  208|  3.89M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE25AddCornerToTraversalStackENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEi:
  185|  2.36M|  inline void AddCornerToTraversalStack(CornerIndex ci, int priority) {
  186|  2.36M|    traversal_stacks_[priority].push_back(ci);
  187|       |    // Make sure that the best available priority is up to date.
  188|  2.36M|    if (priority < best_priority_) {
  ------------------
  |  Branch (188:9): [True: 539k, False: 1.83M]
  ------------------
  189|   539k|      best_priority_ = priority;
  190|   539k|    }
  191|  2.36M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   63|    337|  void OnTraversalEnd() {}
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   55|    724|  MaxPredictionDegreeTraverser() {}

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    362|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    918|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    918|    const auto *corner_table = traverser_.corner_table();
   50|    918|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    918|    const size_t num_faces = mesh_->num_faces();
   52|    918|    const size_t num_points = mesh_->num_points();
   53|  4.74M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.74M, False: 918]
  ------------------
   54|  4.74M|      const auto &face = mesh_->face(f);
   55|  18.9M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 14.2M, False: 4.74M]
  ------------------
   56|  14.2M|        const PointIndex point_id = face[p];
   57|  14.2M|        const VertexIndex vert_id =
   58|  14.2M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  14.2M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 14.2M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  14.2M|        const AttributeValueIndex att_entry_id(
   63|  14.2M|            encoding_data_
   64|  14.2M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  14.2M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 14.2M]
  |  Branch (65:13): [True: 0, False: 14.2M]
  |  Branch (65:39): [True: 0, False: 14.2M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  14.2M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  14.2M|      }
   71|  4.74M|    }
   72|    918|    return true;
   73|    918|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    337|  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|    337|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    337|    traverser_.OnTraversalStart();
   82|    337|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 337]
  ------------------
   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|    337|    } else {
   89|    337|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.61M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.61M, False: 337]
  ------------------
   91|  2.61M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.61M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.61M|      }
   95|    337|    }
   96|    337|    traverser_.OnTraversalEnd();
   97|    337|    return true;
   98|    337|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.61M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.61M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.61M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    362|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.26k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.37k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.37k|    const auto *corner_table = traverser_.corner_table();
   50|  5.37k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.37k|    const size_t num_faces = mesh_->num_faces();
   52|  5.37k|    const size_t num_points = mesh_->num_points();
   53|  4.44M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.43M, False: 5.37k]
  ------------------
   54|  4.43M|      const auto &face = mesh_->face(f);
   55|  17.7M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.3M, False: 4.43M]
  ------------------
   56|  13.3M|        const PointIndex point_id = face[p];
   57|  13.3M|        const VertexIndex vert_id =
   58|  13.3M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.3M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.3M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.3M|        const AttributeValueIndex att_entry_id(
   63|  13.3M|            encoding_data_
   64|  13.3M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.3M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.3M]
  |  Branch (65:13): [True: 0, False: 13.3M]
  |  Branch (65:39): [True: 0, False: 13.3M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.3M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.3M|      }
   71|  4.43M|    }
   72|  5.37k|    return true;
   73|  5.37k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.21k|  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.21k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.21k|    traverser_.OnTraversalStart();
   82|  1.21k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.21k]
  ------------------
   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.21k|    } else {
   89|  1.21k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.73M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.73M, False: 1.21k]
  ------------------
   91|  2.73M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.73M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.73M|      }
   95|  1.21k|    }
   96|  1.21k|    traverser_.OnTraversalEnd();
   97|  1.21k|    return true;
   98|  1.21k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.73M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.73M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.73M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.26k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.54k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  6.26k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  6.26k|    const auto *corner_table = traverser_.corner_table();
   50|  6.26k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  6.26k|    const size_t num_faces = mesh_->num_faces();
   52|  6.26k|    const size_t num_points = mesh_->num_points();
   53|  5.61M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.60M, False: 6.26k]
  ------------------
   54|  5.60M|      const auto &face = mesh_->face(f);
   55|  22.4M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 16.8M, False: 5.60M]
  ------------------
   56|  16.8M|        const PointIndex point_id = face[p];
   57|  16.8M|        const VertexIndex vert_id =
   58|  16.8M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  16.8M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 16.8M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  16.8M|        const AttributeValueIndex att_entry_id(
   63|  16.8M|            encoding_data_
   64|  16.8M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  16.8M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 16.8M]
  |  Branch (65:13): [True: 0, False: 16.8M]
  |  Branch (65:39): [True: 0, False: 16.8M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  16.8M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  16.8M|      }
   71|  5.60M|    }
   72|  6.26k|    return true;
   73|  6.26k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.48k|  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.48k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.48k|    traverser_.OnTraversalStart();
   82|  1.48k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.48k]
  ------------------
   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.48k|    } else {
   89|  1.48k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.53M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.53M, False: 1.48k]
  ------------------
   91|  3.53M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.53M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.53M|      }
   95|  1.48k|    }
   96|  1.48k|    traverser_.OnTraversalEnd();
   97|  1.48k|    return true;
   98|  1.48k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.53M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.53M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.53M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.54k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.08k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  33.0M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  17.0M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  17.0M|    return is_vertex_visited_[vert_id.value()];
   65|  17.0M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.71M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.71M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.71M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  8.05M|  inline TraversalObserverT &traversal_observer() {
   75|  8.05M|    return traversal_observer_;
   76|  8.05M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  12.9M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  12.9M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 69.4k, False: 12.9M]
  ------------------
   47|  69.4k|      return true;  // Invalid faces are always considered as visited.
   48|  69.4k|    }
   49|  12.9M|    return is_face_visited_[face_id.value()];
   50|  12.9M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  5.34M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  5.34M|    is_face_visited_[face_id.value()] = true;
   62|  5.34M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.24k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.24k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.62k|                    TraversalObserver traversal_observer) {
   37|  1.62k|    corner_table_ = corner_table;
   38|  1.62k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.62k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.62k|    traversal_observer_ = traversal_observer;
   41|  1.62k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.73M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.73M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.73M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.73M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.73M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  29.1M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.53M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.53M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.53M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.53M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.53M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  8.81M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  8.81M|    return is_vertex_visited_[vert_id.value()];
   65|  8.81M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  8.39M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  8.39M|    is_vertex_visited_[vert_id.value()] = true;
   68|  8.39M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  11.9M|  inline TraversalObserverT &traversal_observer() {
   75|  11.9M|    return traversal_observer_;
   76|  11.9M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  8.95M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  8.95M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 5.34M, False: 3.61M]
  ------------------
   47|  5.34M|      return true;  // Invalid faces are always considered as visited.
   48|  5.34M|    }
   49|  3.61M|    return is_face_visited_[face_id.value()];
   50|  8.95M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.53M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.53M|    is_face_visited_[face_id.value()] = true;
   62|  3.53M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.08k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.54k|                    TraversalObserver traversal_observer) {
   37|  1.54k|    corner_table_ = corner_table;
   38|  1.54k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.54k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.54k|    traversal_observer_ = traversal_observer;
   41|  1.54k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    239|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    239|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 13, False: 226]
  ------------------
  187|     13|    return false;
  188|     13|  }
  189|    226|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 214]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|    214|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 4, False: 210]
  ------------------
  193|      4|    return false;
  194|      4|  }
  195|    210|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 86, False: 124]
  ------------------
  196|     86|    return true;
  197|     86|  }
  198|    124|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 23, False: 101]
  ------------------
  199|     23|    return false;
  200|     23|  }
  201|    101|  num_decoded_points_ = 0;
  202|       |
  203|    101|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 22, False: 79]
  ------------------
  204|     22|    return false;
  205|     22|  }
  206|     79|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 75]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     75|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 74]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     74|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 4, False: 70]
  ------------------
  213|      4|    return false;
  214|      4|  }
  215|       |
  216|     70|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 48, False: 22]
  ------------------
  217|     48|    return false;
  218|     48|  }
  219|       |
  220|     22|  numbers_decoder_.EndDecoding();
  221|     22|  remaining_bits_decoder_.EndDecoding();
  222|     22|  axis_decoder_.EndDecoding();
  223|     22|  half_decoder_.EndDecoding();
  224|       |
  225|     22|  return true;
  226|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     70|    uint32_t num_points, OutputIteratorT &oit) {
  254|     70|  typedef DecodingStatus Status;
  255|     70|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     70|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     70|  DecodingStatus init_status(num_points, 0, 0);
  258|     70|  std::stack<Status> status_stack;
  259|     70|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.17M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.17M, False: 22]
  ------------------
  263|  3.17M|    const DecodingStatus status = status_stack.top();
  264|  3.17M|    status_stack.pop();
  265|       |
  266|  3.17M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.17M|    const uint32_t last_axis = status.last_axis;
  268|  3.17M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.17M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.17M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.17M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.17M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.17M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.17M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.17M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.17M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.17M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.58M, False: 1.58M]
  ------------------
  285|   321M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 319M, False: 1.58M]
  ------------------
  286|   319M|        *oit = old_base;
  287|   319M|        ++oit;
  288|   319M|        ++num_decoded_points_;
  289|   319M|      }
  290|  1.58M|      continue;
  291|  1.58M|    }
  292|       |
  293|  1.58M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.58M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.38k, False: 1.58M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.38k|      axes_[0] = axis;
  300|  7.82k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 6.44k, False: 1.38k]
  ------------------
  301|  6.44k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  6.44k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 442, False: 6.00k]
  |  |  ------------------
  ------------------
  302|  6.44k|      }
  303|  3.72k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.36k, False: 1.35k]
  ------------------
  304|  15.5k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 13.2k, False: 2.34k]
  ------------------
  305|  13.2k|          p_[axes_[j]] = 0;
  306|  13.2k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  13.2k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.57k, False: 9.66k]
  ------------------
  308|  3.57k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 24, False: 3.55k]
  ------------------
  309|  3.57k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     24|              return false;
  311|     24|            }
  312|  3.57k|          }
  313|  13.2k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  13.2k|        }
  315|  2.34k|        *oit = p_;
  316|  2.34k|        ++oit;
  317|  2.34k|        ++num_decoded_points_;
  318|  2.34k|      }
  319|  1.35k|      continue;
  320|  1.38k|    }
  321|       |
  322|  1.58M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.58M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.58M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.58M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.58M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.58M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.58M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.58M|    uint32_t number = 0;
  334|  1.58M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.58M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.58M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 24, False: 1.58M]
  ------------------
  338|       |      // Invalid |number|.
  339|     24|      return false;
  340|     24|    }
  341|  1.58M|    first_half -= number;
  342|  1.58M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.58M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 852k, False: 733k]
  ------------------
  345|   852k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 850k, False: 1.99k]
  ------------------
  346|   850k|        std::swap(first_half, second_half);
  347|   850k|      }
  348|   852k|    }
  349|       |
  350|  1.58M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.58M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.58M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.58M, False: 36]
  ------------------
  353|  1.58M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.58M|    }
  355|  1.58M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.58M, False: 102]
  ------------------
  356|  1.58M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.58M|    }
  358|  1.58M|  }
  359|     22|  return true;
  360|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  3.50M|        : num_remaining_points(num_remaining_points_),
  135|  3.50M|          last_axis(last_axis_),
  136|  3.50M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  1.75M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.75M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.75M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     85|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    347|      : bit_length_(0),
   87|    347|        num_points_(0),
   88|    347|        num_decoded_points_(0),
   89|    347|        dimension_(dimension),
   90|    347|        p_(dimension, 0),
   91|    347|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    347|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    347|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    188|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    188|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 7, False: 181]
  ------------------
  187|      7|    return false;
  188|      7|  }
  189|    181|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 13, False: 168]
  ------------------
  190|     13|    return false;
  191|     13|  }
  192|    168|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 165]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    165|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 35, False: 130]
  ------------------
  196|     35|    return true;
  197|     35|  }
  198|    130|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 17, False: 113]
  ------------------
  199|     17|    return false;
  200|     17|  }
  201|    113|  num_decoded_points_ = 0;
  202|       |
  203|    113|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 26, False: 87]
  ------------------
  204|     26|    return false;
  205|     26|  }
  206|     87|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 84]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     84|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 5, False: 79]
  ------------------
  210|      5|    return false;
  211|      5|  }
  212|     79|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 77]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     77|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 55, False: 22]
  ------------------
  217|     55|    return false;
  218|     55|  }
  219|       |
  220|     22|  numbers_decoder_.EndDecoding();
  221|     22|  remaining_bits_decoder_.EndDecoding();
  222|     22|  axis_decoder_.EndDecoding();
  223|     22|  half_decoder_.EndDecoding();
  224|       |
  225|     22|  return true;
  226|     77|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     77|    uint32_t num_points, OutputIteratorT &oit) {
  254|     77|  typedef DecodingStatus Status;
  255|     77|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     77|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     77|  DecodingStatus init_status(num_points, 0, 0);
  258|     77|  std::stack<Status> status_stack;
  259|     77|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.51M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.51M, False: 22]
  ------------------
  263|  2.51M|    const DecodingStatus status = status_stack.top();
  264|  2.51M|    status_stack.pop();
  265|       |
  266|  2.51M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.51M|    const uint32_t last_axis = status.last_axis;
  268|  2.51M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.51M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.51M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.51M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.51M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.51M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.51M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.51M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.51M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.51M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.25M, False: 1.25M]
  ------------------
  285|   300M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 299M, False: 1.25M]
  ------------------
  286|   299M|        *oit = old_base;
  287|   299M|        ++oit;
  288|   299M|        ++num_decoded_points_;
  289|   299M|      }
  290|  1.25M|      continue;
  291|  1.25M|    }
  292|       |
  293|  1.25M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.25M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.98k, False: 1.25M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.98k|      axes_[0] = axis;
  300|  13.6k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 11.6k, False: 1.98k]
  ------------------
  301|  11.6k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  11.6k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 453, False: 11.1k]
  |  |  ------------------
  ------------------
  302|  11.6k|      }
  303|  5.41k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.45k, False: 1.95k]
  ------------------
  304|  26.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 23.4k, False: 3.42k]
  ------------------
  305|  23.4k|          p_[axes_[j]] = 0;
  306|  23.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  23.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.61k, False: 18.8k]
  ------------------
  308|  4.61k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 29, False: 4.58k]
  ------------------
  309|  4.61k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     29|              return false;
  311|     29|            }
  312|  4.61k|          }
  313|  23.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  23.4k|        }
  315|  3.42k|        *oit = p_;
  316|  3.42k|        ++oit;
  317|  3.42k|        ++num_decoded_points_;
  318|  3.42k|      }
  319|  1.95k|      continue;
  320|  1.98k|    }
  321|       |
  322|  1.25M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.25M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.25M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.25M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.25M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.25M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.25M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.25M|    uint32_t number = 0;
  334|  1.25M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.25M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.25M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 26, False: 1.25M]
  ------------------
  338|       |      // Invalid |number|.
  339|     26|      return false;
  340|     26|    }
  341|  1.25M|    first_half -= number;
  342|  1.25M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.25M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 679k, False: 578k]
  ------------------
  345|   679k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 675k, False: 3.69k]
  ------------------
  346|   675k|        std::swap(first_half, second_half);
  347|   675k|      }
  348|   679k|    }
  349|       |
  350|  1.25M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.25M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.25M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.25M, False: 80]
  ------------------
  353|  1.25M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.25M|    }
  355|  1.25M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.25M, False: 319]
  ------------------
  356|  1.25M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.25M|    }
  358|  1.25M|  }
  359|     22|  return true;
  360|     77|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  4.14M|        : num_remaining_points(num_remaining_points_),
  135|  4.14M|          last_axis(last_axis_),
  136|  4.14M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.14M|    uint32_t last_axis) {
  232|  4.14M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.14M, Folded]
  ------------------
  233|  4.14M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.14M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.67M, False: 1.47M]
  |  |  ------------------
  ------------------
  234|  4.14M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.14M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  2.07M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.07M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.07M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     33|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    176|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    176|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 172]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    172|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 22, False: 150]
  ------------------
  190|     22|    return false;
  191|     22|  }
  192|    150|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 149]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    149|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 18, False: 131]
  ------------------
  196|     18|    return true;
  197|     18|  }
  198|    131|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 11, False: 120]
  ------------------
  199|     11|    return false;
  200|     11|  }
  201|    120|  num_decoded_points_ = 0;
  202|       |
  203|    120|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 21, False: 99]
  ------------------
  204|     21|    return false;
  205|     21|  }
  206|     99|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 11, False: 88]
  ------------------
  207|     11|    return false;
  208|     11|  }
  209|     88|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 84]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|     84|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 81]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     81|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 75, False: 6]
  ------------------
  217|     75|    return false;
  218|     75|  }
  219|       |
  220|      6|  numbers_decoder_.EndDecoding();
  221|      6|  remaining_bits_decoder_.EndDecoding();
  222|      6|  axis_decoder_.EndDecoding();
  223|      6|  half_decoder_.EndDecoding();
  224|       |
  225|      6|  return true;
  226|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     81|    uint32_t num_points, OutputIteratorT &oit) {
  254|     81|  typedef DecodingStatus Status;
  255|     81|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     81|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     81|  DecodingStatus init_status(num_points, 0, 0);
  258|     81|  std::stack<Status> status_stack;
  259|     81|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  28.7k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 28.7k, False: 6]
  ------------------
  263|  28.7k|    const DecodingStatus status = status_stack.top();
  264|  28.7k|    status_stack.pop();
  265|       |
  266|  28.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  28.7k|    const uint32_t last_axis = status.last_axis;
  268|  28.7k|    const uint32_t stack_pos = status.stack_pos;
  269|  28.7k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  28.7k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  28.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 28.7k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  28.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  28.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 28.7k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  28.7k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  28.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.78k, False: 23.9k]
  ------------------
  285|  3.91G|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.91G, False: 4.78k]
  ------------------
  286|  3.91G|        *oit = old_base;
  287|  3.91G|        ++oit;
  288|  3.91G|        ++num_decoded_points_;
  289|  3.91G|      }
  290|  4.78k|      continue;
  291|  4.78k|    }
  292|       |
  293|  23.9k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  23.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.70k, False: 22.2k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.70k|      axes_[0] = axis;
  300|  3.90k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.19k, False: 1.70k]
  ------------------
  301|  2.19k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.19k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 389, False: 1.80k]
  |  |  ------------------
  ------------------
  302|  2.19k|      }
  303|  4.50k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.82k, False: 1.68k]
  ------------------
  304|  9.04k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.24k, False: 2.80k]
  ------------------
  305|  6.24k|          p_[axes_[j]] = 0;
  306|  6.24k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.24k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.72k, False: 1.52k]
  ------------------
  308|  4.72k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 23, False: 4.70k]
  ------------------
  309|  4.72k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     23|              return false;
  311|     23|            }
  312|  4.72k|          }
  313|  6.22k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.22k|        }
  315|  2.80k|        *oit = p_;
  316|  2.80k|        ++oit;
  317|  2.80k|        ++num_decoded_points_;
  318|  2.80k|      }
  319|  1.68k|      continue;
  320|  1.70k|    }
  321|       |
  322|  22.2k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 22.2k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  22.2k|    const int num_remaining_bits = bit_length_ - level;
  327|  22.2k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  22.2k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  22.2k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  22.2k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  22.2k|    uint32_t number = 0;
  334|  22.2k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  22.2k|    uint32_t first_half = num_remaining_points / 2;
  337|  22.2k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 52, False: 22.2k]
  ------------------
  338|       |      // Invalid |number|.
  339|     52|      return false;
  340|     52|    }
  341|  22.2k|    first_half -= number;
  342|  22.2k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  22.2k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 19.4k, False: 2.81k]
  ------------------
  345|  19.4k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 17.0k, False: 2.33k]
  ------------------
  346|  17.0k|        std::swap(first_half, second_half);
  347|  17.0k|      }
  348|  19.4k|    }
  349|       |
  350|  22.2k|    levels_stack_[stack_pos][axis] += 1;
  351|  22.2k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  22.2k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 21.0k, False: 1.13k]
  ------------------
  353|  21.0k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  21.0k|    }
  355|  22.2k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 8.43k, False: 13.7k]
  ------------------
  356|  8.43k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  8.43k|    }
  358|  22.2k|  }
  359|      6|  return true;
  360|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  4.23M|        : num_remaining_points(num_remaining_points_),
  135|  4.23M|          last_axis(last_axis_),
  136|  4.23M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  2.12M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.12M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.12M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|     16|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    272|      : bit_length_(0),
   87|    272|        num_points_(0),
   88|    272|        num_decoded_points_(0),
   89|    272|        dimension_(dimension),
   90|    272|        p_(dimension, 0),
   91|    272|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    272|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    272|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    141|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    141|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 140]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    140|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 11, False: 129]
  ------------------
  190|     11|    return false;
  191|     11|  }
  192|    129|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 128]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    128|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 11, False: 117]
  ------------------
  196|     11|    return true;
  197|     11|  }
  198|    117|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 8, False: 109]
  ------------------
  199|      8|    return false;
  200|      8|  }
  201|    109|  num_decoded_points_ = 0;
  202|       |
  203|    109|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 17, False: 92]
  ------------------
  204|     17|    return false;
  205|     17|  }
  206|     92|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 90]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     90|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 84]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|     84|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 81]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     81|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 74, False: 7]
  ------------------
  217|     74|    return false;
  218|     74|  }
  219|       |
  220|      7|  numbers_decoder_.EndDecoding();
  221|      7|  remaining_bits_decoder_.EndDecoding();
  222|      7|  axis_decoder_.EndDecoding();
  223|      7|  half_decoder_.EndDecoding();
  224|       |
  225|      7|  return true;
  226|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     81|    uint32_t num_points, OutputIteratorT &oit) {
  254|     81|  typedef DecodingStatus Status;
  255|     81|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     81|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     81|  DecodingStatus init_status(num_points, 0, 0);
  258|     81|  std::stack<Status> status_stack;
  259|     81|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  35.5k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 35.5k, False: 7]
  ------------------
  263|  35.5k|    const DecodingStatus status = status_stack.top();
  264|  35.5k|    status_stack.pop();
  265|       |
  266|  35.5k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  35.5k|    const uint32_t last_axis = status.last_axis;
  268|  35.5k|    const uint32_t stack_pos = status.stack_pos;
  269|  35.5k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  35.5k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  35.5k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 35.5k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  35.5k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  35.5k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 35.5k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  35.5k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  35.5k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 5.28k, False: 30.2k]
  ------------------
  285|  23.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 23.1M, False: 5.28k]
  ------------------
  286|  23.1M|        *oit = old_base;
  287|  23.1M|        ++oit;
  288|  23.1M|        ++num_decoded_points_;
  289|  23.1M|      }
  290|  5.28k|      continue;
  291|  5.28k|    }
  292|       |
  293|  30.2k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  30.2k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.49k, False: 28.7k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.49k|      axes_[0] = axis;
  300|  4.36k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.86k, False: 1.49k]
  ------------------
  301|  2.86k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.86k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 460, False: 2.40k]
  |  |  ------------------
  ------------------
  302|  2.86k|      }
  303|  4.00k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.53k, False: 1.46k]
  ------------------
  304|  9.51k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.00k, False: 2.51k]
  ------------------
  305|  7.00k|          p_[axes_[j]] = 0;
  306|  7.00k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.00k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.21k, False: 2.79k]
  ------------------
  308|  4.21k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 26, False: 4.18k]
  ------------------
  309|  4.21k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     26|              return false;
  311|     26|            }
  312|  4.21k|          }
  313|  6.97k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.97k|        }
  315|  2.51k|        *oit = p_;
  316|  2.51k|        ++oit;
  317|  2.51k|        ++num_decoded_points_;
  318|  2.51k|      }
  319|  1.46k|      continue;
  320|  1.49k|    }
  321|       |
  322|  28.7k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 28.7k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  28.7k|    const int num_remaining_bits = bit_length_ - level;
  327|  28.7k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  28.7k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  28.7k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  28.7k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  28.7k|    uint32_t number = 0;
  334|  28.7k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  28.7k|    uint32_t first_half = num_remaining_points / 2;
  337|  28.7k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 48, False: 28.7k]
  ------------------
  338|       |      // Invalid |number|.
  339|     48|      return false;
  340|     48|    }
  341|  28.7k|    first_half -= number;
  342|  28.7k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  28.7k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 25.5k, False: 3.15k]
  ------------------
  345|  25.5k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 22.2k, False: 3.35k]
  ------------------
  346|  22.2k|        std::swap(first_half, second_half);
  347|  22.2k|      }
  348|  25.5k|    }
  349|       |
  350|  28.7k|    levels_stack_[stack_pos][axis] += 1;
  351|  28.7k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  28.7k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 26.2k, False: 2.48k]
  ------------------
  353|  26.2k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  26.2k|    }
  355|  28.7k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 9.99k, False: 18.7k]
  ------------------
  356|  9.99k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  9.99k|    }
  358|  28.7k|  }
  359|      7|  return true;
  360|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  8.43M|        : num_remaining_points(num_remaining_points_),
  135|  8.43M|          last_axis(last_axis_),
  136|  8.43M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  8.43M|    uint32_t last_axis) {
  232|  8.43M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 8.43M, Folded]
  ------------------
  233|  8.43M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  8.43M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.40M, False: 6.03M]
  |  |  ------------------
  ------------------
  234|  8.43M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  8.43M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  4.23M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  4.23M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  4.23M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     11|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    146|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    146|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 143]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    143|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 133]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|    133|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 131]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    131|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 19, False: 112]
  ------------------
  196|     19|    return true;
  197|     19|  }
  198|    112|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 20, False: 92]
  ------------------
  199|     20|    return false;
  200|     20|  }
  201|     92|  num_decoded_points_ = 0;
  202|       |
  203|     92|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 14, False: 78]
  ------------------
  204|     14|    return false;
  205|     14|  }
  206|     78|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 77]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     77|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 76]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     76|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 75]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     75|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 31, False: 44]
  ------------------
  217|     31|    return false;
  218|     31|  }
  219|       |
  220|     44|  numbers_decoder_.EndDecoding();
  221|     44|  remaining_bits_decoder_.EndDecoding();
  222|     44|  axis_decoder_.EndDecoding();
  223|     44|  half_decoder_.EndDecoding();
  224|       |
  225|     44|  return true;
  226|     75|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     75|    uint32_t num_points, OutputIteratorT &oit) {
  254|     75|  typedef DecodingStatus Status;
  255|     75|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     75|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     75|  DecodingStatus init_status(num_points, 0, 0);
  258|     75|  std::stack<Status> status_stack;
  259|     75|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.67M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.67M, False: 44]
  ------------------
  263|  1.67M|    const DecodingStatus status = status_stack.top();
  264|  1.67M|    status_stack.pop();
  265|       |
  266|  1.67M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.67M|    const uint32_t last_axis = status.last_axis;
  268|  1.67M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.67M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.67M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.67M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.67M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.67M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.67M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.67M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.67M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.67M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 758k, False: 919k]
  ------------------
  285|  71.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 70.4M, False: 758k]
  ------------------
  286|  70.4M|        *oit = old_base;
  287|  70.4M|        ++oit;
  288|  70.4M|        ++num_decoded_points_;
  289|  70.4M|      }
  290|   758k|      continue;
  291|   758k|    }
  292|       |
  293|   919k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   919k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 61.7k, False: 858k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  61.7k|      axes_[0] = axis;
  300|  96.6k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 34.9k, False: 61.7k]
  ------------------
  301|  34.9k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  34.9k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 10.9k, False: 23.9k]
  |  |  ------------------
  ------------------
  302|  34.9k|      }
  303|   158k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 96.5k, False: 61.7k]
  ------------------
  304|   240k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 144k, False: 96.5k]
  ------------------
  305|   144k|          p_[axes_[j]] = 0;
  306|   144k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   144k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 124k, False: 20.0k]
  ------------------
  308|   124k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 28, False: 124k]
  ------------------
  309|   124k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     28|              return false;
  311|     28|            }
  312|   124k|          }
  313|   144k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   144k|        }
  315|  96.5k|        *oit = p_;
  316|  96.5k|        ++oit;
  317|  96.5k|        ++num_decoded_points_;
  318|  96.5k|      }
  319|  61.7k|      continue;
  320|  61.7k|    }
  321|       |
  322|   858k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 858k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   858k|    const int num_remaining_bits = bit_length_ - level;
  327|   858k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   858k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   858k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   858k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   858k|    uint32_t number = 0;
  334|   858k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   858k|    uint32_t first_half = num_remaining_points / 2;
  337|   858k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 3, False: 858k]
  ------------------
  338|       |      // Invalid |number|.
  339|      3|      return false;
  340|      3|    }
  341|   858k|    first_half -= number;
  342|   858k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   858k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 813k, False: 44.7k]
  ------------------
  345|   813k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 782k, False: 30.9k]
  ------------------
  346|   782k|        std::swap(first_half, second_half);
  347|   782k|      }
  348|   813k|    }
  349|       |
  350|   858k|    levels_stack_[stack_pos][axis] += 1;
  351|   858k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   858k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 848k, False: 9.34k]
  ------------------
  353|   848k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   848k|    }
  355|   858k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 830k, False: 27.8k]
  ------------------
  356|   830k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   830k|    }
  358|   858k|  }
  359|     44|  return true;
  360|     75|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  1.67M|        : num_remaining_points(num_remaining_points_),
  135|  1.67M|          last_axis(last_axis_),
  136|  1.67M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|   858k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   858k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   858k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     62|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    208|      : bit_length_(0),
   87|    208|        num_points_(0),
   88|    208|        num_decoded_points_(0),
   89|    208|        dimension_(dimension),
   90|    208|        p_(dimension, 0),
   91|    208|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    208|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    208|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    166|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    166|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 5, False: 161]
  ------------------
  187|      5|    return false;
  188|      5|  }
  189|    161|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 154]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|    154|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 153]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    153|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 151]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|    151|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 17, False: 134]
  ------------------
  199|     17|    return false;
  200|     17|  }
  201|    134|  num_decoded_points_ = 0;
  202|       |
  203|    134|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 24, False: 110]
  ------------------
  204|     24|    return false;
  205|     24|  }
  206|    110|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 107]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|    107|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 7, False: 100]
  ------------------
  210|      7|    return false;
  211|      7|  }
  212|    100|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 99]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     99|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 62, False: 37]
  ------------------
  217|     62|    return false;
  218|     62|  }
  219|       |
  220|     37|  numbers_decoder_.EndDecoding();
  221|     37|  remaining_bits_decoder_.EndDecoding();
  222|     37|  axis_decoder_.EndDecoding();
  223|     37|  half_decoder_.EndDecoding();
  224|       |
  225|     37|  return true;
  226|     99|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     99|    uint32_t num_points, OutputIteratorT &oit) {
  254|     99|  typedef DecodingStatus Status;
  255|     99|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     99|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     99|  DecodingStatus init_status(num_points, 0, 0);
  258|     99|  std::stack<Status> status_stack;
  259|     99|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.88M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.88M, False: 37]
  ------------------
  263|  2.88M|    const DecodingStatus status = status_stack.top();
  264|  2.88M|    status_stack.pop();
  265|       |
  266|  2.88M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.88M|    const uint32_t last_axis = status.last_axis;
  268|  2.88M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.88M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.88M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.88M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.88M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.88M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.88M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.88M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.88M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.88M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.26M, False: 1.61M]
  ------------------
  285|   135M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 133M, False: 1.26M]
  ------------------
  286|   133M|        *oit = old_base;
  287|   133M|        ++oit;
  288|   133M|        ++num_decoded_points_;
  289|   133M|      }
  290|  1.26M|      continue;
  291|  1.26M|    }
  292|       |
  293|  1.61M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.61M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 91.7k, False: 1.52M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  91.7k|      axes_[0] = axis;
  300|   270k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 178k, False: 91.7k]
  ------------------
  301|   178k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   178k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 13.3k, False: 165k]
  |  |  ------------------
  ------------------
  302|   178k|      }
  303|   222k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 130k, False: 91.6k]
  ------------------
  304|   564k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 433k, False: 130k]
  ------------------
  305|   433k|          p_[axes_[j]] = 0;
  306|   433k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   433k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 163k, False: 269k]
  ------------------
  308|   163k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 61, False: 163k]
  ------------------
  309|   163k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     61|              return false;
  311|     61|            }
  312|   163k|          }
  313|   433k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   433k|        }
  315|   130k|        *oit = p_;
  316|   130k|        ++oit;
  317|   130k|        ++num_decoded_points_;
  318|   130k|      }
  319|  91.6k|      continue;
  320|  91.7k|    }
  321|       |
  322|  1.52M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.52M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.52M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.52M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.52M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.52M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.52M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.52M|    uint32_t number = 0;
  334|  1.52M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.52M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.52M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.52M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.52M|    first_half -= number;
  342|  1.52M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.52M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.49M, False: 27.5k]
  ------------------
  345|  1.49M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.43M, False: 54.8k]
  ------------------
  346|  1.43M|        std::swap(first_half, second_half);
  347|  1.43M|      }
  348|  1.49M|    }
  349|       |
  350|  1.52M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.52M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.52M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.49M, False: 22.7k]
  ------------------
  353|  1.49M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.49M|    }
  355|  1.52M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.38M, False: 136k]
  ------------------
  356|  1.38M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.38M|    }
  358|  1.52M|  }
  359|     37|  return true;
  360|     99|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.88M|        : num_remaining_points(num_remaining_points_),
  135|  2.88M|          last_axis(last_axis_),
  136|  2.88M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.88M|    uint32_t last_axis) {
  232|  2.88M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.88M, Folded]
  ------------------
  233|  2.88M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.88M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 995k, False: 1.88M]
  |  |  ------------------
  ------------------
  234|  2.88M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.88M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.52M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.52M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.52M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     39|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    147|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    147|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 143]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    143|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 137]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|    137|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 135]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    135|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 39, False: 96]
  ------------------
  196|     39|    return true;
  197|     39|  }
  198|     96|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 11, False: 85]
  ------------------
  199|     11|    return false;
  200|     11|  }
  201|     85|  num_decoded_points_ = 0;
  202|       |
  203|     85|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 34, False: 51]
  ------------------
  204|     34|    return false;
  205|     34|  }
  206|     51|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 49]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     49|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 47]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     47|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 46]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     46|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 26, False: 20]
  ------------------
  217|     26|    return false;
  218|     26|  }
  219|       |
  220|     20|  numbers_decoder_.EndDecoding();
  221|     20|  remaining_bits_decoder_.EndDecoding();
  222|     20|  axis_decoder_.EndDecoding();
  223|     20|  half_decoder_.EndDecoding();
  224|       |
  225|     20|  return true;
  226|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     46|    uint32_t num_points, OutputIteratorT &oit) {
  254|     46|  typedef DecodingStatus Status;
  255|     46|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     46|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     46|  DecodingStatus init_status(num_points, 0, 0);
  258|     46|  std::stack<Status> status_stack;
  259|     46|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   155k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 155k, False: 20]
  ------------------
  263|   155k|    const DecodingStatus status = status_stack.top();
  264|   155k|    status_stack.pop();
  265|       |
  266|   155k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   155k|    const uint32_t last_axis = status.last_axis;
  268|   155k|    const uint32_t stack_pos = status.stack_pos;
  269|   155k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   155k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   155k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 155k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   155k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   155k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 8, False: 155k]
  ------------------
  278|      8|      return false;
  279|      8|    }
  280|       |
  281|   155k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   155k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 99, False: 155k]
  ------------------
  285|  2.16M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 2.16M, False: 99]
  ------------------
  286|  2.16M|        *oit = old_base;
  287|  2.16M|        ++oit;
  288|  2.16M|        ++num_decoded_points_;
  289|  2.16M|      }
  290|     99|      continue;
  291|     99|    }
  292|       |
  293|   155k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   155k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 129, False: 155k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    129|      axes_[0] = axis;
  300|  7.84k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 7.71k, False: 129]
  ------------------
  301|  7.71k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  7.71k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 106, False: 7.60k]
  |  |  ------------------
  ------------------
  302|  7.71k|      }
  303|    290|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 171, False: 119]
  ------------------
  304|  9.40k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 9.24k, False: 161]
  ------------------
  305|  9.24k|          p_[axes_[j]] = 0;
  306|  9.24k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  9.24k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 9.05k, False: 190]
  ------------------
  308|  9.05k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 10, False: 9.04k]
  ------------------
  309|  9.05k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     10|              return false;
  311|     10|            }
  312|  9.05k|          }
  313|  9.23k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  9.23k|        }
  315|    161|        *oit = p_;
  316|    161|        ++oit;
  317|    161|        ++num_decoded_points_;
  318|    161|      }
  319|    119|      continue;
  320|    129|    }
  321|       |
  322|   155k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 155k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   155k|    const int num_remaining_bits = bit_length_ - level;
  327|   155k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   155k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   155k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   155k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   155k|    uint32_t number = 0;
  334|   155k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   155k|    uint32_t first_half = num_remaining_points / 2;
  337|   155k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 8, False: 155k]
  ------------------
  338|       |      // Invalid |number|.
  339|      8|      return false;
  340|      8|    }
  341|   155k|    first_half -= number;
  342|   155k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   155k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 155k, False: 10]
  ------------------
  345|   155k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 130k, False: 25.2k]
  ------------------
  346|   130k|        std::swap(first_half, second_half);
  347|   130k|      }
  348|   155k|    }
  349|       |
  350|   155k|    levels_stack_[stack_pos][axis] += 1;
  351|   155k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   155k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 130k, False: 25.2k]
  ------------------
  353|   130k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   130k|    }
  355|   155k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 25.4k, False: 130k]
  ------------------
  356|  25.4k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  25.4k|    }
  358|   155k|  }
  359|     20|  return true;
  360|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   155k|        : num_remaining_points(num_remaining_points_),
  135|   155k|          last_axis(last_axis_),
  136|   155k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   155k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   155k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   155k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     58|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    164|      : bit_length_(0),
   87|    164|        num_points_(0),
   88|    164|        num_decoded_points_(0),
   89|    164|        dimension_(dimension),
   90|    164|        p_(dimension, 0),
   91|    164|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    164|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    164|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     98|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     98|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     98|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    277|      : bit_length_(0),
   87|    277|        num_points_(0),
   88|    277|        num_decoded_points_(0),
   89|    277|        dimension_(dimension),
   90|    277|        p_(dimension, 0),
   91|    277|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    277|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    277|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    118|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    118|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    118|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    125|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    125|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    125|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    253|      : bit_length_(0),
   87|    253|        num_points_(0),
   88|    253|        num_decoded_points_(0),
   89|    253|        dimension_(dimension),
   90|    253|        p_(dimension, 0),
   91|    253|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    253|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    253|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     94|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     94|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    199|      : bit_length_(0),
   87|    199|        num_points_(0),
   88|    199|        num_decoded_points_(0),
   89|    199|        dimension_(dimension),
   90|    199|        p_(dimension, 0),
   91|    199|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    199|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    199|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      7|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      7|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      7|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.50M|    uint32_t last_axis) {
  232|  3.50M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.50M, Folded]
  ------------------
  233|  3.50M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.50M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.25M, False: 250k]
  |  |  ------------------
  ------------------
  234|  3.50M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  3.50M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.23M|    uint32_t last_axis) {
  232|  4.23M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.23M, Folded]
  ------------------
  233|  4.23M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.23M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.20M, False: 3.02M]
  |  |  ------------------
  ------------------
  234|  4.23M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.23M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.67M|    uint32_t last_axis) {
  232|  1.67M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.67M, Folded]
  ------------------
  233|  1.67M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.67M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.52M, False: 149k]
  |  |  ------------------
  ------------------
  234|  1.67M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  1.67M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   155k|    uint32_t last_axis) {
  232|   155k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 155k]
  ------------------
  233|      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]
  |  |  ------------------
  ------------------
  234|      0|  }
  235|       |
  236|   155k|  uint32_t best_axis = 0;
  237|   155k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 155k, False: 93]
  ------------------
  238|  23.1M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 23.0M, False: 155k]
  ------------------
  239|  23.0M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 154k, False: 22.8M]
  ------------------
  240|   154k|        best_axis = axis;
  241|   154k|      }
  242|  23.0M|    }
  243|   155k|  } else {
  244|     93|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|     93|  }
  246|       |
  247|   155k|  return best_axis;
  248|   155k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    108|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    108|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    108|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    108|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    108|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 105]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    105|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 93]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|     93|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 92]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     92|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 91]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     91|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 91]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     91|  num_decoded_points_ = 0;
  202|       |
  203|     91|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 28, False: 63]
  ------------------
  204|     28|    return false;
  205|     28|  }
  206|     63|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 59]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     59|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 58]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     58|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 56]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     56|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 41, False: 15]
  ------------------
  217|     41|    return false;
  218|     41|  }
  219|       |
  220|     15|  numbers_decoder_.EndDecoding();
  221|     15|  remaining_bits_decoder_.EndDecoding();
  222|     15|  axis_decoder_.EndDecoding();
  223|     15|  half_decoder_.EndDecoding();
  224|       |
  225|     15|  return true;
  226|     56|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     56|    uint32_t num_points, OutputIteratorT &oit) {
  254|     56|  typedef DecodingStatus Status;
  255|     56|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     56|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     56|  DecodingStatus init_status(num_points, 0, 0);
  258|     56|  std::stack<Status> status_stack;
  259|     56|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   330k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 330k, False: 15]
  ------------------
  263|   330k|    const DecodingStatus status = status_stack.top();
  264|   330k|    status_stack.pop();
  265|       |
  266|   330k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   330k|    const uint32_t last_axis = status.last_axis;
  268|   330k|    const uint32_t stack_pos = status.stack_pos;
  269|   330k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   330k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   330k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 330k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   330k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   330k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 330k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   330k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   330k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 164k, False: 166k]
  ------------------
  285|  73.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 73.0M, False: 164k]
  ------------------
  286|  73.0M|        *oit = old_base;
  287|  73.0M|        ++oit;
  288|  73.0M|        ++num_decoded_points_;
  289|  73.0M|      }
  290|   164k|      continue;
  291|   164k|    }
  292|       |
  293|   166k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   166k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 608, False: 165k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    608|      axes_[0] = axis;
  300|  1.82k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.21k, False: 608]
  ------------------
  301|  1.21k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.21k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 248, False: 968]
  |  |  ------------------
  ------------------
  302|  1.21k|      }
  303|  1.59k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.01k, False: 583]
  ------------------
  304|  3.99k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.00k, False: 990]
  ------------------
  305|  3.00k|          p_[axes_[j]] = 0;
  306|  3.00k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.00k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.72k, False: 1.28k]
  ------------------
  308|  1.72k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 25, False: 1.69k]
  ------------------
  309|  1.72k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     25|              return false;
  311|     25|            }
  312|  1.72k|          }
  313|  2.98k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.98k|        }
  315|    990|        *oit = p_;
  316|    990|        ++oit;
  317|    990|        ++num_decoded_points_;
  318|    990|      }
  319|    583|      continue;
  320|    608|    }
  321|       |
  322|   165k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 165k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   165k|    const int num_remaining_bits = bit_length_ - level;
  327|   165k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   165k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   165k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   165k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   165k|    uint32_t number = 0;
  334|   165k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   165k|    uint32_t first_half = num_remaining_points / 2;
  337|   165k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 16, False: 165k]
  ------------------
  338|       |      // Invalid |number|.
  339|     16|      return false;
  340|     16|    }
  341|   165k|    first_half -= number;
  342|   165k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   165k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 91.8k, False: 73.6k]
  ------------------
  345|  91.8k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 91.0k, False: 816]
  ------------------
  346|  91.0k|        std::swap(first_half, second_half);
  347|  91.0k|      }
  348|  91.8k|    }
  349|       |
  350|   165k|    levels_stack_[stack_pos][axis] += 1;
  351|   165k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   165k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 165k, False: 53]
  ------------------
  353|   165k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   165k|    }
  355|   165k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 165k, False: 84]
  ------------------
  356|   165k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   165k|    }
  358|   165k|  }
  359|     15|  return true;
  360|     56|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     89|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     89|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     89|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     89|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     89|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 88]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     88|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 78]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|     78|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 77]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     77|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 76]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     76|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 76]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     76|  num_decoded_points_ = 0;
  202|       |
  203|     76|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 14, False: 62]
  ------------------
  204|     14|    return false;
  205|     14|  }
  206|     62|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 56]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|     56|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 54]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     54|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 51]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     51|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 38, False: 13]
  ------------------
  217|     38|    return false;
  218|     38|  }
  219|       |
  220|     13|  numbers_decoder_.EndDecoding();
  221|     13|  remaining_bits_decoder_.EndDecoding();
  222|     13|  axis_decoder_.EndDecoding();
  223|     13|  half_decoder_.EndDecoding();
  224|       |
  225|     13|  return true;
  226|     51|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     51|    uint32_t num_points, OutputIteratorT &oit) {
  254|     51|  typedef DecodingStatus Status;
  255|     51|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     51|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     51|  DecodingStatus init_status(num_points, 0, 0);
  258|     51|  std::stack<Status> status_stack;
  259|     51|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.63M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.63M, False: 13]
  ------------------
  263|  1.63M|    const DecodingStatus status = status_stack.top();
  264|  1.63M|    status_stack.pop();
  265|       |
  266|  1.63M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.63M|    const uint32_t last_axis = status.last_axis;
  268|  1.63M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.63M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.63M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.63M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.63M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.63M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.63M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.63M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.63M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.63M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 814k, False: 816k]
  ------------------
  285|  45.8M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 45.0M, False: 814k]
  ------------------
  286|  45.0M|        *oit = old_base;
  287|  45.0M|        ++oit;
  288|  45.0M|        ++num_decoded_points_;
  289|  45.0M|      }
  290|   814k|      continue;
  291|   814k|    }
  292|       |
  293|   816k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   816k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 862, False: 815k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    862|      axes_[0] = axis;
  300|  2.58k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.72k, False: 862]
  ------------------
  301|  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: 280, False: 1.44k]
  |  |  ------------------
  ------------------
  302|  1.72k|      }
  303|  2.26k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.42k, False: 836]
  ------------------
  304|  5.64k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.24k, False: 1.40k]
  ------------------
  305|  4.24k|          p_[axes_[j]] = 0;
  306|  4.24k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.24k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.21k, False: 2.02k]
  ------------------
  308|  2.21k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 26, False: 2.18k]
  ------------------
  309|  2.21k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     26|              return false;
  311|     26|            }
  312|  2.21k|          }
  313|  4.21k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.21k|        }
  315|  1.40k|        *oit = p_;
  316|  1.40k|        ++oit;
  317|  1.40k|        ++num_decoded_points_;
  318|  1.40k|      }
  319|    836|      continue;
  320|    862|    }
  321|       |
  322|   815k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 815k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   815k|    const int num_remaining_bits = bit_length_ - level;
  327|   815k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   815k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   815k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   815k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   815k|    uint32_t number = 0;
  334|   815k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   815k|    uint32_t first_half = num_remaining_points / 2;
  337|   815k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 12, False: 815k]
  ------------------
  338|       |      // Invalid |number|.
  339|     12|      return false;
  340|     12|    }
  341|   815k|    first_half -= number;
  342|   815k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   815k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 440k, False: 375k]
  ------------------
  345|   440k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 439k, False: 453]
  ------------------
  346|   439k|        std::swap(first_half, second_half);
  347|   439k|      }
  348|   440k|    }
  349|       |
  350|   815k|    levels_stack_[stack_pos][axis] += 1;
  351|   815k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   815k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 815k, False: 16]
  ------------------
  353|   815k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   815k|    }
  355|   815k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 815k, False: 44]
  ------------------
  356|   815k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   815k|    }
  358|   815k|  }
  359|     13|  return true;
  360|     51|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     96|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     96|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     96|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     96|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     96|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 95]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     95|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 87]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|     87|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 87]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     87|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 86]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     86|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 86]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     86|  num_decoded_points_ = 0;
  202|       |
  203|     86|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 33, False: 53]
  ------------------
  204|     33|    return false;
  205|     33|  }
  206|     53|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 49]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     49|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 48]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     48|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 46]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     46|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 43, False: 3]
  ------------------
  217|     43|    return false;
  218|     43|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     46|    uint32_t num_points, OutputIteratorT &oit) {
  254|     46|  typedef DecodingStatus Status;
  255|     46|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     46|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     46|  DecodingStatus init_status(num_points, 0, 0);
  258|     46|  std::stack<Status> status_stack;
  259|     46|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.20M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.20M, False: 3]
  ------------------
  263|  4.20M|    const DecodingStatus status = status_stack.top();
  264|  4.20M|    status_stack.pop();
  265|       |
  266|  4.20M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.20M|    const uint32_t last_axis = status.last_axis;
  268|  4.20M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.20M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.20M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.20M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.20M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.20M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.20M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.20M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.20M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.20M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.10M, False: 2.10M]
  ------------------
  285|  9.48M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 7.37M, False: 2.10M]
  ------------------
  286|  7.37M|        *oit = old_base;
  287|  7.37M|        ++oit;
  288|  7.37M|        ++num_decoded_points_;
  289|  7.37M|      }
  290|  2.10M|      continue;
  291|  2.10M|    }
  292|       |
  293|  2.10M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.10M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 393, False: 2.10M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    393|      axes_[0] = axis;
  300|  1.17k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 786, False: 393]
  ------------------
  301|    786|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    786|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 171, False: 615]
  |  |  ------------------
  ------------------
  302|    786|      }
  303|  1.05k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 670, False: 383]
  ------------------
  304|  2.65k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1.99k, False: 660]
  ------------------
  305|  1.99k|          p_[axes_[j]] = 0;
  306|  1.99k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  1.99k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.30k, False: 690]
  ------------------
  308|  1.30k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 10, False: 1.29k]
  ------------------
  309|  1.30k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     10|              return false;
  311|     10|            }
  312|  1.30k|          }
  313|  1.98k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  1.98k|        }
  315|    660|        *oit = p_;
  316|    660|        ++oit;
  317|    660|        ++num_decoded_points_;
  318|    660|      }
  319|    383|      continue;
  320|    393|    }
  321|       |
  322|  2.10M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.10M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.10M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.10M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.10M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.10M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.10M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.10M|    uint32_t number = 0;
  334|  2.10M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.10M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.10M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 33, False: 2.10M]
  ------------------
  338|       |      // Invalid |number|.
  339|     33|      return false;
  340|     33|    }
  341|  2.10M|    first_half -= number;
  342|  2.10M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.10M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 724k, False: 1.38M]
  ------------------
  345|   724k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 723k, False: 1.30k]
  ------------------
  346|   723k|        std::swap(first_half, second_half);
  347|   723k|      }
  348|   724k|    }
  349|       |
  350|  2.10M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.10M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.10M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.10M, False: 72]
  ------------------
  353|  2.10M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.10M|    }
  355|  2.10M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.10M, False: 86]
  ------------------
  356|  2.10M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.10M|    }
  358|  2.10M|  }
  359|      3|  return true;
  360|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    112|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    112|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    112|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    112|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    112|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 111]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    111|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 16, False: 95]
  ------------------
  190|     16|    return false;
  191|     16|  }
  192|     95|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 93]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|     93|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 92]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     92|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 92]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     92|  num_decoded_points_ = 0;
  202|       |
  203|     92|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 37, False: 55]
  ------------------
  204|     37|    return false;
  205|     37|  }
  206|     55|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 54]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     54|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 52]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     52|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 51]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     51|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 48, False: 3]
  ------------------
  217|     48|    return false;
  218|     48|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     51|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     51|    uint32_t num_points, OutputIteratorT &oit) {
  254|     51|  typedef DecodingStatus Status;
  255|     51|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     51|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     51|  DecodingStatus init_status(num_points, 0, 0);
  258|     51|  std::stack<Status> status_stack;
  259|     51|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  8.40M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 8.40M, False: 3]
  ------------------
  263|  8.40M|    const DecodingStatus status = status_stack.top();
  264|  8.40M|    status_stack.pop();
  265|       |
  266|  8.40M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  8.40M|    const uint32_t last_axis = status.last_axis;
  268|  8.40M|    const uint32_t stack_pos = status.stack_pos;
  269|  8.40M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  8.40M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  8.40M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 8.40M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  8.40M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  8.40M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 8.40M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  8.40M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  8.40M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.20M, False: 4.20M]
  ------------------
  285|  78.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 74.4M, False: 4.20M]
  ------------------
  286|  74.4M|        *oit = old_base;
  287|  74.4M|        ++oit;
  288|  74.4M|        ++num_decoded_points_;
  289|  74.4M|      }
  290|  4.20M|      continue;
  291|  4.20M|    }
  292|       |
  293|  4.20M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  4.20M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 749, False: 4.20M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    749|      axes_[0] = axis;
  300|  2.24k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.49k, False: 749]
  ------------------
  301|  1.49k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.49k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 482, False: 1.01k]
  |  |  ------------------
  ------------------
  302|  1.49k|      }
  303|  2.03k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.29k, False: 736]
  ------------------
  304|  5.14k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.86k, False: 1.28k]
  ------------------
  305|  3.86k|          p_[axes_[j]] = 0;
  306|  3.86k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.86k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.23k, False: 633]
  ------------------
  308|  3.23k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 13, False: 3.21k]
  ------------------
  309|  3.23k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     13|              return false;
  311|     13|            }
  312|  3.23k|          }
  313|  3.85k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.85k|        }
  315|  1.28k|        *oit = p_;
  316|  1.28k|        ++oit;
  317|  1.28k|        ++num_decoded_points_;
  318|  1.28k|      }
  319|    736|      continue;
  320|    749|    }
  321|       |
  322|  4.20M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 4.20M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  4.20M|    const int num_remaining_bits = bit_length_ - level;
  327|  4.20M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  4.20M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  4.20M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  4.20M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  4.20M|    uint32_t number = 0;
  334|  4.20M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  4.20M|    uint32_t first_half = num_remaining_points / 2;
  337|  4.20M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 35, False: 4.20M]
  ------------------
  338|       |      // Invalid |number|.
  339|     35|      return false;
  340|     35|    }
  341|  4.20M|    first_half -= number;
  342|  4.20M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  4.20M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 736k, False: 3.46M]
  ------------------
  345|   736k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 735k, False: 821]
  ------------------
  346|   735k|        std::swap(first_half, second_half);
  347|   735k|      }
  348|   736k|    }
  349|       |
  350|  4.20M|    levels_stack_[stack_pos][axis] += 1;
  351|  4.20M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  4.20M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 4.20M, False: 21]
  ------------------
  353|  4.20M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  4.20M|    }
  355|  4.20M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4.20M, False: 51]
  ------------------
  356|  4.20M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  4.20M|    }
  358|  4.20M|  }
  359|      3|  return true;
  360|     51|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     62|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     62|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     62|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     62|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 61]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     61|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 16, False: 45]
  ------------------
  190|     16|    return false;
  191|     16|  }
  192|     45|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 45]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     45|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 4, False: 41]
  ------------------
  196|      4|    return true;
  197|      4|  }
  198|     41|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 41]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     41|  num_decoded_points_ = 0;
  202|       |
  203|     41|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 41, False: 0]
  ------------------
  204|     41|    return false;
  205|     41|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     33|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     33|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     33|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     33|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 32]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     32|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 22]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|     22|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 21]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     21|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 20]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     20|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 20]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     20|  num_decoded_points_ = 0;
  202|       |
  203|     20|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 20, False: 0]
  ------------------
  204|     20|    return false;
  205|     20|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     17|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     17|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     17|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     17|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     17|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 16]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     16|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 11]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     11|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 10]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     10|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 9]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|      9|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 9]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      9|  num_decoded_points_ = 0;
  202|       |
  203|      9|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 9, False: 0]
  ------------------
  204|      9|    return false;
  205|      9|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}

_ZN5draco22FloatPointsTreeDecoderC2Ev:
   65|    596|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    596|  qinfo_.quantization_bits = 0;
   67|    596|  qinfo_.range = 0;
   68|    596|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    561|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    561|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 1, False: 560]
  ------------------
   73|      1|    return false;
   74|      1|  }
   75|    560|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 2, False: 558]
  ------------------
   76|      2|    return false;
   77|      2|  }
   78|    558|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 1, False: 557]
  ------------------
   79|      1|    return false;
   80|      1|  }
   81|    557|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 1, False: 556]
  ------------------
   82|      1|    return false;
   83|      1|  }
   84|    556|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 37, False: 519]
  |  Branch (84:38): [True: 22, False: 15]
  ------------------
   85|     22|    return false;
   86|     22|  }
   87|    534|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 2, False: 532]
  ------------------
   88|      2|    return false;
   89|      2|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    532|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 13, False: 519]
  ------------------
   93|     13|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|     13|#define DRACO_LOGE printf
  ------------------
   94|     13|               compression_level_);
   95|     13|    return false;
   96|     13|  }
   97|       |
   98|    519|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    519|      std::back_inserter(*qpoints);
  100|    519|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    519|                           Converter>
  102|    519|      oit(oit_qpoints);
  103|    519|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 517, False: 2]
  ------------------
  104|    517|    qpoints->reserve(num_points_);
  105|    517|    switch (compression_level_) {
  106|    108|      case 0: {
  ------------------
  |  Branch (106:7): [True: 108, False: 409]
  ------------------
  107|    108|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|    108|        qpoints_decoder.DecodePoints(buffer, oit);
  109|    108|        break;
  110|      0|      }
  111|     89|      case 1: {
  ------------------
  |  Branch (111:7): [True: 89, False: 428]
  ------------------
  112|     89|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     89|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     89|        break;
  115|      0|      }
  116|     96|      case 2: {
  ------------------
  |  Branch (116:7): [True: 96, False: 421]
  ------------------
  117|     96|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     96|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     96|        break;
  120|      0|      }
  121|    112|      case 3: {
  ------------------
  |  Branch (121:7): [True: 112, False: 405]
  ------------------
  122|    112|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    112|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    112|        break;
  125|      0|      }
  126|     62|      case 4: {
  ------------------
  |  Branch (126:7): [True: 62, False: 455]
  ------------------
  127|     62|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     62|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     62|        break;
  130|      0|      }
  131|     33|      case 5: {
  ------------------
  |  Branch (131:7): [True: 33, False: 484]
  ------------------
  132|     33|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     33|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     33|        break;
  135|      0|      }
  136|     17|      case 6: {
  ------------------
  |  Branch (136:7): [True: 17, False: 500]
  ------------------
  137|     17|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     17|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     17|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 517]
  ------------------
  142|      0|        return false;
  143|    517|    }
  144|    517|  }
  145|       |
  146|    519|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 507, False: 12]
  ------------------
  147|    507|    return false;
  148|    507|  }
  149|     12|  return true;
  150|    519|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    519|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   199M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   199M|  const Self &operator=(const SourceType &source) {
   56|   199M|    *oit_ = Converter()(source);
   57|   199M|    return *this;
   58|   199M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   199M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   199M|    return Point3ui(v[0], v[1], v[2]);
   31|   199M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   199M|  const Self &operator++() {
   46|   199M|    ++oit_;
   47|   199M|    return *this;
   48|   199M|  }

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

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

_ZN5draco17PointCloudDecoderC2Ev:
   22|  14.5k|    : point_cloud_(nullptr),
   23|  14.5k|      buffer_(nullptr),
   24|  14.5k|      version_major_(0),
   25|  14.5k|      version_minor_(0),
   26|  14.5k|      options_(nullptr) {}
_ZN5draco17PointCloudDecoder12DecodeHeaderEPNS_13DecoderBufferEPNS_11DracoHeaderE:
   29|  43.8k|                                       DracoHeader *out_header) {
   30|  43.8k|  constexpr char kIoErrorMsg[] = "Failed to parse Draco header.";
   31|  43.8k|  if (!buffer->Decode(out_header->draco_string, 5)) {
  ------------------
  |  Branch (31:7): [True: 3, False: 43.8k]
  ------------------
   32|      3|    return Status(Status::IO_ERROR, kIoErrorMsg);
   33|      3|  }
   34|  43.8k|  if (memcmp(out_header->draco_string, "DRACO", 5) != 0) {
  ------------------
  |  Branch (34:7): [True: 40, False: 43.7k]
  ------------------
   35|     40|    return Status(Status::DRACO_ERROR, "Not a Draco file.");
   36|     40|  }
   37|  43.7k|  if (!buffer->Decode(&(out_header->version_major))) {
  ------------------
  |  Branch (37:7): [True: 1, False: 43.7k]
  ------------------
   38|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   39|      1|  }
   40|  43.7k|  if (!buffer->Decode(&(out_header->version_minor))) {
  ------------------
  |  Branch (40:7): [True: 1, False: 43.7k]
  ------------------
   41|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   42|      1|  }
   43|  43.7k|  if (!buffer->Decode(&(out_header->encoder_type))) {
  ------------------
  |  Branch (43:7): [True: 1, False: 43.7k]
  ------------------
   44|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   45|      1|  }
   46|  43.7k|  if (!buffer->Decode(&(out_header->encoder_method))) {
  ------------------
  |  Branch (46:7): [True: 1, False: 43.7k]
  ------------------
   47|      1|    return Status(Status::IO_ERROR, kIoErrorMsg);
   48|      1|  }
   49|  43.7k|  if (!buffer->Decode(&(out_header->flags))) {
  ------------------
  |  Branch (49:7): [True: 2, False: 43.7k]
  ------------------
   50|      2|    return Status(Status::IO_ERROR, kIoErrorMsg);
   51|      2|  }
   52|  43.7k|  return OkStatus();
   53|  43.7k|}
_ZN5draco17PointCloudDecoder14DecodeMetadataEv:
   55|    772|Status PointCloudDecoder::DecodeMetadata() {
   56|    772|  std::unique_ptr<GeometryMetadata> metadata =
   57|    772|      std::unique_ptr<GeometryMetadata>(new GeometryMetadata());
   58|    772|  MetadataDecoder metadata_decoder;
   59|    772|  if (!metadata_decoder.DecodeGeometryMetadata(buffer_, metadata.get())) {
  ------------------
  |  Branch (59:7): [True: 753, False: 19]
  ------------------
   60|    753|    return Status(Status::DRACO_ERROR, "Failed to decode metadata.");
   61|    753|  }
   62|     19|  point_cloud_->AddMetadata(std::move(metadata));
   63|     19|  return OkStatus();
   64|    772|}
_ZN5draco17PointCloudDecoder6DecodeERKNS_12DracoOptionsINS_17GeometryAttribute4TypeEEEPNS_13DecoderBufferEPNS_10PointCloudE:
   68|  14.5k|                                 PointCloud *out_point_cloud) {
   69|  14.5k|  options_ = &options;
   70|  14.5k|  buffer_ = in_buffer;
   71|  14.5k|  point_cloud_ = out_point_cloud;
   72|  14.5k|  DracoHeader header;
   73|  14.5k|  DRACO_RETURN_IF_ERROR(DecodeHeader(buffer_, &header))
  ------------------
  |  |   74|  14.5k|  {                                                   \
  |  |   75|  14.5k|    const draco::Status _local_status = (expression); \
  |  |   76|  14.5k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 0, False: 14.5k]
  |  |  ------------------
  |  |   77|      0|      return _local_status;                           \
  |  |   78|      0|    }                                                 \
  |  |   79|  14.5k|  }
  ------------------
   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|  14.5k|  if (header.encoder_type != GetGeometryType()) {
  ------------------
  |  Branch (76:7): [True: 0, False: 14.5k]
  ------------------
   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|  14.5k|  version_major_ = header.version_major;
   83|  14.5k|  version_minor_ = header.version_minor;
   84|       |
   85|  14.5k|  const uint8_t max_supported_major_version =
   86|  14.5k|      header.encoder_type == POINT_CLOUD ? kDracoPointCloudBitstreamVersionMajor
  ------------------
  |  Branch (86:7): [True: 2.20k, False: 12.3k]
  ------------------
   87|  14.5k|                                         : kDracoMeshBitstreamVersionMajor;
   88|  14.5k|  const uint8_t max_supported_minor_version =
   89|  14.5k|      header.encoder_type == POINT_CLOUD ? kDracoPointCloudBitstreamVersionMinor
  ------------------
  |  Branch (89:7): [True: 2.20k, False: 12.3k]
  ------------------
   90|  14.5k|                                         : kDracoMeshBitstreamVersionMinor;
   91|       |
   92|       |  // Check for version compatibility.
   93|  14.5k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   94|  14.5k|  if (version_major_ < 1 || version_major_ > max_supported_major_version) {
  ------------------
  |  Branch (94:7): [True: 1, False: 14.5k]
  |  Branch (94:29): [True: 10, False: 14.5k]
  ------------------
   95|     11|    return Status(Status::UNKNOWN_VERSION, "Unknown major version.");
   96|     11|  }
   97|  14.5k|  if (version_major_ == max_supported_major_version &&
  ------------------
  |  Branch (97:7): [True: 12.8k, False: 1.71k]
  ------------------
   98|  12.8k|      version_minor_ > max_supported_minor_version) {
  ------------------
  |  Branch (98:7): [True: 6, False: 12.8k]
  ------------------
   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|  14.5k|  buffer_->set_bitstream_version(
  110|  14.5k|      DRACO_BITSTREAM_VERSION(version_major_, version_minor_));
  ------------------
  |  |  115|  14.5k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  111|       |
  112|  14.5k|  if (bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 3) &&
  ------------------
  |  |  115|  29.1k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (112:7): [True: 14.0k, False: 480]
  ------------------
  113|  14.0k|      (header.flags & METADATA_FLAG_MASK)) {
  ------------------
  |  |  151|  14.0k|#define METADATA_FLAG_MASK 0x8000
  ------------------
  |  Branch (113:7): [True: 772, False: 13.3k]
  ------------------
  114|    772|    DRACO_RETURN_IF_ERROR(DecodeMetadata())
  ------------------
  |  |   74|    772|  {                                                   \
  |  |   75|    772|    const draco::Status _local_status = (expression); \
  |  |   76|    772|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 753, False: 19]
  |  |  ------------------
  |  |   77|    753|      return _local_status;                           \
  |  |   78|    753|    }                                                 \
  |  |   79|    772|  }
  ------------------
  115|    772|  }
  116|  13.8k|  if (!InitializeDecoder()) {
  ------------------
  |  Branch (116:7): [True: 17, False: 13.7k]
  ------------------
  117|     17|    return Status(Status::DRACO_ERROR, "Failed to initialize the decoder.");
  118|     17|  }
  119|  13.7k|  if (!DecodeGeometryData()) {
  ------------------
  |  Branch (119:7): [True: 7.41k, False: 6.38k]
  ------------------
  120|  7.41k|    return Status(Status::DRACO_ERROR, "Failed to decode geometry data.");
  121|  7.41k|  }
  122|  6.38k|  if (!DecodePointAttributes()) {
  ------------------
  |  Branch (122:7): [True: 5.06k, False: 1.31k]
  ------------------
  123|  5.06k|    return Status(Status::DRACO_ERROR, "Failed to decode point attributes.");
  124|  5.06k|  }
  125|  1.31k|  return OkStatus();
  126|  6.38k|}
_ZN5draco17PointCloudDecoder21DecodePointAttributesEv:
  128|  6.38k|bool PointCloudDecoder::DecodePointAttributes() {
  129|  6.38k|  uint8_t num_attributes_decoders;
  130|  6.38k|  if (!buffer_->Decode(&num_attributes_decoders)) {
  ------------------
  |  Branch (130:7): [True: 164, False: 6.21k]
  ------------------
  131|    164|    return false;
  132|    164|  }
  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|  43.8k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (136:19): [True: 37.9k, False: 5.87k]
  ------------------
  137|  37.9k|    if (!CreateAttributesDecoder(i)) {
  ------------------
  |  Branch (137:9): [True: 343, False: 37.6k]
  ------------------
  138|    343|      return false;
  139|    343|    }
  140|  37.9k|  }
  141|       |
  142|       |  // Initialize all attributes decoders. No data is decoded here.
  143|  37.5k|  for (auto &att_dec : attributes_decoders_) {
  ------------------
  |  Branch (143:22): [True: 37.5k, False: 5.87k]
  ------------------
  144|  37.5k|    if (!att_dec->Init(this, point_cloud_)) {
  ------------------
  |  Branch (144:9): [True: 0, False: 37.5k]
  ------------------
  145|      0|      return false;
  146|      0|    }
  147|  37.5k|  }
  148|       |
  149|       |  // Decode any data needed by the attribute decoders.
  150|  14.3k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (150:19): [True: 8.87k, False: 5.50k]
  ------------------
  151|  8.87k|    if (!attributes_decoders_[i]->DecodeAttributesDecoderData(buffer_)) {
  ------------------
  |  Branch (151:9): [True: 370, False: 8.50k]
  ------------------
  152|    370|      return false;
  153|    370|    }
  154|  8.87k|  }
  155|       |
  156|       |  // Create map between attribute and decoder ids.
  157|  12.1k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (157:19): [True: 6.64k, False: 5.50k]
  ------------------
  158|  6.64k|    const int32_t num_attributes = attributes_decoders_[i]->GetNumAttributes();
  159|  24.3k|    for (int j = 0; j < num_attributes; ++j) {
  ------------------
  |  Branch (159:21): [True: 17.7k, False: 6.64k]
  ------------------
  160|  17.7k|      int att_id = attributes_decoders_[i]->GetAttributeId(j);
  161|  17.7k|      if (att_id >= attribute_to_decoder_map_.size()) {
  ------------------
  |  Branch (161:11): [True: 17.7k, False: 0]
  ------------------
  162|  17.7k|        attribute_to_decoder_map_.resize(att_id + 1);
  163|  17.7k|      }
  164|  17.7k|      attribute_to_decoder_map_[att_id] = i;
  165|  17.7k|    }
  166|  6.64k|  }
  167|       |
  168|       |  // Decode the actual attributes using the created attribute decoders.
  169|  5.50k|  if (!DecodeAllAttributes()) {
  ------------------
  |  Branch (169:7): [True: 4.19k, False: 1.31k]
  ------------------
  170|  4.19k|    return false;
  171|  4.19k|  }
  172|       |
  173|  1.31k|  if (!OnAttributesDecoded()) {
  ------------------
  |  Branch (173:7): [True: 0, False: 1.31k]
  ------------------
  174|      0|    return false;
  175|      0|  }
  176|  1.31k|  return true;
  177|  1.31k|}
_ZN5draco17PointCloudDecoder19DecodeAllAttributesEv:
  179|  5.50k|bool PointCloudDecoder::DecodeAllAttributes() {
  180|  5.90k|  for (auto &att_dec : attributes_decoders_) {
  ------------------
  |  Branch (180:22): [True: 5.90k, False: 1.31k]
  ------------------
  181|  5.90k|    if (!att_dec->DecodeAttributes(buffer_)) {
  ------------------
  |  Branch (181:9): [True: 4.19k, False: 1.71k]
  ------------------
  182|  4.19k|      return false;
  183|  4.19k|    }
  184|  5.90k|  }
  185|  1.31k|  return true;
  186|  5.50k|}
_ZN5draco17PointCloudDecoder20GetPortableAttributeEi:
  189|  1.76k|    int32_t parent_att_id) {
  190|  1.76k|  if (parent_att_id < 0 || parent_att_id >= point_cloud_->num_attributes()) {
  ------------------
  |  Branch (190:7): [True: 0, False: 1.76k]
  |  Branch (190:28): [True: 0, False: 1.76k]
  ------------------
  191|      0|    return nullptr;
  192|      0|  }
  193|  1.76k|  const int32_t parent_att_decoder_id =
  194|  1.76k|      attribute_to_decoder_map_[parent_att_id];
  195|  1.76k|  return attributes_decoders_[parent_att_decoder_id]->GetPortableAttribute(
  196|  1.76k|      parent_att_id);
  197|  1.76k|}

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

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

_ZN5draco27PointCloudSequentialDecoder18DecodeGeometryDataEv:
   22|    152|bool PointCloudSequentialDecoder::DecodeGeometryData() {
   23|    152|  int32_t num_points;
   24|    152|  if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (24:7): [True: 4, False: 148]
  ------------------
   25|      4|    return false;
   26|      4|  }
   27|    148|  point_cloud()->set_num_points(num_points);
   28|    148|  return true;
   29|    152|}
_ZN5draco27PointCloudSequentialDecoder23CreateAttributesDecoderEi:
   32|  4.64k|    int32_t att_decoder_id) {
   33|       |  // Always create the basic attribute decoder.
   34|  4.64k|  return SetAttributesDecoder(
   35|  4.64k|      att_decoder_id,
   36|  4.64k|      std::unique_ptr<AttributesDecoder>(
   37|  4.64k|          new SequentialAttributeDecodersController(
   38|  4.64k|              std::unique_ptr<PointsSequencer>(
   39|  4.64k|                  new LinearSequencer(point_cloud()->num_points())))));
   40|  4.64k|}

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

_ZN5draco18MostSignificantBitEj:
   58|  12.7M|inline int MostSignificantBit(uint32_t n) {
   59|  12.7M|#if defined(__GNUC__)
   60|  12.7M|  return 31 ^ __builtin_clz(n);
   61|       |#elif defined(_MSC_VER)
   62|       |  unsigned long where;
   63|       |  _BitScanReverse(&where, n);
   64|       |  return (int)where;
   65|       |#else
   66|       |  uint32_t msb = 0;
   67|       |  if (n) {
   68|       |    if (0xFFFF0000 & n) { n >>= (1 << 4); msb |= (1 << 4); }
   69|       |    if (0x0000FF00 & n) { n >>= (1 << 3); msb |= (1 << 3); }
   70|       |    if (0x000000F0 & n) { n >>= (1 << 2); msb |= (1 << 2); }
   71|       |    if (0x0000000C & n) { n >>= (1 << 1); msb |= (1 << 1); }
   72|       |    if (0x00000002 & n) { msb |= (1 << 0); }
   73|       |  } else {
   74|       |    msb = -1;
   75|       |  }
   76|       |  return msb;
   77|       |#endif
   78|  12.7M|}
_ZN5draco24ConvertSymbolToSignedIntIjEENSt3__111make_signedIT_E4typeES3_:
  112|   823M|    IntTypeT val) {
  113|   823M|  static_assert(std::is_integral<IntTypeT>::value, "IntTypeT is not integral.");
  114|   823M|  typedef typename std::make_signed<IntTypeT>::type SignedType;
  115|   823M|  const bool is_positive = !static_cast<bool>(val & 1);
  116|   823M|  val >>= 1;
  117|   823M|  if (is_positive) {
  ------------------
  |  Branch (117:7): [True: 819M, False: 3.25M]
  ------------------
  118|   819M|    return static_cast<SignedType>(val);
  119|   819M|  }
  120|  3.25M|  SignedType ret = static_cast<SignedType>(val);
  121|  3.25M|  ret = -ret - 1;
  122|  3.25M|  return ret;
  123|   823M|}

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  16.1M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  16.1M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 16.1M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  16.1M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  16.1M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   950M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   950M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 321, False: 950M]
  ------------------
   78|    321|      return false;  // Buffer overflow.
   79|    321|    }
   80|   950M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   950M|    pos_ += size_to_decode;
   82|   950M|    return true;
   83|   950M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  32.3k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  14.5k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  45.5k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   188k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  6.18k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  16.2M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  4.45M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  7.17k|    inline void reset(const void *b, size_t s) {
  131|  7.17k|      bit_offset_ = 0;
  132|  7.17k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  7.17k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  7.17k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  5.99k|    inline uint64_t BitsDecoded() const {
  138|  5.99k|      return static_cast<uint64_t>(bit_offset_);
  139|  5.99k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  16.1M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  16.1M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 16.1M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  16.1M|      uint32_t value = 0;
  165|  36.8M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 20.6M, False: 16.1M]
  ------------------
  166|  20.6M|        value |= GetBit() << bit;
  167|  20.6M|      }
  168|  16.1M|      *x = value;
  169|  16.1M|      return true;
  170|  16.1M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  20.6M|    inline int GetBit() {
  176|  20.6M|      const size_t off = bit_offset_;
  177|  20.6M|      const size_t byte_offset = off >> 3;
  178|  20.6M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  20.6M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 19.9M, False: 704k]
  ------------------
  180|  19.9M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  19.9M|        bit_offset_ = off + 1;
  182|  19.9M|        return bit;
  183|  19.9M|      }
  184|   704k|      return 0;
  185|  20.6M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  6.96M|  bool Decode(T *out_val) {
   69|  6.96M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4.16k, False: 6.96M]
  ------------------
   70|  4.16k|      return false;
   71|  4.16k|    }
   72|  6.96M|    pos_ += sizeof(T);
   73|  6.96M|    return true;
   74|  6.96M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  6.96M|  bool Peek(T *out_val) {
   88|  6.96M|    const size_t size_to_decode = sizeof(T);
   89|  6.96M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4.16k, False: 6.96M]
  ------------------
   90|  4.16k|      return false;  // Buffer overflow.
   91|  4.16k|    }
   92|  6.96M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  6.96M|    return true;
   94|  6.96M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  12.8k|  bool Decode(T *out_val) {
   69|  12.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 134, False: 12.7k]
  ------------------
   70|    134|      return false;
   71|    134|    }
   72|  12.7k|    pos_ += sizeof(T);
   73|  12.7k|    return true;
   74|  12.8k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  12.8k|  bool Peek(T *out_val) {
   88|  12.8k|    const size_t size_to_decode = sizeof(T);
   89|  12.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 134, False: 12.7k]
  ------------------
   90|    134|      return false;  // Buffer overflow.
   91|    134|    }
   92|  12.7k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  12.7k|    return true;
   94|  12.8k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   191k|  bool Decode(T *out_val) {
   69|   191k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 430, False: 191k]
  ------------------
   70|    430|      return false;
   71|    430|    }
   72|   191k|    pos_ += sizeof(T);
   73|   191k|    return true;
   74|   191k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   191k|  bool Peek(T *out_val) {
   88|   191k|    const size_t size_to_decode = sizeof(T);
   89|   191k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 430, False: 191k]
  ------------------
   90|    430|      return false;  // Buffer overflow.
   91|    430|    }
   92|   191k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   191k|    return true;
   94|   191k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  18.8k|  bool Decode(T *out_val) {
   69|  18.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 115, False: 18.7k]
  ------------------
   70|    115|      return false;
   71|    115|    }
   72|  18.7k|    pos_ += sizeof(T);
   73|  18.7k|    return true;
   74|  18.8k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  18.8k|  bool Peek(T *out_val) {
   88|  18.8k|    const size_t size_to_decode = sizeof(T);
   89|  18.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 115, False: 18.7k]
  ------------------
   90|    115|      return false;  // Buffer overflow.
   91|    115|    }
   92|  18.7k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  18.7k|    return true;
   94|  18.8k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   593k|  bool Decode(T *out_val) {
   69|   593k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 103, False: 593k]
  ------------------
   70|    103|      return false;
   71|    103|    }
   72|   593k|    pos_ += sizeof(T);
   73|   593k|    return true;
   74|   593k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   593k|  bool Peek(T *out_val) {
   88|   593k|    const size_t size_to_decode = sizeof(T);
   89|   593k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 103, False: 593k]
  ------------------
   90|    103|      return false;  // Buffer overflow.
   91|    103|    }
   92|   593k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   593k|    return true;
   94|   593k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|   160k|  bool Decode(T *out_val) {
   69|   160k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 33, False: 160k]
  ------------------
   70|     33|      return false;
   71|     33|    }
   72|   160k|    pos_ += sizeof(T);
   73|   160k|    return true;
   74|   160k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|   160k|  bool Peek(T *out_val) {
   88|   160k|    const size_t size_to_decode = sizeof(T);
   89|   160k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 33, False: 160k]
  ------------------
   90|     33|      return false;  // Buffer overflow.
   91|     33|    }
   92|   160k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   160k|    return true;
   94|   160k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.53k|  bool Decode(T *out_val) {
   69|  1.53k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 46, False: 1.49k]
  ------------------
   70|     46|      return false;
   71|     46|    }
   72|  1.49k|    pos_ += sizeof(T);
   73|  1.49k|    return true;
   74|  1.53k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.53k|  bool Peek(T *out_val) {
   88|  1.53k|    const size_t size_to_decode = sizeof(T);
   89|  1.53k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 46, False: 1.49k]
  ------------------
   90|     46|      return false;  // Buffer overflow.
   91|     46|    }
   92|  1.49k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.49k|    return true;
   94|  1.53k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    757|  bool Decode(T *out_val) {
   69|    757|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 9, False: 748]
  ------------------
   70|      9|      return false;
   71|      9|    }
   72|    748|    pos_ += sizeof(T);
   73|    748|    return true;
   74|    757|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    757|  bool Peek(T *out_val) {
   88|    757|    const size_t size_to_decode = sizeof(T);
   89|    757|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 9, False: 748]
  ------------------
   90|      9|      return false;  // Buffer overflow.
   91|      9|    }
   92|    748|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    748|    return true;
   94|    757|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   343M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|  4.87G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  10.7M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  10.7M|    return value_ >= val;
  100|  10.7M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   249M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  3.06G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  25.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   109M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   109M|    value_ = i.value_;
  153|   109M|    return *this;
  154|   109M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  1.14G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.14G|    value_ = i.value_;
  153|  1.14G|    return *this;
  154|  1.14G|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  25.5M|  inline ThisIndexType &operator++() {
  103|  25.5M|    ++value_;
  104|  25.5M|    return *this;
  105|  25.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.29G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.29G|    return value_ == i.value_;
   77|  2.29G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   866M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  3.14k|  constexpr bool operator<(const IndexType &i) const {
   88|  3.14k|    return value_ < i.value_;
   89|  3.14k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   121M|  constexpr bool operator==(const IndexType &i) const {
   76|   121M|    return value_ == i.value_;
   77|   121M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   199M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   199M|    return ThisIndexType(value_ - val);
  133|   199M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   661M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   661M|    return ThisIndexType(value_ + val);
  127|   661M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  21.9M|  constexpr bool operator==(const IndexType &i) const {
   76|  21.9M|    return value_ == i.value_;
   77|  21.9M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   221M|  constexpr bool operator!=(const IndexType &i) const {
   82|   221M|    return value_ != i.value_;
   83|   221M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   355M|  constexpr bool operator!=(const IndexType &i) const {
   82|   355M|    return value_ != i.value_;
   83|   355M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   498M|  inline ThisIndexType &operator++() {
  103|   498M|    ++value_;
  104|   498M|    return *this;
  105|   498M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   390M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   390M|    value_ = i.value_;
  153|   390M|    return *this;
  154|   390M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   948M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   948M|    value_ = i.value_;
  153|   948M|    return *this;
  154|   948M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  44.3M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  44.3M|    return value_ >= val;
  100|  44.3M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  10.9M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.04G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  18.7G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   186M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  14.0G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   202M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  17.2M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  17.2M|    return ThisIndexType(value_ + val);
  127|  17.2M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   152M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  32.5M|  constexpr bool operator<(const IndexType &i) const {
   88|  32.5M|    return value_ < i.value_;
   89|  32.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|  5.00G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  1.14G|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  70.6M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  4.84G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   539M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  6.15M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  6.15M|    value_ = i.value_;
  153|  6.15M|    return *this;
  154|  6.15M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  10.9M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  10.9M|    value_ += val;
  141|  10.9M|    return *this;
  142|  10.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  32.4M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  32.4M|    value_ = val;
  157|  32.4M|    return *this;
  158|  32.4M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  1.10G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  7.00M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  6.99M|  inline ThisIndexType &operator++() {
  103|  6.99M|    ++value_;
  104|  6.99M|    return *this;
  105|  6.99M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  27.9M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|  10.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  4.79G|  inline ThisIndexType &operator++() {
  103|  4.79G|    ++value_;
  104|  4.79G|    return *this;
  105|  4.79G|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|  10.1M|  inline ThisIndexType &operator++() {
  103|  10.1M|    ++value_;
  104|  10.1M|    return *this;
  105|  10.1M|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|  4.76G|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  4.76G|    return value_ >= val;
  100|  4.76G|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  40.2M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  40.2M|    return vector_[index.value()];
   75|  40.2M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  27.9M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  12.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  15.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|  72.2M|  inline reference operator[](const IndexTypeT &index) {
   71|  72.2M|    return vector_[index.value()];
   72|  72.2M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  42.0k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  21.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  3.55k|  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|  10.7M|  inline reference operator[](const IndexTypeT &index) {
   71|  10.7M|    return vector_[index.value()];
   72|  10.7M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  25.8M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  25.8M|    return vector_[index.value()];
   75|  25.8M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   175M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  15.3M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   318M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   318M|    return vector_[index.value()];
   75|   318M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   760M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   760M|    return vector_[index.value()];
   75|   760M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   351M|  inline reference operator[](const IndexTypeT &index) {
   71|   351M|    return vector_[index.value()];
   72|   351M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  56.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  56.9M|    return vector_[index.value()];
   75|  56.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   290M|  inline reference operator[](const IndexTypeT &index) {
   71|   290M|    return vector_[index.value()];
   72|   290M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  89.8M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   190M|  inline reference operator[](const IndexTypeT &index) {
   71|   190M|    return vector_[index.value()];
   72|   190M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.16k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   190M|  inline reference operator[](const IndexTypeT &index) {
   71|   190M|    return vector_[index.value()];
   72|   190M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  59.0k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.61M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  55.8k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  6.84k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  6.84k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  6.84k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  6.84k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  13.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  13.0k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  13.0k|    vector_.swap(arg.vector_);
   57|  13.0k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  13.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  13.0k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  13.0k|    vector_.swap(arg.vector_);
   57|  13.0k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  6.84k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  6.84k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  6.84k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  12.3k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  29.6k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  58.1k|int32_t DataTypeLength(DataType dt) {
   20|  58.1k|  switch (dt) {
   21|  19.2k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 19.2k, False: 38.9k]
  ------------------
   22|  23.1k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.93k, False: 54.2k]
  ------------------
   23|  23.1k|      return 1;
   24|  3.62k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 3.62k, False: 54.5k]
  ------------------
   25|  4.90k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 1.28k, False: 56.8k]
  ------------------
   26|  4.90k|      return 2;
   27|  24.1k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 24.1k, False: 33.9k]
  ------------------
   28|  25.6k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.44k, False: 56.7k]
  ------------------
   29|  25.6k|      return 4;
   30|    160|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 160, False: 58.0k]
  ------------------
   31|    581|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 421, False: 57.7k]
  ------------------
   32|    581|      return 8;
   33|  3.60k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.60k, False: 54.5k]
  ------------------
   34|  3.60k|      return 4;
   35|    109|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 109, False: 58.0k]
  ------------------
   36|    109|      return 8;
   37|    186|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 186, False: 57.9k]
  ------------------
   38|    186|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 58.1k]
  ------------------
   40|      0|      return -1;
   41|  58.1k|  }
   42|  58.1k|}

_ZN5draco7IntSqrtEm:
   31|  3.06k|inline uint64_t IntSqrt(uint64_t number) {
   32|  3.06k|  if (number == 0) {
  ------------------
  |  Branch (32:7): [True: 412, False: 2.65k]
  ------------------
   33|    412|    return 0;
   34|    412|  }
   35|       |  // First estimate good initial value of the square root as log2(number).
   36|  2.65k|  uint64_t act_number = number;
   37|  2.65k|  uint64_t square_root = 1;
   38|  48.0k|  while (act_number >= 2) {
  ------------------
  |  Branch (38:10): [True: 45.3k, False: 2.65k]
  ------------------
   39|       |    // Double the square root until |square_root * square_root > number|.
   40|  45.3k|    square_root *= 2;
   41|  45.3k|    act_number /= 4;
   42|  45.3k|  }
   43|       |  // Perform Newton's (or Babylonian) method to find the true floor(sqrt()).
   44|  7.07k|  do {
   45|       |    // New |square_root| estimate is computed as the average between
   46|       |    // |square_root| and |number / square_root|.
   47|  7.07k|    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|  7.07k|  } while (square_root * square_root > number);
  ------------------
  |  Branch (53:12): [True: 4.42k, False: 2.65k]
  ------------------
   54|  2.65k|  return square_root;
   55|  3.06k|}
_ZN5draco13AddAsUnsignedIiTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEES3_S3_S3_:
   63|  50.8M|inline DataTypeT AddAsUnsigned(DataTypeT a, DataTypeT b) {
   64|  50.8M|  typedef typename std::make_unsigned<DataTypeT>::type DataTypeUT;
   65|  50.8M|  return static_cast<DataTypeT>(static_cast<DataTypeUT>(a) +
   66|  50.8M|                                static_cast<DataTypeUT>(b));
   67|  50.8M|}

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

_ZN5draco7OptionsC2Ev:
   32|  29.3k|  Options() = default;
_ZN5draco7OptionsD2Ev:
   33|  58.6k|  ~Options() = default;
_ZNK5draco7Options11IsOptionSetERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   70|    903|  bool IsOptionSet(const std::string &name) const {
   71|    903|    return options_.count(name) > 0;
   72|    903|  }

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  2.20k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|     10|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  12.3k|  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|     56|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  14.6k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  14.6k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|     56|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  13.3k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  14.6k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.31k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  2.21k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|     10|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  2.20k|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  12.3k|  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|  12.3k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   336k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   336k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 336k, Folded]
  ------------------
   65|   336k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.48k, False: 334k]
  ------------------
   66|  1.48k|      return false;
   67|  1.48k|    }
   68|   336k|  } 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|   334k|  return true;
   77|   336k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   129k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   129k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   129k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 94, False: 129k]
  ------------------
   33|     94|    return false;
   34|     94|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   129k|  uint8_t in;
   39|   129k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 901, False: 128k]
  ------------------
   40|    901|    return false;
   41|    901|  }
   42|   128k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 21.6k, False: 106k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  21.6k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 637, False: 21.0k]
  ------------------
   45|    637|      return false;
   46|    637|    }
   47|       |    // Append decoded info from this byte.
   48|  21.0k|    *out_val <<= 7;
   49|  21.0k|    *out_val |= in & ((1 << 7) - 1);
   50|   106k|  } else {
   51|       |    // Last byte reached
   52|   106k|    *out_val = in;
   53|   106k|  }
   54|   127k|  return true;
   55|   128k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.74k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.74k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.74k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 8.74k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.74k|  uint8_t in;
   39|  8.74k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 34, False: 8.70k]
  ------------------
   40|     34|    return false;
   41|     34|  }
   42|  8.70k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 644, False: 8.06k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    644|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 50, False: 594]
  ------------------
   45|     50|      return false;
   46|     50|    }
   47|       |    // Append decoded info from this byte.
   48|    594|    *out_val <<= 7;
   49|    594|    *out_val |= in & ((1 << 7) - 1);
   50|  8.06k|  } else {
   51|       |    // Last byte reached
   52|  8.06k|    *out_val = in;
   53|  8.06k|  }
   54|  8.65k|  return true;
   55|  8.70k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  7.12k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  7.12k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 7.12k, Folded]
  ------------------
   65|  7.12k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 160, False: 6.96k]
  ------------------
   66|    160|      return false;
   67|    160|    }
   68|  7.12k|  } 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|  6.96k|  return true;
   77|  7.12k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.10k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.10k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.10k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 4.10k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.10k|  uint8_t in;
   39|  4.10k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 40, False: 4.06k]
  ------------------
   40|     40|    return false;
   41|     40|  }
   42|  4.06k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 366, False: 3.70k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    366|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 43, False: 323]
  ------------------
   45|     43|      return false;
   46|     43|    }
   47|       |    // Append decoded info from this byte.
   48|    323|    *out_val <<= 7;
   49|    323|    *out_val |= in & ((1 << 7) - 1);
   50|  3.70k|  } else {
   51|       |    // Last byte reached
   52|  3.70k|    *out_val = in;
   53|  3.70k|  }
   54|  4.02k|  return true;
   55|  4.06k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   158k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   158k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   158k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 24, False: 158k]
  ------------------
   33|     24|    return false;
   34|     24|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   158k|  uint8_t in;
   39|   158k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 119, False: 158k]
  ------------------
   40|    119|    return false;
   41|    119|  }
   42|   158k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.03k, False: 155k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.03k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 146, False: 2.89k]
  ------------------
   45|    146|      return false;
   46|    146|    }
   47|       |    // Append decoded info from this byte.
   48|  2.89k|    *out_val <<= 7;
   49|  2.89k|    *out_val |= in & ((1 << 7) - 1);
   50|   155k|  } else {
   51|       |    // Last byte reached
   52|   155k|    *out_val = in;
   53|   155k|  }
   54|   157k|  return true;
   55|   158k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  4.31k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  4.31k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 4.31k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  4.31k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  4.31k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  4.31k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 62, False: 4.24k]
  ------------------
   72|     62|      return false;
   73|     62|    }
   74|  4.24k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  4.24k|  }
   76|  4.24k|  return true;
   77|  4.31k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.81k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.81k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.81k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 16, False: 4.79k]
  ------------------
   33|     16|    return false;
   34|     16|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.79k|  uint8_t in;
   39|  4.79k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 46, False: 4.74k]
  ------------------
   40|     46|    return false;
   41|     46|  }
   42|  4.74k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 499, False: 4.24k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    499|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 100, False: 399]
  ------------------
   45|    100|      return false;
   46|    100|    }
   47|       |    // Append decoded info from this byte.
   48|    399|    *out_val <<= 7;
   49|    399|    *out_val |= in & ((1 << 7) - 1);
   50|  4.24k|  } else {
   51|       |    // Last byte reached
   52|  4.24k|    *out_val = in;
   53|  4.24k|  }
   54|  4.64k|  return true;
   55|  4.74k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.54k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.54k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.54k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 3.54k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.54k|  uint8_t in;
   39|  3.54k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 18, False: 3.52k]
  ------------------
   40|     18|    return false;
   41|     18|  }
   42|  3.52k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 708, False: 2.81k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    708|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 40, False: 668]
  ------------------
   45|     40|      return false;
   46|     40|    }
   47|       |    // Append decoded info from this byte.
   48|    668|    *out_val <<= 7;
   49|    668|    *out_val |= in & ((1 << 7) - 1);
   50|  2.81k|  } else {
   51|       |    // Last byte reached
   52|  2.81k|    *out_val = in;
   53|  2.81k|  }
   54|  3.48k|  return true;
   55|  3.52k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  25.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  25.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  25.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 25.1k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  25.1k|  uint8_t in;
   39|  25.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 34, False: 25.0k]
  ------------------
   40|     34|    return false;
   41|     34|  }
   42|  25.0k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 450, False: 24.6k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    450|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 31, False: 419]
  ------------------
   45|     31|      return false;
   46|     31|    }
   47|       |    // Append decoded info from this byte.
   48|    419|    *out_val <<= 7;
   49|    419|    *out_val |= in & ((1 << 7) - 1);
   50|  24.6k|  } else {
   51|       |    // Last byte reached
   52|  24.6k|    *out_val = in;
   53|  24.6k|  }
   54|  25.0k|  return true;
   55|  25.0k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  10.0k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  10.0k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  10.0k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 63, False: 9.95k]
  ------------------
   33|     63|    return false;
   34|     63|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  9.95k|  uint8_t in;
   39|  9.95k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 99, False: 9.85k]
  ------------------
   40|     99|    return false;
   41|     99|  }
   42|  9.85k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.62k, False: 7.22k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.62k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 366, False: 2.26k]
  ------------------
   45|    366|      return false;
   46|    366|    }
   47|       |    // Append decoded info from this byte.
   48|  2.26k|    *out_val <<= 7;
   49|  2.26k|    *out_val |= in & ((1 << 7) - 1);
   50|  7.22k|  } else {
   51|       |    // Last byte reached
   52|  7.22k|    *out_val = in;
   53|  7.22k|  }
   54|  9.48k|  return true;
   55|  9.85k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  8.09k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.09k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.09k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 37, False: 8.05k]
  ------------------
   33|     37|    return false;
   34|     37|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.05k|  uint8_t in;
   39|  8.05k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 81, False: 7.97k]
  ------------------
   40|     81|    return false;
   41|     81|  }
   42|  7.97k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 4.71k, False: 3.26k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  4.71k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 453, False: 4.26k]
  ------------------
   45|    453|      return false;
   46|    453|    }
   47|       |    // Append decoded info from this byte.
   48|  4.26k|    *out_val <<= 7;
   49|  4.26k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.26k|  } else {
   51|       |    // Last byte reached
   52|  3.26k|    *out_val = in;
   53|  3.26k|  }
   54|  7.52k|  return true;
   55|  7.97k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  33.8k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  33.8k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  33.8k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 13, False: 33.8k]
  ------------------
   33|     13|    return false;
   34|     13|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  33.8k|  uint8_t in;
   39|  33.8k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 69, False: 33.7k]
  ------------------
   40|     69|    return false;
   41|     69|  }
   42|  33.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.02k, False: 30.7k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.02k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 85, False: 2.93k]
  ------------------
   45|     85|      return false;
   46|     85|    }
   47|       |    // Append decoded info from this byte.
   48|  2.93k|    *out_val <<= 7;
   49|  2.93k|    *out_val |= in & ((1 << 7) - 1);
   50|  30.7k|  } else {
   51|       |    // Last byte reached
   52|  30.7k|    *out_val = in;
   53|  30.7k|  }
   54|  33.6k|  return true;
   55|  33.7k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  99.1k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   121k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  10.1k|  Self operator-(const Self &o) const {
  138|  10.1k|    Self ret;
  139|  40.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 30.3k, False: 10.1k]
  ------------------
  140|  30.3k|      ret[i] = (*this)[i] - o[i];
  141|  30.3k|    }
  142|  10.1k|    return ret;
  143|  10.1k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  24.9k|  VectorD() {
   41|  99.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 74.7k, False: 24.9k]
  ------------------
   42|  74.7k|      (*this)[i] = Scalar(0);
   43|  74.7k|    }
   44|  24.9k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.32G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     44|      : v_({{c0, c1, c2}}) {
   60|     44|    DRACO_DCHECK_EQ(dimension, 3);
   61|     44|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   123M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  10.2M|  Self operator-(const Self &o) const {
  138|  10.2M|    Self ret;
  139|  40.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 30.7M, False: 10.2M]
  ------------------
  140|  30.7M|      ret[i] = (*this)[i] - o[i];
  141|  30.7M|    }
  142|  10.2M|    return ret;
  143|  10.2M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  5.10M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  5.10M|  static_assert(std::is_signed<ScalarT>::value,
  321|  5.10M|                "ScalarT must be a signed type. ");
  322|  5.10M|  VectorD<ScalarT, 3> r;
  323|  5.10M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  5.10M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  5.10M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  5.10M|  return r;
  327|  5.10M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  5.10M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  5.10M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.02M|  Scalar AbsSum() const {
  238|  2.02M|    Scalar result(0);
  239|  8.08M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 6.07M, False: 2.01M]
  ------------------
  240|  6.07M|      Scalar next_value = std::abs(v_[i]);
  241|  6.07M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 13.8k, False: 6.06M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  13.8k|        return std::numeric_limits<Scalar>::max();
  244|  13.8k|      }
  245|  6.06M|      result += next_value;
  246|  6.06M|    }
  247|  2.01M|    return result;
  248|  2.02M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   266k|  Self operator/(const Scalar &o) const {
  183|   266k|    Self ret;
  184|  1.06M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 798k, False: 266k]
  ------------------
  185|   798k|      ret[i] = (*this)[i] / o;
  186|   798k|    }
  187|   266k|    return ret;
  188|   266k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   155M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  9.45M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  6.07M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.57M|  Self operator-() const {
  121|  1.57M|    Self ret;
  122|  6.29M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 4.72M, False: 1.57M]
  ------------------
  123|  4.72M|      ret[i] = -(*this)[i];
  124|  4.72M|    }
  125|  1.57M|    return ret;
  126|  1.57M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  4.72M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  17.5M|  Self operator-(const Self &o) const {
  138|  17.5M|    Self ret;
  139|  52.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 35.1M, False: 17.5M]
  ------------------
  140|  35.1M|      ret[i] = (*this)[i] - o[i];
  141|  35.1M|    }
  142|  17.5M|    return ret;
  143|  17.5M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|   210M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|   316M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|   229M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  35.1M|  Self operator+(const Self &o) const {
  130|  35.1M|    Self ret;
  131|   105M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 70.3M, False: 35.1M]
  ------------------
  132|  70.3M|      ret[i] = (*this)[i] + o[i];
  133|  70.3M|    }
  134|  35.1M|    return ret;
  135|  35.1M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|   295M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   726k|  Self operator-(const Self &o) const {
  138|   726k|    Self ret;
  139|  2.17M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.45M, False: 726k]
  ------------------
  140|  1.45M|      ret[i] = (*this)[i] - o[i];
  141|  1.45M|    }
  142|   726k|    return ret;
  143|   726k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   726k|  Self operator+(const Self &o) const {
  130|   726k|    Self ret;
  131|  2.17M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.45M, False: 726k]
  ------------------
  132|  1.45M|      ret[i] = (*this)[i] + o[i];
  133|  1.45M|    }
  134|   726k|    return ret;
  135|   726k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   537k|  bool operator==(const Self &o) const {
  207|  1.60M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 1.07M, False: 532k]
  ------------------
  208|  1.07M|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 4.71k, False: 1.06M]
  ------------------
  209|  4.71k|        return false;
  210|  4.71k|      }
  211|  1.07M|    }
  212|   532k|    return true;
  213|   537k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  6.45M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  5.39k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  6.07k|  Scalar Dot(const Self &o) const {
  251|  6.07k|    Scalar ret(0);
  252|  24.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 18.2k, False: 6.07k]
  ------------------
  253|  18.2k|      ret += (*this)[i] * o[i];
  254|  18.2k|    }
  255|  6.07k|    return ret;
  256|  6.07k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    682|  Self operator*(const Scalar &o) const {
  175|    682|    Self ret;
  176|  2.72k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 2.04k, False: 682]
  ------------------
  177|  2.04k|      ret[i] = (*this)[i] * o;
  178|  2.04k|    }
  179|    682|    return ret;
  180|    682|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  4.71k|  Self operator-(const Self &o) const {
  138|  4.71k|    Self ret;
  139|  14.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 9.42k, False: 4.71k]
  ------------------
  140|  9.42k|      ret[i] = (*this)[i] - o[i];
  141|  9.42k|    }
  142|  4.71k|    return ret;
  143|  4.71k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  9.42k|  VectorD() {
   41|  28.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 18.8k, False: 9.42k]
  ------------------
   42|  18.8k|      (*this)[i] = Scalar(0);
   43|  18.8k|    }
   44|  9.42k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|  1.08M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  1.08M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  1.08M|    v_[0] = c0;
   55|  1.08M|    v_[1] = c1;
   56|  1.08M|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  37.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   355k|  bool operator==(const Self &o) const {
  207|  1.00M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 681k, False: 325k]
  ------------------
  208|   681k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 30.3k, False: 651k]
  ------------------
  209|  30.3k|        return false;
  210|  30.3k|      }
  211|   681k|    }
  212|   325k|    return true;
  213|   355k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  2.09M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  29.9M|  VectorD() {
   41|   119M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 89.9M, False: 29.9M]
  ------------------
   42|  89.9M|      (*this)[i] = Scalar(0);
   43|  89.9M|    }
   44|  29.9M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  33.3k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  36.5k|  Scalar Dot(const Self &o) const {
  251|  36.5k|    Scalar ret(0);
  252|   146k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 109k, False: 36.5k]
  ------------------
  253|   109k|      ret += (*this)[i] * o[i];
  254|   109k|    }
  255|  36.5k|    return ret;
  256|  36.5k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  3.16k|  Self operator-(const Self &o) const {
  138|  3.16k|    Self ret;
  139|  9.48k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 6.32k, False: 3.16k]
  ------------------
  140|  6.32k|      ret[i] = (*this)[i] - o[i];
  141|  6.32k|    }
  142|  3.16k|    return ret;
  143|  3.16k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  9.22k|  Self operator*(const Scalar &o) const {
  175|  9.22k|    Self ret;
  176|  27.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 18.4k, False: 9.22k]
  ------------------
  177|  18.4k|      ret[i] = (*this)[i] * o;
  178|  18.4k|    }
  179|  9.22k|    return ret;
  180|  9.22k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  3.07k|  Self operator+(const Self &o) const {
  130|  3.07k|    Self ret;
  131|  9.23k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.15k, False: 3.07k]
  ------------------
  132|  6.15k|      ret[i] = (*this)[i] + o[i];
  133|  6.15k|    }
  134|  3.07k|    return ret;
  135|  3.07k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.07k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.07k|  return v * o;
  294|  3.07k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  3.06k|  Self operator+(const Self &o) const {
  130|  3.06k|    Self ret;
  131|  12.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 9.18k, False: 3.06k]
  ------------------
  132|  9.18k|      ret[i] = (*this)[i] + o[i];
  133|  9.18k|    }
  134|  3.06k|    return ret;
  135|  3.06k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.06k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.06k|  return v * o;
  294|  3.06k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  3.06k|  Self operator*(const Scalar &o) const {
  175|  3.06k|    Self ret;
  176|  12.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 9.18k, False: 3.06k]
  ------------------
  177|  9.18k|      ret[i] = (*this)[i] * o;
  178|  9.18k|    }
  179|  3.06k|    return ret;
  180|  3.06k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   713k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   713k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   713k|    v_[0] = c0;
   55|   713k|    v_[1] = c1;
   56|   713k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  21.5k|  VectorD() {
   41|  64.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 43.1k, False: 21.5k]
  ------------------
   42|  43.1k|      (*this)[i] = Scalar(0);
   43|  43.1k|    }
   44|  21.5k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  6.11k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  18.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 12.2k, False: 6.11k]
  ------------------
  104|  12.2k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 12.2k, False: 0]
  ------------------
  105|  12.2k|        v_[i] = Scalar(src_vector[i]);
  106|  12.2k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  12.2k|    }
  110|  6.11k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    801|  Self operator+(const Self &o) const {
  130|    801|    Self ret;
  131|  2.40k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.60k, False: 801]
  ------------------
  132|  1.60k|      ret[i] = (*this)[i] + o[i];
  133|  1.60k|    }
  134|    801|    return ret;
  135|    801|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  3.05k|  VectorD() {
   41|  9.16k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.11k, False: 3.05k]
  ------------------
   42|  6.11k|      (*this)[i] = Scalar(0);
   43|  6.11k|    }
   44|  3.05k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  18.3k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  12.2k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  3.05k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  9.16k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.11k, False: 3.05k]
  ------------------
  104|  6.11k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.11k, False: 0]
  ------------------
  105|  6.11k|        v_[i] = Scalar(src_vector[i]);
  106|  6.11k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.11k|    }
  110|  3.05k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  3.05k|  Self operator/(const Scalar &o) const {
  183|  3.05k|    Self ret;
  184|  9.16k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 6.11k, False: 3.05k]
  ------------------
  185|  6.11k|      ret[i] = (*this)[i] / o;
  186|  6.11k|    }
  187|  3.05k|    return ret;
  188|  3.05k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  2.25k|  Self operator-(const Self &o) const {
  138|  2.25k|    Self ret;
  139|  6.76k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.51k, False: 2.25k]
  ------------------
  140|  4.51k|      ret[i] = (*this)[i] - o[i];
  141|  4.51k|    }
  142|  2.25k|    return ret;
  143|  2.25k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  86.3k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.57M|  VectorD() {
   41|  6.30M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.72M, False: 1.57M]
  ------------------
   42|  4.72M|      (*this)[i] = Scalar(0);
   43|  4.72M|    }
   44|  1.57M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  56.1M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  56.1M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  56.1M|    v_[0] = c0;
   55|  56.1M|    v_[1] = c1;
   56|  56.1M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|   105M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   316M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 210M, False: 105M]
  ------------------
  104|   210M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 210M, False: 0]
  ------------------
  105|   210M|        v_[i] = Scalar(src_vector[i]);
  106|   210M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   210M|    }
  110|   105M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  52.7M|  VectorD() {
   41|   158M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 105M, False: 52.7M]
  ------------------
   42|   105M|      (*this)[i] = Scalar(0);
   43|   105M|    }
   44|  52.7M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  52.7M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   158M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 105M, False: 52.7M]
  ------------------
  104|   105M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 105M, False: 0]
  ------------------
  105|   105M|        v_[i] = Scalar(src_vector[i]);
  106|   105M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   105M|    }
  110|  52.7M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  20.2M|  VectorD(const Self &o) {
   89|  60.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 40.5M, False: 20.2M]
  ------------------
   90|  40.5M|      (*this)[i] = o[i];
   91|  40.5M|    }
   92|  20.2M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  1.45M|  VectorD() {
   41|  4.35M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 2.90M, False: 1.45M]
  ------------------
   42|  2.90M|      (*this)[i] = Scalar(0);
   43|  2.90M|    }
   44|  1.45M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   441M|  VectorD(const Self &o) {
   89|  1.76G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.32G, False: 441M]
  ------------------
   90|  1.32G|      (*this)[i] = o[i];
   91|  1.32G|    }
   92|   441M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.32G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   199M|      : v_({{c0, c1, c2}}) {
   60|   199M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   199M|  }

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

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

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  2.55k|      : corner_table_(table),
  229|  2.55k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  2.55k|        corner_(start_corner_),
  231|  2.55k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.62M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  8.85k|  VertexCornersIterator &operator++() {
  268|  8.85k|    Next();
  269|  8.85k|    return *this;
  270|  8.85k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.09M|  void Next() {
  248|  3.09M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.07M, False: 18.4k]
  ------------------
  249|  3.07M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.07M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 16.4k, False: 3.05M]
  ------------------
  251|       |        // Open boundary reached.
  252|  16.4k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  16.4k|        left_traversal_ = false;
  254|  3.05M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 509k, False: 2.54M]
  ------------------
  255|       |        // End reached.
  256|   509k|        corner_ = kInvalidCornerIndex;
  257|   509k|      }
  258|  3.07M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  18.4k|      corner_ = corner_table_->SwingRight(corner_);
  262|  18.4k|    }
  263|  3.09M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.17M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  3.52M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  4.03M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.02M|  void Next() {
  248|  2.02M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.99M, False: 21.0k]
  ------------------
  249|  1.99M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.99M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.40M, False: 593k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.40M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.40M|        left_traversal_ = false;
  254|  1.40M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 96.7k, False: 496k]
  ------------------
  255|       |        // End reached.
  256|  96.7k|        corner_ = kInvalidCornerIndex;
  257|  96.7k|      }
  258|  1.99M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  21.0k|      corner_ = corner_table_->SwingRight(corner_);
  262|  21.0k|    }
  263|  2.02M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.50M|      : corner_table_(table),
  236|  1.50M|        start_corner_(corner_id),
  237|  1.50M|        corner_(start_corner_),
  238|  1.50M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   523k|      : corner_table_(table),
  236|   523k|        start_corner_(corner_id),
  237|   523k|        corner_(start_corner_),
  238|   523k|        left_traversal_(true) {}

_ZN5draco4MeshC2Ev:
   29|  12.3k|Mesh::Mesh() {}

_ZN5draco4Mesh7AddFaceERKNSt3__15arrayINS_9IndexTypeIjNS_20PointIndex_tag_type_EEELm3EEE:
   62|  42.0k|  void AddFace(const Face &face) { faces_.push_back(face); }
_ZN5draco4Mesh7SetFaceENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEERKNSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEE:
   64|  10.7M|  void SetFace(FaceIndex face_id, const Face &face) {
   65|  10.7M|    if (face_id >= static_cast<uint32_t>(faces_.size())) {
  ------------------
  |  Branch (65:9): [True: 0, False: 10.7M]
  ------------------
   66|      0|      faces_.resize(face_id.value() + 1, Face());
   67|      0|    }
   68|  10.7M|    faces_[face_id] = face;
   69|  10.7M|  }
_ZN5draco4Mesh11SetNumFacesEm:
   73|  3.55k|  void SetNumFaces(size_t num_faces) { faces_.resize(num_faces, Face()); }
_ZNK5draco4Mesh9num_facesEv:
   75|  10.7M|  FaceIndex::ValueType num_faces() const {
   76|  10.7M|    return static_cast<uint32_t>(faces_.size());
   77|  10.7M|  }
_ZNK5draco4Mesh4faceENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   78|  25.8M|  const Face &face(FaceIndex face_id) const {
   79|  25.8M|    DRACO_DCHECK_LE(0, face_id.value());
   80|  25.8M|    DRACO_DCHECK_LT(face_id.value(), static_cast<int>(faces_.size()));
   81|  25.8M|    return faces_[face_id];
   82|  25.8M|  }
_ZN5draco4Mesh12SetAttributeEiNSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   84|  14.7k|  void SetAttribute(int att_id, std::unique_ptr<PointAttribute> pa) override {
   85|  14.7k|    PointCloud::SetAttribute(att_id, std::move(pa));
   86|  14.7k|    if (static_cast<int>(attribute_data_.size()) <= att_id) {
  ------------------
  |  Branch (86:9): [True: 14.7k, False: 0]
  ------------------
   87|  14.7k|      attribute_data_.resize(att_id + 1);
   88|  14.7k|    }
   89|  14.7k|  }
_ZN5draco4Mesh13AttributeDataC2Ev:
  155|  14.7k|    AttributeData() : element_type(MESH_CORNER_ATTRIBUTE) {}

_ZN5draco24MeshAttributeCornerTableC2Ev:
   23|  36.0k|    : no_interior_seams_(true), corner_table_(nullptr), valence_cache_(*this) {}
_ZN5draco24MeshAttributeCornerTable9InitEmptyEPKNS_11CornerTableE:
   25|  6.18k|bool MeshAttributeCornerTable::InitEmpty(const CornerTable *table) {
   26|  6.18k|  if (table == nullptr) {
  ------------------
  |  Branch (26:7): [True: 0, False: 6.18k]
  ------------------
   27|      0|    return false;
   28|      0|  }
   29|  6.18k|  valence_cache_.ClearValenceCache();
   30|  6.18k|  valence_cache_.ClearValenceCacheInaccurate();
   31|  6.18k|  is_edge_on_seam_.assign(table->num_corners(), false);
   32|  6.18k|  is_vertex_on_seam_.assign(table->num_vertices(), false);
   33|  6.18k|  corner_to_vertex_map_.assign(table->num_corners(), kInvalidVertexIndex);
   34|  6.18k|  vertex_to_attribute_entry_id_map_.reserve(table->num_vertices());
   35|  6.18k|  vertex_to_left_most_corner_map_.reserve(table->num_vertices());
   36|  6.18k|  corner_table_ = table;
   37|  6.18k|  no_interior_seams_ = true;
   38|  6.18k|  return true;
   39|  6.18k|}
_ZN5draco24MeshAttributeCornerTable11AddSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  108|  17.3M|void MeshAttributeCornerTable::AddSeamEdge(CornerIndex c) {
  109|  17.3M|  DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  110|  17.3M|  is_edge_on_seam_[c.value()] = true;
  111|       |  // Mark seam vertices.
  112|  17.3M|  is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Next(c)).value()] =
  113|  17.3M|      true;
  114|  17.3M|  is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Previous(c))
  115|  17.3M|                         .value()] = true;
  116|       |
  117|  17.3M|  const CornerIndex opp_corner = corner_table_->Opposite(c);
  118|  17.3M|  if (opp_corner != kInvalidCornerIndex) {
  ------------------
  |  Branch (118:7): [True: 16.8M, False: 509k]
  ------------------
  119|  16.8M|    no_interior_seams_ = false;
  120|  16.8M|    is_edge_on_seam_[opp_corner.value()] = true;
  121|  16.8M|    is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Next(opp_corner))
  122|  16.8M|                           .value()] = true;
  123|  16.8M|    is_vertex_on_seam_
  124|  16.8M|        [corner_table_->Vertex(corner_table_->Previous(opp_corner)).value()] =
  125|  16.8M|            true;
  126|  16.8M|  }
  127|  17.3M|}
_ZN5draco24MeshAttributeCornerTable17RecomputeVerticesEPKNS_4MeshEPKNS_14PointAttributeE:
  130|  6.18k|                                                 const PointAttribute *att) {
  131|  6.18k|  DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  132|  6.18k|  if (mesh != nullptr && att != nullptr) {
  ------------------
  |  Branch (132:7): [True: 0, False: 6.18k]
  |  Branch (132:26): [True: 0, False: 0]
  ------------------
  133|      0|    return RecomputeVerticesInternal<true>(mesh, att);
  134|  6.18k|  } else {
  135|  6.18k|    return RecomputeVerticesInternal<false>(nullptr, nullptr);
  136|  6.18k|  }
  137|  6.18k|}
_ZN5draco24MeshAttributeCornerTable25RecomputeVerticesInternalILb0EEEbPKNS_4MeshEPKNS_14PointAttributeE:
  141|  6.18k|    const Mesh *mesh, const PointAttribute *att) {
  142|  6.18k|  DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  143|  6.18k|  vertex_to_attribute_entry_id_map_.clear();
  144|  6.18k|  vertex_to_left_most_corner_map_.clear();
  145|  6.18k|  int num_new_vertices = 0;
  146|  7.00M|  for (VertexIndex v(0); v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (146:26): [True: 6.99M, False: 6.18k]
  ------------------
  147|  6.99M|    const CornerIndex c = corner_table_->LeftMostCorner(v);
  148|  6.99M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (148:9): [True: 79.4k, False: 6.91M]
  ------------------
  149|  79.4k|      continue;  // Isolated vertex?
  150|  79.4k|    }
  151|  6.91M|    AttributeValueIndex first_vert_id(num_new_vertices++);
  152|  6.91M|    if (init_vertex_to_attribute_entry_map) {
  ------------------
  |  Branch (152:9): [Folded, False: 6.91M]
  ------------------
  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.91M|    } else {
  156|       |      // Identity mapping
  157|  6.91M|      vertex_to_attribute_entry_id_map_.push_back(first_vert_id);
  158|  6.91M|    }
  159|  6.91M|    CornerIndex first_c = c;
  160|  6.91M|    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.91M|    if (is_vertex_on_seam_[v.value()]) {
  ------------------
  |  Branch (163:9): [True: 6.24M, False: 669k]
  ------------------
  164|       |      // Try to swing left on the modified corner table. We need to get the
  165|       |      // first corner that defines an attribute seam.
  166|  6.24M|      act_c = SwingLeft(first_c);
  167|  6.39M|      while (act_c != kInvalidCornerIndex) {
  ------------------
  |  Branch (167:14): [True: 144k, False: 6.24M]
  ------------------
  168|   144k|        first_c = act_c;
  169|   144k|        act_c = SwingLeft(act_c);
  170|   144k|        if (act_c == c) {
  ------------------
  |  Branch (170:13): [True: 0, False: 144k]
  ------------------
  171|       |          // We reached the initial corner which shouldn't happen when we swing
  172|       |          // left from |c|.
  173|      0|          return false;
  174|      0|        }
  175|   144k|      }
  176|  6.24M|    }
  177|  6.91M|    corner_to_vertex_map_[first_c.value()] = VertexIndex(first_vert_id.value());
  178|  6.91M|    vertex_to_left_most_corner_map_.push_back(first_c);
  179|  6.91M|    act_c = corner_table_->SwingRight(first_c);
  180|  39.4M|    while (act_c != kInvalidCornerIndex && act_c != first_c) {
  ------------------
  |  Branch (180:12): [True: 38.9M, False: 513k]
  |  Branch (180:44): [True: 32.5M, False: 6.40M]
  ------------------
  181|  32.5M|      if (IsCornerOppositeToSeamEdge(corner_table_->Next(act_c))) {
  ------------------
  |  Branch (181:11): [True: 28.3M, False: 4.17M]
  ------------------
  182|  28.3M|        first_vert_id = AttributeValueIndex(num_new_vertices++);
  183|  28.3M|        if (init_vertex_to_attribute_entry_map) {
  ------------------
  |  Branch (183:13): [Folded, False: 28.3M]
  ------------------
  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|  28.3M|        } else {
  188|       |          // Identity mapping.
  189|  28.3M|          vertex_to_attribute_entry_id_map_.push_back(first_vert_id);
  190|  28.3M|        }
  191|  28.3M|        vertex_to_left_most_corner_map_.push_back(act_c);
  192|  28.3M|      }
  193|  32.5M|      corner_to_vertex_map_[act_c.value()] = VertexIndex(first_vert_id.value());
  194|  32.5M|      act_c = corner_table_->SwingRight(act_c);
  195|  32.5M|    }
  196|  6.91M|  }
  197|  6.18k|  return true;
  198|  6.18k|}

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  59.9M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  59.9M|    return is_edge_on_seam_[corner.value()];
   47|  59.9M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  27.3M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  27.3M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 27.3M]
  |  Branch (50:42): [True: 23.4M, False: 3.89M]
  ------------------
   51|  23.4M|      return kInvalidCornerIndex;
   52|  23.4M|    }
   53|  3.89M|    return corner_table_->Opposite(corner);
   54|  27.3M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  37.8M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  37.8M|    return corner_table_->Next(corner);
   58|  37.8M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  20.3M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  20.3M|    return corner_table_->Previous(corner);
   62|  20.3M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  5.31M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  5.31M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  5.31M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.12M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.12M|    return Opposite(Previous(corner));
   73|  3.12M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  3.53M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  3.53M|    return Opposite(Next(corner));
   76|  3.53M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  4.03M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  4.03M|    return Previous(Opposite(Previous(corner)));
   81|  4.03M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  12.5M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  12.5M|    return Next(Opposite(Next(corner)));
   86|  12.5M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  9.21k|  int num_vertices() const {
   89|  9.21k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  9.21k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  3.02k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.32k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  99.6M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  99.6M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  99.6M|    return ConfidentVertex(corner);
   97|  99.6M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  99.6M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  99.6M|    return corner_to_vertex_map_[corner.value()];
  100|  99.6M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.10M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.10M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.10M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.10M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.10M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.10M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.10M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.10M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.69M, False: 408k]
  ------------------
  128|  2.69M|      return true;
  129|  2.69M|    }
  130|   408k|    return false;
  131|  3.10M|  }

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

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

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

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

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

_ZN5draco15MetadataDecoderC2Ev:
   23|    772|MetadataDecoder::MetadataDecoder() : buffer_(nullptr) {}
_ZN5draco15MetadataDecoder22DecodeGeometryMetadataEPNS_13DecoderBufferEPNS_16GeometryMetadataE:
   35|    772|                                             GeometryMetadata *metadata) {
   36|    772|  if (!metadata) {
  ------------------
  |  Branch (36:7): [True: 0, False: 772]
  ------------------
   37|      0|    return false;
   38|      0|  }
   39|    772|  buffer_ = in_buffer;
   40|    772|  uint32_t num_att_metadata = 0;
   41|    772|  if (!DecodeVarint(&num_att_metadata, buffer_)) {
  ------------------
  |  Branch (41:7): [True: 13, False: 759]
  ------------------
   42|     13|    return false;
   43|     13|  }
   44|       |  // Decode attribute metadata.
   45|  1.19k|  for (uint32_t i = 0; i < num_att_metadata; ++i) {
  ------------------
  |  Branch (45:24): [True: 901, False: 296]
  ------------------
   46|    901|    uint32_t att_unique_id;
   47|    901|    if (!DecodeVarint(&att_unique_id, buffer_)) {
  ------------------
  |  Branch (47:9): [True: 19, False: 882]
  ------------------
   48|     19|      return false;
   49|     19|    }
   50|    882|    std::unique_ptr<AttributeMetadata> att_metadata =
   51|    882|        std::unique_ptr<AttributeMetadata>(new AttributeMetadata());
   52|    882|    att_metadata->set_att_unique_id(att_unique_id);
   53|    882|    if (!DecodeMetadata(static_cast<Metadata *>(att_metadata.get()))) {
  ------------------
  |  Branch (53:9): [True: 444, False: 438]
  ------------------
   54|    444|      return false;
   55|    444|    }
   56|    438|    metadata->AddAttributeMetadata(std::move(att_metadata));
   57|    438|  }
   58|    296|  return DecodeMetadata(static_cast<Metadata *>(metadata));
   59|    759|}
_ZN5draco15MetadataDecoder14DecodeMetadataEPNS_8MetadataE:
   61|  1.17k|bool MetadataDecoder::DecodeMetadata(Metadata *metadata) {
   62|       |  // Limit metadata nesting depth to avoid stack overflow in destructor.
   63|  1.17k|  constexpr int kMaxSubmetadataLevel = 1000;
   64|       |
   65|  1.17k|  struct MetadataTuple {
   66|  1.17k|    Metadata *parent_metadata;
   67|  1.17k|    Metadata *decoded_metadata;
   68|  1.17k|    int level;
   69|  1.17k|  };
   70|  1.17k|  std::vector<MetadataTuple> metadata_stack;
   71|  1.17k|  metadata_stack.push_back({nullptr, metadata, 0});
   72|  48.4k|  while (!metadata_stack.empty()) {
  ------------------
  |  Branch (72:10): [True: 48.0k, False: 457]
  ------------------
   73|  48.0k|    const MetadataTuple mp = metadata_stack.back();
   74|  48.0k|    metadata_stack.pop_back();
   75|  48.0k|    metadata = mp.decoded_metadata;
   76|       |
   77|  48.0k|    if (mp.parent_metadata != nullptr) {
  ------------------
  |  Branch (77:9): [True: 46.8k, False: 1.17k]
  ------------------
   78|  46.8k|      if (mp.level > kMaxSubmetadataLevel) {
  ------------------
  |  Branch (78:11): [True: 2, False: 46.8k]
  ------------------
   79|      2|        return false;
   80|      2|      }
   81|  46.8k|      std::string sub_metadata_name;
   82|  46.8k|      if (!DecodeName(&sub_metadata_name)) {
  ------------------
  |  Branch (82:11): [True: 44, False: 46.7k]
  ------------------
   83|     44|        return false;
   84|     44|      }
   85|  46.7k|      std::unique_ptr<Metadata> sub_metadata =
   86|  46.7k|          std::unique_ptr<Metadata>(new Metadata());
   87|  46.7k|      metadata = sub_metadata.get();
   88|  46.7k|      if (!mp.parent_metadata->AddSubMetadata(sub_metadata_name,
  ------------------
  |  Branch (88:11): [True: 15, False: 46.7k]
  ------------------
   89|  46.7k|                                              std::move(sub_metadata))) {
   90|     15|        return false;
   91|     15|      }
   92|  46.7k|    }
   93|  47.9k|    if (metadata == nullptr) {
  ------------------
  |  Branch (93:9): [True: 0, False: 47.9k]
  ------------------
   94|      0|      return false;
   95|      0|    }
   96|       |
   97|  47.9k|    uint32_t num_entries = 0;
   98|  47.9k|    if (!DecodeVarint(&num_entries, buffer_)) {
  ------------------
  |  Branch (98:9): [True: 46, False: 47.9k]
  ------------------
   99|     46|      return false;
  100|     46|    }
  101|   105k|    for (uint32_t i = 0; i < num_entries; ++i) {
  ------------------
  |  Branch (101:26): [True: 58.3k, False: 47.3k]
  ------------------
  102|  58.3k|      if (!DecodeEntry(metadata)) {
  ------------------
  |  Branch (102:11): [True: 515, False: 57.8k]
  ------------------
  103|    515|        return false;
  104|    515|      }
  105|  58.3k|    }
  106|  47.3k|    uint32_t num_sub_metadata = 0;
  107|  47.3k|    if (!DecodeVarint(&num_sub_metadata, buffer_)) {
  ------------------
  |  Branch (107:9): [True: 17, False: 47.3k]
  ------------------
  108|     17|      return false;
  109|     17|    }
  110|  47.3k|    if (num_sub_metadata > buffer_->remaining_size()) {
  ------------------
  |  Branch (110:9): [True: 82, False: 47.2k]
  ------------------
  111|       |      // The decoded number of metadata items is unreasonably high.
  112|     82|      return false;
  113|     82|    }
  114|   513k|    for (uint32_t i = 0; i < num_sub_metadata; ++i) {
  ------------------
  |  Branch (114:26): [True: 466k, False: 47.2k]
  ------------------
  115|   466k|      metadata_stack.push_back(
  116|   466k|          {metadata, nullptr, mp.parent_metadata ? mp.level + 1 : mp.level});
  ------------------
  |  Branch (116:31): [True: 458k, False: 8.03k]
  ------------------
  117|   466k|    }
  118|  47.2k|  }
  119|    457|  return true;
  120|  1.17k|}
_ZN5draco15MetadataDecoder11DecodeEntryEPNS_8MetadataE:
  122|  58.3k|bool MetadataDecoder::DecodeEntry(Metadata *metadata) {
  123|  58.3k|  std::string entry_name;
  124|  58.3k|  if (!DecodeName(&entry_name)) {
  ------------------
  |  Branch (124:7): [True: 232, False: 58.1k]
  ------------------
  125|    232|    return false;
  126|    232|  }
  127|  58.1k|  uint32_t data_size = 0;
  128|  58.1k|  if (!DecodeVarint(&data_size, buffer_)) {
  ------------------
  |  Branch (128:7): [True: 48, False: 58.1k]
  ------------------
  129|     48|    return false;
  130|     48|  }
  131|  58.1k|  if (data_size == 0) {
  ------------------
  |  Branch (131:7): [True: 86, False: 58.0k]
  ------------------
  132|     86|    return false;
  133|     86|  }
  134|  58.0k|  if (data_size > buffer_->remaining_size()) {
  ------------------
  |  Branch (134:7): [True: 149, False: 57.8k]
  ------------------
  135|    149|    return false;
  136|    149|  }
  137|  57.8k|  std::vector<uint8_t> entry_value(data_size);
  138|  57.8k|  if (!buffer_->Decode(&entry_value[0], data_size)) {
  ------------------
  |  Branch (138:7): [True: 0, False: 57.8k]
  ------------------
  139|      0|    return false;
  140|      0|  }
  141|  57.8k|  metadata->AddEntryBinary(entry_name, entry_value);
  142|  57.8k|  return true;
  143|  57.8k|}
_ZN5draco15MetadataDecoder10DecodeNameEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  145|   105k|bool MetadataDecoder::DecodeName(std::string *name) {
  146|   105k|  uint8_t name_len = 0;
  147|   105k|  if (!buffer_->Decode(&name_len)) {
  ------------------
  |  Branch (147:7): [True: 79, False: 105k]
  ------------------
  148|     79|    return false;
  149|     79|  }
  150|   105k|  name->resize(name_len);
  151|   105k|  if (name_len == 0) {
  ------------------
  |  Branch (151:7): [True: 24.5k, False: 80.5k]
  ------------------
  152|  24.5k|    return true;
  153|  24.5k|  }
  154|  80.5k|  if (!buffer_->Decode(&name->at(0), name_len)) {
  ------------------
  |  Branch (154:7): [True: 197, False: 80.3k]
  ------------------
  155|    197|    return false;
  156|    197|  }
  157|  80.3k|  return true;
  158|  80.5k|}

_ZN5draco10PointCloudC2Ev:
   27|  14.6k|PointCloud::PointCloud() : num_points_(0) {}
_ZNK5draco10PointCloud18NumNamedAttributesENS_17GeometryAttribute4TypeE:
   56|  1.76k|int32_t PointCloud::NumNamedAttributes(GeometryAttribute::Type type) const {
   57|  1.76k|  if (type == GeometryAttribute::INVALID ||
  ------------------
  |  Branch (57:7): [True: 0, False: 1.76k]
  ------------------
   58|  1.76k|      type >= GeometryAttribute::NAMED_ATTRIBUTES_COUNT) {
  ------------------
  |  Branch (58:7): [True: 0, False: 1.76k]
  ------------------
   59|      0|    return 0;
   60|      0|  }
   61|  1.76k|  return static_cast<int32_t>(named_attribute_index_[type].size());
   62|  1.76k|}
_ZNK5draco10PointCloud19GetNamedAttributeIdENS_17GeometryAttribute4TypeE:
   64|  1.76k|int32_t PointCloud::GetNamedAttributeId(GeometryAttribute::Type type) const {
   65|  1.76k|  return GetNamedAttributeId(type, 0);
   66|  1.76k|}
_ZNK5draco10PointCloud19GetNamedAttributeIdENS_17GeometryAttribute4TypeEi:
   69|  1.76k|                                        int i) const {
   70|  1.76k|  if (NumNamedAttributes(type) <= i) {
  ------------------
  |  Branch (70:7): [True: 2, False: 1.76k]
  ------------------
   71|      2|    return -1;
   72|      2|  }
   73|  1.76k|  return named_attribute_index_[type][i];
   74|  1.76k|}
_ZN5draco10PointCloud12AddAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
  134|  22.0k|int PointCloud::AddAttribute(std::unique_ptr<PointAttribute> pa) {
  135|  22.0k|  SetAttribute(static_cast<int>(attributes_.size()), std::move(pa));
  136|  22.0k|  return static_cast<int>(attributes_.size() - 1);
  137|  22.0k|}
_ZN5draco10PointCloud12SetAttributeEiNSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
  172|  22.0k|void PointCloud::SetAttribute(int att_id, std::unique_ptr<PointAttribute> pa) {
  173|  22.0k|  DRACO_DCHECK(att_id >= 0);
  174|  22.0k|  if (static_cast<int>(attributes_.size()) <= att_id) {
  ------------------
  |  Branch (174:7): [True: 22.0k, False: 0]
  ------------------
  175|  22.0k|    attributes_.resize(att_id + 1);
  176|  22.0k|  }
  177|  22.0k|  if (pa->attribute_type() < GeometryAttribute::NAMED_ATTRIBUTES_COUNT) {
  ------------------
  |  Branch (177:7): [True: 22.0k, False: 0]
  ------------------
  178|  22.0k|    named_attribute_index_[pa->attribute_type()].push_back(att_id);
  179|  22.0k|  }
  180|  22.0k|  pa->set_unique_id(att_id);
  181|  22.0k|  attributes_[att_id] = std::move(pa);
  182|  22.0k|}

_ZNK5draco10PointCloud14num_attributesEv:
   75|  1.76k|  int32_t num_attributes() const {
   76|  1.76k|    return static_cast<int32_t>(attributes_.size());
   77|  1.76k|  }
_ZNK5draco10PointCloud9attributeEi:
   78|  9.76k|  const PointAttribute *attribute(int32_t att_id) const {
   79|  9.76k|    DRACO_DCHECK_LE(0, att_id);
   80|  9.76k|    DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
   81|  9.76k|    return attributes_[att_id].get();
   82|  9.76k|  }
_ZN5draco10PointCloud9attributeEi:
   86|  55.7k|  PointAttribute *attribute(int32_t att_id) {
   87|  55.7k|    DRACO_DCHECK_LE(0, att_id);
   88|  55.7k|    DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
   89|  55.7k|    return attributes_[att_id].get();
   90|  55.7k|  }
_ZN5draco10PointCloud11AddMetadataENSt3__110unique_ptrINS_16GeometryMetadataENS1_14default_deleteIS3_EEEE:
  141|     19|  void AddMetadata(std::unique_ptr<GeometryMetadata> metadata) {
  142|     19|    metadata_ = std::move(metadata);
  143|     19|  }
_ZNK5draco10PointCloud10num_pointsEv:
  195|  48.5k|  PointIndex::ValueType num_points() const { return num_points_; }
_ZN5draco10PointCloud14set_num_pointsEj:
  200|  6.38k|  void set_num_points(PointIndex::ValueType num) { num_points_ = num; }
_ZN5draco10PointCloudD2Ev:
   36|  14.6k|  virtual ~PointCloud() = default;

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

